diff --git a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte index a6c33c50b3..fe0e2443a2 100644 --- a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte @@ -23,7 +23,7 @@ import AccessTab from "../_components/AccessTab.svelte" import { API } from "api" import { store } from "builderStore" - import { apps, auth } from "stores/portal" + import { apps, auth, groups } from "stores/portal" import analytics, { Events, EventSource } from "analytics" import { AppStatus } from "constants" import AppLockModal from "components/common/AppLockModal.svelte" @@ -192,6 +192,7 @@ try { await API.syncApp(application) deployments = await fetchDeployments() + await groups.actions.init() if (!apps.length) { await apps.load() } 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 a0719441d0..c1a3a707b6 100644 --- a/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte +++ b/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte @@ -78,8 +78,6 @@ onMount(async () => { try { - await groups.actions.init() - await apps.load() await roles.fetch() } catch (error) { notifications.error(error) diff --git a/packages/builder/src/pages/builder/portal/overview/_components/OverviewTab.svelte b/packages/builder/src/pages/builder/portal/overview/_components/OverviewTab.svelte index 695f48a9e2..854fb3cce6 100644 --- a/packages/builder/src/pages/builder/portal/overview/_components/OverviewTab.svelte +++ b/packages/builder/src/pages/builder/portal/overview/_components/OverviewTab.svelte @@ -5,10 +5,11 @@ import { store } from "builderStore" import clientPackage from "@budibase/client/package.json" import { processStringSync } from "@budibase/string-templates" - import { users, auth, apps } from "stores/portal" + import { users, auth, apps, groups } from "stores/portal" import { createEventDispatcher } from "svelte" import { fetchData } from "@budibase/frontend-core" import { API } from "api" + import GroupIcon from "../../manage/groups/_components/GroupIcon.svelte" export let app export let deployments @@ -40,6 +41,13 @@ appId: apps.getProdAppID(app.devId), }, }) + $: prodAppId = apps.getProdAppID(app.devId) + $: appGroups = $groups.filter(group => { + if (!group.roles) { + return false + } + return groups.actions.getGroupAppIds(group).includes(prodAppId) + }) const unpublishApp = () => { dispatch("unpublish", app) @@ -156,30 +164,45 @@ }} dataCy={"access"} > -