forked from MapComplete/MapComplete
Feat: allow to disable questions (and to enable them again), fix #256
This commit is contained in:
parent
f8ef32f123
commit
93ebdd8e16
8 changed files with 238 additions and 76 deletions
23
src/UI/Popup/DisabledQuestions.svelte
Normal file
23
src/UI/Popup/DisabledQuestions.svelte
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<script lang="ts">
|
||||
import DisabledQuestionsLayer from "./DisabledQuestionsLayer.svelte"
|
||||
import { Stores } from "../../Logic/UIEventSource"
|
||||
|
||||
/**
|
||||
* Shows _all_ disabled questions
|
||||
*/
|
||||
export let state
|
||||
let layers = state.layout.layers.filter(l => l.isNormal())
|
||||
|
||||
let allDisabled = Stores.concat<string>(layers.map(l => state.userRelatedState.getThemeDisabled(state.layout.id, l.id))).map(l => [].concat(...l))
|
||||
|
||||
</script>
|
||||
|
||||
<h3>Disabled questions</h3>
|
||||
{#if $allDisabled.length === 0}
|
||||
To disable a question, click the three dots in the upper-right corner
|
||||
{:else}
|
||||
To enable a question again, click it
|
||||
{#each layers as layer (layer.id)}
|
||||
<DisabledQuestionsLayer {state} {layer} />
|
||||
{/each}
|
||||
{/if}
|
||||
Loading…
Add table
Add a link
Reference in a new issue