Studio: move some validation from throwing errors in LayerConfig.ts into errors in Validation

This commit is contained in:
Pieter Vander Vennet 2023-10-17 16:06:58 +02:00
parent 632dd6dfb1
commit ec79672fa6
10 changed files with 160 additions and 79 deletions

View file

@ -289,7 +289,11 @@ class ExpandTagRendering extends Conversion<
lookup = this.lookup(tr)
}
if (lookup === undefined) {
if (this._state.sharedLayers?.size > 0) {
if (
this._state.sharedLayers?.size > 0 &&
ctx.path.at(-1) !== "icon" &&
!ctx.path.find((p) => p === "pointRendering")
) {
ctx.warn(
`A literal rendering was detected: ${tr}
Did you perhaps forgot to add a layer name as 'layername.${tr}'? ` +