diff --git a/package-lock.json b/package-lock.json index f9918446f..0e8f02c59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,8 +7,8 @@ "name": "@appwrite/console", "dependencies": { "@appwrite.io/console": "^0.6.1", - "@appwrite.io/pink": "0.16.0", - "@appwrite.io/pink-icons": "0.16.0", + "@appwrite.io/pink": "0.17.0", + "@appwrite.io/pink-icons": "0.17.0", "@popperjs/core": "^2.11.8", "@sentry/svelte": "^7.66.0", "@sentry/tracing": "^7.66.0", @@ -166,19 +166,19 @@ } }, "node_modules/@appwrite.io/pink": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.16.0.tgz", - "integrity": "sha512-KprOd+36I0w6PC0x6NJclvyJNpCsjAPcrCHL3QixSX0dZ66wqFE6NitF/KiVVCxbuBaNgjrm7oQ0hr7dt1Sm5Q==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@appwrite.io/pink/-/pink-0.17.0.tgz", + "integrity": "sha512-1FkVVqdqU5d0FlGIyLisCoLR3JaqGlQs3+BJydo6Mr9/bRWKcg4O9nw+e1P1Lx8StnVnDEM5CRCQdzyPQSNByw==", "dependencies": { - "@appwrite.io/pink-icons": "0.16.0", + "@appwrite.io/pink-icons": "0.17.0", "normalize.css": "^8.0.1", "the-new-css-reset": "^1.11.2" } }, "node_modules/@appwrite.io/pink-icons": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@appwrite.io/pink-icons/-/pink-icons-0.16.0.tgz", - "integrity": "sha512-tWaG5lFXnKzbFbGf4SlxoFYj2yH7kQDejFq+UHdfzBrqteSfZpxIxdNmKHIea1ztcmsat4y+R0ZbVX9iOv+oPw==" + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@appwrite.io/pink-icons/-/pink-icons-0.17.0.tgz", + "integrity": "sha512-JcYjVI+nPO8BTJzKlUH2RKyUYg/3pEy81dr3TrQB0HlsrngDq3akhaNCfnQzLg9Kicdl+Cr4Gq920Ha6zA4FQQ==" }, "node_modules/@babel/code-frame": { "version": "7.24.2", diff --git a/package.json b/package.json index e021b3c61..eb7eba70d 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "e2e": "playwright test tests/e2e" }, "dependencies": { - "@appwrite.io/pink": "0.16.0", - "@appwrite.io/pink-icons": "0.16.0", + "@appwrite.io/pink": "0.17.0", + "@appwrite.io/pink-icons": "0.17.0", "@appwrite.io/console": "^0.6.1", "@popperjs/core": "^2.11.8", "@sentry/svelte": "^7.66.0", diff --git a/src/lib/components/billing/estimatedTotalBox.svelte b/src/lib/components/billing/estimatedTotalBox.svelte index a20d951b2..6ead40362 100644 --- a/src/lib/components/billing/estimatedTotalBox.svelte +++ b/src/lib/components/billing/estimatedTotalBox.svelte @@ -28,7 +28,7 @@ : grossCost; - +

{currentPlan.name} plan

{formatCurrency(currentPlan.price)}

