mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: plan final action text
This commit is contained in:
@@ -21,7 +21,8 @@
|
||||
paymentExpired,
|
||||
checkForMarkedForDeletion,
|
||||
checkForMandate,
|
||||
checkForMissingPaymentMethod
|
||||
checkForMissingPaymentMethod,
|
||||
plansInfo
|
||||
} from '$lib/stores/billing';
|
||||
import { goto } from '$app/navigation';
|
||||
import { CommandCenter, registerCommands, registerSearchers } from '$lib/commandCenter';
|
||||
@@ -269,10 +270,12 @@
|
||||
await checkForUsageLimit(org);
|
||||
checkForMarkedForDeletion(org);
|
||||
if (org?.billingPlan !== BillingPlan.STARTER) {
|
||||
calculateTrialDay(org);
|
||||
await paymentExpired(org);
|
||||
await checkPaymentAuthorizationRequired(org);
|
||||
await checkForMandate(org);
|
||||
if ($plansInfo.get(org.billingPlan)?.trialDays) {
|
||||
calculateTrialDay(org);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import type { Coupon } from '$lib/sdk/billing';
|
||||
import { plansInfo } from '$lib/stores/billing';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import { createOrganization, createOrganizationFinalAction } from './store';
|
||||
|
||||
const plan = $plansInfo?.get($createOrganization.billingPlan);
|
||||
@@ -18,6 +19,8 @@
|
||||
const today = new Date();
|
||||
const billingPayDate = new Date(today.getTime() + 44 * 24 * 60 * 60 * 1000);
|
||||
|
||||
onMount(() => {});
|
||||
|
||||
let coupon: string = null;
|
||||
let couponData: Partial<Coupon> = {
|
||||
code: null,
|
||||
@@ -48,6 +51,10 @@
|
||||
$: if ($createOrganization.billingPlan === BillingPlan.STARTER) {
|
||||
$createOrganizationFinalAction = 'Create organization';
|
||||
}
|
||||
|
||||
$: if (plan?.trialDays) {
|
||||
$createOrganizationFinalAction = 'Start trial';
|
||||
}
|
||||
</script>
|
||||
|
||||
<WizardStep beforeSubmit={handleBefore}>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
|
||||
import { plansInfo, type Tier } from '$lib/stores/billing';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { type Tier } from '$lib/stores/billing';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const createOrgSteps = writable<WizardStepsType>(new Map());
|
||||
export const createOrganizationFinalAction = writable<string>(
|
||||
get(plansInfo)?.get(get(organization)?.billingPlan)?.trialDays ? 'Start trial' : 'Create'
|
||||
);
|
||||
export const createOrganizationFinalAction = writable<string>('Create');
|
||||
|
||||
export const createOrganization = writable<{
|
||||
id?: string;
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
$: if (!$isUpgrade) {
|
||||
$changeOrganizationFinalAction = 'Confirm plan change';
|
||||
}
|
||||
|
||||
$: if (plan?.trialDays) {
|
||||
$changeOrganizationFinalAction = 'Start trial';
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if downgradeToStarter}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
|
||||
import { plansInfo, type Tier } from '$lib/stores/billing';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { type Tier } from '$lib/stores/billing';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const changeTierSteps = writable<WizardStepsType>(new Map());
|
||||
export const isUpgrade = writable<boolean>(false);
|
||||
export const changeOrganizationFinalAction = writable<string>(
|
||||
get(plansInfo)?.get(get(organization)?.billingPlan)?.trialDays ? 'Start trial' : 'Create'
|
||||
);
|
||||
export const changeOrganizationFinalAction = writable<string>('Create');
|
||||
|
||||
export const changeOrganizationTier = writable<{
|
||||
billingPlan: Tier;
|
||||
|
||||
Reference in New Issue
Block a user