diff --git a/assets/layers/school/school.json b/assets/layers/school/school.json index 555834786a..cb2e68ccc5 100644 --- a/assets/layers/school/school.json +++ b/assets/layers/school/school.json @@ -839,6 +839,16 @@ "freeform": { "key": "dress_code" }, + "invalidValues": { + "or": [ + { + "and": [ + "dress_code~(^|.*;)uniform(.*|$)", + "dress_code~(^|.*;)(casual|obligated_colour)(.*|$)" + ] + } + ] + }, "mappings": [ { "if": "dress_code=uniform", diff --git a/src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts b/src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts index 1d7c6e4d9a..1641c7ae55 100644 --- a/src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts +++ b/src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts @@ -268,7 +268,7 @@ export interface QuestionableTagRenderingConfigJson extends TagRenderingConfigJs */ default?: string /** - * question: What values of the freeform key should be interpreted as 'unknown'? + * question: What tag combintations key should be interpreted as 'unknown'? * For example, if a feature has `shop=yes`, the question 'what type of shop is this?' should still asked * ifunset: The question will be considered answered if any value is set for the key * group: expert diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index 4f90e07143..c5a26ace42 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -812,6 +812,10 @@ export default class TagRenderingConfig { if (and.and.length === 0) { return undefined } + console.log(">>> New properties", TagUtils.asProperties(and, currentProperties), this.invalidValues) + if (this.invalidValues?.matchesProperties(TagUtils.asProperties(and, currentProperties))) { + return undefined + } return and } diff --git a/src/UI/BigComponents/ThemesList.svelte b/src/UI/BigComponents/ThemesList.svelte index 755fa70308..47ff6ac755 100644 --- a/src/UI/BigComponents/ThemesList.svelte +++ b/src/UI/BigComponents/ThemesList.svelte @@ -7,7 +7,7 @@ import { MinimalThemeInformation } from "../../Models/ThemeConfig/ThemeConfig" import Translations from "../i18n/Translations" import Tr from "../Base/Tr.svelte" - import { twMerge } from "tailwind-merge" + import { Utils } from "../../Utils" export let search: UIEventSource = new UIEventSource(undefined) export let themes: MinimalThemeInformation[] @@ -20,7 +20,7 @@
- {#each themes as theme (theme.id)} + {#each Utils.NoNull(themes) as theme (theme.id)} {#if $search && hasSelection && themes?.[0] === theme}