diff --git a/src/lib/components/billing/paymentModal.svelte b/src/lib/components/billing/paymentModal.svelte index 2b5ef5d1b..56bcdab20 100644 --- a/src/lib/components/billing/paymentModal.svelte +++ b/src/lib/components/billing/paymentModal.svelte @@ -68,7 +68,12 @@ } - + - + diff --git a/src/lib/components/billing/planComparisonBox.svelte b/src/lib/components/billing/planComparisonBox.svelte index d9ae9326e..85443bcfb 100644 --- a/src/lib/components/billing/planComparisonBox.svelte +++ b/src/lib/components/billing/planComparisonBox.svelte @@ -25,25 +25,25 @@
{#if selectedTab === 'tier-0'}

{plan.name} plan

-
    -
  • +
      +
    • Limited to {plan.databases} Database, {plan.buckets} Buckets, {plan.functions} Functions per project
    • -
    • Limited to 1 organization member
    • -
    • {plan.bandwidth}GB bandwidth
    • -
    • {plan.storage}GB storage
    • -
    • {formatNum(plan.executions)} executions
    • +
    • Limited to 1 organization member
    • +
    • {plan.bandwidth}GB bandwidth
    • +
    • {plan.storage}GB storage
    • +
    • {formatNum(plan.executions)} executions
    {:else if selectedTab === 'tier-1'}

    {plan.name} plan

    -
      -
    • Everything in the Starter plan, plus:
    • -
    • Unlimited databases, buckets, functions
    • -
    • {plan.bandwidth}GB bandwidth
    • -
    • {plan.storage}GB storage
    • -
    • {formatNum(plan.executions)} executions
    • -
    • Email support
    • +
        +
      • Everything in the Starter plan, plus:
      • +
      • Unlimited databases, buckets, functions
      • +
      • {plan.bandwidth}GB bandwidth
      • +
      • {plan.storage}GB storage
      • +
      • {formatNum(plan.executions)} executions
      • +
      • Email support
      {/if}
diff --git a/src/lib/components/billing/selectPaymentMethod.svelte b/src/lib/components/billing/selectPaymentMethod.svelte index 3e4d9269c..1e2db6a94 100644 --- a/src/lib/components/billing/selectPaymentMethod.svelte +++ b/src/lib/components/billing/selectPaymentMethod.svelte @@ -4,7 +4,7 @@ import { sdk } from '$lib/stores/sdk'; import { hasStripePublicKey, isCloud } from '$lib/system'; import { onMount } from 'svelte'; - import { Card, CreditCardBrandImage } from '..'; + import { Alert, Card, CreditCardBrandImage } from '..'; import PaymentModal from './paymentModal.svelte'; import { capitalize } from '$lib/helpers/string'; @@ -27,9 +27,20 @@ }); $: filteredMethods = methods?.paymentMethods?.filter((method) => !!method?.last4); + + $: selectedPaymentMethod = methods?.paymentMethods?.find((method) => method.$id === value); {#if filteredMethods?.length} + {#if selectedPaymentMethod?.country === 'in'} + + Indian credit or debit card-holders + To comply with RBI regulations in India, Appwrite will ask for verification to charge up + to $150 USD on your payment method. We will never charge more than the cost of your plan + and the resources you use, or your budget cap limit. For higher usage limits, please contact + us. + + {/if} {:else} - +

diff --git a/src/lib/constants.ts b/src/lib/constants.ts index fd4a80b82..3d994e792 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -350,3 +350,38 @@ export enum BillingPlan { PRO = 'tier-1', SCALE = 'tier-2' } + +export const feedbackDowngradeOptions = [ + { + value: 'availableFeatures', + label: "The available features don't meet my needs" + }, + { + value: 'traction', + label: "My project isn't getting traction" + }, + { + value: 'bugs', + label: 'I experienced bugs or unexpected outages while using the console' + }, + { + value: 'starter', + label: 'The Starter plan is enough for my projects' + }, + { + value: 'budget', + label: "I don't have the budget" + }, + { + value: 'tryOut', + label: 'I just wanted to try it out' + }, + { + value: 'alternative', + label: 'I found an alternative/competitor to meet my needs' + }, + { + value: 'other', + label: 'Other' + } +]; diff --git a/src/lib/layout/wizardSecondaryHeader.svelte b/src/lib/layout/wizardSecondaryHeader.svelte index e7971f533..91a5bda0e 100644 --- a/src/lib/layout/wizardSecondaryHeader.svelte +++ b/src/lib/layout/wizardSecondaryHeader.svelte @@ -5,8 +5,8 @@

-
- +
+ diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index 1036feda1..a298eace4 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -356,7 +356,7 @@ export class Billing { organizationId: string, billingPlan: string, paymentMethodId: string, - billingAddressId: string + billingAddressId: string = undefined ): Promise { const path = `/organizations/${organizationId}/plan`; const params = { diff --git a/src/routes/console/organization-[organization]/change-plan/+page.svelte b/src/routes/console/organization-[organization]/change-plan/+page.svelte new file mode 100644 index 000000000..8d07d9e3a --- /dev/null +++ b/src/routes/console/organization-[organization]/change-plan/+page.svelte @@ -0,0 +1,386 @@ + + + + Change plan - Appwrite + + + + Change plan + +
+ +

+ For more details on our plans, visit our + . +

+ {#if anyOrgFree && billingPlan === BillingPlan.PRO} + + You are limited to one Starter organization per account. Consider upgrading or + deleting . + + {/if} +
    +
  • + + +
    +

    + {tierFree.name} + {#if $organization.billingPlan === BillingPlan.STARTER} + Current plan + {/if} +

    +

    {tierFree.description}

    +

    + {formatCurrency(freePlan?.price ?? 0)} +

    +
    +
    +
    +
  • + +
  • + + +
    +

    + {tierPro.name} + {#if $organization.billingPlan === BillingPlan.PRO} + Current plan + {/if} +

    +

    + {tierPro.description} +

    +

    + {formatCurrency(proPlan?.price ?? 0)} per member/month + usage +

    +
    +
    +
    +
  • +
+ {#if billingPlan === BillingPlan.PRO && $organization.billingPlan !== BillingPlan.PRO} + + + + + {#if !couponData?.code} + + {/if} + {/if} + {#if !isUpgrade && billingPlan === BillingPlan.STARTER && $organization.billingPlan !== BillingPlan.STARTER} + + + + + {/if} +
+ + {#if billingPlan !== BillingPlan.STARTER && $organization.billingPlan !== BillingPlan.PRO} + + {:else} + + {/if} + +
+ + + + + +
+ + diff --git a/src/routes/console/organization-[organization]/change-plan/+page.ts b/src/routes/console/organization-[organization]/change-plan/+page.ts new file mode 100644 index 000000000..cde580678 --- /dev/null +++ b/src/routes/console/organization-[organization]/change-plan/+page.ts @@ -0,0 +1,10 @@ +import { Dependencies } from '$lib/constants'; + +export const load = async ({ depends, parent }) => { + const { members } = await parent(); + depends(Dependencies.ORGANIZATION); + + return { + members + }; +};