Skip to content

Commit

Permalink
add id and layerName to search index for admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
okauppinen committed Jul 19, 2023
1 parent e414809 commit b243d57
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bundles/framework/layerlist/model/LayerGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class LayerGroup {
this.groups = groups || [];
this.searchIndex = {};
this.tools = [];
this._isAdmin = Oskari.user().isAdmin();
}

getParentId () {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b243d57

Please sign in to comment.