forked from MapComplete/MapComplete
UI: hide 'active filters' and 'filter results' if the filter view is disabled
This commit is contained in:
parent
d10f89469a
commit
35b4943948
1 changed files with 11 additions and 7 deletions
|
@ -18,7 +18,7 @@
|
|||
.filter(
|
||||
(f) =>
|
||||
f.filter.options[0].fields.length === 0 &&
|
||||
Constants.priviliged_layers.indexOf(<any>f.layer.id) < 0
|
||||
Constants.priviliged_layers.indexOf(<any>f.layer.id) < 0,
|
||||
)
|
||||
.map((af) => {
|
||||
const index = <number>af.control.data
|
||||
|
@ -28,15 +28,18 @@
|
|||
option: af.filter.options[index],
|
||||
}
|
||||
return r
|
||||
})
|
||||
}),
|
||||
)
|
||||
let allowOtherThemes = state.featureSwitches.featureSwitchBackToThemeOverview
|
||||
let searchTerm = state.searchState.searchTerm
|
||||
|
||||
let allowOtherThemes = state.featureSwitches.featureSwitchBackToThemeOverview
|
||||
let allowFilters = state.featureSwitches.featureSwitchFilter
|
||||
</script>
|
||||
|
||||
<div class="low-interaction flex flex-col gap-y-2 p-4">
|
||||
<ActiveFilters {state} activeFilters={$activeFilters} />
|
||||
|
||||
{#if $allowFilters}
|
||||
<ActiveFilters {state} activeFilters={$activeFilters} />
|
||||
{/if}
|
||||
{#if $searchTerm.length === 0 && $activeFilters.length === 0}
|
||||
<div class="items-center p-8 text-center">
|
||||
<b>
|
||||
|
@ -45,8 +48,9 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
<FilterResults {state} />
|
||||
|
||||
{#if $allowFilters}
|
||||
<FilterResults {state} />
|
||||
{/if}
|
||||
<GeocodeResults {state} />
|
||||
|
||||
{#if $allowOtherThemes}
|
||||
|
|
Loading…
Reference in a new issue