fix view CI
This commit is contained in:
parent
23c99059cb
commit
780fe7b4c2
|
@ -54,26 +54,24 @@
|
||||||
let anchor
|
let anchor
|
||||||
let dropdown
|
let dropdown
|
||||||
|
|
||||||
$: filters = view.filters || []
|
|
||||||
$: viewModel = $backendUiStore.models.find(
|
$: viewModel = $backendUiStore.models.find(
|
||||||
({ _id }) => _id === $backendUiStore.selectedView.modelId
|
({ _id }) => _id === $backendUiStore.selectedView.modelId
|
||||||
)
|
)
|
||||||
$: fields = viewModel && Object.keys(viewModel.schema)
|
$: fields = viewModel && Object.keys(viewModel.schema)
|
||||||
|
|
||||||
function saveView() {
|
function saveView() {
|
||||||
view.filters = filters
|
|
||||||
backendUiStore.actions.views.save(view)
|
backendUiStore.actions.views.save(view)
|
||||||
notifier.success(`View ${view.name} saved.`)
|
notifier.success(`View ${view.name} saved.`)
|
||||||
dropdown.hide()
|
dropdown.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFilter(idx) {
|
function removeFilter(idx) {
|
||||||
filters.splice(idx, 1)
|
view.filters.splice(idx, 1)
|
||||||
filters = filters
|
view.filters = view.filters
|
||||||
}
|
}
|
||||||
|
|
||||||
function addFilter() {
|
function addFilter() {
|
||||||
filters = [...filters, {}]
|
view.filters = [...view.filters, {}]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -82,7 +80,7 @@
|
||||||
text
|
text
|
||||||
small
|
small
|
||||||
on:click={dropdown.show}
|
on:click={dropdown.show}
|
||||||
active={filters && filters.length}>
|
active={view.filters && view.filters.length}>
|
||||||
<Icon name="filter" />
|
<Icon name="filter" />
|
||||||
Filter
|
Filter
|
||||||
</TextButton>
|
</TextButton>
|
||||||
|
@ -90,7 +88,7 @@
|
||||||
<Popover bind:this={dropdown} {anchor} align="left">
|
<Popover bind:this={dropdown} {anchor} align="left">
|
||||||
<h5>Filter</h5>
|
<h5>Filter</h5>
|
||||||
<div class="input-group-row">
|
<div class="input-group-row">
|
||||||
{#each filters as filter, idx}
|
{#each view.filters as filter, idx}
|
||||||
{#if idx === 0}
|
{#if idx === 0}
|
||||||
<p>Where</p>
|
<p>Where</p>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
Loading…
Reference in New Issue