From 04ac6cc5cf97dd2561dce33036abd5e349cca504 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 5 Apr 2024 16:56:05 +0200 Subject: [PATCH] feat: add `limitReached` banner and delete previous modal --- .../billing/alerts/limitReached.svelte | 43 +++++++ src/lib/layout/header.svelte | 14 --- src/lib/stores/billing.ts | 24 +++- src/routes/console/+layout.svelte | 6 +- .../excesLimitModal.svelte | 106 ------------------ .../organization-[organization]/store.ts | 3 +- .../usage/[[invoice]]/+page.svelte | 3 +- .../settings/usage/[[invoice]]/+page.svelte | 5 +- 8 files changed, 74 insertions(+), 130 deletions(-) create mode 100644 src/lib/components/billing/alerts/limitReached.svelte delete mode 100644 src/routes/console/organization-[organization]/excesLimitModal.svelte diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte new file mode 100644 index 000000000..9844136b6 --- /dev/null +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -0,0 +1,43 @@ + + +{#if $organization?.$id && $organization?.billingPlan === BillingPlan.STARTER && $readOnly && !$page.url.pathname.includes('/console/account')} + + + Usage for the {$organization.name} organization has reached the limits of the Starter + plan. Consider upgrading to increase your resource usage. + + + + + + +{/if} diff --git a/src/lib/layout/header.svelte b/src/lib/layout/header.svelte index 9dbc534c5..16c97001a 100644 --- a/src/lib/layout/header.svelte +++ b/src/lib/layout/header.svelte @@ -24,9 +24,6 @@ import CreateOrganizationCloud from '$routes/console/createOrganizationCloud.svelte'; import { Feedback } from '$lib/components/feedback'; import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte'; - import { Pill } from '$lib/elements'; - import { showExcess } from '$routes/console/organization-[organization]/store'; - import { readOnly } from '$lib/stores/billing'; import { BillingPlan } from '$lib/constants'; let showDropdown = false; @@ -105,17 +102,6 @@ {/if} -{#if !$page.url.pathname.includes('/console/account') && $readOnly} -
- ($showExcess = true)}> -
-
-
-
-{/if} -
Bandwidth -

Calculated for all bandwidth used in your project.

+

+ Calculated for all bandwidth used across your project. Resets at the start of each + billing cycle. +

{#if network} {@const humanized = humanFileSize(total(network))}