Skip to content

Commit

Permalink
UX - Display an error message if the layer is not found in the CFG fi…
Browse files Browse the repository at this point in the history
…le, if admin
  • Loading branch information
Gustry committed Jan 31, 2025
1 parent 719d5b5 commit 82133d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion assets/src/modules/config/LayerTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,15 @@ function buildLayerTreeGroupConfigItems(wmsCapaLayerGroup, layersCfg, level) {
const wmsName = wmsCapaLayer.Name;
const cfg = layersCfg.getLayerConfigByWmsName(wmsName);
if (cfg == null) {
console.log('The WMS layer name `'+ wmsName +'` is unknown!');
const errorMessage = `The WMS layer name "${wmsName}" is unknown. Is the Lizmap configuration file "${lizUrls.params.project}.qgs.cfg" up to date ?`;
console.warn(errorMessage);
try {
// document is not defined in JUnit
if (document.body.dataset.lizmapAdminUser === 1) {
lizMap.addMessage(errorMessage, 'warning', true).attr('id', 'lizmap-warning-message');
}
}catch(error) {}

continue;
}
if (wmsCapaLayer.hasOwnProperty('Layer') && wmsCapaLayer.Layer.length != 0) {
Expand Down

0 comments on commit 82133d5

Please sign in to comment.