diff --git a/i18n/en.pot b/i18n/en.pot index c8a238df5..b88530a79 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: 2023-06-27T14:37:02.617Z\n" -"PO-Revision-Date: 2023-06-27T14:37:02.617Z\n" +"POT-Creation-Date: 2023-09-05T07:20:57.111Z\n" +"PO-Revision-Date: 2023-09-05T07:20:57.111Z\n" msgid "Add to {{axisName}}" msgstr "Add to {{axisName}}" @@ -622,11 +622,21 @@ msgstr "" msgid "There's a problem with at least one selected indicator" msgstr "There's a problem with at least one selected indicator" -msgid "No access" -msgstr "No access" +msgid "Restricted access" +msgstr "Restricted access" -msgid "You don't have access to the requested data" -msgstr "You don't have access to the requested data" +msgid "" +"You don’t have access to the data in this visualization. Contact a system " +"administrator." +msgstr "" +"You don’t have access to the data in this visualization. Contact a system " +"administrator." + +msgid "You don’t have access to one or more of the chosen organisation units." +msgstr "You don’t have access to one or more of the chosen organisation units." + +msgid "You don’t have access to event analytics. Contact a system administrator." +msgstr "You don’t have access to event analytics. Contact a system administrator." msgid "Something went wrong" msgstr "Something went wrong" diff --git a/src/components/App.js b/src/components/App.js index b16c9e649..36dd55491 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -23,8 +23,10 @@ import { EVENT_TYPE } from '../modules/dataStatistics.js' import { dataAccessError, emptyResponseError, + eventAccessError, genericServerError, indicatorError, + orgUnitAccessError, visualizationNotFoundError, } from '../modules/error.js' import history from '../modules/history.js' @@ -216,8 +218,15 @@ const App = () => { output = indicatorError() break case 'E7121': + case 'E7123': output = dataAccessError() break + case 'E7120': + output = orgUnitAccessError() + break + case 'E7217': + output = eventAccessError() + break default: output = genericServerError() } diff --git a/src/modules/error.js b/src/modules/error.js index 5d1522e8a..9f9d25e4c 100644 --- a/src/modules/error.js +++ b/src/modules/error.js @@ -78,9 +78,29 @@ export const indicatorError = () => export const dataAccessError = () => visualizationError( - GenericError, - i18n.t('No access'), - i18n.t("You don't have access to the requested data") + DataError, + i18n.t('Restricted access'), + i18n.t( + 'You don’t have access to the data in this visualization. Contact a system administrator.' + ) + ) + +export const orgUnitAccessError = () => + visualizationError( + DataError, + i18n.t('Restricted access'), + i18n.t( + 'You don’t have access to one or more of the chosen organisation units.' + ) + ) + +export const eventAccessError = () => + visualizationError( + DataError, + i18n.t('Restricted access'), + i18n.t( + 'You don’t have access to event analytics. Contact a system administrator.' + ) ) export const getAlertTypeByStatusCode = (statusCode) =>