Skip to content

Commit

Permalink
feat: temp
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Oct 16, 2023
1 parent 7ae8326 commit c63f701
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class D2SectionPlain extends React.PureComponent<Props> {

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

if (!sectionMetaData.showContainer || this.props.formHorizontal) {
return (
Expand All @@ -87,7 +88,10 @@ class D2SectionPlain extends React.PureComponent<Props> {
);
}
return (
<div>
<div
className={applyCustomFormClass ? this.props.classes.containerCustomForm : ''}
data-test="d2-form-component"
>
<Section
header={this.renderSectionHeader()}
description={this.renderSectionDescription()}
Expand All @@ -109,20 +113,17 @@ class D2SectionPlain extends React.PureComponent<Props> {
}

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

if (isHidden) {
return null;
}

return (<div
data-test="d2-form-component"
className={applyCustomFormClass ? this.props.classes.containerCustomForm : ''}
>
{
this.renderSection(passOnProps)
}
</div>);
return (
<React.Fragment>
{this.renderSection(passOnProps)}
</React.Fragment>
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export class D2SectionFieldsComponent extends Component<Props> {
<CustomFormHOC
formBuilderRef={(instance) => { this.formBuilderInstance = instance; }}
id={formId}
data-test="dhis2-capture-form"
fields={this.getFieldConfigWithRulesEffects()}
dataElements={this.formFields}
values={values}
Expand Down

0 comments on commit c63f701

Please sign in to comment.