fix: messages and bug.

This commit is contained in:
Darshan
2025-09-01 20:00:01 +05:30
parent b641df15d5
commit ce06db539f
4 changed files with 15 additions and 9 deletions
@@ -3,10 +3,7 @@
import { Click } from '$lib/actions/analytics';
import { Button } from '$lib/elements/forms';
import { HeaderAlert } from '$lib/layout';
import {
hideBillingHeaderRoutes,
upgradeURL
} from '$lib/stores/billing';
import { hideBillingHeaderRoutes, upgradeURL } from '$lib/stores/billing';
import { currentPlan, organization } from '$lib/stores/organization';
import SelectProjectCloud from './selectProjectCloud.svelte';
import { toLocaleDate } from '$lib/helpers/date';
@@ -30,8 +27,9 @@
type="warning"
title="Action required: You have more than {$currentPlan.projects} projects.">
<svelte:fragment>
Choose which projects to keep before {toLocaleDate($organization.billingNextInvoiceDate)} or upgrade
to Pro. Projects over the limit will be blocked after this date.
Choose which projects to keep before {toLocaleDate(
$organization.billingNextInvoiceDate
)} or upgrade to Pro. Projects over the limit will be blocked after this date.
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button
@@ -148,9 +148,12 @@
{/if}
{#if selectedProjects.length === $currentPlan?.projects}
{@const difference = projects.length - selectedProjects.length}
{@const messagePrefix =
difference > 1 ? `${difference} projects` : `${difference} project`}
<Alert.Inline
status="warning"
title={`${projects.length - selectedProjects.length} projects will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
title={`${messagePrefix} will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
<span>
{@html formatProjectsToArchive()}
will be archived.
@@ -292,9 +292,11 @@
</Table.Root>
</div>
{#if selectedProjects.length === allowedProjectsToKeep}
{@const difference = projects.length - selectedProjects.length}
{@const messagePrefix = difference > 1 ? `${difference} projects` : `${difference} project`}
<Alert.Inline
status="warning"
title={`${projects.length - selectedProjects.length} projects will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
title={`${messagePrefix} will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
{formatProjectsToArchive()} will be archived
</Alert.Inline>
{/if}
@@ -134,8 +134,11 @@
</Layout.Stack>
{#if isCloud && $currentPlan?.projects && $currentPlan?.projects > 0 && data.organization.projects.length > 0 && $canWriteProjects && (projectsToArchive.length > 0 || data.projects.total > $currentPlan.projects)}
{@const difference = projectsToArchive}
{@const messagePrefix =
difference.length > 1 ? `${difference} projects` : `${difference} project`}
<Alert.Inline
title={`${projectsToArchive.length} projects will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
title={`${messagePrefix} will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
<Typography.Text>Upgrade your plan to restore archived projects</Typography.Text>
<svelte:fragment slot="actions">
<Button