From 451fc563580ecf5f370f894b9763c79c04fa2f06 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 26 Apr 2021 15:57:17 +0100 Subject: [PATCH 1/4] Update all table popovers to be modals and fix edit roles modal --- .../DataTable/buttons/CreateViewButton.svelte | 21 +++---- .../DataTable/buttons/ExportButton.svelte | 21 +++---- .../buttons/ManageAccessButton.svelte | 26 ++++---- .../CreateViewModal.svelte} | 35 ++--------- .../backend/DataTable/modals/EditRoles.svelte | 42 +++++-------- .../DataTable/modals/ExportModal.svelte | 37 +++++++++++ .../ManageAccessModal.svelte} | 42 ++----------- .../DataTable/popovers/ExportPopover.svelte | 63 ------------------- 8 files changed, 93 insertions(+), 194 deletions(-) rename packages/builder/src/components/backend/DataTable/{popovers/CreateViewPopover.svelte => modals/CreateViewModal.svelte} (55%) create mode 100644 packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte rename packages/builder/src/components/backend/DataTable/{popovers/ManageAccessPopover.svelte => modals/ManageAccessModal.svelte} (65%) delete mode 100644 packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte index aca1f3001e..285323c6d7 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte @@ -1,16 +1,13 @@ -
- -
- - - + + + + diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte index 7b5d93cf86..9ec0a86131 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte @@ -1,18 +1,15 @@ -
- -
- - - + + + + diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index 996396d9d3..8af3f3f3f1 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -1,29 +1,25 @@ -
- -
- - + Manage Access + + + - \ No newline at end of file + permissions={resourcePermissions} /> + diff --git a/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte similarity index 55% rename from packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte rename to packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte index 3e1e97e756..d70b51f4c5 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte @@ -1,5 +1,5 @@ -
- Create View + - -
- - + diff --git a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte index 7ee70efe21..5cf33f8d3d 100644 --- a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte @@ -21,7 +21,7 @@ // Changes the selected role const changeRole = event => { - const id = event?.target?.value + const id = event?.detail const role = $roles.find(role => role._id === id) if (role) { selectedRole = { @@ -94,42 +94,34 @@ secondary label="Role" value={selectedRoleId} - on:change={changeRole}> - - {#each $roles as role} - - {/each} - + on:change={changeRole} + options={$roles} + placeholder="Create new role" + getOptionValue={role => role._id} + getOptionLabel={role => role.name} /> {#if selectedRole} + bind:value={selectedRole.inherits} + options={otherRoles} + getOptionValue={role => role._id} + getOptionLabel={role => role.name} + placeholder="None" /> + bind:value={selectedRole.permissionId} + options={basePermissions} + getOptionValue={x => x._id} + getOptionLabel={x => x.name} + placeholder="Choose permissions" /> {/if}
{#if !isCreating} - + {/if}
diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte new file mode 100644 index 0000000000..0344b3a925 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -0,0 +1,37 @@ + + + + x.name} - getOptionValue={x => x.key} /> - - - - From 37d1004d8dbcdb14cef23d9f712a0718bb721e91 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 26 Apr 2021 16:02:03 +0100 Subject: [PATCH 2/4] Fix active class on buttons --- packages/bbui/src/Button/Button.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/bbui/src/Button/Button.svelte b/packages/bbui/src/Button/Button.svelte index cbab6803eb..6e2b63adbd 100644 --- a/packages/bbui/src/Button/Button.svelte +++ b/packages/bbui/src/Button/Button.svelte @@ -23,15 +23,13 @@ class:active class="spectrum-Button spectrum-Button--size{size.toUpperCase()}" {disabled} - on:click|preventDefault -> + on:click|preventDefault> {#if icon} {/if} @@ -46,4 +44,7 @@ overflow: hidden; text-overflow: ellipsis; } + .active { + color: var(--spectrum-global-color-blue-600) !important; + } From 17bf73706a862a9aea1468533f2f6cd1cbcd50d0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 26 Apr 2021 16:14:16 +0100 Subject: [PATCH 3/4] Update filter popover to modal --- packages/bbui/src/Styleguide/Label.svelte | 2 +- .../DataTable/buttons/FilterButton.svelte | 27 ++++++++------- .../CalculateModal.svelte} | 34 ++++--------------- 3 files changed, 22 insertions(+), 41 deletions(-) rename packages/builder/src/components/backend/DataTable/{popovers/CalculatePopover.svelte => modals/CalculateModal.svelte} (71%) diff --git a/packages/bbui/src/Styleguide/Label.svelte b/packages/bbui/src/Styleguide/Label.svelte index 4fe9458a35..5ca8b52672 100644 --- a/packages/bbui/src/Styleguide/Label.svelte +++ b/packages/bbui/src/Styleguide/Label.svelte @@ -3,7 +3,7 @@ diff --git a/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte index 889b9bdcf7..50730abcda 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte @@ -1,20 +1,21 @@ -
- -
- - - + + + + diff --git a/packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte b/packages/builder/src/components/backend/DataTable/modals/CalculateModal.svelte similarity index 71% rename from packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte rename to packages/builder/src/components/backend/DataTable/modals/CalculateModal.svelte index fb882a5dc0..3eec950edb 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/CalculatePopover.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CalculateModal.svelte @@ -1,5 +1,5 @@ -
-
Calculate
+
{/if} @@ -152,61 +163,22 @@ placeholder={filter.key || fields[0]} bind:value={filter.value} /> {/if} - removeFilter(idx)} /> + removeFilter(idx)} /> {/each}
+ {:else} + Add a filter to get started. {/if} - +
diff --git a/packages/builder/src/components/backend/DataTable/modals/GroupByModal.svelte b/packages/builder/src/components/backend/DataTable/modals/GroupByModal.svelte new file mode 100644 index 0000000000..5eab472c01 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/modals/GroupByModal.svelte @@ -0,0 +1,24 @@ + + + + - -
- -