Skip to content

Commit

Permalink
Revert "feat: temp"
Browse files Browse the repository at this point in the history
This reverts commit 0ae1eea.
  • Loading branch information
henrikmv committed Nov 3, 2023
1 parent 172c864 commit 3ad55f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class D2Form extends React.PureComponent<PropsForPureComponent> {
formBuilderId={this.getFormBuilderId(section.id)}
sectionId={section.id}
applyCustomFormClass={false}
data-test="d2-form-component"
{...passOnProps}
/>
)
Expand All @@ -105,6 +106,7 @@ class D2Form extends React.PureComponent<PropsForPureComponent> {
formId={this.getFormId()}
formBuilderId={this.getFormBuilderId(section.id)}
sectionId={section.id}
data-test="d2-form-component"
applyCustomFormClass={!!section.customForm}
{...passOnProps}
/>
Expand Down Expand Up @@ -167,7 +169,6 @@ export const D2FormComponent = (props: Props) => {
<D2Form
ref={handleRef}
{...passOnProps}
data-test="d2-form-component"
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type OwnProps = $ReadOnly<{|
formFoundation: RenderFoundation,
id: string,
formHorizontal?: boolean,
'data-test'?: string,
getCustomContent?: (beforeSectionId: string) => React.Node,
...FormRef
|}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class D2SectionPlain extends React.PureComponent<Props> {
}

renderSection(sectionProps) {
const { sectionMetaData, applyCustomFormClass, classes, sectionId, ...passOnProps } = sectionProps;
const { sectionMetaData, classes, sectionId, ...passOnProps } = sectionProps;

if (!sectionMetaData.showContainer || this.props.formHorizontal) {
return (
Expand All @@ -87,9 +87,7 @@ class D2SectionPlain extends React.PureComponent<Props> {
);
}
return (
<div
className={applyCustomFormClass ? this.props.classes.containerCustomForm : ''}
>
<div>
<Section
header={this.renderSectionHeader()}
description={this.renderSectionDescription()}
Expand All @@ -111,13 +109,19 @@ class D2SectionPlain extends React.PureComponent<Props> {
}

render() {
const { isHidden, ...passOnProps } = this.props;
const { isHidden, applyCustomFormClass, ...passOnProps } = this.props;

if (isHidden) {
return null;
}

return this.renderSection(passOnProps);
return (<div
className={applyCustomFormClass ? this.props.classes.containerCustomForm : ''}
>
{
this.renderSection(passOnProps)
}
</div>);
}
}

Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17160,13 +17160,6 @@ semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
dependencies:
lru-cache "^6.0.0"

semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

[email protected]:
version "0.18.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be"
Expand Down

0 comments on commit 3ad55f0

Please sign in to comment.