From 264d77ec11e803010372a7eb6c3a6229a9243e7b Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 1 Feb 2024 09:32:06 +0100 Subject: [PATCH 1/3] Metadata editor / Improve layer configuration init. Related to https://github.com/geonetwork/core-geonetwork/pull/7646. --- .../components/edit/onlinesrc/OnlineSrcDirective.js | 8 +------- .../edit/onlinesrc/partials/addOnlinesrc.html | 12 ++---------- .../components/metadatamanager/EditorService.js | 9 ++++++++- .../main/resources/catalog/locales/en-editor.json | 1 - 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js index a2bb60fb980..ec8b4098706 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js @@ -678,13 +678,7 @@ // }); // } // Add each WMS layer to the map - if (scope.gnCurrentEdit.layerConfig == undefined) { - scope.layers = scope.gnCurrentEdit.layerConfig; - } else { - scope.layers = Array.isArray(scope.gnCurrentEdit.layerConfig) - ? scope.gnCurrentEdit.layerConfig - : [scope.gnCurrentEdit.layerConfig]; - } + scope.layers = scope.gnCurrentEdit.layerConfig; angular.forEach(scope.gnCurrentEdit.layerConfig, function (layer) { scope.map.addLayer( new ol.layer.Tile({ diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html index 405682e079b..f8ed6466aed 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html @@ -531,7 +531,7 @@
createAThumbnail
@@ -539,15 +539,7 @@
id="gn-addonlinesrc-thumbnail-map" class="form-group gn-thumbnail-maker-panel" > -
- noLayersForThumbnail -
-
+