From b87d3b29f2285c08e6cfc3f9ef890948185ddc66 Mon Sep 17 00:00:00 2001 From: DavidQuartz Date: Fri, 29 Jul 2022 11:09:57 +0000 Subject: [PATCH] fixes 1120 --- geonode_mapstore_client/client/js/epics/gnsync.js | 6 +++--- .../client/static/mapstore/translations/data.de-DE.json | 6 ++++-- .../client/static/mapstore/translations/data.en-US.json | 6 ++++-- .../client/static/mapstore/translations/data.es-ES.json | 6 ++++-- .../client/static/mapstore/translations/data.fr-FR.json | 6 ++++-- .../client/static/mapstore/translations/data.it-IT.json | 6 ++++-- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/geonode_mapstore_client/client/js/epics/gnsync.js b/geonode_mapstore_client/client/js/epics/gnsync.js index 2fa13bc17b..d885e39ab9 100644 --- a/geonode_mapstore_client/client/js/epics/gnsync.js +++ b/geonode_mapstore_client/client/js/epics/gnsync.js @@ -83,13 +83,13 @@ const getSyncInfo = (appType, resourceData, successArr = []) => { * @param {Number} successes length of success arra * @returns {Object} */ -const getNotificationInfo = (errors, successes) => { +const getNotificationInfo = (errors, successes, resourceType) => { let verdict = 'Success'; if (errors > 0 && successes > 0) verdict = 'Warning'; else if (errors === 0 && successes > 0) verdict = 'Success'; else if (errors > 0 && successes === 0) verdict = 'Error'; - return {level: verdict.toLowerCase(), title: `gnviewer.sync${verdict}Title`, message: `gnviewer.sync${verdict}Message`}; + return {level: verdict.toLowerCase(), title: `gnviewer.sync${verdict}${verdict !== 'Warning' ? resourceType : ''}Title`, message: `gnviewer.sync${verdict}Message`}; }; /** @@ -136,7 +136,7 @@ export const gnSyncComponentsWithResources = (action$, store) => action$.ofType( const updateActions = getUpdateActions(); // notification action into - const {level, title, message} = getNotificationInfo(errorsResponses.length, successResponses.length); + const {level, title, message} = getNotificationInfo(errorsResponses.length, successResponses.length, resourceType); return Observable.of( ...updateActions, diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json index a7b7dcc39e..32699b8028 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json @@ -238,9 +238,11 @@ "deleteStyleMessage": "Möchten Sie diesen Stil wirklich löschen?", "deleteStyleCancel": "Nein, nicht löschen", "deleteStyleConfirm": "Ja, ich bin sicher", - "syncErrorTitle": "Die aktuelle GeoStory kann nicht synchronisiert werden", + "syncErrorgeostoryTitle": "Die aktuelle GeoStory kann nicht synchronisiert werden", + "syncErrordashboardTitle": "Kann das aktuelle Dashboard nicht synchronisieren", "syncErrorDefault": "Netzwerkfehler", - "syncSuccessTitle": "GeoStory synchronisiert", + "syncSuccessgeostoryTitle": "GeoStory synchronisiert", + "syncSuccessdashboardTitle": "Dashboard synchronisiert", "syncSuccessMessage": "Erfolgreich synchronisiert", "syncWarningTitle": "Einige Ressourcen konnten nicht synchronisiert werden", "syncErrorMessage": "Fehler beim Synchronisieren der Ressourcen", diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json index 114b6a26c7..17efaf0b22 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json @@ -238,9 +238,11 @@ "deleteStyleMessage": "Are you sure you want to delete this style?", "deleteStyleCancel": "No, don't delete it", "deleteStyleConfirm": "Yes, I'm sure", - "syncErrorTitle": "Cannot sync the current geostory", + "syncErrorgeostoryTitle": "Cannot sync the current geostory", + "syncErrordashboardTitle": "Cannot sync the current dashboard", "syncErrorDefault": "Network error", - "syncSuccessTitle": "Geostory synced", + "syncSuccessgeostoryTitle": "Geostory synced", + "syncSuccessdashboardTitle": "Dashboard synced", "syncSuccessMessage": "Synchronized successfully", "syncWarningTitle": "Could not sync some resources", "syncErrorMessage": "Failed to sync resources", diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json index 8cb01a4bc6..efb1f2c798 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json @@ -237,9 +237,11 @@ "deleteStyleMessage": "¿Está seguro de que desea eliminar este estilo?", "deleteStyleCancel": "No, no lo elimines", "deleteStyleConfirm": "Sí, estoy seguro", - "syncErrorTitle": "No se puede sincronizar la geohistoria actual", + "syncErrorgeostoryTitle": "No se puede sincronizar la geohistoria actual", + "syncErrordashboardTitle": "No se puede sincronizar el tablero actual", "syncErrorDefault": "Error de red", - "syncSuccessTitle": "Geohistoria sincronizada", + "syncSuccessgeostoryTitle": "Geohistoria sincronizada", + "syncSuccessdashboardTitle": "Panel sincronizado", "syncSuccessMessage": "Sincronizado correctamente", "syncWarningTitle": "No se pudieron sincronizar algunos recursos", "syncErrorMessage": "Error al sincronizar recursos", diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json index ac8b48316f..8c670984ca 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json @@ -238,9 +238,11 @@ "deleteStyleMessage": "Voulez-vous vraiment supprimer ce style?", "deleteStyleCancel": "Non, ne le supprime pas", "deleteStyleConfirm": "Oui, je suis sûr", - "syncErrorTitle": "Impossible de synchroniser la géohistoire actuelle", + "syncErrorgeostoryTitle": "Impossible de synchroniser la géohistoire actuelle", + "syncErrordashboardTitle": "Impossible de synchroniser le tableau de bord actuel", "syncErrorDefault": "Erreur réseau", - "syncSuccessTitle": "Géohistoire synchronisée", + "syncSuccessgeostoryTitle": "Géohistoire synchronisée", + "syncSuccessdashboardTitle": "Tableau de bord synchronisé", "syncSuccessMessage": "Synchronisé avec succès", "syncWarningTitle": "Impossible de synchroniser certaines ressources", "syncErrorMessage": "Échec de la synchronisation des ressources", diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json index a07afc8af5..0bcfb1091e 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json @@ -240,9 +240,11 @@ "deleteStyleMessage": "Sei sicuro di voler eliminare questo stile?", "deleteStyleCancel": "No, non cancellarlo", "deleteStyleConfirm": "Si, cancella stile", - "syncErrorTitle": "Impossibile sincronizzare la geostoria attuale", + "syncErrorgeostoryTitle": "Impossibile sincronizzare la geostoria attuale", + "syncErrordashboardTitle": "Impossibile sincronizzare la dashboard corrente", "syncErrorDefault": "Errore di rete", - "syncSuccessTitle": "Geostoria sincronizzata", + "syncSuccessgeostoryTitle": "Geostoria sincronizzata", + "syncSuccessdashboardTitle": "Dashboard sincronizzato", "syncSuccessMessage": "Sincronizzato con successo", "syncWarningTitle": "Impossibile sincronizzare alcune risorse", "syncErrorMessage": "Impossibile sincronizzare le risorse",