From b243d571d21818b7e0ae15c0743232125510205b Mon Sep 17 00:00:00 2001 From: okauppinen Date: Wed, 19 Jul 2023 20:13:18 +0300 Subject: [PATCH] add id and layerName to search index for admin user --- bundles/framework/layerlist/model/LayerGroup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bundles/framework/layerlist/model/LayerGroup.js b/bundles/framework/layerlist/model/LayerGroup.js index f8520805f3..614456ddc2 100644 --- a/bundles/framework/layerlist/model/LayerGroup.js +++ b/bundles/framework/layerlist/model/LayerGroup.js @@ -9,6 +9,7 @@ export class LayerGroup { this.groups = groups || []; this.searchIndex = {}; this.tools = []; + this._isAdmin = Oskari.user().isAdmin(); } getParentId () { @@ -104,10 +105,15 @@ export class LayerGroup { newLayers.forEach(layer => this.addLayer(layer)); } _getSearchIndex (layer) { - var val = layer.getName() + ' ' + + let val = layer.getName() + ' ' + layer.getInspireName() + ' ' + layer.getOrganizationName(); // TODO: maybe filter out undefined texts + if (this._isAdmin) { + val = val + ' ' + + layer.getId() + ' ' + + layer.getLayerName(); + } return val.toLowerCase(); } matchesKeyword (layerId, keyword) {