diff --git a/src/lib/components/billing/planSelection.svelte b/src/lib/components/billing/planSelection.svelte index 6c2103187..a4a290367 100644 --- a/src/lib/components/billing/planSelection.svelte +++ b/src/lib/components/billing/planSelection.svelte @@ -7,8 +7,8 @@ import { LabelCard } from '..'; export let billingPlan: Tier; - export let anyOrgFree = false; export let isNewOrg = false; + export let anyOrgFree = false; export let selfService = true; $: freePlan = $plansInfo.get(BillingPlan.FREE); @@ -22,12 +22,9 @@ + title={tierFree.name}> {#if $organization?.billingPlan === BillingPlan.FREE && !isNewOrg} diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index e0bc8eb0c..682bf7bd8 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -150,8 +150,7 @@ await goto(previousPage); addNotification({ type: 'success', - isHtml: true, - message: `${$organization.name} plan has been successfully updated.` + message: `${$organization.name} plan has been successfully updated.` }); trackEvent(Submit.OrganizationDowngrade, { @@ -264,7 +263,9 @@ $: isUpgrade = $plansInfo.get(selectedPlan).order > $currentPlan?.order; $: isDowngrade = $plansInfo.get(selectedPlan).order < $currentPlan?.order; - $: isButtonDisabled = $organization?.billingPlan === selectedPlan; + $: isButtonDisabled = + $organization?.billingPlan === selectedPlan || + (isDowngrade && selectedPlan === BillingPlan.FREE && data.hasFreeOrgs); @@ -297,8 +298,21 @@ selfService={data.selfService} anyOrgFree={data.hasFreeOrgs} /> + {#if isDowngrade && selectedPlan === BillingPlan.FREE && data.hasFreeOrgs} + + To downgrade this organization, first migrate or delete one of your + existing paid organizations. + + + {/if} + {#if isDowngrade} - {#if selectedPlan === BillingPlan.FREE} + {#if selectedPlan === BillingPlan.FREE && !data.hasFreeOrgs} {:else if selectedPlan === BillingPlan.PRO && data.organization.billingPlan === BillingPlan.SCALE && collaborators?.length > 0} {@const extraMembers = collaborators?.length ?? 0} @@ -364,7 +378,7 @@ id="members" /> {/if} - {#if isDowngrade && selectedPlan === BillingPlan.FREE} + {#if isDowngrade && selectedPlan === BillingPlan.FREE && !data.hasFreeOrgs}
{:else if data.organization.billingPlan !== BillingPlan.CUSTOM} - + {/if}