From 261c3da45919dcf50c4b68cfd96a4cf4cd26252c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 3 Oct 2020 21:06:58 +0100 Subject: [PATCH] Update backend export popover to be line with new popover structure --- .../backend/DataTable/ModelDataTable.svelte | 6 + .../backend/DataTable/ViewDataTable.svelte | 2 + .../DataTable/buttons/ExportButton.svelte | 20 ++ .../DataTable/popovers/ExportPopover.svelte | 61 ++++++ .../database/DataTable/ModelDataTable.svelte | 196 ------------------ .../database/DataTable/ViewDataTable.svelte | 56 ----- .../database/DataTable/popovers/Export.svelte | 71 ------- 7 files changed, 89 insertions(+), 323 deletions(-) create mode 100644 packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte delete mode 100644 packages/builder/src/components/database/DataTable/ModelDataTable.svelte delete mode 100644 packages/builder/src/components/database/DataTable/ViewDataTable.svelte delete mode 100644 packages/builder/src/components/database/DataTable/popovers/Export.svelte diff --git a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte index 6565bf1766..49659ff8d0 100644 --- a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte @@ -3,6 +3,7 @@ import CreateRowButton from "./buttons/CreateRowButton.svelte" import CreateColumnButton from "./buttons/CreateColumnButton.svelte" import CreateViewButton from "./buttons/CreateViewButton.svelte" + import ExportButton from "./buttons/ExportButton.svelte" import * as api from "./api" import Table from "./Table.svelte" @@ -10,6 +11,10 @@ $: title = $backendUiStore.selectedModel.name $: schema = $backendUiStore.selectedModel.schema + $: modelView = { + schema, + name: $backendUiStore.selectedView.name, + } // Fetch records for specified model $: { @@ -26,5 +31,6 @@ {#if Object.keys(schema).length > 0} + {/if} diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 4c7e6bb915..ec94ae2aa6 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -4,6 +4,7 @@ import CalculateButton from "./buttons/CalculateButton.svelte" import GroupByButton from "./buttons/GroupByButton.svelte" import FilterButton from "./buttons/FilterButton.svelte" + import ExportButton from "./buttons/ExportButton.svelte" export let view = {} @@ -39,4 +40,5 @@ {#if view.calculation} {/if} + diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte new file mode 100644 index 0000000000..f4e4fb34a8 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte @@ -0,0 +1,20 @@ + + +
+ + + Export + +
+ + + diff --git a/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte new file mode 100644 index 0000000000..0d52689a6e --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte @@ -0,0 +1,61 @@ + + +
+
Export Data
+ + +
+ + diff --git a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte deleted file mode 100644 index c0d5ad6959..0000000000 --- a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte +++ /dev/null @@ -1,196 +0,0 @@ - - -
-
-

{$backendUiStore.selectedModel.name}

-
- - {#if Object.keys($backendUiStore.selectedModel.schema).length > 0} - - - - {/if} -
-
- - - - - {#each headers as header} - - {/each} - - - - {#if paginatedData.length === 0} -
No Data.
- {/if} - {#each paginatedData as row} - - - {#each headers as header} - - {/each} - - {/each} - -
-
Edit
-
- -
- - - {#if schema[header].type === 'link'} - - {:else if schema[header].type === 'attachment'} - - {:else}{getOr('', header, row)}{/if} -
- -
- - diff --git a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte deleted file mode 100644 index 0958737b59..0000000000 --- a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - {#if view.calculation} - - {/if} - -
diff --git a/packages/builder/src/components/database/DataTable/popovers/Export.svelte b/packages/builder/src/components/database/DataTable/popovers/Export.svelte deleted file mode 100644 index 00514edb9c..0000000000 --- a/packages/builder/src/components/database/DataTable/popovers/Export.svelte +++ /dev/null @@ -1,71 +0,0 @@ - - -
- - - Export - -
- -
Export Format
- -
- - -
-
- -