diff --git a/geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_templates/ObjectFieldTemplate.jsx b/geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_templates/ObjectFieldTemplate.jsx index 63a09b82e5..1806725479 100644 --- a/geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_templates/ObjectFieldTemplate.jsx +++ b/geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_templates/ObjectFieldTemplate.jsx @@ -8,10 +8,12 @@ */ import React, { useState } from 'react'; +import PropTypes from 'prop-types'; import Button from '@js/components/Button'; import { Glyphicon } from 'react-bootstrap'; import FaIcon from '@js/components/FaIcon'; import Message from '@mapstore/framework/components/I18N/Message'; +import { getMessageById } from '@mapstore/framework/utils/LocaleUtils'; import InputControlWithDebounce from '@js/components/InputControlWithDebounce'; import { canExpand, @@ -69,11 +71,10 @@ function RootMetadata({ properties, errorSchema, formContext -}) { +}, context) { const { title: metadataTitle } = formContext; - const [filterText, setFilterText] = useState(''); const groups = properties.reduce((acc, property) => { @@ -86,7 +87,7 @@ function RootMetadata({ || !title.toLowerCase().includes((filterText || '').toLowerCase())) { return acc; } - const sectionKey = options?.['geonode-ui:group'] || 'General'; + const sectionKey = options?.['geonode-ui:group'] || getMessageById(context.messages, 'gnviewer.metadataGroupTitle'); const sectionItems = acc[sectionKey] || []; return { ...acc, @@ -144,6 +145,10 @@ function RootMetadata({ ); } +RootMetadata.contextTypes = { + messages: PropTypes.object +}; + function ObjectFieldTemplate(props) { const isRoot = props?.idSchema?.$id === 'root'; if (isRoot) { diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json index 3dd6a45409..07eb1bbdaa 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json @@ -453,7 +453,8 @@ "metadataUpdateError": "Die Metadaten konnten nicht aktualisiert werden", "metadataNotFound": "Für die ausgewählte Ressource wurden keine Metadaten gefunden", "filterMetadata": "Nach Namen filtern...", - "noMetadataFound": "Keine Metadaten gefunden..." + "noMetadataFound": "Keine Metadaten gefunden...", + "metadataGroupTitle": "Allgemein" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json index f453a940f2..86f5d597e1 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.en-US.json @@ -453,7 +453,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json index 32da967118..555256ef4b 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json @@ -452,7 +452,8 @@ "metadataUpdateError": "No fue posible actualizar los metadatos", "metadataNotFound": "No se encontraron metadatos para el recurso seleccionado", "filterMetadata": "Filtrar por nombre...", - "noMetadataFound": "No se encontraron metadatos..." + "noMetadataFound": "No se encontraron metadatos...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json index fc6cdde0a7..a2eb3dd074 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.fi-FI.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json index 4a962c91cd..04438d60fe 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json @@ -453,7 +453,8 @@ "metadataUpdateError": "Il n'a pas été possible de mettre à jour les métadonnées", "metadataNotFound": "Les métadonnées ne sont pas trouvées pour la ressource sélectionnée", "filterMetadata": "Filtrer par nom...", - "noMetadataFound": "Aucune métadonnée trouvée..." + "noMetadataFound": "Aucune métadonnée trouvée...", + "metadataGroupTitle": "Général" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json index d30f63792f..20e96445e3 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.hr-HR.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json index 385d85b06a..c8c43446af 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json @@ -455,7 +455,8 @@ "metadataUpdateError": "Non è stato possibile aggiornare i metadati", "metadataNotFound": "Metadati non disponibili per la risorsa selezionata", "filterMetadata": "Filtra per nome...", - "noMetadataFound": "Nessun metadato trovato..." + "noMetadataFound": "Nessun metadato trovato...", + "metadataGroupTitle": "Generale" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json index d85c317460..f7b50c648f 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.nl-NL.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.pt-PT.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.pt-PT.json index c97af1a453..2030ac5d35 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.pt-PT.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.pt-PT.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.sk-SK.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.sk-SK.json index fedece922e..f439c67556 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.sk-SK.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.sk-SK.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.sv-SE.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.sv-SE.json index c6f23f56a6..77bf4bb121 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.sv-SE.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.sv-SE.json @@ -423,7 +423,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.vi-VN.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.vi-VN.json index 582ececc1a..9681bd4373 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.vi-VN.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.vi-VN.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } } diff --git a/geonode_mapstore_client/static/mapstore/gn-translations/data.zh-ZH.json b/geonode_mapstore_client/static/mapstore/gn-translations/data.zh-ZH.json index 4e8373b383..58bad15726 100644 --- a/geonode_mapstore_client/static/mapstore/gn-translations/data.zh-ZH.json +++ b/geonode_mapstore_client/static/mapstore/gn-translations/data.zh-ZH.json @@ -422,7 +422,8 @@ "metadataUpdateError": "It was not possible to update the metadata", "metadataNotFound": "Metadata not found for the selected resource", "filterMetadata": "Filter by name...", - "noMetadataFound": "No metadata found..." + "noMetadataFound": "No metadata found...", + "metadataGroupTitle": "General" } } }