-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [DHIS2-11804] add missing dependencies to rules engine execution
- Loading branch information
Showing
13 changed files
with
115 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#FLOW-TYPED | ||
to install libdefs: | ||
flow-typed install --libdefDir fromReactScripts | ||
move folders to flow-typed directory | ||
move folders to flow-typed directory |
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
15 changes: 15 additions & 0 deletions
15
...dules/capture-core/components/WidgetEventEdit/helpers/getAttributeValuesForRulesEngine.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 { convertServerToClient } from '../../../converters'; | ||
import { type DataElement } from '../../../metaData'; | ||
import type { | ||
AttributeValue, | ||
} from '../../Pages/common/EnrollmentOverviewDomain/useCommonEnrollmentDomainData'; | ||
|
||
export const getAttributeValuesForRulesEngine = (attributeValues: Array<AttributeValue> = [], attributes: Array<DataElement>) => | ||
attributeValues.reduce((acc, { id, value }) => { | ||
const dataElement = attributes.find(({ id: attributeId }) => id === attributeId); | ||
if (dataElement) { | ||
acc[id] = convertServerToClient(value, dataElement.type); | ||
} | ||
return acc; | ||
}, {}); |
14 changes: 14 additions & 0 deletions
14
...re_modules/capture-core/components/WidgetEventEdit/helpers/getEnrollmentForRulesEngine.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,14 @@ | ||
// @flow | ||
import { convertServerToClient } from '../../../converters'; | ||
import { dataElementTypes } from '../../../metaData'; | ||
import type { | ||
EnrollmentData, | ||
} from '../../Pages/common/EnrollmentOverviewDomain/useCommonEnrollmentDomainData'; | ||
|
||
export const getEnrollmentForRulesEngine = ({ enrollmentDate, incidentDate, enrollment }: EnrollmentData = {}): { enrollmentId: string, enrollmentDate: string, incidentDate?: string } => ({ | ||
enrollmentId: enrollment, | ||
// $FlowFixMe | ||
enrollmentDate: convertServerToClient(enrollmentDate, dataElementTypes.DATE), | ||
// $FlowFixMe | ||
incidentDate: convertServerToClient(incidentDate, dataElementTypes.DATE), | ||
}); |
3 changes: 3 additions & 0 deletions
3
src/core_modules/capture-core/components/WidgetEventEdit/helpers/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,3 @@ | ||
// @flow | ||
export { getAttributeValuesForRulesEngine } from './getAttributeValuesForRulesEngine'; | ||
export { getEnrollmentForRulesEngine } from './getEnrollmentForRulesEngine'; |
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