From 47dd256d38d7266c61aed7d8ff42c47201283973 Mon Sep 17 00:00:00 2001 From: ChiragAgg5k Date: Tue, 4 Mar 2025 19:19:15 +0530 Subject: [PATCH] chore: hid banner before april 1st --- src/lib/components/progressBarBig.svelte | 6 +++-- .../usage/[[invoice]]/+page.svelte | 26 ++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/lib/components/progressBarBig.svelte b/src/lib/components/progressBarBig.svelte index 01d47ed26..198f5504a 100644 --- a/src/lib/components/progressBarBig.svelte +++ b/src/lib/components/progressBarBig.svelte @@ -6,7 +6,7 @@ export let maxValue: string | undefined = undefined; export let maxUnit: string | undefined = undefined; export let progressValue: number; - export let progressMax: number; + export let progressMax: number | undefined = undefined; export let showBar = true; export let progressBarData: Array = []; @@ -21,7 +21,9 @@ {currentValue} {currentUnit}

-

{progress}%

+ {#if progressMax !== undefined} +

{progress}%

+ {/if}

diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index 78ee37c5f..eec2e105c 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -24,6 +24,22 @@ export let data; + // Mock data for image transformations + data.organizationUsage = { + ...data.organizationUsage, + imageTransformationsTotal: 1250, + imageTransformations: [ + { date: '2024-03-01', value: 50 }, + { date: '2024-03-02', value: 75 }, + { date: '2024-03-03', value: 125 }, + { date: '2024-03-04', value: 200 }, + { date: '2024-03-05', value: 150 }, + { date: '2024-03-06', value: 175 }, + { date: '2024-03-07', value: 225 }, + { date: '2024-03-08', value: 250 } + ] + }; + const tier = data?.plan ? (data.plan.$id as Tier) : (data?.currentInvoice?.plan ?? $organization?.billingPlan); @@ -271,18 +287,20 @@ >.

- {#if $organization.billingPlan === BillingPlan.FREE} + + {#if $organization.billingPlan === BillingPlan.FREE && new Date() < new Date('2024-04-01')} {:else if data.organizationUsage.imageTransformationsTotal} {@const current = data.organizationUsage.imageTransformationsTotal} {@const max = getServiceLimit('imageTransformations', tier, plan)} + {@const isBeforeApril = new Date() < new Date('2024-04-01')}