EZQMS-531: Prop to disable Save As and Save buttons in FilterBar (#4560)

Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
This commit is contained in:
Pete Anøther 2024-02-07 02:22:03 -03:00 committed by GitHub
parent 7510879147
commit 9d87641a73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,7 @@
export let space: Ref<Space> | undefined
export let query: DocumentQuery<Doc>
export let viewOptions: ViewOptions | undefined = undefined
export let hideSaveButtons: boolean = false
const client = getClient()
const hierarchy = client.getHierarchy()
@ -190,26 +191,28 @@
</div>
</div>
<div class="flex gap-1-5">
<Button
icon={view.icon.Views}
label={view.string.SaveAs}
width={'fit-content'}
on:click={async () => {
await saveFilteredView()
}}
/>
{#if selectedFilterChanged($selectedFilterStore, $filterStore, $activeViewlet, $viewOptionStore)}
{#if !hideSaveButtons}
<div class="flex gap-1-5">
<Button
icon={view.icon.Views}
label={view.string.Save}
label={view.string.SaveAs}
width={'fit-content'}
on:click={async () => {
await saveCurrentFilteredView($selectedFilterStore)
await saveFilteredView()
}}
/>
{/if}
</div>
{#if selectedFilterChanged($selectedFilterStore, $filterStore, $activeViewlet, $viewOptionStore)}
<Button
icon={view.icon.Views}
label={view.string.Save}
width={'fit-content'}
on:click={async () => {
await saveCurrentFilteredView($selectedFilterStore)
}}
/>
{/if}
</div>
{/if}
</div>
{/if}