From fcde52c1fab85685a98982b691fa274e12b8a302 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Thu, 30 Nov 2023 12:31:48 +0000 Subject: [PATCH 1/3] chore(release): cut 100.46.0 [skip release] # [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)) --- CHANGELOG.md | 7 +++++++ package.json | 4 ++-- packages/rules-engine/package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a28036713d..97013b7aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [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) diff --git a/package.json b/package.json index a3a3e55966..cd12b9b935 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "100.45.2", + "version": "100.46.0", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "100.45.2", + "@dhis2/rules-engine-javascript": "100.46.0", "@dhis2/app-runtime": "^3.9.3", "@dhis2/d2-i18n": "^1.1.0", "@dhis2/d2-icons": "^1.0.1", diff --git a/packages/rules-engine/package.json b/packages/rules-engine/package.json index 360a957889..b53e6943e0 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "100.45.2", + "version": "100.46.0", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": { From a24bb2723f06cd4a3ca87bbbb22977b097377b3c Mon Sep 17 00:00:00 2001 From: Tony Valle <79843014+superskip@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:46:51 +0100 Subject: [PATCH 2/3] fix: [DHIS2-15686] fix program rule variables for edit profile mode (#3463) --- .../WidgetProfile/DataEntry/ProgramRules/rulesContainer.js | 3 ++- .../components/WidgetProfile/DataEntry/hooks/useEvents.js | 6 +++--- .../WidgetProfile/DataEntry/hooks/useLifecycle.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/ProgramRules/rulesContainer.js b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/ProgramRules/rulesContainer.js index bb75e2a61d..554648322a 100644 --- a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/ProgramRules/rulesContainer.js +++ b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/ProgramRules/rulesContainer.js @@ -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), })); }; diff --git a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useEvents.js b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useEvents.js index 0c900af9a4..6e606a08d4 100644 --- a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useEvents.js +++ b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useEvents.js @@ -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; }, {}); @@ -39,8 +39,8 @@ export const useEvents = (enrollment: any, elementsById: Array) => { 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], diff --git a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useLifecycle.js b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useLifecycle.js index ce75b815f8..c60464a921 100644 --- a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useLifecycle.js +++ b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/hooks/useLifecycle.js @@ -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); From 47a95b2989880af8264f63409b57b9bf7043776e Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Thu, 30 Nov 2023 13:02:09 +0000 Subject: [PATCH 3/3] chore(release): cut 100.46.1 [skip release] ## [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)) --- CHANGELOG.md | 7 +++++++ package.json | 4 ++-- packages/rules-engine/package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97013b7aa0..7b603a0b17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [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) diff --git a/package.json b/package.json index cd12b9b935..4648cadedc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "100.46.0", + "version": "100.46.1", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "100.46.0", + "@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", diff --git a/packages/rules-engine/package.json b/packages/rules-engine/package.json index b53e6943e0..ff1415cd4f 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "100.46.0", + "version": "100.46.1", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": {