From eb5325e71087c0e00011878bd58f2fef3ad55eea Mon Sep 17 00:00:00 2001 From: Mohamed Ameen Date: Thu, 19 Dec 2024 12:11:15 +0000 Subject: [PATCH 1/9] fix: [DHIS2-118654] Use importStrategy=DELETE to support older backend (#3914) --- .../EditEventDataEntry/editEventDataEntry.actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/EditEventDataEntry/editEventDataEntry.actions.js b/src/core_modules/capture-core/components/WidgetEventEdit/EditEventDataEntry/editEventDataEntry.actions.js index ddd9bd1ff2..52a9c2f393 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/EditEventDataEntry/editEventDataEntry.actions.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/EditEventDataEntry/editEventDataEntry.actions.js @@ -71,7 +71,7 @@ export const startDeleteEventDataEntry = (serverData: Object, eventId: string, p actionCreator(actionTypes.START_DELETE_EVENT_DATA_ENTRY)({ eventId }, { offline: { effect: { - url: 'tracker?async=false&importStrategy=delete', + url: 'tracker?async=false&importStrategy=DELETE', method: effectMethods.POST, data: serverData, }, From 0a73ff8f8ff7d830fdd23d11c6a5e743282f436f Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Thu, 19 Dec 2024 12:15:31 +0000 Subject: [PATCH 2/9] chore(release): cut 101.20.1 [skip release] ## [101.20.1](https://github.com/dhis2/capture-app/compare/v101.20.0...v101.20.1) (2024-12-19) ### Bug Fixes * [DHIS2-118654] Use importStrategy=DELETE to support older backend ([#3914](https://github.com/dhis2/capture-app/issues/3914)) ([eb5325e](https://github.com/dhis2/capture-app/commit/eb5325e71087c0e00011878bd58f2fef3ad55eea)) --- 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 5d572bad72..bde6d83308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [101.20.1](https://github.com/dhis2/capture-app/compare/v101.20.0...v101.20.1) (2024-12-19) + + +### Bug Fixes + +* [DHIS2-118654] Use importStrategy=DELETE to support older backend ([#3914](https://github.com/dhis2/capture-app/issues/3914)) ([eb5325e](https://github.com/dhis2/capture-app/commit/eb5325e71087c0e00011878bd58f2fef3ad55eea)) + # [101.20.0](https://github.com/dhis2/capture-app/compare/v101.19.4...v101.20.0) (2024-12-17) diff --git a/package.json b/package.json index 55d37eb06b..1e258c5991 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "101.20.0", + "version": "101.20.1", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "101.20.0", + "@dhis2/rules-engine-javascript": "101.20.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 cfef6fbc8d..3b21d592f1 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "101.20.0", + "version": "101.20.1", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": { From a4630471d77804436c8803daed4bd05e5c61f2c7 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 22 Dec 2024 02:44:58 +0100 Subject: [PATCH 3/9] fix(translations): sync translations from transifex (master) Automatically merged. --- i18n/nb.po | 43 +++++++++++++--- i18n/zh.po | 141 ++++++++++++++++++++++++++++++++--------------------- 2 files changed, 123 insertions(+), 61 deletions(-) diff --git a/i18n/nb.po b/i18n/nb.po index 08dc43cc41..0cf4fcf440 100644 --- a/i18n/nb.po +++ b/i18n/nb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2024-12-03T10:58:18.077Z\n" +"POT-Creation-Date: 2024-12-05T11:39:04.447Z\n" "PO-Revision-Date: 2019-06-27 07:31+0000\n" "Last-Translator: Karoline Tufte Lien , 2024\n" "Language-Team: Norwegian Bokmål (https://app.transifex.com/hisp-uio/teams/100509/nb/)\n" @@ -45,10 +45,10 @@ msgstr "" "at dette vil lukke andre versjoner." msgid "Enrollment dashboard" -msgstr "" +msgstr "Registreringsdashbord" msgid "View event" -msgstr "" +msgstr "Vis hendelse" msgid "Edit event" msgstr "Rediger hendelse" @@ -66,16 +66,16 @@ msgid "Cancelled enrollments" msgstr "Avbrutte registreringer" msgid "{{trackedEntityName}} list" -msgstr "" +msgstr "{{trackedEntityName}}-liste" msgid "Search" msgstr "Søk" msgid "Working List" -msgstr "" +msgstr "Arbeidsliste" msgid "Event list" -msgstr "" +msgstr "Hendelsesliste" msgid "More" msgstr "Mer" @@ -1495,9 +1495,40 @@ msgstr "{{ scheduledEvents }} planlagt" msgid "Stages and Events" msgstr "Faser og hendelser" +msgid "An error occurred while unlinking and deleting the event." +msgstr "" + +msgid "Unlink and delete linked event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link and delete the linked event? This " +"action permanently removes the link, linked event, and all related data." +msgstr "" + +msgid "Yes, unlink and delete linked event" +msgstr "" + +msgid "Unlink event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link between these events? This action " +"removes the link itself, but the linked event will remain." +msgstr "" + +msgid "Yes, unlink event" +msgstr "" + msgid "View linked event" msgstr "Vis knyttede hendelser" +msgid "You do not have access to remove the link between these events" +msgstr "" + +msgid "You do not have access to remove the link and delete the linked event" +msgstr "" + msgid "An error occurred while loading the widget." msgstr "En feil oppstå ved lasting av widget. " diff --git a/i18n/zh.po b/i18n/zh.po index 7d141be381..6fa7b235d5 100644 --- a/i18n/zh.po +++ b/i18n/zh.po @@ -1,16 +1,16 @@ # # Translators: # Philip Larsen Donnelly, 2024 -# easylin , 2024 # Viktor Varland , 2024 # 晓东 林 <13981924470@126.com>, 2024 +# easylin , 2024 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2024-12-03T10:58:18.077Z\n" +"POT-Creation-Date: 2024-12-05T11:39:04.447Z\n" "PO-Revision-Date: 2019-06-27 07:31+0000\n" -"Last-Translator: 晓东 林 <13981924470@126.com>, 2024\n" +"Last-Translator: easylin , 2024\n" "Language-Team: Chinese (https://app.transifex.com/hisp-uio/teams/100509/zh/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -42,10 +42,10 @@ msgstr "" "App仅支持同时运行一个版本(在同一域中)。如果您想再次使用此版本,请刷新此页面,但是请注意,它将关闭其他版本。" msgid "Enrollment dashboard" -msgstr "" +msgstr "注册仪表板" msgid "View event" -msgstr "" +msgstr "查看活动" msgid "Edit event" msgstr "编辑事件" @@ -63,16 +63,16 @@ msgid "Cancelled enrollments" msgstr "取消注册" msgid "{{trackedEntityName}} list" -msgstr "" +msgstr "{{trackedEntityName}} 清单" msgid "Search" msgstr "搜索" msgid "Working List" -msgstr "" +msgstr "工作列表" msgid "Event list" -msgstr "" +msgstr "事件列表" msgid "More" msgstr "更多" @@ -1209,7 +1209,7 @@ msgid "stage not found in rules execution" msgstr "在规则执行中找不到阶段" msgid "Please provide an valid organisation unit" -msgstr "" +msgstr "请提供有效的组织单位" msgid "Delete event" msgstr "删除事件" @@ -1370,7 +1370,7 @@ msgid "Report date" msgstr "报告日期" msgid "Please enter a date" -msgstr "" +msgstr "请输入日期" msgid "Please provide a valid organisation unit" msgstr "请提供有效的机构" @@ -1429,19 +1429,50 @@ msgstr "{{ scheduledEvents }} 已安排" msgid "Stages and Events" msgstr "阶段与活动" +msgid "An error occurred while unlinking and deleting the event." +msgstr "" + +msgid "Unlink and delete linked event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link and delete the linked event? This " +"action permanently removes the link, linked event, and all related data." +msgstr "" + +msgid "Yes, unlink and delete linked event" +msgstr "" + +msgid "Unlink event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link between these events? This action " +"removes the link itself, but the linked event will remain." +msgstr "" + +msgid "Yes, unlink event" +msgstr "" + msgid "View linked event" msgstr "查看链接事件" +msgid "You do not have access to remove the link between these events" +msgstr "" + +msgid "You do not have access to remove the link and delete the linked event" +msgstr "" + msgid "An error occurred while loading the widget." msgstr "加载小部件时发生错误。" msgid "Linked event" -msgstr "" +msgstr "关联事件" msgid "" "This {{stageName}} event is linked to a {{linkedStageName}} event. Review " "the linked event details before entering data below" -msgstr "" +msgstr "此{{stageName}} 事件与{{linkedStageName}} 事件相关联。在输入以下数据之前,请查看链接事件的详细信息" msgid "Scheduled" msgstr "已经调度" @@ -1543,44 +1574,44 @@ msgid "an error occurred loading working lists" msgstr "载入工作列表发生错误" msgid "You do not have access to complete events" -msgstr "" +msgstr "您无法访问完成的事件" msgid "Complete events" -msgstr "" +msgstr "完成事件" msgid "Are you sure you want to complete all active events in selection?" -msgstr "" +msgstr "您确定要在选择中完成所有活动事件吗?" msgid "There are no active events to complete in the current selection." -msgstr "" +msgstr "当前选择中没有要完成的活动。" msgid "Error completing events" -msgstr "" +msgstr "完成事件 错误" msgid "There was an error completing the events." -msgstr "" +msgstr "完成事件时出现错误。" msgid "Details (Advanced)" -msgstr "" +msgstr "详细信息(高级)" msgid "An unknown error occurred." msgstr "出现未知错误。" msgid "An error occurred while completing events" -msgstr "" +msgstr "完成事件时发生错误" msgid "An error occurred while deleting the events" -msgstr "" +msgstr "删除事件时发生错误" msgid "You do not have access to delete events" -msgstr "" +msgstr "您无权删除事件" msgid "Delete events" -msgstr "" +msgstr "删除事件" msgid "" "This cannot be undone. Are you sure you want to delete the selected events?" -msgstr "" +msgstr "此操作无法撤销。您确定要删除所选事件吗?" msgid "Registration Date" msgstr "登记日期" @@ -1600,110 +1631,110 @@ msgstr "选择要按 {{label}} 筛选的项目阶段" msgid "" "Some enrollments were completed successfully, but there was an error while " "completing the rest. Please see the details below." -msgstr "" +msgstr "部分注册已成功完成,但在完成其他注册时出现错误。详情请见下文。" msgid "" "There was an error while completing the enrollments. Please see the details " "below." -msgstr "" +msgstr "在完成注册时出现错误。请参阅下面的详细信息。" msgid "" "An unexpected error occurred while fetching the enrollments. Please try " "again." -msgstr "" +msgstr "在获取注册信息时发生了意外错误。请重试。" msgid "" "There are currently no active enrollments in the selection. All enrollments " "are already completed or cancelled." -msgstr "" +msgstr "该选项中目前没有有效注册。所有注册均已完成或取消。" msgid "" "This action will complete {{count}} active enrollment in your selection." msgid_plural "" "This action will complete {{count}} active enrollment in your selection." -msgstr[0] "" +msgstr[0] "此操作将完成{{count}} 您选择的活动注册。" msgid "{{count}} enrollment already marked as completed will not be changed." msgid_plural "" "{{count}} enrollment already marked as completed will not be changed." -msgstr[0] "" +msgstr[0] "{{count}} 已标记为完成的注册将不会更改。" msgid "Mark all events within enrollments as complete" -msgstr "" +msgstr "将注册中的所有事件标记为已完成" msgid "You do not have access to bulk complete enrollments" -msgstr "" +msgstr "您无法批量完成注册" msgid "Complete enrollments" -msgstr "" +msgstr "完成注册" msgid "Error completing enrollments" -msgstr "" +msgstr "完成注册出错" msgid "No active enrollments to complete" -msgstr "" +msgstr "没有待完成的有效注册" msgid "Complete {{count}} enrollment" msgid_plural "Complete {{count}} enrollment" -msgstr[0] "" +msgstr[0] "完成{{count}} 注册" msgid "An error occurred when completing the enrollments" -msgstr "" +msgstr "完成注册时发生错误" msgid "An unknown error occurred when completing enrollments" -msgstr "" +msgstr "完成注册时出现未知错误" msgid "You do not have access to delete enrollments" -msgstr "" +msgstr "您没有删除注册的权限" msgid "Delete enrollments" -msgstr "" +msgstr "删除注册" msgid "Delete selected enrollments" -msgstr "" +msgstr "删除选定的注册" msgid "" "An error occurred while loading the selected enrollments. Please try again." -msgstr "" +msgstr "加载所选注册信息时发生错误。请重试。" msgid "" "This action will permanently delete the selected enrollments, including all " "associated data and events." -msgstr "" +msgstr "此操作将永久删除所选注册信息,包括所有相关数据和事件。" msgid "Active enrollments ({{count}})" msgid_plural "Active enrollments ({{count}})" -msgstr[0] "" +msgstr[0] "有效注册 ({{count}})" msgid "Completed enrollments ({{count}})" msgid_plural "Completed enrollments ({{count}})" -msgstr[0] "" +msgstr[0] "完成注册 ({{count}})" msgid "Cancelled enrollments ({{count}})" msgid_plural "Cancelled enrollments ({{count}})" -msgstr[0] "" +msgstr[0] "取消注册 ({{count}})" msgid "Delete {{count}} enrollment" msgid_plural "Delete {{count}} enrollment" -msgstr[0] "" +msgstr[0] "删除{{count}} 注册" msgid "An error occurred when deleting enrollments" -msgstr "" +msgstr "删除注册时发生错误" msgid "Delete {{ trackedEntityName }} with all enrollments" -msgstr "" +msgstr "删除{{ trackedEntityName }} 和所有注册信息" msgid "Delete {{count}} {{ trackedEntityName }}" msgid_plural "Delete {{count}} {{ trackedEntityName }}" -msgstr[0] "" +msgstr[0] "删除{{count}} {{ trackedEntityName }}" msgid "" "Deleting records will also delete any associated enrollments and events. " "This cannot be undone. Are you sure you want to delete?" -msgstr "" +msgstr "删除记录也会删除任何相关的注册和事件。此操作无法撤销。您确定要删除吗?" msgid "An error occurred while deleting the records" -msgstr "" +msgstr "删除记录时发生错误" msgid "Working list could not be updated" msgstr "工作清单无法更新" @@ -1875,13 +1906,13 @@ msgid "Checking..." msgstr "检查" msgid "Please provide a valid positive integer" -msgstr "" +msgstr "请提供一个有效的正整数" msgid "Please enter a valid time" -msgstr "" +msgstr "请输入有效时间" msgid "Please enter a time" -msgstr "" +msgstr "请输入时间" msgid "Set coordinate" msgstr "设置坐标" From 6c6340f4243f56ce7f4b2707b76ee93617dd4cf2 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 22 Dec 2024 01:49:10 +0000 Subject: [PATCH 4/9] chore(release): cut 101.20.2 [skip release] ## [101.20.2](https://github.com/dhis2/capture-app/compare/v101.20.1...v101.20.2) (2024-12-22) ### Bug Fixes * **translations:** sync translations from transifex (master) ([a463047](https://github.com/dhis2/capture-app/commit/a4630471d77804436c8803daed4bd05e5c61f2c7)) --- 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 bde6d83308..36d0669902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [101.20.2](https://github.com/dhis2/capture-app/compare/v101.20.1...v101.20.2) (2024-12-22) + + +### Bug Fixes + +* **translations:** sync translations from transifex (master) ([a463047](https://github.com/dhis2/capture-app/commit/a4630471d77804436c8803daed4bd05e5c61f2c7)) + ## [101.20.1](https://github.com/dhis2/capture-app/compare/v101.20.0...v101.20.1) (2024-12-19) diff --git a/package.json b/package.json index 1e258c5991..7200b95525 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "101.20.1", + "version": "101.20.2", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "101.20.1", + "@dhis2/rules-engine-javascript": "101.20.2", "@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 3b21d592f1..b9732045f9 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "101.20.1", + "version": "101.20.2", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": { From f58bcd3c62d45101bbb4d5b16f504f1699cbb3d4 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 29 Dec 2024 02:44:41 +0100 Subject: [PATCH 5/9] fix(translations): sync translations from transifex (master) Automatically merged. --- i18n/es_419.po | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/i18n/es_419.po b/i18n/es_419.po index 96fc75f7af..2638dd7424 100644 --- a/i18n/es_419.po +++ b/i18n/es_419.po @@ -3,13 +3,14 @@ # Philip Larsen Donnelly, 2024 # Enzo Nicolas Rossi , 2024 # Jaime Bosque , 2024 +# Pablo Del Médico, 2024 # msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2024-12-03T10:58:18.077Z\n" +"POT-Creation-Date: 2024-12-05T11:39:04.447Z\n" "PO-Revision-Date: 2019-06-27 07:31+0000\n" -"Last-Translator: Jaime Bosque , 2024\n" +"Last-Translator: Pablo Del Médico, 2024\n" "Language-Team: Spanish (Latin America) (https://app.transifex.com/hisp-uio/teams/100509/es_419/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -47,10 +48,10 @@ msgstr "" "versiones." msgid "Enrollment dashboard" -msgstr "" +msgstr "Panel de inscripción" msgid "View event" -msgstr "" +msgstr "Ver evento" msgid "Edit event" msgstr "Editar evento" @@ -68,7 +69,7 @@ msgid "Cancelled enrollments" msgstr "" msgid "{{trackedEntityName}} list" -msgstr "" +msgstr "{{trackedEntityName}} lista" msgid "Search" msgstr "Buscar" @@ -77,10 +78,10 @@ msgid "Working List" msgstr "" msgid "Event list" -msgstr "" +msgstr "Lista de eventos" msgid "More" -msgstr "" +msgstr "Más" msgid "View {{programName}} dashboard" msgstr "Ver panel de {{programName}}" @@ -1206,10 +1207,10 @@ msgid "Follow-up" msgstr "" msgid "Started at{{escape}}" -msgstr "" +msgstr "Comenzó en {{escape}}" msgid "Owned by{{escape}}" -msgstr "" +msgstr "Propiedad de {{escape}}" msgid "Cancelled" msgstr "Cancelar" @@ -1475,9 +1476,40 @@ msgstr "" msgid "Stages and Events" msgstr "" +msgid "An error occurred while unlinking and deleting the event." +msgstr "" + +msgid "Unlink and delete linked event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link and delete the linked event? This " +"action permanently removes the link, linked event, and all related data." +msgstr "" + +msgid "Yes, unlink and delete linked event" +msgstr "" + +msgid "Unlink event" +msgstr "" + +msgid "" +"Are you sure you want to remove the link between these events? This action " +"removes the link itself, but the linked event will remain." +msgstr "" + +msgid "Yes, unlink event" +msgstr "" + msgid "View linked event" msgstr "" +msgid "You do not have access to remove the link between these events" +msgstr "" + +msgid "You do not have access to remove the link and delete the linked event" +msgstr "" + msgid "An error occurred while loading the widget." msgstr "" From 8665d754b3e6501220c093bca133509e66f11864 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 29 Dec 2024 01:48:50 +0000 Subject: [PATCH 6/9] chore(release): cut 101.20.3 [skip release] ## [101.20.3](https://github.com/dhis2/capture-app/compare/v101.20.2...v101.20.3) (2024-12-29) ### Bug Fixes * **translations:** sync translations from transifex (master) ([f58bcd3](https://github.com/dhis2/capture-app/commit/f58bcd3c62d45101bbb4d5b16f504f1699cbb3d4)) --- 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 36d0669902..3f8e81a1bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [101.20.3](https://github.com/dhis2/capture-app/compare/v101.20.2...v101.20.3) (2024-12-29) + + +### Bug Fixes + +* **translations:** sync translations from transifex (master) ([f58bcd3](https://github.com/dhis2/capture-app/commit/f58bcd3c62d45101bbb4d5b16f504f1699cbb3d4)) + ## [101.20.2](https://github.com/dhis2/capture-app/compare/v101.20.1...v101.20.2) (2024-12-22) diff --git a/package.json b/package.json index 7200b95525..e4caffa666 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "101.20.2", + "version": "101.20.3", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "101.20.2", + "@dhis2/rules-engine-javascript": "101.20.3", "@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 b9732045f9..0ae04d0315 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "101.20.2", + "version": "101.20.3", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": { From dcf1a957e4504247cd27b69c75cb67128526ed7c Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 7 Jan 2025 14:39:04 +0100 Subject: [PATCH 7/9] chore: [DHIS2-18736] fix Cypress tests broken due to the change of year (#3933) --- .../StagesAndEventsWidget/StagesAndEventsWidget.feature | 2 +- .../StagesAndEventsWidget/StagesAndEventsWidget.js | 4 ++-- .../e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js | 4 ++-- .../WidgetsForEnrollmentAddEventPage.feature | 2 +- .../WidgetsForEnrollmentDashboard.feature | 2 +- .../WidgetsForEnrollmentEditEvent.feature | 2 +- .../TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature | 2 ++ 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature index e944741b2f..a18e595f6b 100644 --- a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature +++ b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature @@ -71,7 +71,7 @@ Feature: User interacts with Stages and Events Widget @with-restore-deleted-event Scenario: User can delete an event - Given you open the enrollment page by typing #/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f + Given you open the enrollment page by typing #/enrollment?enrollmentId=ITyaPVATEwc&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=wsk89u7zquT And there is an Active event in the TB visit stage When you click the Delete event overflow button on the Active event And you confirm you want to delete the event diff --git a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js index 35d8996ee7..bf5334da58 100644 --- a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js +++ b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js @@ -3,7 +3,7 @@ import { getCurrentYear } from '../../../support/date'; import '../sharedSteps'; After({ tags: '@with-restore-deleted-event' }, () => { - cy.visit('#/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f'); + cy.visit('#/enrollment?enrollmentId=ITyaPVATEwc&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=wsk89u7zquT'); cy.get('[data-test="stages-and-events-widget"]') .find('[data-test="widget-contents"]') @@ -215,7 +215,7 @@ When(/you click the (.*) event overflow button on the (.*) event$/, (buttonName, cy.get('[data-test="overflow-menu"]') .contains(buttonName) - .click(); + .click({ force: true }); }); Then('the event should be skipped', () => { diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js index 9f4148abf9..fe8fdfee12 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js @@ -9,10 +9,10 @@ After({ tags: '@with-transfer-ownership-data-cleanup' }, () => { }); const changeEnrollmentAndEventsStatus = () => ( - cy.buildApiUrl('tracker', 'trackedEntities/osF4RF4EiqP?program=IpHINAT79UW&fields=enrollments') + cy.buildApiUrl('tracker', 'trackedEntities/mPLqCVS27AD?program=IpHINAT79UW&fields=enrollments') .then(url => cy.request(url)) .then(({ body }) => { - const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'qyx7tscVpVB'); + const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'YqNTNLKmX4z'); const eventsToUpdate = enrollment.events.map(e => ({ ...e, status: 'ACTIVE', diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature index 0ab586b19f..cd6062c7fe 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature @@ -68,7 +68,7 @@ Feature: The user interacts with the widgets on the enrollment add event page Then you can assign a user when scheduling the event Scenario: User can complete the enrollment and the active events - Given you land on the enrollment edit event page by having typed #/enrollmentEventNew?enrollmentId=qyx7tscVpVB&orgUnitId=DiszpKrYNg8&programId=IpHINAT79UW&teiId=osF4RF4EiqP + Given you land on the enrollment edit event page by having typed #/enrollmentEventNew?enrollmentId=YqNTNLKmX4z&orgUnitId=RzgSFJ9E46G&programId=IpHINAT79UW&teiId=mPLqCVS27AD And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature index ffd0a56c1c..76b3465297 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature @@ -127,7 +127,7 @@ Feature: The user interacts with the widgets on the enrollment dashboard Then the user can see the program rules effect in the indicator widget Scenario: User can complete the enrollment and the active events - Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=qyx7tscVpVB + Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=YqNTNLKmX4z And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature index 39bd30c304..defa075922 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature @@ -105,7 +105,7 @@ Feature: The user interacts with the widgets on the enrollment edit event Then the table footer should display page 2 Scenario: User can complete the enrollment and the active events - Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=OWpIzQ4xabC&orgUnitId=DiszpKrYNg8 + Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=PyXThVzWJzL&orgUnitId=RzgSFJ9E46G And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu diff --git a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature index f79f4faf87..40b383e7b3 100644 --- a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature +++ b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature @@ -31,6 +31,8 @@ Feature: User facing tests for bulk actions on Tracked Entity working lists When you select the first 5 rows Then the filters should be disabled +#DHIS2-18447 +@skip Scenario: The user should see an error message when trying to bulk complete enrollments with errors Given you open the main page with Ngelehun and Malaria focus investigation context And you select the first 3 rows From f670971808f49b75295c1d3c7ef25a747b4888df Mon Sep 17 00:00:00 2001 From: henrikmv <110386561+henrikmv@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:34:37 +0100 Subject: [PATCH 8/9] feat: [DHIS2-18328] Handle log entries for occurredAt, scheduledAt and geometry (#3887) * feat: geometry scheduledat occuredat in changelog * fix: clean up * fix: add check for featuretype * feat: style improvements * fix: convert changelog data in servertoclient * feat: update clienttolist * fix: revert new folder structure * fix: code clean up * fix: show coordinate * feat: style improvements * fix: change from property to fields * fix: review comments * fix: translation * fix: revert type change --- i18n/en.pot | 22 ++++++- .../MinimalCoordinates/MinimalCoordinates.js | 12 ++-- .../MinimalCoordinates/index.js | 0 .../PolygonCoordinates/PolygonCoordinates.js | 59 +++++++++++++++++++ .../Coordinates/PolygonCoordinates/index.js | 2 + .../components/Coordinates/index.js | 3 + .../NewRelationship/RegisterTei/open.epics.js | 2 +- ...TrackedEntityRelationshipsWrapper.epics.js | 2 +- .../EventChangelogWrapper.component.js | 11 ++++ .../common/Changelog/Changelog.types.js | 3 + .../ChangelogCells/ChangelogValueCell.js | 8 ++- .../common/hooks/useListDataValues.js | 4 +- .../capture-core/converters/clientToList.js | 44 +++++++------- .../capture-core/converters/clientToView.js | 2 +- .../capture-core/converters/serverToClient.js | 25 ++++++-- 15 files changed, 161 insertions(+), 38 deletions(-) rename src/core_modules/capture-core/components/{ => Coordinates}/MinimalCoordinates/MinimalCoordinates.js (61%) rename src/core_modules/capture-core/components/{ => Coordinates}/MinimalCoordinates/index.js (100%) create mode 100644 src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/PolygonCoordinates.js create mode 100644 src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/index.js create mode 100644 src/core_modules/capture-core/components/Coordinates/index.js diff --git a/i18n/en.pot b/i18n/en.pot index 2f414dc91a..0e6ac05309 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-12-05T11:39:04.447Z\n" -"PO-Revision-Date: 2024-12-05T11:39:04.447Z\n" +"POT-Creation-Date: 2024-12-15T15:25:38.375Z\n" +"PO-Revision-Date: 2024-12-15T15:25:38.375Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -101,6 +101,24 @@ msgstr "Date of enrollment" msgid "Last updated" msgstr "Last updated" +msgid "Lat" +msgstr "Lat" + +msgid "Long" +msgstr "Long" + +msgid "lat" +msgstr "lat" + +msgid "long" +msgstr "long" + +msgid "Show less" +msgstr "Show less" + +msgid "Show more" +msgstr "Show more" + msgid "error encountered during field validation" msgstr "error encountered during field validation" diff --git a/src/core_modules/capture-core/components/MinimalCoordinates/MinimalCoordinates.js b/src/core_modules/capture-core/components/Coordinates/MinimalCoordinates/MinimalCoordinates.js similarity index 61% rename from src/core_modules/capture-core/components/MinimalCoordinates/MinimalCoordinates.js rename to src/core_modules/capture-core/components/Coordinates/MinimalCoordinates/MinimalCoordinates.js index 36af51e4f5..39b23b672c 100644 --- a/src/core_modules/capture-core/components/MinimalCoordinates/MinimalCoordinates.js +++ b/src/core_modules/capture-core/components/Coordinates/MinimalCoordinates/MinimalCoordinates.js @@ -1,5 +1,6 @@ // @flow import React from 'react'; +import i18n from '@dhis2/d2-i18n'; type Props = $ReadOnly<{| latitude: number | string, @@ -8,9 +9,10 @@ type Props = $ReadOnly<{| const toSixDecimal = value => (parseFloat(value) ? parseFloat(value).toFixed(6) : null); -export const MinimalCoordinates = ({ latitude, longitude }: Props) => - (
- lat: {toSixDecimal(latitude)}
- long: {toSixDecimal(longitude)} -
); +export const MinimalCoordinates = ({ latitude, longitude }: Props) => ( +
+ {i18n.t('Lat')}: {toSixDecimal(latitude)}
+ {i18n.t('Long')}: {toSixDecimal(longitude)} +
+); diff --git a/src/core_modules/capture-core/components/MinimalCoordinates/index.js b/src/core_modules/capture-core/components/Coordinates/MinimalCoordinates/index.js similarity index 100% rename from src/core_modules/capture-core/components/MinimalCoordinates/index.js rename to src/core_modules/capture-core/components/Coordinates/MinimalCoordinates/index.js diff --git a/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/PolygonCoordinates.js b/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/PolygonCoordinates.js new file mode 100644 index 0000000000..c019bdb5fe --- /dev/null +++ b/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/PolygonCoordinates.js @@ -0,0 +1,59 @@ +// @flow +import React, { useState } from 'react'; +import i18n from '@dhis2/d2-i18n'; +import { withStyles } from '@material-ui/core/styles'; +import { IconChevronUp16, IconChevronDown16, colors, spacers } from '@dhis2/ui'; + +type Props = $ReadOnly<{| + coordinates: Array>, + classes: { + buttonContainer: string, + viewButton: string, + }, +|}>; + +const styles = { + buttonContainer: { + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + }, + viewButton: { + background: 'none', + border: 'none', + cursor: 'pointer', + color: colors.grey800, + marginTop: spacers.dp8, + display: 'flex', + alignItems: 'center', + '&:hover': { + textDecoration: 'underline', + color: 'black', + }, + }, +}; + +const PolygonCoordinatesPlain = ({ coordinates, classes }: Props) => { + const [showMore, setShowMore] = useState(false); + return ( + <> +
+ {coordinates.slice(0, showMore ? coordinates.length : 1).map((coordinatePair, index) => ( + // eslint-disable-next-line react/no-array-index-key +
+ {`${i18n.t('lat')}: ${coordinatePair[1]}`}
+ {`${i18n.t('long')}: ${coordinatePair[0]}`} +
+ ))} +
+
+ +
+ + ); +}; + +export const PolygonCoordinates = withStyles(styles)(PolygonCoordinatesPlain); diff --git a/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/index.js b/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/index.js new file mode 100644 index 0000000000..0c85230d28 --- /dev/null +++ b/src/core_modules/capture-core/components/Coordinates/PolygonCoordinates/index.js @@ -0,0 +1,2 @@ +// @flow +export { PolygonCoordinates } from './PolygonCoordinates'; diff --git a/src/core_modules/capture-core/components/Coordinates/index.js b/src/core_modules/capture-core/components/Coordinates/index.js new file mode 100644 index 0000000000..a7549a63b6 --- /dev/null +++ b/src/core_modules/capture-core/components/Coordinates/index.js @@ -0,0 +1,3 @@ +// @flow +export { MinimalCoordinates } from './MinimalCoordinates'; +export { PolygonCoordinates } from './PolygonCoordinates'; diff --git a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js index cfa4280b97..3244faf794 100644 --- a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js @@ -30,7 +30,7 @@ function getTrackerProgram(suggestedProgramId: string) { log.error( errorCreator('tracker program for id not found')({ suggestedProgramId, error }), ); - throw Error(i18n('Metadata error. see log for details')); + throw Error(i18n.t('Metadata error. see log for details')); } return trackerProgram; } diff --git a/src/core_modules/capture-core/components/Pages/common/TEIRelationshipsWidget/TrackedEntityRelationshipsWrapper/TrackedEntityRelationshipsWrapper.epics.js b/src/core_modules/capture-core/components/Pages/common/TEIRelationshipsWidget/TrackedEntityRelationshipsWrapper/TrackedEntityRelationshipsWrapper.epics.js index 488faf8e6f..c752b65d0a 100644 --- a/src/core_modules/capture-core/components/Pages/common/TEIRelationshipsWidget/TrackedEntityRelationshipsWrapper/TrackedEntityRelationshipsWrapper.epics.js +++ b/src/core_modules/capture-core/components/Pages/common/TEIRelationshipsWidget/TrackedEntityRelationshipsWrapper/TrackedEntityRelationshipsWrapper.epics.js @@ -30,7 +30,7 @@ function getTrackerProgram(suggestedProgramId: string) { log.error( errorCreator('tracker program for id not found')({ suggestedProgramId, error }), ); - throw Error(i18n('Metadata error. see log for details')); + throw Error(i18n.t('Metadata error. see log for details')); } return trackerProgram; } diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/EventChangelogWrapper/EventChangelogWrapper.component.js b/src/core_modules/capture-core/components/WidgetEventEdit/EventChangelogWrapper/EventChangelogWrapper.component.js index e7041bdd74..2d7d294dd0 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/EventChangelogWrapper/EventChangelogWrapper.component.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/EventChangelogWrapper/EventChangelogWrapper.component.js @@ -1,5 +1,6 @@ // @flow import React, { useMemo } from 'react'; +import i18n from '@dhis2/d2-i18n'; import type { DataElement } from '../../../metaData'; import { dataElementTypes } from '../../../metaData'; import type { Props } from './EventChangelogWrapper.types'; @@ -42,9 +43,19 @@ export const EventChangelogWrapper = ({ formFoundation, eventId, eventData, ...p return acc; }, {}); + const additionalFields = formFoundation.featureType !== 'None' ? { + geometry: { + id: 'geometry', + name: formFoundation.featureType === 'Polygon' ? i18n.t('Area') : i18n.t('Coordinate'), + type: formFoundation.featureType === 'Polygon' ? + dataElementTypes.POLYGON : dataElementTypes.COORDINATE, + }, + } : null; + return { ...fieldElementsById, ...fieldElementsContext, + ...additionalFields, }; }, [formFoundation]); diff --git a/src/core_modules/capture-core/components/WidgetsChangelog/common/Changelog/Changelog.types.js b/src/core_modules/capture-core/components/WidgetsChangelog/common/Changelog/Changelog.types.js index 56dccc68cd..ece01ab3a9 100644 --- a/src/core_modules/capture-core/components/WidgetsChangelog/common/Changelog/Changelog.types.js +++ b/src/core_modules/capture-core/components/WidgetsChangelog/common/Changelog/Changelog.types.js @@ -6,6 +6,7 @@ type CreatedChange = {| type: typeof CHANGE_TYPES.CREATED, dataElement?: string, attribute?: string, + field?: string, currentValue: any, |} @@ -13,6 +14,7 @@ type UpdatedChange = {| type: typeof CHANGE_TYPES.UPDATED, dataElement?: string, attribute?: string, + field?: string, previousValue: any, currentValue: any, |} @@ -21,6 +23,7 @@ type DeletedChange = {| type: typeof CHANGE_TYPES.DELETED, dataElement?: string, attribute?: string, + field?: string, previousValue: any, |} diff --git a/src/core_modules/capture-core/components/WidgetsChangelog/common/ChangelogTable/ChangelogCells/ChangelogValueCell.js b/src/core_modules/capture-core/components/WidgetsChangelog/common/ChangelogTable/ChangelogCells/ChangelogValueCell.js index 4d6bd41b3e..3b43a13eba 100644 --- a/src/core_modules/capture-core/components/WidgetsChangelog/common/ChangelogTable/ChangelogCells/ChangelogValueCell.js +++ b/src/core_modules/capture-core/components/WidgetsChangelog/common/ChangelogTable/ChangelogCells/ChangelogValueCell.js @@ -23,9 +23,12 @@ const styles = { display: 'flex', flexDirection: 'row', alignItems: 'center', - whiteSpace: 'normal', height: '100%', }, + buttonContainer: { + display: 'flex', + justifyContent: 'center', + }, previousValue: { color: colors.grey700, wordBreak: 'break-word', @@ -33,9 +36,10 @@ const styles = { currentValue: { color: colors.grey900, wordBreak: 'break-word', + maxWidth: '82%', }, arrow: { - margin: `0 ${spacers.dp4}`, + margin: spacers.dp4, }, }; diff --git a/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/useListDataValues.js b/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/useListDataValues.js index e94bf94a88..16dcbe87f2 100644 --- a/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/useListDataValues.js +++ b/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/useListDataValues.js @@ -44,7 +44,8 @@ const fetchFormattedValues = async ({ elementKey: string, change: Change, ) => { - const fieldId = change.dataElement || change.attribute; + const { dataElement, attribute, field } = change; + const fieldId = dataElement ?? attribute ?? field; if (!fieldId) { log.error('Could not find fieldId in change:', change); return { metadataElement: null, fieldId: null }; @@ -115,6 +116,7 @@ const fetchFormattedValues = async ({ reactKey: fieldId ? `${createdAt}-${fieldId}` : attributeOptionsKey, date: pipe(convertServerToClient, convertClientToList)(fromServerDate(createdAt), dataElementTypes.DATETIME), user: `${firstName} ${surname} (${username})`, + dataItemId: fieldId, changeType: type, dataItemLabel: metadataElement.name, previousValue, diff --git a/src/core_modules/capture-core/converters/clientToList.js b/src/core_modules/capture-core/converters/clientToList.js index e72b837179..abbfbf6975 100644 --- a/src/core_modules/capture-core/converters/clientToList.js +++ b/src/core_modules/capture-core/converters/clientToList.js @@ -7,7 +7,7 @@ import { PreviewImage } from 'capture-ui'; import { dataElementTypes, type DataElement } from '../metaData'; import { convertMomentToDateFormatString } from '../utils/converters/date'; import { stringifyNumber } from './common/stringifyNumber'; -import { MinimalCoordinates } from '../components/MinimalCoordinates'; +import { MinimalCoordinates, PolygonCoordinates } from '../components/Coordinates'; import { TooltipOrgUnit } from '../components/Tooltips/TooltipOrgUnit'; function convertDateForListDisplay(rawValue: string): string { @@ -87,41 +87,45 @@ function convertStatusForDisplay(clientValue: Object) { ); } -function convertOrgUnitForDisplay(clientValue: string | {id: string}) { +function convertOrgUnitForDisplay(clientValue: string | { id: string }) { const orgUnitId = typeof clientValue === 'string' ? clientValue : clientValue.id; return ( ); } +function convertPolygonForDisplay(clientValue: Object) { + return ; +} const valueConvertersForType = { - [dataElementTypes.NUMBER]: stringifyNumber, - [dataElementTypes.INTEGER]: stringifyNumber, - [dataElementTypes.INTEGER_POSITIVE]: stringifyNumber, - [dataElementTypes.INTEGER_ZERO_OR_POSITIVE]: stringifyNumber, - [dataElementTypes.INTEGER_NEGATIVE]: stringifyNumber, - [dataElementTypes.INTEGER_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), - [dataElementTypes.INTEGER_POSITIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), - [dataElementTypes.INTEGER_ZERO_OR_POSITIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), - [dataElementTypes.INTEGER_NEGATIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), - [dataElementTypes.PERCENTAGE]: (value: number) => `${stringifyNumber(value)} %`, + [dataElementTypes.AGE]: convertDateForListDisplay, + [dataElementTypes.ASSIGNEE]: (rawValue: Object) => `${rawValue.name} (${rawValue.username})`, + [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), + [dataElementTypes.COORDINATE]: MinimalCoordinates, [dataElementTypes.DATE]: convertDateForListDisplay, [dataElementTypes.DATE_RANGE]: value => convertRangeForDisplay(convertDateForListDisplay, value), [dataElementTypes.DATETIME]: convertDateTimeForListDisplay, [dataElementTypes.DATETIME_RANGE]: value => convertRangeForDisplay(convertDateTimeForListDisplay, value), - [dataElementTypes.TIME]: convertTimeForListDisplay, - [dataElementTypes.TIME_RANGE]: value => convertRangeForDisplay(convertTimeForListDisplay, value), - [dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'), - [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), - [dataElementTypes.COORDINATE]: MinimalCoordinates, - [dataElementTypes.AGE]: convertDateForListDisplay, [dataElementTypes.FILE_RESOURCE]: convertFileForDisplay, [dataElementTypes.IMAGE]: convertImageForDisplay, - [dataElementTypes.ORGANISATION_UNIT]: convertOrgUnitForDisplay, - [dataElementTypes.ASSIGNEE]: (rawValue: Object) => `${rawValue.name} (${rawValue.username})`, + [dataElementTypes.INTEGER]: stringifyNumber, + [dataElementTypes.INTEGER_NEGATIVE]: stringifyNumber, + [dataElementTypes.INTEGER_NEGATIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), + [dataElementTypes.INTEGER_POSITIVE]: stringifyNumber, + [dataElementTypes.INTEGER_POSITIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), + [dataElementTypes.INTEGER_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), + [dataElementTypes.INTEGER_ZERO_OR_POSITIVE]: stringifyNumber, + [dataElementTypes.INTEGER_ZERO_OR_POSITIVE_RANGE]: value => convertRangeForDisplay(stringifyNumber, value), + [dataElementTypes.NUMBER]: stringifyNumber, [dataElementTypes.NUMBER_RANGE]: convertNumberRangeForDisplay, + [dataElementTypes.ORGANISATION_UNIT]: convertOrgUnitForDisplay, + [dataElementTypes.PERCENTAGE]: (value: number) => `${stringifyNumber(value)} %`, + [dataElementTypes.POLYGON]: convertPolygonForDisplay, [dataElementTypes.STATUS]: convertStatusForDisplay, + [dataElementTypes.TIME]: convertTimeForListDisplay, + [dataElementTypes.TIME_RANGE]: value => convertRangeForDisplay(convertTimeForListDisplay, value), + [dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'), }; export function convertValue(value: any, type: $Keys, dataElement?: ?DataElement) { diff --git a/src/core_modules/capture-core/converters/clientToView.js b/src/core_modules/capture-core/converters/clientToView.js index fb7728f723..826c637456 100644 --- a/src/core_modules/capture-core/converters/clientToView.js +++ b/src/core_modules/capture-core/converters/clientToView.js @@ -6,7 +6,7 @@ import { PreviewImage } from 'capture-ui'; import { dataElementTypes, type DataElement } from '../metaData'; import { convertMomentToDateFormatString } from '../utils/converters/date'; import { stringifyNumber } from './common/stringifyNumber'; -import { MinimalCoordinates } from '../components/MinimalCoordinates'; +import { MinimalCoordinates } from '../components/Coordinates'; import { TooltipOrgUnit } from '../components/Tooltips/TooltipOrgUnit'; diff --git a/src/core_modules/capture-core/converters/serverToClient.js b/src/core_modules/capture-core/converters/serverToClient.js index 7a342c3aff..456e87d6af 100644 --- a/src/core_modules/capture-core/converters/serverToClient.js +++ b/src/core_modules/capture-core/converters/serverToClient.js @@ -43,6 +43,24 @@ export function convertOptionSetValue(value: any, type: $Keys moment(d2Value).toISOString(), [dataElementTypes.TRUE_ONLY]: (d2Value: string) => ((d2Value === 'true') || null), [dataElementTypes.BOOLEAN]: (d2Value: string) => (d2Value === 'true'), - [dataElementTypes.COORDINATE]: (d2Value: string | Array) => { - const arr = typeof d2Value === 'string' ? JSON.parse(d2Value) : d2Value; - return { latitude: arr[1], longitude: arr[0] }; - }, - [dataElementTypes.POLYGON]: (d2Value: Array) => d2Value, + [dataElementTypes.COORDINATE]: (d2Value: string | Array) => convertCoordinateToClient(d2Value), + [dataElementTypes.POLYGON]: (d2Value: string | Array>) => convertPolygonToClient(d2Value), [dataElementTypes.ASSIGNEE]: convertAssignedUserToClient, }; From 8227680c27d4635753ea2f644c502ab46261f15e Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Tue, 7 Jan 2025 22:38:40 +0000 Subject: [PATCH 9/9] chore(release): cut 101.21.0 [skip release] # [101.21.0](https://github.com/dhis2/capture-app/compare/v101.20.3...v101.21.0) (2025-01-07) ### Features * [DHIS2-18328] Handle log entries for occurredAt, scheduledAt and geometry ([#3887](https://github.com/dhis2/capture-app/issues/3887)) ([f670971](https://github.com/dhis2/capture-app/commit/f670971808f49b75295c1d3c7ef25a747b4888df)) --- 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 3f8e81a1bc..b144404cd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [101.21.0](https://github.com/dhis2/capture-app/compare/v101.20.3...v101.21.0) (2025-01-07) + + +### Features + +* [DHIS2-18328] Handle log entries for occurredAt, scheduledAt and geometry ([#3887](https://github.com/dhis2/capture-app/issues/3887)) ([f670971](https://github.com/dhis2/capture-app/commit/f670971808f49b75295c1d3c7ef25a747b4888df)) + ## [101.20.3](https://github.com/dhis2/capture-app/compare/v101.20.2...v101.20.3) (2024-12-29) diff --git a/package.json b/package.json index e4caffa666..9e3f58ba03 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capture-app", "homepage": ".", - "version": "101.20.3", + "version": "101.21.0", "cacheVersion": "7", "serverVersion": "38", "license": "BSD-3-Clause", @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "101.20.3", + "@dhis2/rules-engine-javascript": "101.21.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 0ae04d0315..df1868e4b6 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/rules-engine-javascript", - "version": "101.20.3", + "version": "101.21.0", "license": "BSD-3-Clause", "main": "./build/cjs/index.js", "scripts": {