Themes: first version of circular economy theme

This commit is contained in:
Pieter Vander Vennet 2024-07-27 02:18:58 +02:00
parent 3acba29198
commit 592be68f09
20 changed files with 1917 additions and 11 deletions

View file

@ -127,6 +127,7 @@ export default class Constants {
"clock",
"close",
"crosshair",
"gear",
"help",
"home",
"invalid",

View file

@ -366,9 +366,17 @@ export default class TagRenderingConfig {
throw `${ctx}: Invalid mapping: "if" is defined as an array. Use {"and": <your conditions>} or {"or": <your conditions>} instead`
}
if (mapping.addExtraTags !== undefined && multiAnswer) {
throw `${ctx}: Invalid mapping: got a multi-Answer with addExtraTags; this is not allowed`
if(mapping.addExtraTags !== undefined && !Array.isArray(mapping.addExtraTags)){
throw `${ctx}.addExtraTags: expected a list, but got a ${typeof mapping.addExtraTags}`
}
if (mapping.addExtraTags !== undefined && multiAnswer) {
const usedKeys = mapping.addExtraTags?.flatMap(et => TagUtils.Tag(et).usedKeys())
if(usedKeys.some(key => TagUtils.Tag(mapping.if).usedKeys().indexOf(key ) > 0)){
throw `${ctx}: Invalid mapping: got a multi-Answer with addExtraTags which also modifies one of the keys; this is not allowed`
}
}
let hideInAnswer: boolean | TagsFilter = false
if (typeof mapping.hideInAnswer === "boolean") {