From cecd9a5864ce70909d3f9e6e60ba92d91cb3b44d Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 8 Dec 2023 15:06:08 +0100 Subject: [PATCH 1/4] fix: add custom errors for analytics requests (#445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Henrik Øverland --- i18n/en.pot | 19 +++++++++++++++++++ src/components/App.js | 8 ++++++++ src/modules/error.js | 16 ++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/i18n/en.pot b/i18n/en.pot index 77840d779..76e5937bb 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -639,6 +639,25 @@ msgstr "You don’t have access to event analytics. Contact a system administrat msgid "Something went wrong" msgstr "Something went wrong" +msgid "" +"There's a problem with the generated analytics. Contact a system " +"administrator." +msgstr "" +"There's a problem with the generated analytics. Contact a system " +"administrator." + +msgid "There's a syntax problem with the analytics request." +msgstr "There's a syntax problem with the analytics request." + +msgid "Organisation unit" +msgstr "Organisation unit" + +msgid "Event status" +msgstr "Event status" + +msgid "Program status" +msgstr "Program status" + msgid "Last updated on" msgstr "Last updated on" diff --git a/src/components/App.js b/src/components/App.js index b70e705df..ade64bd92 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -22,6 +22,8 @@ import { acSetVisualization } from '../actions/visualization.js' import { parseCondition, OPERATOR_IN } from '../modules/conditions.js' import { EVENT_TYPE } from '../modules/dataStatistics.js' import { + analyticsGenerationError, + analyticsRequestError, dataAccessError, emptyResponseError, eventAccessError, @@ -245,6 +247,12 @@ const App = () => { case 'E7217': output = eventAccessError() break + case 'E7144': + output = analyticsGenerationError() + break + case 'E7145': + output = analyticsRequestError() + break default: output = genericServerError() } diff --git a/src/modules/error.js b/src/modules/error.js index 53f895ded..021f68378 100644 --- a/src/modules/error.js +++ b/src/modules/error.js @@ -96,6 +96,22 @@ export const eventAccessError = () => ) ) +export const analyticsGenerationError = () => + visualizationError( + GenericError, + i18n.t('Something went wrong'), + i18n.t( + "There's a problem with the generated analytics. Contact a system administrator." + ) + ) + +export const analyticsRequestError = () => + visualizationError( + GenericError, + i18n.t('Something went wrong'), + i18n.t("There's a syntax problem with the analytics request.") + ) + export const getAlertTypeByStatusCode = (statusCode) => String(statusCode).match(/50\d/) ? 'error' : 'warning' From b300dd31776fa15b711119cd6c7de6b2bd8854cb Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Fri, 8 Dec 2023 14:26:26 +0000 Subject: [PATCH 2/4] chore(release): cut 100.11.3 [skip release] ## [100.11.3](https://github.com/dhis2/line-listing-app/compare/v100.11.2...v100.11.3) (2023-12-08) ### Bug Fixes * add custom errors for analytics requests ([#445](https://github.com/dhis2/line-listing-app/issues/445)) ([cecd9a5](https://github.com/dhis2/line-listing-app/commit/cecd9a5864ce70909d3f9e6e60ba92d91cb3b44d)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03318b7a8..438e63a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [100.11.3](https://github.com/dhis2/line-listing-app/compare/v100.11.2...v100.11.3) (2023-12-08) + + +### Bug Fixes + +* add custom errors for analytics requests ([#445](https://github.com/dhis2/line-listing-app/issues/445)) ([cecd9a5](https://github.com/dhis2/line-listing-app/commit/cecd9a5864ce70909d3f9e6e60ba92d91cb3b44d)) + ## [100.11.2](https://github.com/dhis2/line-listing-app/compare/v100.11.1...v100.11.2) (2023-12-07) diff --git a/package.json b/package.json index 2bfe1babd..930997ff8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "line-listing-app", - "version": "100.11.2", + "version": "100.11.3", "description": "DHIS2 Line Listing", "license": "BSD-3-Clause", "private": true, From b356aa51952428b721c32f000ced94e58c5b2970 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 10 Dec 2023 02:40:08 +0100 Subject: [PATCH 3/4] fix(translations): sync translations from transifex (master) Automatically merged. --- i18n/cs.po | 14 +++++++++++--- i18n/zh.po | 10 +++++++++- i18n/zh_CN.po | 10 +++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/i18n/cs.po b/i18n/cs.po index 1cfe3eade..78f0251d6 100644 --- a/i18n/cs.po +++ b/i18n/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2023-09-05T07:20:57.111Z\n" +"POT-Creation-Date: 2023-11-29T10:50:15.561Z\n" "PO-Revision-Date: 2022-08-23 11:50+0000\n" "Last-Translator: Jiří Podhorecký, 2023\n" "Language-Team: Czech (https://app.transifex.com/hisp-uio/teams/100509/cs/)\n" @@ -394,7 +394,15 @@ msgstr "Vaše nejsledovanější seznamy řádků" msgid "Not available offline" msgstr "Není k dispozici offline" +msgid "" +"This line list may show data that was not available when the interpretation " +"was written." +msgstr "" + msgid "Sort by {{column}}" +msgstr "Řadit podle {{column}}" + +msgid "No event" msgstr "" msgid "Rows per page" @@ -641,11 +649,11 @@ msgstr "" "K datům v této vizualizaci nemáte přístup. Kontaktujte správce systému." msgid "You don’t have access to one or more of the chosen organisation units." -msgstr "" +msgstr "Nemáte přístup k jedné nebo více vybraným organizačním jednotkám." msgid "" "You don’t have access to event analytics. Contact a system administrator." -msgstr "" +msgstr "Nemáte přístup k analýze událostí. Kontaktujte správce systému." msgid "Something went wrong" msgstr "Něco se pokazilo" diff --git a/i18n/zh.po b/i18n/zh.po index fbc989f61..347859ad6 100644 --- a/i18n/zh.po +++ b/i18n/zh.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2023-09-05T07:20:57.111Z\n" +"POT-Creation-Date: 2023-11-29T10:50:15.561Z\n" "PO-Revision-Date: 2022-08-23 11:50+0000\n" "Last-Translator: easylin , 2023\n" "Language-Team: Chinese (https://app.transifex.com/hisp-uio/teams/100509/zh/)\n" @@ -372,9 +372,17 @@ msgstr "您浏览次数最多的行列表" msgid "Not available offline" msgstr "离线不可用" +msgid "" +"This line list may show data that was not available when the interpretation " +"was written." +msgstr "该行列表可能会显示编写解释时不可用的数据。" + msgid "Sort by {{column}}" msgstr "按{{列}}排序" +msgid "No event" +msgstr "无事件" + msgid "Rows per page" msgstr "行每页" diff --git a/i18n/zh_CN.po b/i18n/zh_CN.po index 763f9bc79..0aa863f35 100644 --- a/i18n/zh_CN.po +++ b/i18n/zh_CN.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2023-09-05T07:20:57.111Z\n" +"POT-Creation-Date: 2023-11-29T10:50:15.561Z\n" "PO-Revision-Date: 2022-08-23 11:50+0000\n" "Last-Translator: easylin , 2023\n" "Language-Team: Chinese (China) (https://app.transifex.com/hisp-uio/teams/100509/zh_CN/)\n" @@ -370,9 +370,17 @@ msgstr "您查看次数最多的线路列表" msgid "Not available offline" msgstr "离线时不可用" +msgid "" +"This line list may show data that was not available when the interpretation " +"was written." +msgstr "该行列表可能会显示编写解释时不可用的数据。" + msgid "Sort by {{column}}" msgstr "排序方式{{column}}" +msgid "No event" +msgstr "无事件" + msgid "Rows per page" msgstr "行每页" From 34e7b3d1ede1ba8153d8ca6d6acd772d235d141c Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Sun, 10 Dec 2023 01:59:06 +0000 Subject: [PATCH 4/4] chore(release): cut 100.11.4 [skip release] ## [100.11.4](https://github.com/dhis2/line-listing-app/compare/v100.11.3...v100.11.4) (2023-12-10) ### Bug Fixes * **translations:** sync translations from transifex (master) ([b356aa5](https://github.com/dhis2/line-listing-app/commit/b356aa51952428b721c32f000ced94e58c5b2970)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 438e63a18..9b7127255 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [100.11.4](https://github.com/dhis2/line-listing-app/compare/v100.11.3...v100.11.4) (2023-12-10) + + +### Bug Fixes + +* **translations:** sync translations from transifex (master) ([b356aa5](https://github.com/dhis2/line-listing-app/commit/b356aa51952428b721c32f000ced94e58c5b2970)) + ## [100.11.3](https://github.com/dhis2/line-listing-app/compare/v100.11.2...v100.11.3) (2023-12-08) diff --git a/package.json b/package.json index 930997ff8..58d640394 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "line-listing-app", - "version": "100.11.3", + "version": "100.11.4", "description": "DHIS2 Line Listing", "license": "BSD-3-Clause", "private": true,