From d83175bc1d071d8e08c61a663bab5c778a3a48ae Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 30 May 2024 11:35:06 +0200 Subject: [PATCH] chore: change plan name to free --- src/lib/components/billing/alerts/limitReached.svelte | 4 +++- src/lib/components/billing/planComparisonBox.svelte | 4 ++-- src/lib/components/billing/planExcess.svelte | 4 ++-- src/lib/components/billing/usageRates.svelte | 5 ++--- src/lib/constants.ts | 2 +- src/lib/stores/billing.ts | 6 +++--- src/routes/console/createOrganization.svelte | 6 +++--- src/routes/console/onboarding/+page.svelte | 4 ++-- .../organization-[organization]/billing/+page.svelte | 8 +++++--- .../organization-[organization]/change-plan/+page.svelte | 6 ++++-- .../console/project-[project]/auth/templates/+page.svelte | 6 ++++-- .../storage/bucket-[bucket]/+page.svelte | 2 +- 12 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/lib/components/billing/alerts/limitReached.svelte b/src/lib/components/billing/alerts/limitReached.svelte index 7cb72e1d0..4d2bc17e5 100644 --- a/src/lib/components/billing/alerts/limitReached.svelte +++ b/src/lib/components/billing/alerts/limitReached.svelte @@ -14,7 +14,9 @@ type="error" title={`${$organization.name} usage has reached the ${tierToPlan($organization.billingPlan).name} plan limit`}> - Usage for the {$organization.name} organization has reached the limits of the Starter + Usage for the {$organization.name} organization has reached the limits of the {tierToPlan( + $organization.billingPlan + ).name} plan. Consider upgrading to increase your resource usage. diff --git a/src/lib/components/billing/planComparisonBox.svelte b/src/lib/components/billing/planComparisonBox.svelte index 85443bcfb..b17aa8437 100644 --- a/src/lib/components/billing/planComparisonBox.svelte +++ b/src/lib/components/billing/planComparisonBox.svelte @@ -13,7 +13,7 @@ (selectedTab = 'tier-0')}> - Starter + Free {plan.name} plan
    -
  • Everything in the Starter plan, plus:
  • +
  • Everything in the Free plan, plus:
  • Unlimited databases, buckets, functions
  • {plan.bandwidth}GB bandwidth
  • {plan.storage}GB storage
  • diff --git a/src/lib/components/billing/planExcess.svelte b/src/lib/components/billing/planExcess.svelte index 153b5cb99..04971036b 100644 --- a/src/lib/components/billing/planExcess.svelte +++ b/src/lib/components/billing/planExcess.svelte @@ -42,8 +42,8 @@ {#if excess?.members > 0} {#if currentTier === BillingPlan.STARTER} - The Starter plan has a limit of one organization member. By proceeding, all but the - creator of the organization admin will be removed. + The {plan.name} plan has a limit of one organization member. By proceeding, all but the creator + of the organization admin will be removed. {:else if currentTier === BillingPlan.PRO} Additional organization members on the Pro plan cost {collaboratorPrice} per member per billing period. By proceeding, you acknowledge your fees may increase in your next billing period. diff --git a/src/lib/components/billing/usageRates.svelte b/src/lib/components/billing/usageRates.svelte index f5654243a..b23fdae63 100644 --- a/src/lib/components/billing/usageRates.svelte +++ b/src/lib/components/billing/usageRates.svelte @@ -54,9 +54,8 @@ {#if isFree} - Usage on the Starter plan is limited for the following resources. Next billing period: {toLocaleDate( - nextDate - )}. + Usage on the {$plansInfo?.get(BillingPlan.STARTER)} plan is limited for the following resources. + Next billing period: {toLocaleDate(nextDate)}. {:else if org.billingPlan === BillingPlan.PRO}

    Usage on the Pro plan will be charged at the end of each billing period at the following diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 85795f75e..dcd29671e 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -367,7 +367,7 @@ export const feedbackDowngradeOptions = [ }, { value: 'starter', - label: 'The Starter plan is enough for my projects' + label: 'The Free plan is enough for my projects' }, { value: 'budget', diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index bd6b2881b..10d0989b1 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -111,7 +111,7 @@ export type TierData = { }; export const tierFree: TierData = { - name: 'Starter', + name: 'Free', description: 'For personal hobby projects of small scale and students.' }; @@ -218,9 +218,9 @@ export async function checkForUsageLimit(org: Organization) { if (now - lastNotification < 1000 * 60 * 60 * 24) return; localStorage.setItem('limitReachedNotification', now.toString()); - let message = `${org.name} has reached 75% of the Starter plan's ${resources.find((r) => r.value >= 75).name} limit. Upgrade to ensure there are no service disruptions.`; + let message = `${org.name} has reached 75% of the ${tierToPlan(BillingPlan.STARTER).name} plan's ${resources.find((r) => r.value >= 75).name} limit. Upgrade to ensure there are no service disruptions.`; if (resources.filter((r) => r.value >= 75)?.length > 1) { - message = `Usage for ${org.name} has reached 75% of the Starter plan limit. Upgrade to ensure there are no service disruptions.`; + message = `Usage for ${org.name} has reached 75% of the ${tierToPlan(BillingPlan.STARTER).name} plan limit. Upgrade to ensure there are no service disruptions.`; } addNotification({ type: 'warning', diff --git a/src/routes/console/createOrganization.svelte b/src/routes/console/createOrganization.svelte index fe4fbc844..70087ad91 100644 --- a/src/routes/console/createOrganization.svelte +++ b/src/routes/console/createOrganization.svelte @@ -49,9 +49,9 @@ Get ready for Appwrite Pro We will soon introduce the much-anticipated Pro plan. Your account will continue to have - access to one free Starter organization. If you manage more than one - organization, you will need to either upgrade to the Pro plan, transfer your projects to - a Pro organization, or migrate to self-hosting. + access to one free organization. If you manage more than one organization, you + will need to either upgrade to the Pro plan, transfer your projects to a Pro + organization, or migrate to self-hosting. diff --git a/src/routes/console/onboarding/+page.svelte b/src/routes/console/onboarding/+page.svelte index 1f7aac074..0ac45c44e 100644 --- a/src/routes/console/onboarding/+page.svelte +++ b/src/routes/console/onboarding/+page.svelte @@ -27,11 +27,11 @@ ? [ { value: BillingPlan.STARTER, - label: `Starter - ${formatCurrency($plansInfo.get(BillingPlan.STARTER).price)}/month` + label: `${tierToPlan(BillingPlan.STARTER).name} - ${formatCurrency($plansInfo.get(BillingPlan.STARTER).price)}/month` }, { value: BillingPlan.PRO, - label: `Pro - ${formatCurrency($plansInfo.get(BillingPlan.PRO).price)}/month + add-ons` + label: `${tierToPlan(BillingPlan.PRO).name} - ${formatCurrency($plansInfo.get(BillingPlan.PRO).price)}/month + add-ons` } ] : []; diff --git a/src/routes/console/organization-[organization]/billing/+page.svelte b/src/routes/console/organization-[organization]/billing/+page.svelte index 8f7f50b4b..51a165d07 100644 --- a/src/routes/console/organization-[organization]/billing/+page.svelte +++ b/src/routes/console/organization-[organization]/billing/+page.svelte @@ -10,7 +10,7 @@ import PaymentHistory from './paymentHistory.svelte'; import TaxId from './taxId.svelte'; import { Alert, Heading } from '$lib/components'; - import { failedInvoice, paymentMethods, upgradeURL } from '$lib/stores/billing'; + import { failedInvoice, paymentMethods, tierToPlan, upgradeURL } from '$lib/stores/billing'; import type { PaymentMethodData } from '$lib/sdk/billing'; import { onMount } from 'svelte'; import { page } from '$app/stores'; @@ -111,8 +111,10 @@ {/if} {#if $organization?.billingPlanDowngrade} - Your organization will change to a Starter plan once your current billing cycle ends and - your invoice is paid on {toLocaleDate($organization.billingNextInvoiceDate)}. + Your organization will change to a {tierToPlan(BillingPlan.STARTER).name} plan once your + current billing cycle ends and your invoice is paid on {toLocaleDate( + $organization.billingNextInvoiceDate + )}. {/if}

    diff --git a/src/routes/console/organization-[organization]/change-plan/+page.svelte b/src/routes/console/organization-[organization]/change-plan/+page.svelte index 046b57013..d9522ff89 100644 --- a/src/routes/console/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/console/organization-[organization]/change-plan/+page.svelte @@ -263,8 +263,10 @@

    {#if anyOrgFree && billingPlan === BillingPlan.PRO} - You are limited to one Starter organization per account. Consider upgrading or - deleting . diff --git a/src/routes/console/project-[project]/auth/templates/+page.svelte b/src/routes/console/project-[project]/auth/templates/+page.svelte index 792851d04..c76bb2716 100644 --- a/src/routes/console/project-[project]/auth/templates/+page.svelte +++ b/src/routes/console/project-[project]/auth/templates/+page.svelte @@ -58,6 +58,7 @@ EmailTemplateLocale } from '@appwrite.io/console'; import Email2FaTemplate from './email2FATemplate.svelte'; + import { tierToPlan } from '$lib/stores/billing'; const projectId = $page.params.project; @@ -139,8 +140,9 @@ href: `${base}/console/organization-${$organization.$id}/billing` } ]}> - All emails sent using the Starter plan will include attribution to Appwrite in - the signature. To send attribution-free emails, upgrade your plan. + All emails sent using the {tierToPlan(BillingPlan.STARTER).name} plan will include + attribution to Appwrite in the signature. To send attribution-free emails, upgrade + your plan. {/if} diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte index a59db0265..a83b4dcc5 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte @@ -112,7 +112,7 @@ - {#if tier === 'Starter'} + {#if tier === 'Free'}

    The {tier} plan has limits

    • {limit}GB total file storage