From f54d1985b44a03e705b13f6ce5832852dec3eddb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Aug 2024 07:46:15 +0100 Subject: [PATCH] Add new detail popover and update manage access button to use it --- packages/bbui/src/Popover/Popover.svelte | 3 + .../buttons/ManageAccessButton.svelte | 25 +++--- .../DataTable/modals/ManageAccessModal.svelte | 82 ++++++------------- .../components/common/DetailPopover.svelte | 59 +++++++++++++ .../src/components/grid/stores/datasource.js | 1 - 5 files changed, 103 insertions(+), 67 deletions(-) create mode 100644 packages/builder/src/components/common/DetailPopover.svelte diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index 696e246d28..6c6ae6817d 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -143,6 +143,9 @@ border-color: var(--spectrum-global-color-gray-300); overflow: auto; transition: opacity 260ms ease-out; + filter: none; + -webkit-filter: none; + box-shadow: 0 1px 4px var(--drop-shadow); } .blockPointerEvents { pointer-events: none; diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index aa8eefe89c..e43cc33915 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -2,22 +2,25 @@ import { ActionButton, Modal } from "@budibase/bbui" import { permissions } from "stores/builder" import ManageAccessModal from "../modals/ManageAccessModal.svelte" + import DetailPopover from "components/common/DetailPopover.svelte" export let resourceId - export let disabled = false - let modal let resourcePermissions - async function openModal() { - resourcePermissions = await permissions.forResourceDetailed(resourceId) - modal.show() + $: fetchPermissions(resourceId) + + const fetchPermissions = async id => { + console.log("getting perms for", id) + resourcePermissions = await permissions.forResourceDetailed(id) } - - Access - - - - + + + Access + + {#if resourcePermissions} + + {/if} + diff --git a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte index 48b584690e..b80dad4321 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte @@ -1,19 +1,8 @@ - - - Manage Access - {#if requiresPlanToModify} - - - {getFormattedPlanName(requiresPlanToModify)} - - - {/if} - - Specify the minimum access level role for this data. -
- - - {#each Object.keys(computedPermissions) as level} - - +