-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [DHIS2-16337] Org unit in view event page (#3882)
* feat: add field and label to view event page * feat: add field and label to view event page * feat: add orgunit id to redux * feat: add validator * fix: remove console log * feat: label improvement
- Loading branch information
Showing
6 changed files
with
55 additions
and
16 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
5 changes: 5 additions & 0 deletions
5
src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/index.js
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,5 @@ | ||
// @flow | ||
export { getCategoryOptionsValidatorContainers } from './categoryOptions.validatorContainersGetter'; | ||
export { getEventDateValidatorContainers } from './eventDate.validatorContainersGetter'; | ||
export { getNoteValidatorContainers } from './note.validatorContainersGetter'; | ||
export { getOrgUnitValidatorContainers } from './orgUnit.validatorContainersGetter'; |
15 changes: 15 additions & 0 deletions
15
...components/WidgetEventEdit/DataEntry/fieldValidators/orgUnit.validatorContainersGetter.js
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 @@ | ||
// @flow | ||
import { isValidOrgUnit } from 'capture-core-utils/validators/form'; | ||
import i18n from '@dhis2/d2-i18n'; | ||
|
||
const validateOrgUnit = (value?: ?Object) => isValidOrgUnit(value); | ||
|
||
export const getOrgUnitValidatorContainers = () => { | ||
const validatorContainers = [ | ||
{ | ||
validator: validateOrgUnit, | ||
message: i18n.t('Please provide an valid organisation unit'), | ||
}, | ||
]; | ||
return validatorContainers; | ||
}; |
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