{#if tier === 'Starter'}
- You are limited to {limit} GB of storage on the {tier} plan.
+ You are limited to {limit} GB of total storage and {Math.floor(
+ parseInt(maxFileSize.value)
+ )}{maxFileSize.unit} on the {tier} plan.
- for addtional storage.
+ for additional storage.
{:else}
diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte
index e62c6af3f..a67c5086e 100644
--- a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte
+++ b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte
@@ -2,7 +2,7 @@
import { Box, CreditCardBrandImage } from '$lib/components';
import { CouponInput } from '$lib/components/billing';
import { BillingPlan } from '$lib/constants';
- import { FormList, InputTextarea } from '$lib/elements/forms';
+ import { FormList, InputSelect, InputTextarea } from '$lib/elements/forms';
import { toLocaleDate } from '$lib/helpers/date';
import { formatCurrency } from '$lib/helpers/numbers';
import { WizardStep } from '$lib/layout';
@@ -10,7 +10,12 @@
import { plansInfo } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { sdk } from '$lib/stores/sdk';
- import { changeOrganizationFinalAction, changeOrganizationTier, isUpgrade } from './store';
+ import {
+ changeOrganizationFinalAction,
+ changeOrganizationTier,
+ feedbackDowngradeOptions,
+ isUpgrade
+ } from './store';
const plan = $plansInfo.get($changeOrganizationTier.billingPlan);
const collaboratorPrice = plan?.addons.member?.price ?? 0;
@@ -28,7 +33,6 @@
status: null,
credits: null
};
- let comment: string = null;
async function fetchCard() {
try {
@@ -51,16 +55,22 @@
Confirm plan change
- Your feedback is important to us and helps us improve the services Appwrite offer. If
- there is a specific reason you chose to change your plan at this time, please let us
- know.
+ Your feedback is important to us and helps us improve the services Appwrite offers.
+ Please let us know if there is a specific reason for changing your plan.
+
+ placeholder="Enter feedback"
+ bind:value={$changeOrganizationTier.feedbackMessage} />
{:else}
diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/paymentDetails.svelte b/src/routes/console/wizard/cloudOrganizationChangeTier/paymentDetails.svelte
index b82943719..99116f394 100644
--- a/src/routes/console/wizard/cloudOrganizationChangeTier/paymentDetails.svelte
+++ b/src/routes/console/wizard/cloudOrganizationChangeTier/paymentDetails.svelte
@@ -10,9 +10,9 @@
import { Dependencies } from '$lib/constants';
import { initializeStripe, isStripeInitialized, submitStripeCard } from '$lib/stores/stripe';
import { organization } from '$lib/stores/organization';
- import { symmetricDifference } from '$lib/helpers/array';
import { showUsageRatesModal } from '$lib/stores/billing';
import { PaymentBoxes } from '$lib/components/billing';
+ import { page } from '$app/stores';
let methods: PaymentList;
let filteredMethods: PaymentMethodData[];
@@ -48,15 +48,10 @@
}
} else {
try {
- await submitStripeCard(name);
- const latestMethods = await sdk.forConsole.billing.listPaymentMethods();
- const paymentMethod = symmetricDifference(
- methods.paymentMethods,
- latestMethods.paymentMethods
- )[0] as PaymentMethodData;
- const card = await sdk.forConsole.billing.getPaymentMethod(paymentMethod.$id);
+ const method = await submitStripeCard(name, $page?.params?.organization ?? null);
+ const card = await sdk.forConsole.billing.getPaymentMethod(method.$id);
if (card?.last4) {
- $changeOrganizationTier.paymentMethodId = paymentMethod.$id;
+ $changeOrganizationTier.paymentMethodId = method.$id;
} else {
throw new Error(
'The payment method you selected is not valid. Please select a different one.'
diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts b/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts
index f9f97b578..846dbabcc 100644
--- a/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts
+++ b/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts
@@ -23,6 +23,7 @@ export const changeOrganizationTier = writable<{
};
taxId?: string;
feedbackMessage?: string;
+ feedbackDowngradeReason?: string;
couponCode?: string;
}>({
billingPlan: BillingPlan.PRO,
@@ -32,3 +33,38 @@ export const changeOrganizationTier = writable<{
billingAddressId: null,
taxId: null
});
+
+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/vite.config.ts b/vite.config.ts
index 754fb4acc..db9f16dc8 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -13,7 +13,8 @@ const config = defineConfig({
'@analytics/google-analytics',
'analytics',
'dayjs',
- 'dotenv'
+ 'dotenv',
+ 'zrender'
]
},
define: {
@@ -36,7 +37,11 @@ const testConfig = defineConfig({
pool: 'threads',
setupFiles: ['./tests/unit/setup.ts'],
deps: {
- inline: ['@analytics/type-utils']
+ optimizer: {
+ web: {
+ include: ['@analytics/type-utils']
+ }
+ }
}
}
});