From d41de1ca6ab562e76b2d6e40af94900cfaa63148 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 12 May 2022 19:46:13 +0100 Subject: [PATCH 1/2] webhook URL paste, hiding no access role --- .../src/components/automation/Shared/WebhookDisplay.svelte | 2 +- .../builder/src/components/common/inputs/CopyInput.svelte | 3 +-- .../manage/users/_components/UpdateRolesModal.svelte | 7 ++++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte index dcd96ce2b9..9ba4140b51 100644 --- a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte +++ b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte @@ -12,4 +12,4 @@ } - + diff --git a/packages/builder/src/components/common/inputs/CopyInput.svelte b/packages/builder/src/components/common/inputs/CopyInput.svelte index 102fd5682a..589623f542 100644 --- a/packages/builder/src/components/common/inputs/CopyInput.svelte +++ b/packages/builder/src/components/common/inputs/CopyInput.svelte @@ -3,7 +3,6 @@ export let label = null export let value - export let copyValue export let dataCy = null const copyToClipboard = val => { @@ -19,7 +18,7 @@
-
copyToClipboard(value || copyValue)}> +
copyToClipboard(value)}>
diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte index 5a60bfdff8..8fb372cca7 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte @@ -6,6 +6,8 @@ export let app export let user + let devAccess = user?.admin?.global || user?.builder?.global + const NO_ACCESS = "NO_ACCESS" const dispatch = createEventDispatcher() @@ -14,7 +16,10 @@ let options = roles .filter(role => role._id !== "PUBLIC") .map(role => ({ value: role._id, label: role.name })) - options.push({ value: NO_ACCESS, label: "No Access" }) + + if (!devAccess) { + options.push({ value: NO_ACCESS, label: "No Access" }) + } let selectedRole = user?.roles?.[app?._id] async function updateUserRoles() { From e6586e64a36842d3f1a2f138d1f19f1dd369525c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 13 May 2022 14:36:11 +0100 Subject: [PATCH 2/2] only lock no_access for builder users --- .../portal/manage/users/_components/UpdateRolesModal.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte index 8fb372cca7..a9399fcca7 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/UpdateRolesModal.svelte @@ -6,8 +6,6 @@ export let app export let user - let devAccess = user?.admin?.global || user?.builder?.global - const NO_ACCESS = "NO_ACCESS" const dispatch = createEventDispatcher() @@ -17,7 +15,7 @@ .filter(role => role._id !== "PUBLIC") .map(role => ({ value: role._id, label: role.name })) - if (!devAccess) { + if (!user?.builder?.global) { options.push({ value: NO_ACCESS, label: "No Access" }) } let selectedRole = user?.roles?.[app?._id]