Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into eh/TECH/TECH-1541_R…
Browse files Browse the repository at this point in the history
…eplaceMuiDialog
  • Loading branch information
eirikhaugstulen committed Nov 30, 2023
2 parents d5e3cd0 + 47a95b2 commit 6a895f6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [100.46.1](https://github.com/dhis2/capture-app/compare/v100.46.0...v100.46.1) (2023-11-30)


### Bug Fixes

* [DHIS2-15686] fix program rule variables for edit profile mode ([#3463](https://github.com/dhis2/capture-app/issues/3463)) ([a24bb27](https://github.com/dhis2/capture-app/commit/a24bb2723f06cd4a3ca87bbbb22977b097377b3c))

# [100.46.0](https://github.com/dhis2/capture-app/compare/v100.45.2...v100.46.0) (2023-11-30)


### Features

* [DHIS2-14275] Support custom icons ([#3473](https://github.com/dhis2/capture-app/issues/3473)) ([2404fca](https://github.com/dhis2/capture-app/commit/2404fca8085965e699ae518cfe816f2f3d38dea7))

## [100.45.2](https://github.com/dhis2/capture-app/compare/v100.45.1...v100.45.2) (2023-11-29)


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "capture-app",
"homepage": ".",
"version": "100.45.2",
"version": "100.46.1",
"cacheVersion": "7",
"serverVersion": "38",
"license": "BSD-3-Clause",
Expand All @@ -10,7 +10,7 @@
"packages/rules-engine"
],
"dependencies": {
"@dhis2/rules-engine-javascript": "100.45.2",
"@dhis2/rules-engine-javascript": "100.46.1",
"@dhis2/app-runtime": "^3.9.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-icons": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/rules-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/rules-engine-javascript",
"version": "100.45.2",
"version": "100.46.1",
"license": "BSD-3-Clause",
"main": "./build/cjs/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// @flow
import type { ProgramRulesContainer } from '@dhis2/rules-engine-javascript';
import { getTrackedEntityAttributeId, getProgramId, getProgramRuleActions, getProgramStageId } from '../helpers';
import { getTrackedEntityAttributeId, getDataElementId, getProgramId, getProgramRuleActions, getProgramStageId } from '../helpers';
import { getRulesAndVariablesFromProgramIndicators } from '../../../../metaDataMemoryStoreBuilders/programs/getRulesAndVariablesFromIndicators';

const addProgramVariables = (program, programRuleVariables) => {
program.programRuleVariables = programRuleVariables.map(programRulesVariable => ({
...programRulesVariable,
programId: getProgramId(programRulesVariable),
dataElementId: getDataElementId(programRulesVariable),
trackedEntityAttributeId: getTrackedEntityAttributeId(programRulesVariable),
}));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getClientFormattedDataValuesAsObject = (dataValues, elementsById) =>
dataValues.reduce((acc, { dataElement: id, value }) => {
const dataElement = elementsById[id];
if (dataElement) {
acc[id] = convertValue(value, elementsById[id].type);
acc[id] = convertValue(value, dataElement.valueType);
}
return acc;
}, {});
Expand Down Expand Up @@ -39,8 +39,8 @@ export const useEvents = (enrollment: any, elementsById: Array<any>) => {
enrollmentId: event.enrollment,
enrollmentStatus: event.enrollmentStatus,
status: event.status,
eventDate: convertDate(event.eventDate),
dueDate: convertDate(event.dueDate),
occurredAt: convertDate(event.occurredAt),
scheduledAt: convertDate(event.scheduledAt),
...getClientFormattedDataValuesAsObject(event.dataValues, elementsById),
})),
[elementsById, enrollment, orgUnitNames],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useLifecycle = ({
const state = useSelector(stateArg => stateArg);
const enrollment = useSelector(({ enrollmentDomain }) => enrollmentDomain?.enrollment);
const dataElements: DataElements = useDataElements(programAPI);
const otherEvents = useEvents(enrollment, programAPI);
const otherEvents = useEvents(enrollment, dataElements);
const orgUnit: ?OrgUnit = useOrganisationUnit(orgUnitId).orgUnit;
const rulesContainer: ProgramRulesContainer = useRulesContainer(programAPI);
const formFoundation: RenderFoundation = useFormFoundation(programAPI);
Expand Down

0 comments on commit 6a895f6

Please sign in to comment.