From e511e023456fe77700e1ec79f70cdaee2812025e Mon Sep 17 00:00:00 2001 From: sourabpramanik Date: Sat, 6 Jan 2024 07:30:32 +0530 Subject: [PATCH 01/19] fix: added writable store to toggle execute function modal --- .../functions/function-[function]/+page.svelte | 7 +++++-- .../functions/function-[function]/execute.svelte | 11 +++-------- .../function-[function]/executions/+page.svelte | 7 +++++-- .../settings/executeFunction.svelte | 9 +++++++-- .../functions/function-[function]/store.ts | 4 +++- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 1462e407d..aa0c3c17b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -25,7 +25,7 @@ TableRow, TableScroll } from '$lib/elements/table'; - import { deploymentList, execute, func, proxyRuleList } from './store'; + import { deploymentList, execute, func, proxyRuleList, showFunctionExecute } from './store'; import { Container, ContainerHeader } from '$lib/layout'; import { app } from '$lib/stores/app'; import { calculateSize, humanFileSize } from '$lib/helpers/sizeConvertion'; @@ -151,7 +151,10 @@ diff --git a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte index 278a3ceab..4c10082c4 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte @@ -16,6 +16,7 @@ import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import type { Models } from '@appwrite.io/console'; + import { showFunctionExecute } from './store'; export let selectedFunction: Models.Function = null; @@ -34,13 +35,8 @@ { label: 'OPTIONS', value: 'OPTIONS' } ]; - let show = false; let submitting = false; - $: if (selectedFunction && !show) { - show = true; - } - const handleSubmit = async () => { submitting = true; try { @@ -80,7 +76,7 @@ function close() { selectedFunction = null; - show = false; + $showFunctionExecute = false; } afterNavigate(close); @@ -89,10 +85,9 @@

Manually execute your function. (selectedFunction = $func)}> + buttonMethod={() => { + selectedFunction = $func; + $showFunctionExecute = true; + }}>

The {tier} plan has limits

    diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte index 112bc2758..ba4d81ea3 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/executeFunction.svelte @@ -2,7 +2,7 @@ import { CardGrid, Heading, SvgIcon } from '$lib/components'; import { Button } from '$lib/elements/forms'; import { toLocaleDateTime } from '$lib/helpers/date'; - import { execute, func } from '../store'; + import { execute, func, showFunctionExecute } from '../store'; @@ -26,6 +26,11 @@ - + diff --git a/src/routes/console/project-[project]/functions/function-[function]/store.ts b/src/routes/console/project-[project]/functions/function-[function]/store.ts index c08ec380a..c5bd1d726 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/store.ts +++ b/src/routes/console/project-[project]/functions/function-[function]/store.ts @@ -12,6 +12,8 @@ export const proxyRuleList = derived( ($page) => $page.data.proxyRuleList as Models.ProxyRuleList ); export const execute: Writable = writable(); +export const showFunctionExecute: Writable = writable(false); + export const repositories: Writable<{ search: string; installationId: string; @@ -22,4 +24,4 @@ export const repositories: Writable<{ repositories: [] }); -export const showCreateDeployment: Writable = writable(false); +export const showCreateDeployment: Writable = writable(false); \ No newline at end of file From 7d9dfc4b956eccdb2236159f67466fc5dd79088f Mon Sep 17 00:00:00 2001 From: sourabpramanik Date: Tue, 9 Jan 2024 01:44:18 +0530 Subject: [PATCH 02/19] fix: formatting in store --- .../project-[project]/functions/function-[function]/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/store.ts b/src/routes/console/project-[project]/functions/function-[function]/store.ts index c5bd1d726..0bc01a1d4 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/store.ts +++ b/src/routes/console/project-[project]/functions/function-[function]/store.ts @@ -24,4 +24,4 @@ export const repositories: Writable<{ repositories: [] }); -export const showCreateDeployment: Writable = writable(false); \ No newline at end of file +export const showCreateDeployment: Writable = writable(false); From fb0023dfd9e30c774f6cb1e7f9ae39b79cb85603 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 13 Feb 2024 14:54:09 +0100 Subject: [PATCH 03/19] feat: downgrade feedback options --- .../confirmDetails.svelte | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte index e62c6af3f..6b38a5df7 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'; @@ -45,21 +45,58 @@ $: if (!$isUpgrade) { $changeOrganizationFinalAction = 'Confirm plan change'; } + + const options = [ + { + value: 'availableFeatures', + label: "The available features don't meet my needs" + }, + { + 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' + } + ]; {#if downgradeToStarter} 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. + From ed19d79b2ded0c0a4e178d4fe6869a5dfa8d48e9 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:16:12 +0530 Subject: [PATCH 04/19] Update execution placeholder body --- .../functions/function-[function]/execute.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte index 278a3ceab..bac8b0303 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte @@ -123,7 +123,7 @@ {:else} @@ -214,7 +214,7 @@ From 358bda940cae7ffa7b91656b78a3a253c44496bc Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:21:12 +0530 Subject: [PATCH 05/19] Format document --- .../functions/function-[function]/execute.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte index bac8b0303..9f9780139 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte @@ -121,11 +121,7 @@ - + {:else} From 059560b5f8bcb2d4eebf4761a86c1657c9965579 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:17:13 +0530 Subject: [PATCH 06/19] Dropdown for secure protocol for custom smtp --- .../settings/smtp/+page.svelte | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/routes/console/project-[project]/settings/smtp/+page.svelte b/src/routes/console/project-[project]/settings/smtp/+page.svelte index e61255b17..735a0c5f8 100644 --- a/src/routes/console/project-[project]/settings/smtp/+page.svelte +++ b/src/routes/console/project-[project]/settings/smtp/+page.svelte @@ -23,6 +23,7 @@ import { organization } from '$lib/stores/organization'; import { wizard } from '$lib/stores/wizard'; import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte'; + import InputSelect from '$lib/elements/forms/inputSelect.svelte'; let enabled = false; let senderName: string; @@ -32,7 +33,13 @@ let port: number; let username: string; let password: string; - let secure = false; + let secure: string; + + const options = [ + { value: 'tls', label: 'TLS' }, + { value: 'ssl', label: 'SSL' }, + { value: '', label: 'None' } + ]; onMount(() => { enabled = $project.smtpEnabled ?? false; @@ -43,7 +50,7 @@ port = $project.smtpPort; username = $project.smtpUsername; password = $project.smtpPassword; - secure = $project.smtpSecure === 'tls'; + secure = $project.smtpSecure === 'tls' ? 'tls' : $project.smtpSecure === 'ssl' ? 'ssl' : ''; }); async function updateSmtp() { @@ -68,7 +75,7 @@ port ? port : undefined, username ? username : undefined, password ? password : undefined, - secure ? 'tls' : undefined + secure ? secure : undefined ); invalidate(Dependencies.PROJECT); @@ -97,7 +104,7 @@ port: $project.smtpPort, username: $project.smtpUsername, password: $project.smtpPassword, - secure: $project.smtpSecure === 'tls' + secure: $project.smtpSecure } ); @@ -109,7 +116,7 @@ port = undefined; username = undefined; password = undefined; - secure = false; + secure = undefined; } @@ -189,10 +196,12 @@ label="Password" bind:value={password} placeholder="Enter password" /> - - - Enable if TLS is supported on your SMTP server. - + {/if} {/if} From 7c22c42476a35da5d38ccea492679f3370e016bb Mon Sep 17 00:00:00 2001 From: Elad Shechter Date: Mon, 26 Feb 2024 11:20:06 +0800 Subject: [PATCH 07/19] Attribute items - reduce spacing between rows from 8px to 4px --- .../document-[document]/attributeItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte index 857e64584..0f08c8134 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte @@ -58,7 +58,7 @@ {:else} -
      +
        {#each [...formValues[attribute.key].keys()] as index}
      • From 942c2f729cfda064913e12cf2632919dba5eff61 Mon Sep 17 00:00:00 2001 From: Elad Shechter Date: Mon, 26 Feb 2024 22:19:24 +0800 Subject: [PATCH 08/19] Attribute items - reduce gap between field from 16px to 8px - Chen QA --- .../document-[document]/attributeItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte index 0f08c8134..1be558a2d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeItem.svelte @@ -60,7 +60,7 @@ {:else}
          {#each [...formValues[attribute.key].keys()] as index} -
        • +
        • Date: Tue, 5 Mar 2024 10:41:12 +0530 Subject: [PATCH 09/19] chore: disable the create project button explicitly to prevent accidental clicks --- .../organization-[organization]/createProject.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/console/organization-[organization]/createProject.svelte b/src/routes/console/organization-[organization]/createProject.svelte index e0f80e179..2a2bb6096 100644 --- a/src/routes/console/organization-[organization]/createProject.svelte +++ b/src/routes/console/organization-[organization]/createProject.svelte @@ -18,9 +18,11 @@ let name: string; let showCustomId = false; let error: string; + let disabled: boolean = false; async function create() { try { + disabled = true; const project = await sdk.forConsole.projects.create( id ?? ID.unique(), name, @@ -36,10 +38,12 @@ type: 'success', message: `${name} has been created` }); + show = false; await goto(`/console/project-${project.$id}`); } catch (e) { error = e.message; trackError(e, Submit.ProjectCreate); + disabled = false; } } @@ -61,6 +65,6 @@ - + From a49b361f827dd46ce7b6772109726954d82b2064 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 5 Mar 2024 10:41:20 +0530 Subject: [PATCH 10/19] chore: clean up --- .../console/organization-[organization]/createProject.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/organization-[organization]/createProject.svelte b/src/routes/console/organization-[organization]/createProject.svelte index 2a2bb6096..e77051022 100644 --- a/src/routes/console/organization-[organization]/createProject.svelte +++ b/src/routes/console/organization-[organization]/createProject.svelte @@ -29,6 +29,7 @@ teamId, 'default' ); + show = false; dispatch('created', project); trackEvent(Submit.ProjectCreate, { customId: !!id, @@ -38,7 +39,6 @@ type: 'success', message: `${name} has been created` }); - show = false; await goto(`/console/project-${project.$id}`); } catch (e) { error = e.message; From becd5bd62b9fd990944e94cfcd396a18f6e6602e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 5 Mar 2024 18:38:24 +0000 Subject: [PATCH 11/19] chore: linter --- .../console/organization-[organization]/createProject.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/organization-[organization]/createProject.svelte b/src/routes/console/organization-[organization]/createProject.svelte index e77051022..ae0dca20c 100644 --- a/src/routes/console/organization-[organization]/createProject.svelte +++ b/src/routes/console/organization-[organization]/createProject.svelte @@ -65,6 +65,6 @@ - + From 3d1b6b72034d5df4b27a298570c5922118fefcad Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 6 Mar 2024 12:49:46 +0100 Subject: [PATCH 12/19] feat: add enpoint --- .../console/changeOrganizationTierCloud.svelte | 15 +++++++++++++++ .../confirmDetails.svelte | 5 ++--- .../wizard/cloudOrganizationChangeTier/store.ts | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/routes/console/changeOrganizationTierCloud.svelte b/src/routes/console/changeOrganizationTierCloud.svelte index aeb45a657..235296675 100644 --- a/src/routes/console/changeOrganizationTierCloud.svelte +++ b/src/routes/console/changeOrganizationTierCloud.svelte @@ -25,6 +25,7 @@ import { tierToPlan } from '$lib/stores/billing'; import { user } from '$lib/stores/user'; import { feedback } from '$lib/stores/feedback'; + import { VARS } from '$lib/system'; const dispatch = createEventDispatcher(); @@ -49,6 +50,20 @@ $user.email ); + await fetch(`${VARS.GROWTH_ENDPOINT}/billing`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + from: $organization.billingPlan, + to: $changeOrganizationTier.billingPlan, + email: $user.email, + message: $changeOrganizationTier.feedbackMessage, + reason: $changeOrganizationTier.feedbackDowngradeReason + }) + }); + addNotification({ type: 'success', isHtml: true, diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte index 6b38a5df7..b6c029801 100644 --- a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte +++ b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte @@ -28,7 +28,6 @@ status: null, credits: null }; - let comment: string = null; async function fetchCard() { try { @@ -92,12 +91,12 @@ placeholder="Select one" required {options} - bind:value={comment} /> + bind:value={$changeOrganizationTier.feedbackDowngradeReason} /> + bind:value={$changeOrganizationTier.feedbackMessage} /> {:else} diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts b/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts index f9f97b578..8554b5e61 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, From ef3dc0c009e03d1b4380c04c45b23e197d9ec79e Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 6 Mar 2024 13:55:40 +0100 Subject: [PATCH 13/19] fix: hide trial tag on starter orgs --- src/routes/console/account/organizations/+page.svelte | 2 +- src/routes/console/organization-[organization]/header.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/account/organizations/+page.svelte b/src/routes/console/account/organizations/+page.svelte index a82d76a58..0216b5621 100644 --- a/src/routes/console/account/organizations/+page.svelte +++ b/src/routes/console/account/organizations/+page.svelte @@ -82,7 +82,7 @@ FREE
          {/if} - {#if organization?.billingTrialStartDate && $daysLeftInTrial > 0} + {#if organization?.billingTrialStartDate && $daysLeftInTrial > 0 && organization.billingPlan !== BillingPlan.STARTER}
          FREE {/if} - {#if isCloud && $organization?.billingTrialStartDate && $daysLeftInTrial > 0} + {#if isCloud && $organization?.billingTrialStartDate && $daysLeftInTrial > 0 && $organization.billingPlan !== BillingPlan.STARTER}
          Date: Wed, 6 Mar 2024 14:40:05 +0100 Subject: [PATCH 14/19] feat: improve message sent --- .../changeOrganizationTierCloud.svelte | 19 ++++----- .../confirmDetails.svelte | 40 ++++--------------- .../cloudOrganizationChangeTier/store.ts | 31 ++++++++++++++ 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/src/routes/console/changeOrganizationTierCloud.svelte b/src/routes/console/changeOrganizationTierCloud.svelte index 235296675..fd0055b81 100644 --- a/src/routes/console/changeOrganizationTierCloud.svelte +++ b/src/routes/console/changeOrganizationTierCloud.svelte @@ -14,6 +14,7 @@ changeOrganizationFinalAction, changeOrganizationTier, changeTierSteps, + feedbackDowngradeOptions, isUpgrade } from './wizard/cloudOrganizationChangeTier/store'; import { goto, invalidate } from '$app/navigation'; @@ -24,7 +25,6 @@ import { wizard } from '$lib/stores/wizard'; import { tierToPlan } from '$lib/stores/billing'; import { user } from '$lib/stores/user'; - import { feedback } from '$lib/stores/feedback'; import { VARS } from '$lib/system'; const dispatch = createEventDispatcher(); @@ -43,24 +43,21 @@ $changeOrganizationTier.paymentMethodId, $changeOrganizationTier.billingAddressId ); - feedback.submitFeedback( - 'downgrade', - $changeOrganizationTier.feedbackMessage, - $user?.name ?? '', - $user.email - ); - await fetch(`${VARS.GROWTH_ENDPOINT}/billing`, { + await fetch(`${VARS.GROWTH_ENDPOINT}/feedback/billing`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - from: $organization.billingPlan, - to: $changeOrganizationTier.billingPlan, + from: tierToPlan($organization.billingPlan).name, + to: tierToPlan($changeOrganizationTier.billingPlan).name, email: $user.email, message: $changeOrganizationTier.feedbackMessage, - reason: $changeOrganizationTier.feedbackDowngradeReason + reason: feedbackDowngradeOptions.find( + (option) => + option.value === $changeOrganizationTier.feedbackDowngradeReason + )?.label }) }); diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte index b6c029801..a67c5086e 100644 --- a/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte +++ b/src/routes/console/wizard/cloudOrganizationChangeTier/confirmDetails.svelte @@ -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; @@ -44,37 +49,6 @@ $: if (!$isUpgrade) { $changeOrganizationFinalAction = 'Confirm plan change'; } - - const options = [ - { - value: 'availableFeatures', - label: "The available features don't meet my needs" - }, - { - 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' - } - ]; {#if downgradeToStarter} @@ -90,7 +64,7 @@ label="What made you decide to change your plan?*" placeholder="Select one" required - {options} + options={feedbackDowngradeOptions} bind:value={$changeOrganizationTier.feedbackDowngradeReason} /> Date: Wed, 6 Mar 2024 17:24:20 +0100 Subject: [PATCH 15/19] feat: add org id and user id to dowgrade feedback --- src/routes/console/changeOrganizationTierCloud.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/console/changeOrganizationTierCloud.svelte b/src/routes/console/changeOrganizationTierCloud.svelte index fd0055b81..2e2ad4544 100644 --- a/src/routes/console/changeOrganizationTierCloud.svelte +++ b/src/routes/console/changeOrganizationTierCloud.svelte @@ -53,11 +53,13 @@ from: tierToPlan($organization.billingPlan).name, to: tierToPlan($changeOrganizationTier.billingPlan).name, email: $user.email, - message: $changeOrganizationTier.feedbackMessage, reason: feedbackDowngradeOptions.find( (option) => option.value === $changeOrganizationTier.feedbackDowngradeReason - )?.label + )?.label, + orgId: $organization.$id, + userId: $user.$id, + message: $changeOrganizationTier?.feedbackMessage ?? '' }) }); From 8ca43dfa8e69802c6c96625a14c634d5fbc84e2d Mon Sep 17 00:00:00 2001 From: Arman Date: Sat, 9 Mar 2024 17:35:48 +0100 Subject: [PATCH 16/19] feat: add downgrade reason --- .../console/wizard/cloudOrganizationChangeTier/store.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts b/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts index 6cb6d12b0..846dbabcc 100644 --- a/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts +++ b/src/routes/console/wizard/cloudOrganizationChangeTier/store.ts @@ -39,6 +39,10 @@ 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' From 21e845bbe159364d7ed054e489130f85b7b83baa Mon Sep 17 00:00:00 2001 From: Arman Date: Sun, 10 Mar 2024 12:01:01 +0100 Subject: [PATCH 17/19] fix: providers modals not opening correctly, move modals to custom folder --- src/lib/stores/oauth-providers.ts | 18 +++++++++--------- .../auth/{ => (providers)}/appleOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/auth0OAuth.svelte | 5 +++-- .../{ => (providers)}/authentikOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/gitlabOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/googleOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/mainOAuth.svelte | 5 +++-- .../{ => (providers)}/microsoftOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/oidcOAuth.svelte | 5 +++-- .../auth/{ => (providers)}/oktaOAuth.svelte | 5 +++-- .../auth/settings/+page.svelte | 10 ++++++++-- 11 files changed, 44 insertions(+), 29 deletions(-) rename src/routes/console/project-[project]/auth/{ => (providers)}/appleOAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/auth0OAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/authentikOAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/gitlabOAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/googleOAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/mainOAuth.svelte (94%) rename src/routes/console/project-[project]/auth/{ => (providers)}/microsoftOAuth.svelte (95%) rename src/routes/console/project-[project]/auth/{ => (providers)}/oidcOAuth.svelte (96%) rename src/routes/console/project-[project]/auth/{ => (providers)}/oktaOAuth.svelte (95%) diff --git a/src/lib/stores/oauth-providers.ts b/src/lib/stores/oauth-providers.ts index c5752e8ac..09c5bf539 100644 --- a/src/lib/stores/oauth-providers.ts +++ b/src/lib/stores/oauth-providers.ts @@ -1,15 +1,15 @@ import type { Models } from '@appwrite.io/console'; import type { SvelteComponent } from 'svelte'; import { writable } from 'svelte/store'; -import Apple from '../../routes/console/project-[project]/auth/appleOAuth.svelte'; -import Auth0 from '../../routes/console/project-[project]/auth/auth0OAuth.svelte'; -import Authentik from '../../routes/console/project-[project]/auth/authentikOAuth.svelte'; -import GitLab from '../../routes/console/project-[project]/auth/gitlabOAuth.svelte'; -import Google from '../../routes/console/project-[project]/auth/googleOAuth.svelte'; -import Main from '../../routes/console/project-[project]/auth/mainOAuth.svelte'; -import Microsoft from '../../routes/console/project-[project]/auth/microsoftOAuth.svelte'; -import Oidc from '../../routes/console/project-[project]/auth/oidcOAuth.svelte'; -import Okta from '../../routes/console/project-[project]/auth/oktaOAuth.svelte'; +import Apple from '../../routes/console/project-[project]/auth/(providers)/appleOAuth.svelte'; +import Auth0 from '../../routes/console/project-[project]/auth/(providers)/auth0OAuth.svelte'; +import Authentik from '../../routes/console/project-[project]/auth/(providers)/authentikOAuth.svelte'; +import GitLab from '../../routes/console/project-[project]/auth/(providers)/gitlabOAuth.svelte'; +import Google from '../../routes/console/project-[project]/auth/(providers)/googleOAuth.svelte'; +import Main from '../../routes/console/project-[project]/auth/(providers)/mainOAuth.svelte'; +import Microsoft from '../../routes/console/project-[project]/auth/(providers)/microsoftOAuth.svelte'; +import Oidc from '../../routes/console/project-[project]/auth/(providers)/oidcOAuth.svelte'; +import Okta from '../../routes/console/project-[project]/auth/(providers)/oktaOAuth.svelte'; export type Provider = Models.Provider & { key: string; diff --git a/src/routes/console/project-[project]/auth/appleOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/appleOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/appleOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/appleOAuth.svelte index c14b2e5f7..982422b3f 100644 --- a/src/routes/console/project-[project]/auth/appleOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/appleOAuth.svelte @@ -5,11 +5,12 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; const projectId = $page.params.project; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -37,7 +38,7 @@ $: secret = keyID && teamID && p8 ? JSON.stringify({ keyID, teamID, p8 }) : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/auth0OAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/auth0OAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/auth0OAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/auth0OAuth.svelte index 51a25c834..0607180a5 100644 --- a/src/routes/console/project-[project]/auth/auth0OAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/auth0OAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -38,7 +39,7 @@ : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/authentikOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/authentikOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/authentikOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/authentikOAuth.svelte index 7df8877a5..f7d6dcd37 100644 --- a/src/routes/console/project-[project]/auth/authentikOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/authentikOAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -38,7 +39,7 @@ : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/gitlabOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/gitlabOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/gitlabOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/gitlabOAuth.svelte index e93d4ae8f..95f80675e 100644 --- a/src/routes/console/project-[project]/auth/gitlabOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/gitlabOAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -36,7 +37,7 @@ clientSecret && endpoint ? JSON.stringify({ clientSecret, endpoint }) : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/googleOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/googleOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/googleOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/googleOAuth.svelte index c06c99b6f..defd59038 100644 --- a/src/routes/console/project-[project]/auth/googleOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/googleOAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; const projectId = $page.params.project; @@ -34,7 +35,7 @@ }; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/mainOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/mainOAuth.svelte similarity index 94% rename from src/routes/console/project-[project]/auth/mainOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/mainOAuth.svelte index f8c11649e..184fcd00c 100644 --- a/src/routes/console/project-[project]/auth/mainOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/mainOAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; const projectId = $page.params.project; @@ -34,7 +35,7 @@ }; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/microsoftOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/microsoftOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/microsoftOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/microsoftOAuth.svelte index 266713e8e..7fd451af5 100644 --- a/src/routes/console/project-[project]/auth/microsoftOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/microsoftOAuth.svelte @@ -5,9 +5,10 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -37,7 +38,7 @@ clientSecret && tenantID ? JSON.stringify({ clientSecret, tenantID }) : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/oidcOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/oidcOAuth.svelte similarity index 96% rename from src/routes/console/project-[project]/auth/oidcOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/oidcOAuth.svelte index 719759e14..f00f07e30 100644 --- a/src/routes/console/project-[project]/auth/oidcOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/oidcOAuth.svelte @@ -5,11 +5,12 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; const projectId = $page.params.project; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -60,7 +61,7 @@ : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/oktaOAuth.svelte b/src/routes/console/project-[project]/auth/(providers)/oktaOAuth.svelte similarity index 95% rename from src/routes/console/project-[project]/auth/oktaOAuth.svelte rename to src/routes/console/project-[project]/auth/(providers)/oktaOAuth.svelte index b9e640f8d..6e23ca60c 100644 --- a/src/routes/console/project-[project]/auth/oktaOAuth.svelte +++ b/src/routes/console/project-[project]/auth/(providers)/oktaOAuth.svelte @@ -5,11 +5,12 @@ import type { Provider } from '$lib/stores/oauth-providers'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { updateOAuth } from './updateOAuth'; + import { updateOAuth } from '../updateOAuth'; const projectId = $page.params.project; export let provider: Provider; + export let show = false; let appId: string = null; let enabled: boolean = null; @@ -42,7 +43,7 @@ : provider.secret; - + {provider.name} OAuth2 Settings

          diff --git a/src/routes/console/project-[project]/auth/settings/+page.svelte b/src/routes/console/project-[project]/auth/settings/+page.svelte index fea2bad07..610733117 100644 --- a/src/routes/console/project-[project]/auth/settings/+page.svelte +++ b/src/routes/console/project-[project]/auth/settings/+page.svelte @@ -14,6 +14,7 @@ import { project } from '../../store'; const projectId = $page.params.project; + let showProvider = false; $: { authMethods.load($project); @@ -74,6 +75,7 @@ class="card u-flex u-flex-vertical u-cross-center u-width-full-line" on:click={() => { selectedProvider = provider; + showProvider = true; trackEvent(`click_select_provider`, { provider: provider.key.toLowerCase() }); @@ -99,9 +101,13 @@ {/if} -{#if selectedProvider} +{#if selectedProvider && showProvider} (selectedProvider = null)} /> + bind:show={showProvider} + on:close={() => { + selectedProvider = null; + showProvider = false; + }} /> {/if} From f3b069501567a1faee7b660eed55b27ae4e0356a Mon Sep 17 00:00:00 2001 From: Arman Date: Sun, 10 Mar 2024 15:44:38 +0100 Subject: [PATCH 18/19] fix: execute modal --- .../functions/function-[function]/+layout.svelte | 4 ++-- .../functions/function-[function]/execute.svelte | 13 +++++-------- .../function-[function]/executions/+page.svelte | 11 ++--------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte index d693ef604..8ae5bc6d4 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte @@ -5,7 +5,7 @@ import { Dependencies } from '$lib/constants'; import { invalidate, goto } from '$app/navigation'; import { registerCommands } from '$lib/commandCenter'; - import { execute, func, showCreateDeployment } from './store'; + import { func, showCreateDeployment } from './store'; import { project } from '../../store'; import type { Models } from '@appwrite.io/console'; import Execute from './execute.svelte'; @@ -147,4 +147,4 @@ - + diff --git a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte index 65fe792c5..070c0af0c 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/execute.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/execute.svelte @@ -15,10 +15,7 @@ import Label from '$lib/elements/forms/label.svelte'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; - import type { Models } from '@appwrite.io/console'; - import { showFunctionExecute } from './store'; - - export let selectedFunction: Models.Function = null; + import { showFunctionExecute, execute } from './store'; let path = '/'; let method = 'GET'; @@ -47,7 +44,7 @@ } await sdk.forProject.functions.createExecution( - selectedFunction.$id, + $execute.$id, body, true, path, @@ -56,7 +53,7 @@ ); if (!$page.url?.toString()?.includes('/executions')) { await goto( - `${base}/console/project-${$page.params.project}/functions/function-${selectedFunction.$id}/executions` + `${base}/console/project-${$page.params.project}/functions/function-${$execute.$id}/executions` ); } invalidate(Dependencies.EXECUTIONS); @@ -75,7 +72,7 @@ }; function close() { - selectedFunction = null; + $execute = null; $showFunctionExecute = false; } @@ -100,7 +97,7 @@

          - {#if selectedFunction?.version !== 'v3'} + {#if $execute?.version !== 'v3'} Customizable execution data now available for functions v3.0 diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 57ee9f4f3..0b14ea74f 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -19,19 +19,16 @@ import { log } from '$lib/stores/logs'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import { func, showFunctionExecute } from '../store'; + import { func, execute, showFunctionExecute } from '../store'; import type { Models } from '@appwrite.io/console'; import { organization } from '$lib/stores/organization'; import { getServiceLimit, showUsageRatesModal } from '$lib/stores/billing'; import { project } from '$routes/console/project-[project]/store'; import Create from '../create.svelte'; - import Execute from '../execute.svelte'; import { abbreviateNumber } from '$lib/helpers/numbers'; export let data; - let selectedFunction: Models.Function = null; - onMount(() => { return sdk.forConsole.client.subscribe('console', (response) => { if (response.events.includes('functions.*.executions.*')) { @@ -55,7 +52,7 @@ buttonText="Execute now" buttonEvent="execute_function" buttonMethod={() => { - selectedFunction = $func; + $execute = $func; $showFunctionExecute = true; }}> @@ -172,7 +169,3 @@ {/if} - - - - From 6f08a1cfbba31580a7af54823f9724b9c47e412f Mon Sep 17 00:00:00 2001 From: Arman Date: Sun, 10 Mar 2024 16:49:02 +0100 Subject: [PATCH 19/19] fix: zrender cloud --- vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 754fb4acc..d1d53436e 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: {