forked from MapComplete/MapComplete
Fix: questions are shown if the condition is met, fix #1630
This commit is contained in:
parent
2d50323f21
commit
85002766a8
2 changed files with 3 additions and 14 deletions
|
@ -14,12 +14,6 @@
|
||||||
export let tags: UIEventSource<Record<string, string>>
|
export let tags: UIEventSource<Record<string, string>>
|
||||||
export let highlightedRendering: UIEventSource<string> = undefined
|
export let highlightedRendering: UIEventSource<string> = undefined
|
||||||
|
|
||||||
let _tags: Record<string, string>
|
|
||||||
onDestroy(
|
|
||||||
tags.addCallbackAndRun((tags) => {
|
|
||||||
_tags = tags
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
let _metatags: Record<string, string>
|
let _metatags: Record<string, string>
|
||||||
onDestroy(
|
onDestroy(
|
||||||
|
@ -29,7 +23,7 @@
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if _tags._deleted === "yes"}
|
{#if $tags._deleted === "yes"}
|
||||||
<Tr t={Translations.t.delete.isDeleted} />
|
<Tr t={Translations.t.delete.isDeleted} />
|
||||||
<button class="w-full" on:click={() => state.selectedElement.setData(undefined)}>
|
<button class="w-full" on:click={() => state.selectedElement.setData(undefined)}>
|
||||||
<Tr t={Translations.t.general.returnToTheMap} />
|
<Tr t={Translations.t.general.returnToTheMap} />
|
||||||
|
@ -37,8 +31,8 @@
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex flex-col gap-y-2 overflow-y-auto p-1 px-2">
|
<div class="flex flex-col gap-y-2 overflow-y-auto p-1 px-2">
|
||||||
{#each layer.tagRenderings as config (config.id)}
|
{#each layer.tagRenderings as config (config.id)}
|
||||||
{#if (config.condition === undefined || config.condition.matchesProperties(_tags)) && (config.metacondition === undefined || config.metacondition.matchesProperties( { ..._tags, ..._metatags } ))}
|
{#if (config.condition?.matchesProperties($tags) ?? true) && (config.metacondition?.matchesProperties( { ...$tags, ..._metatags } ?? true))}
|
||||||
{#if config.IsKnown(_tags)}
|
{#if config.IsKnown($tags)}
|
||||||
<TagRenderingEditable
|
<TagRenderingEditable
|
||||||
{tags}
|
{tags}
|
||||||
{config}
|
{config}
|
||||||
|
|
|
@ -677,11 +677,6 @@ export default class SpecialVisualizations {
|
||||||
)
|
)
|
||||||
return new SvelteUIElement(StarsBarIcon, {
|
return new SvelteUIElement(StarsBarIcon, {
|
||||||
score: reviews.average,
|
score: reviews.average,
|
||||||
reviews,
|
|
||||||
state,
|
|
||||||
tags,
|
|
||||||
feature,
|
|
||||||
layer,
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue