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 30, 2025
1 parent bde049a commit b388246
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/src/modules/config/LayerTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ 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);
if (document.body.dataset.lizmapAdminUser === 1) {
lizMap.addMessage(errorMessage, 'warning', true).attr('id', 'lizmap-warning-message');
}
continue;
}
if (wmsCapaLayer.hasOwnProperty('Layer') && wmsCapaLayer.Layer.length != 0) {
Expand Down

0 comments on commit b388246

Please sign in to comment.