From 88f1db74b7c5d0b7fa5e859da99dc02f32d5c5fc Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 21 Jul 2022 09:52:01 +0100 Subject: [PATCH] updating license check to search for feature --- .vscode/settings.json | 5 +---- .../pages/builder/portal/apps/index.svelte | 6 +++-- .../portal/manage/groups/[groupId].svelte | 2 +- .../builder/portal/manage/groups/index.svelte | 22 +++++++++++-------- .../portal/manage/users/[userId].svelte | 7 +++--- .../users/_components/AddUserModal.svelte | 6 +++-- .../users/_components/ImportUsersModal.svelte | 6 +++-- .../builder/portal/manage/users/index.svelte | 6 +++-- .../overview/_components/AccessTab.svelte | 6 +++-- packages/builder/src/stores/portal/groups.js | 14 +++++++++--- packages/frontend-core/src/constants.js | 4 ++++ .../server/src/api/routes/tests/user.spec.js | 1 + packages/worker/src/api/routes/index.js | 4 +++- 13 files changed, 58 insertions(+), 31 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 71f0092a59..4838a4fd89 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "editor.defaultFormatter": "vscode.json-language-features" }, "[javascript]": { - "editor.defaultFormatter": "vscode.typescript-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "debug.javascript.terminalOptions": { "skipFiles": [ @@ -16,7 +16,4 @@ "/**" ] }, - "[typescript]": { - "editor.defaultFormatter": "vscode.typescript-language-features" - }, } diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 5cac1fb9d8..0d05e170e0 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -69,7 +69,9 @@ $: unlocked = lockedApps?.length === 0 $: automationErrors = getAutomationErrors(enrichedApps) - $: isProPlan = $auth.user?.license.plan.type !== Constants.PlanType.FREE + $: hasGroupsLicense = $auth.user?.license.features.includes( + Constants.Features.USER_GROUPS + ) const enrichApps = (apps, user, sortBy) => { const enrichedApps = apps.map(app => ({ @@ -358,7 +360,7 @@ {/if}
- {#if isProPlan && $groups.length} + {#if hasGroupsLicense && $groups.length} {/if}