-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split data sets form into multiple components (#495) [skip rele…
…ase] * feat: split data sets form into multiple components * fix: lint * fix: remove unused code * fix: remove unused sync hook --------- Co-authored-by: Birk Johansson <[email protected]>
- Loading branch information
Showing
19 changed files
with
212 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { | ||
StandardFormSectionDescription, | ||
StandardFormSectionTitle, | ||
} from '../../../components' | ||
import { SectionedFormSection } from '../../../components/sectionedForm' | ||
|
||
export const AdvancedFormContents = ({ name }: { name: string }) => { | ||
return ( | ||
<SectionedFormSection name={name}> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Advanced options')} | ||
</StandardFormSectionTitle> | ||
<StandardFormSectionDescription> | ||
{i18n.t( | ||
'These options are used for advanced data set configurations.' | ||
)} | ||
</StandardFormSectionDescription> | ||
<div style={{ height: 900 }} /> | ||
</SectionedFormSection> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { | ||
ModelTransferField, | ||
StandardFormField, | ||
StandardFormSectionDescription, | ||
StandardFormSectionTitle, | ||
} from '../../../components' | ||
import { SectionedFormSection } from '../../../components/sectionedForm' | ||
import { CategoryComboField } from './CategoryComboField' | ||
|
||
export const DataFormContents = ({ name }: { name: string }) => { | ||
return ( | ||
<SectionedFormSection name={name}> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Configure data elements')} | ||
</StandardFormSectionTitle> | ||
<StandardFormSectionDescription> | ||
{i18n.t('Choose what data is collected for this data set.')} | ||
</StandardFormSectionDescription> | ||
<StandardFormField> | ||
<ModelTransferField | ||
name={'dataElements'} | ||
query={{ | ||
resource: 'dataElements', | ||
}} | ||
/> | ||
</StandardFormField> | ||
<div style={{ height: 24 }} /> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Data set disaggregation')} | ||
</StandardFormSectionTitle> | ||
<StandardFormSectionDescription> | ||
{i18n.t( | ||
'Choose an optional category combination to disaggregate the entire data set.' | ||
)} | ||
</StandardFormSectionDescription> | ||
<CategoryComboField /> | ||
</SectionedFormSection> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { StandardFormSectionTitle } from '../../../components' | ||
import { SectionedFormSection } from '../../../components/sectionedForm' | ||
|
||
export const FormFormContents = ({ name }: { name: string }) => { | ||
return ( | ||
<SectionedFormSection name={name}> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Data entry form')} | ||
</StandardFormSectionTitle> | ||
<div style={{ height: 300 }} /> | ||
</SectionedFormSection> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
src/pages/dataSetsWip/form/OrganisationUnitsFormContents.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { | ||
StandardFormSectionDescription, | ||
StandardFormSectionTitle, | ||
} from '../../../components' | ||
import { SectionedFormSection } from '../../../components/sectionedForm' | ||
|
||
export const OrganisationUnitsFormContents = ({ name }: { name: string }) => { | ||
return ( | ||
<SectionedFormSection name={name}> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Organisation units')} | ||
</StandardFormSectionTitle> | ||
<StandardFormSectionDescription> | ||
{i18n.t( | ||
'Configure which organisation units can collect data for this data set.' | ||
)} | ||
</StandardFormSectionDescription> | ||
<div style={{ height: 300 }} /> | ||
</SectionedFormSection> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
import { | ||
StandardFormSectionDescription, | ||
StandardFormSectionTitle, | ||
} from '../../../components' | ||
import { SectionedFormSection } from '../../../components/sectionedForm' | ||
import { PeriodTypeField } from './PeriodTypeField' | ||
|
||
export const PeriodsContents = ({ name }: { name: string }) => { | ||
return ( | ||
<SectionedFormSection name={name}> | ||
<StandardFormSectionTitle> | ||
{i18n.t('Configure data entry periods')} | ||
</StandardFormSectionTitle> | ||
<StandardFormSectionDescription> | ||
{i18n.t( | ||
'Choose for what time periods data can be entered for this data set' | ||
)} | ||
</StandardFormSectionDescription> | ||
<PeriodTypeField /> | ||
</SectionedFormSection> | ||
) | ||
} |
Oops, something went wrong.