From 3a5557a4377d8678839578c8a40248d5c656c609 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 23 Sep 2022 11:40:19 +0100 Subject: [PATCH] Update group upgrade UX --- .../portal/licensing/LicensingOverlays.svelte | 2 +- .../portal/licensing/licensingBanners.js | 2 +- .../pages/builder/portal/apps/create.svelte | 4 +- .../pages/builder/portal/apps/index.svelte | 7 +-- .../builder/portal/manage/groups/index.svelte | 36 ++++++----- .../portal/manage/users/[userId].svelte | 4 +- .../users/_components/AddUserModal.svelte | 4 +- .../_components/DeletionFailureModal.svelte | 1 - .../users/_components/ImportUsersModal.svelte | 4 +- .../builder/portal/manage/users/index.svelte | 4 +- .../overview/_components/AccessTab.svelte | 4 +- .../_components/AssignmentModal.svelte | 4 +- .../builder/portal/settings/usage.svelte | 3 +- packages/builder/src/stores/portal/auth.js | 11 +--- packages/builder/src/stores/portal/groups.js | 7 +-- .../builder/src/stores/portal/licensing.js | 61 ++++++++++++++++--- 16 files changed, 99 insertions(+), 59 deletions(-) diff --git a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte index 736aac862f..bcafd92a85 100644 --- a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte +++ b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte @@ -43,7 +43,7 @@ { key: ExpiringKeys.LICENSING_PAYMENT_FAILED, criteria: () => { - return $licensing.accountPastDue && !$licensing.isFreePlan() + return $licensing.accountPastDue && !$licensing.isFreePlan }, action: () => { paymentFailedModal.show() diff --git a/packages/builder/src/components/portal/licensing/licensingBanners.js b/packages/builder/src/components/portal/licensing/licensingBanners.js index 37d8e4a540..d93305cbf6 100644 --- a/packages/builder/src/components/portal/licensing/licensingBanners.js +++ b/packages/builder/src/components/portal/licensing/licensingBanners.js @@ -113,7 +113,7 @@ const buildPaymentFailedBanner = () => { key: "payment_Failed", type: BANNER_TYPES.NEGATIVE, criteria: () => { - return get(licensing)?.accountPastDue && !get(licensing).isFreePlan() + return get(licensing)?.accountPastDue && !get(licensing).isFreePlan }, message: `Payment Failed - Please update your billing details or your account will be downgrades in ${get(licensing)?.pastDueDaysRemaining} day${ diff --git a/packages/builder/src/pages/builder/portal/apps/create.svelte b/packages/builder/src/pages/builder/portal/apps/create.svelte index e3dc6a267c..2dda17875b 100644 --- a/packages/builder/src/pages/builder/portal/apps/create.svelte +++ b/packages/builder/src/pages/builder/portal/apps/create.svelte @@ -31,8 +31,8 @@ onMount(async () => { try { await templates.load() - await licensing.getQuotaUsage() - await licensing.getUsageMetrics() + // always load latest + await licensing.init() if ($templates?.length === 0) { notifications.error( "There was a problem loading quick start templates." diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 019ec67cd7..e4cacada81 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -229,9 +229,8 @@ try { await apps.load() await templates.load() - - await licensing.getQuotaUsage() - await licensing.getUsageMetrics() + // always load latest + await licensing.init() if ($templates?.length === 0) { notifications.error( @@ -361,7 +360,7 @@ {/if}
- {#if $auth.groupsEnabled} + {#if $licensing.groupsEnabled} {/if}