diff --git a/src/lib/stores/wizard.ts b/src/lib/stores/wizard.ts index 355eb7afc..39cc8f6bc 100644 --- a/src/lib/stores/wizard.ts +++ b/src/lib/stores/wizard.ts @@ -1,4 +1,5 @@ import { trackEvent } from '$lib/actions/analytics'; +import type { WizardStepsType } from '$lib/layout/wizard.svelte'; import type { SvelteComponent } from 'svelte'; import { writable } from 'svelte/store'; @@ -47,3 +48,12 @@ function createWizardStore() { } export const wizard = createWizardStore(); + +export function updateStepStatus(map: WizardStepsType, key: number, status: boolean) { + const updatedComponent = { + ...map.get(key), + disabled: status + }; + map.set(key, updatedComponent); + return map; +} diff --git a/src/routes/console/changeOrganizationTierCloud.svelte b/src/routes/console/changeOrganizationTierCloud.svelte index bb352eda3..1e630243c 100644 --- a/src/routes/console/changeOrganizationTierCloud.svelte +++ b/src/routes/console/changeOrganizationTierCloud.svelte @@ -7,13 +7,16 @@ import Step2 from './wizard/cloudOrganizationChangeTier/step2.svelte'; import Step3 from './wizard/cloudOrganizationChangeTier/step3.svelte'; import Step4 from './wizard/cloudOrganizationChangeTier/step4.svelte'; - import { changeOrganizationTier } from './wizard/cloudOrganizationChangeTier/store'; - import type { WizardStepsType } from '$lib/layout/wizard.svelte'; + import { + changeOrganizationTier, + changeTierSteps + } from './wizard/cloudOrganizationChangeTier/store'; import { goto, invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { page } from '$app/stores'; import { organization } from '$lib/stores/organization'; + import { wizard } from '$lib/stores/wizard'; const dispatch = createEventDispatcher(); @@ -37,6 +40,7 @@ [75] ); } + //Add collaborators if ($changeOrganizationTier?.collaborators?.length) { $changeOrganizationTier.collaborators.forEach(async (collaborator) => { @@ -62,6 +66,7 @@ trackEvent(Submit.OrganizationCreate, { customId: !!$changeOrganizationTier.id }); + wizard.hide(); } catch (e) { addNotification({ type: 'error', @@ -79,21 +84,19 @@ }; }); - const stepsComponents: WizardStepsType = new Map(); - - stepsComponents.set(1, { + $changeTierSteps.set(1, { label: 'Change plan', component: Step1 }); - stepsComponents.set(2, { + $changeTierSteps.set(2, { label: 'Payment details', component: Step2 }); - stepsComponents.set(3, { + $changeTierSteps.set(3, { label: 'Invite collaborators', component: Step3 }); - stepsComponents.set(4, { + $changeTierSteps.set(4, { label: 'Review & confirm', component: Step4 }); @@ -101,7 +104,7 @@ diff --git a/src/routes/console/createOrganizationCloud.svelte b/src/routes/console/createOrganizationCloud.svelte index cb8d86829..3a2f3b685 100644 --- a/src/routes/console/createOrganizationCloud.svelte +++ b/src/routes/console/createOrganizationCloud.svelte @@ -7,12 +7,13 @@ import Step2 from './wizard/cloudOrganization/step2.svelte'; import Step3 from './wizard/cloudOrganization/step3.svelte'; import Step4 from './wizard/cloudOrganization/step4.svelte'; - import { createOrganization, stepsComponents } from './wizard/cloudOrganization/store'; + import { createOrganization, createOrgSteps } from './wizard/cloudOrganization/store'; import { goto, invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { ID } from '@appwrite.io/console'; import { page } from '$app/stores'; + import { wizard } from '$lib/stores/wizard'; const dispatch = createEventDispatcher(); @@ -59,6 +60,7 @@ trackEvent(Submit.OrganizationCreate, { customId: !!$createOrganization.id }); + wizard.hide(); } catch (e) { addNotification({ type: 'error', @@ -77,19 +79,19 @@ }; }); - $stepsComponents.set(1, { + $createOrgSteps.set(1, { label: 'Organization details', component: Step1 }); - $stepsComponents.set(2, { + $createOrgSteps.set(2, { label: 'Payment details', component: Step2 }); - $stepsComponents.set(3, { + $createOrgSteps.set(3, { label: 'Invite collaborators', component: Step3 }); - $stepsComponents.set(4, { + $createOrgSteps.set(4, { label: 'Review & confirm', component: Step4 }); @@ -97,7 +99,7 @@ diff --git a/src/routes/console/organization-[organization]/billing/billingAddress.svelte b/src/routes/console/organization-[organization]/billing/billingAddress.svelte index 5b4898229..f6b93342e 100644 --- a/src/routes/console/organization-[organization]/billing/billingAddress.svelte +++ b/src/routes/console/organization-[organization]/billing/billingAddress.svelte @@ -16,7 +16,7 @@
- + diff --git a/src/routes/console/organization-[organization]/billing/paymentHistory.svelte b/src/routes/console/organization-[organization]/billing/paymentHistory.svelte index 4d355b397..b6a5359a0 100644 --- a/src/routes/console/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/console/organization-[organization]/billing/paymentHistory.svelte @@ -53,16 +53,17 @@ {#if $invoiceList.total} - Date + Due Date Status Amount Due Invoce # - + {#each $invoiceList?.invoices as invoice, i} - {toLocaleDate(invoice.from)} + {toLocaleDate(invoice.dueAt)} {invoice.status} diff --git a/src/routes/console/organization-[organization]/billing/paymentMethods.svelte b/src/routes/console/organization-[organization]/billing/paymentMethods.svelte index cdcaae7be..362acf7bf 100644 --- a/src/routes/console/organization-[organization]/billing/paymentMethods.svelte +++ b/src/routes/console/organization-[organization]/billing/paymentMethods.svelte @@ -133,7 +133,7 @@
- + @@ -167,7 +167,7 @@
- +