From 31208b1f8fbe1eb9a9bd5c67247586f33b45b4d1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 22 Sep 2022 13:57:44 +0100 Subject: [PATCH] Renaming function to more accurately reflect its group app ID lookup purpose. --- packages/builder/src/pages/builder/apps/index.svelte | 2 +- .../src/pages/builder/portal/manage/groups/[groupId].svelte | 2 +- .../builder/portal/overview/_components/AccessTab.svelte | 6 ++++-- .../portal/overview/_components/AssignmentModal.svelte | 2 +- packages/builder/src/stores/portal/groups.js | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index c6f922f27b..ac907ad556 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -53,7 +53,7 @@ : publishedApps.filter(app => { return userGroups.find(group => { return groups.actions - .getGroupApps(group) + .getGroupAppIds(group) .map(role => apps.extractAppId(role)) .includes(app.appId) }) diff --git a/packages/builder/src/pages/builder/portal/manage/groups/[groupId].svelte b/packages/builder/src/pages/builder/portal/manage/groups/[groupId].svelte index 0f4d621cd6..c64b7b8bf6 100644 --- a/packages/builder/src/pages/builder/portal/manage/groups/[groupId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/groups/[groupId].svelte @@ -42,7 +42,7 @@ $: group = $groups.find(x => x._id === groupId) $: filtered = $users.data $: groupApps = $apps.filter(app => - groups.actions.getGroupApps(group).includes(app.appId) + groups.actions.getGroupAppIds(group).includes(app.appId) ) $: { if (loaded && !group?._id) { diff --git a/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte b/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte index 96ea66ff13..51ffccb8be 100644 --- a/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte +++ b/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte @@ -44,7 +44,7 @@ if (!group.roles) { return false } - return groups.actions.getGroupApps(group).includes(fixedAppId) + return groups.actions.getGroupAppIds(group).includes(fixedAppId) }) async function removeUser(user) { @@ -114,7 +114,9 @@ autoWidth quiet value={group.roles[ - groups.actions.getGroupApps(group).find(x => x === fixedAppId) + groups.actions + .getGroupAppIds(group) + .find(x => x === fixedAppId) ]} allowPublic={false} /> diff --git a/packages/builder/src/pages/builder/portal/overview/_components/AssignmentModal.svelte b/packages/builder/src/pages/builder/portal/overview/_components/AssignmentModal.svelte index 570ab554b9..a8b864cf3d 100644 --- a/packages/builder/src/pages/builder/portal/overview/_components/AssignmentModal.svelte +++ b/packages/builder/src/pages/builder/portal/overview/_components/AssignmentModal.svelte @@ -113,7 +113,7 @@ search = search?.toLowerCase() return (allGroups || []).filter(group => { // Filter out assigned groups - const appIds = groups.actions.getGroupApps(group) + const appIds = groups.actions.getGroupAppIds(group) if (appIds.includes(appId)) { return false } diff --git a/packages/builder/src/stores/portal/groups.js b/packages/builder/src/stores/portal/groups.js index b868e693ac..fb1e7d6663 100644 --- a/packages/builder/src/stores/portal/groups.js +++ b/packages/builder/src/stores/portal/groups.js @@ -77,7 +77,7 @@ export function createGroupsStore() { await getGroup(groupId) }, - getGroupApps: group => { + getGroupAppIds: group => { return Object.keys(group?.roles || {}) }, }