From 23c99059cb0f0bbb27bf8ae7cc0cf69fc37455e9 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 25 Aug 2020 14:15:01 +0100 Subject: [PATCH 1/2] view fixes --- .../src/components/database/DataTable/ViewDataTable.svelte | 6 ++++-- .../components/database/DataTable/popovers/Filter.svelte | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte index 11e0f85601..289e3a6e12 100644 --- a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte @@ -42,8 +42,10 @@ } - +
- + {#if view.calculation} + + {/if}
diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index 64f0ff039f..8dc4c3073e 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -53,8 +53,8 @@ let anchor let dropdown - let filters = view.filters || [] + $: filters = view.filters || [] $: viewModel = $backendUiStore.models.find( ({ _id }) => _id === $backendUiStore.selectedView.modelId ) From 780fe7b4c2ef279eeed5fef0b481f82d759616fd Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 25 Aug 2020 15:39:49 +0100 Subject: [PATCH 2/2] fix view CI --- .../database/DataTable/popovers/Filter.svelte | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index 8dc4c3073e..1cf8e9acab 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -54,26 +54,24 @@ let anchor let dropdown - $: filters = view.filters || [] $: viewModel = $backendUiStore.models.find( ({ _id }) => _id === $backendUiStore.selectedView.modelId ) $: fields = viewModel && Object.keys(viewModel.schema) function saveView() { - view.filters = filters backendUiStore.actions.views.save(view) notifier.success(`View ${view.name} saved.`) dropdown.hide() } function removeFilter(idx) { - filters.splice(idx, 1) - filters = filters + view.filters.splice(idx, 1) + view.filters = view.filters } function addFilter() { - filters = [...filters, {}] + view.filters = [...view.filters, {}] } @@ -82,7 +80,7 @@ text small on:click={dropdown.show} - active={filters && filters.length}> + active={view.filters && view.filters.length}> Filter @@ -90,7 +88,7 @@
Filter
- {#each filters as filter, idx} + {#each view.filters as filter, idx} {#if idx === 0}

Where

{:else}