-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: select a program indicator expression [DHIS2-15645] (#179)
* feat: create section component * feat: android expression validator * feat: create program tei header component * feat: handle change tei header * feat: get expression description * feat: save in datastore format * feat: add tests to get expression description
- Loading branch information
Showing
16 changed files
with
497 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { FieldSet, Legend } from '@dhis2/ui' | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import styles from './Section.module.css' | ||
|
||
export const Section = ({ legend, children }) => ( | ||
<div className={styles.container}> | ||
<FieldSet> | ||
<Legend className={styles.legend}> | ||
<span> {legend} </span> | ||
</Legend> | ||
{children} | ||
</FieldSet> | ||
</div> | ||
) | ||
|
||
Section.propTypes = { | ||
legend: PropTypes.string, | ||
children: PropTypes.element.isRequired, | ||
} |
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,16 @@ | ||
.legend { | ||
display: inline-block; | ||
padding-bottom: var(--spacers-dp16); | ||
font-size: 15px; | ||
color: var(--colors-grey900); | ||
font-weight: 500; | ||
letter-spacing: 0.2px; | ||
} | ||
|
||
.container { | ||
padding: var(--spacers-dp16) 0; | ||
} | ||
|
||
.container:not(:last-child) { | ||
margin-bottom: var(--spacers-dp8); | ||
} |
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,28 @@ | ||
import { useDataQuery } from '@dhis2/app-runtime' | ||
|
||
/** | ||
* Query to get program list with attributes and indicators | ||
* */ | ||
|
||
const programQuery = { | ||
programs: { | ||
resource: 'programs', | ||
params: { | ||
fields: [ | ||
'id', | ||
'name', | ||
'programTrackedEntityAttributes[id,trackedEntityAttribute[id,name,valueType]]', | ||
'programIndicators[id,name,expression]', | ||
], | ||
paging: 'false', | ||
}, | ||
}, | ||
} | ||
|
||
export const useGetPrograms = () => { | ||
const { data } = useDataQuery(programQuery) | ||
|
||
return { | ||
programs: data && data.programs?.programs, | ||
} | ||
} |
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
Oops, something went wrong.