From 56cebe156b5960d67843f64f8996e13995644183 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 28 Apr 2021 13:59:55 +0100 Subject: [PATCH] Update all backend buttons to be action buttons. Add missing ActionMenu conversion to views --- .../bbui/src/ActionButton/ActionButton.svelte | 15 +-- .../backend/DataTable/DataTable.svelte | 2 +- .../DataTable/buttons/CalculateButton.svelte | 7 +- .../buttons/CreateColumnButton.svelte | 8 +- .../DataTable/buttons/CreateRowButton.svelte | 8 +- .../DataTable/buttons/CreateViewButton.svelte | 8 +- .../DataTable/buttons/ExportButton.svelte | 6 +- .../DataTable/buttons/FilterButton.svelte | 7 +- .../buttons/HideAutocolumnButton.svelte | 23 +--- .../buttons/ManageAccessButton.svelte | 8 +- .../TableNavigator/TableNavigator.svelte | 13 +-- .../popovers/EditViewPopover.svelte | 102 ++++-------------- .../components/common/ConfirmDialog.svelte | 12 +-- 13 files changed, 63 insertions(+), 156 deletions(-) diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index 9dd5c68f43..c7bfbc32db 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -41,14 +41,12 @@ class="spectrum-ActionButton spectrum-ActionButton--size{size}" {disabled} on:longPress - on:click|preventDefault -> + on:click|preventDefault> {#if longPressable} {/if} @@ -57,8 +55,7 @@ class="spectrum-Icon spectrum-Icon--size{size}" focusable="false" aria-hidden="true" - aria-label={icon} - > + aria-label={icon}> {/if} @@ -66,9 +63,3 @@ {/if} - - diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index 80b28d470b..53d1efb330 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -57,7 +57,7 @@ {#if schema && Object.keys(schema).length > 0} diff --git a/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte index 2d05938f41..7316b1c69c 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte @@ -1,5 +1,5 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte index 1459187332..86aef4ddbb 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte @@ -1,13 +1,13 @@ - + + Create column + diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte index cb65525f68..7f62a246f3 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte @@ -1,16 +1,16 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte index 285323c6d7..297d120ede 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte @@ -1,13 +1,13 @@ - + + Create view + diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte index 9ec0a86131..7a76ba0820 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte @@ -1,5 +1,5 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte index 5b345d6df7..e93c355404 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte @@ -1,5 +1,5 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte index 1f92043381..3d74188ee4 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte @@ -1,28 +1,13 @@ -
- -
- - + + {#if hideAutocolumns}Show auto columns{:else}Hide auto columns{/if} + diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index 8af3f3f3f1..38dfcbf26a 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -1,5 +1,5 @@ - + + Manage access + 0} - icon={table._id === TableNames.USERS ? "UserGroup" : "Table"} + icon={table._id === TableNames.USERS ? 'UserGroup' : 'Table'} text={table.name} selected={selectedView === `all_${table._id}`} - on:click={() => selectTable(table)} - > + on:click={() => selectTable(table)}> {#if table._id !== TableNames.USERS} {/if} @@ -46,14 +45,12 @@ {#each Object.keys(table.views || {}) as viewName, idx (idx)} onClickView(table, viewName)} - > + on:click={() => onClickView(table, viewName)}> + view={{ name: viewName, ...table.views[viewName] }} /> {/each} {/each} diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index 929afd2ad6..1bd9798fdb 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -1,40 +1,30 @@ -
-
+ +
- - {#if editing} -
-
Edit View
- -
- - -
-
- {:else} - - - - - {/if} -
-
+ Edit + Delete + + + + + + - - + title="Confirm Deletion" /> diff --git a/packages/builder/src/components/common/ConfirmDialog.svelte b/packages/builder/src/components/common/ConfirmDialog.svelte index 27a7517fce..33a1d86b88 100644 --- a/packages/builder/src/components/common/ConfirmDialog.svelte +++ b/packages/builder/src/components/common/ConfirmDialog.svelte @@ -1,5 +1,5 @@