From 339cd3ed892351d3d3dfbdb69a5fa58111c14f31 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sun, 14 Jul 2024 19:42:49 +0530 Subject: [PATCH 01/53] fix: stuck uploader progress. --- src/lib/stores/uploader.ts | 8 +++++++- .../storage/bucket-[bucket]/create-file/create.svelte | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/stores/uploader.ts b/src/lib/stores/uploader.ts index 867dc3856..c90d52891 100644 --- a/src/lib/stores/uploader.ts +++ b/src/lib/stores/uploader.ts @@ -79,7 +79,7 @@ const createUploader = () => { (p) => { newFile.$id = p.$id; newFile.progress = p.progress; - newFile.completed = p.progress === 100 ? true : false; + newFile.completed = p.progress === 100; updateFile(p.$id, newFile); } ); @@ -94,6 +94,12 @@ const createUploader = () => { return n; }); }, + removeAtIndex: (itemIndex: number) => { + update((n) => { + n.files = n.files.filter((_file, index) => index !== itemIndex); + return n; + }); + }, removeFile: async (file: Models.File) => { if (file.chunksTotal === file.chunksUploaded) { return update((n) => { diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte index 66315f0dd..57f75e9ea 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte @@ -29,7 +29,7 @@ async function create() { try { - uploader.uploadFile( + const uploadPromise = uploader.uploadFile( bucketId, $createFile.id ?? ID.unique(), $createFile.files[0], @@ -47,7 +47,11 @@ trackEvent(Submit.FileCreate, { customId: !!$createFile.id }); + + await uploadPromise; } catch (e) { + uploader.removeAtIndex(0); + addNotification({ type: 'error', message: e.message From 0bb957059396e162c85146e42fc518dacf89c9fe Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 17 Jul 2024 11:45:18 +0530 Subject: [PATCH 02/53] update: use file id to remove from queue. --- src/lib/stores/uploader.ts | 6 ------ .../storage/bucket-[bucket]/create-file/create.svelte | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/stores/uploader.ts b/src/lib/stores/uploader.ts index c90d52891..28bd29a81 100644 --- a/src/lib/stores/uploader.ts +++ b/src/lib/stores/uploader.ts @@ -94,12 +94,6 @@ const createUploader = () => { return n; }); }, - removeAtIndex: (itemIndex: number) => { - update((n) => { - n.files = n.files.filter((_file, index) => index !== itemIndex); - return n; - }); - }, removeFile: async (file: Models.File) => { if (file.chunksTotal === file.chunksUploaded) { return update((n) => { diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte index 57f75e9ea..a82bf186e 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/create.svelte @@ -28,10 +28,12 @@ }); async function create() { + const fileId = $createFile.id ?? ID.unique(); + try { const uploadPromise = uploader.uploadFile( bucketId, - $createFile.id ?? ID.unique(), + fileId, $createFile.files[0], $createFile.permissions ); @@ -50,7 +52,7 @@ await uploadPromise; } catch (e) { - uploader.removeAtIndex(0); + uploader.removeFromQueue(fileId); addNotification({ type: 'error', From cefd26c098a5748a86855489d24ec9e625ffbf35 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Fri, 19 Jul 2024 14:42:11 +0530 Subject: [PATCH 03/53] fix: documents selection state not reset on navigation. --- .../collection-[collection]/table.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte index 8b8c7832d..4ebc07e0a 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -1,5 +1,5 @@ diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte index 6fc0798a6..a16869433 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte @@ -21,14 +21,16 @@ export async function updateDatetime( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateDatetimeAttribute( databaseId, collectionId, data.key, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index a59723d75..2ecde6f3a 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -16,6 +16,7 @@ const databaseId = $page.params.database; const collectionId = $page.params.collection; + let originalKey = ''; let error: string; let currentAttr: Attributes; @@ -31,8 +32,11 @@ }) as Option; async function submit() { + console.log(originalKey); + try { - await option.update(databaseId, collectionId, selectedAttribute); + await option.update(databaseId, collectionId, selectedAttribute, originalKey); + originalKey = selectedAttribute.key; await invalidate(Dependencies.COLLECTION); if (!$page.url.pathname.includes('attributes')) { await goto( @@ -76,8 +80,7 @@ label="Attribute Key" placeholder="Enter Key" bind:value={selectedAttribute.key} - autofocus - readonly /> + autofocus /> {/if} {#if option} + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateEmailAttribute( databaseId, collectionId, data.key, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte index ceaf4488e..2bb0da7de 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte @@ -22,7 +22,8 @@ export async function updateEnum( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateEnumAttribute( databaseId, @@ -30,7 +31,8 @@ data.key, data.elements, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte index d92ce2d69..f23957e80 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte @@ -23,7 +23,8 @@ export async function updateFloat( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateFloatAttribute( databaseId, @@ -32,7 +33,8 @@ data.required, data.min, data.max, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte index bc4231dc4..4642ba40e 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte @@ -23,7 +23,8 @@ export async function updateInteger( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateIntegerAttribute( databaseId, @@ -32,7 +33,8 @@ data.required, data.min, data.max, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte index 3af418ebf..1b5d07994 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte @@ -20,14 +20,16 @@ export async function updateIp( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateIpAttribute( databaseId, collectionId, data.key, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index 59150c3a7..341eb5a8e 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -29,7 +29,8 @@ export async function updateRelationship( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { if (!isValueOfStringEnum(RelationMutate, data.onDelete)) { throw new Error(`Invalid on delete: ${data.onDelete}`); @@ -38,7 +39,8 @@ databaseId, collectionId, data.key, - data.onDelete + data.onDelete, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts index 3c3106fc1..f84794c37 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts @@ -32,7 +32,7 @@ export type Option = { key: string, data: Partial ) => Promise; - update: (databaseId: string, collectionId: string, data: Partial) => Promise; + update: (databaseId: string, collectionId: string, data: Partial, originalKey: string) => Promise; format?: 'email' | 'ip' | 'url' | 'enum'; icon: string; }; diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte index 37d1e2e2f..a08cbbbaa 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte @@ -21,14 +21,16 @@ export async function updateString( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateStringAttribute( databaseId, collectionId, - data.key, + originalKey, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/url.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/url.svelte index e2c6755c6..aae66f37d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/url.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/url.svelte @@ -21,14 +21,16 @@ export async function updateUrl( databaseId: string, collectionId: string, - data: Partial + data: Partial, + originalKey?: string ) { await sdk.forProject.databases.updateUrlAttribute( databaseId, collectionId, data.key, data.required, - data.default + data.default, + data.key !== originalKey ? data.key : undefined, ); } diff --git a/src/routes/console/project-[project]/databases/database-[database]/string.svelte b/src/routes/console/project-[project]/databases/database-[database]/string.svelte new file mode 100644 index 000000000..a08cbbbaa --- /dev/null +++ b/src/routes/console/project-[project]/databases/database-[database]/string.svelte @@ -0,0 +1,106 @@ + + + + + +{#if data.size >= 50} + +{:else} + +{/if} + + Indicate whether this is a required attribute + + + Indicate whether this attribute should act as an array, with the default value set as an empty + array. + From 3f13565cf59d13a8f9aad83c7bb0a9cc526ef7fd Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 22 Aug 2024 17:17:25 +0900 Subject: [PATCH 10/53] Get relationship attribute renaming working --- .../collection-[collection]/attributes/edit.svelte | 4 +--- .../collection-[collection]/attributes/relationship.svelte | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index 2ecde6f3a..4dbf5da9d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -32,11 +32,8 @@ }) as Option; async function submit() { - console.log(originalKey); - try { await option.update(databaseId, collectionId, selectedAttribute, originalKey); - originalKey = selectedAttribute.key; await invalidate(Dependencies.COLLECTION); if (!$page.url.pathname.includes('attributes')) { await goto( @@ -57,6 +54,7 @@ $: if (showEdit) { currentAttr ??= { ...selectedAttribute }; + originalKey = currentAttr.key; error = null; } diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index 341eb5a8e..337252c1d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -35,10 +35,11 @@ if (!isValueOfStringEnum(RelationMutate, data.onDelete)) { throw new Error(`Invalid on delete: ${data.onDelete}`); } + await sdk.forProject.databases.updateRelationshipAttribute( databaseId, collectionId, - data.key, + originalKey, data.onDelete, data.key !== originalKey ? data.key : undefined, ); @@ -189,7 +190,6 @@ placeholder="Enter Key" bind:value={data.key} autofocus - readonly={editing} required />
From 6746f1047c8854746dc3275fd1fb825f1bc8eb96 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 26 Aug 2024 15:19:35 +0200 Subject: [PATCH 11/53] fix: downgrade feedback mandatory --- .../change-plan/+page.svelte | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index 0e394e4a4..705b96abe 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -149,9 +149,9 @@ type: 'success', isHtml: true, message: ` - ${$organization.name} has been changed to ${ - tierToPlan(billingPlan).name - } plan.` + ${$organization.name} will change to ${ + tierToPlan(billingPlan).name + } plan at the end of the current billing cycle.` }); trackEvent(Submit.OrganizationDowngrade, { @@ -162,7 +162,7 @@ type: 'error', message: e.message }); - trackError(e, isUpgrade ? Submit.OrganizationUpgrade : Submit.OrganizationDowngrade); + trackError(e, Submit.OrganizationDowngrade); } } @@ -213,22 +213,12 @@ await invalidate(Dependencies.ORGANIZATION); await goto(`${base}/organization-${org.$id}`); - if (isUpgrade) { - addNotification({ - type: 'success', - message: 'Your organization has been upgraded' - }); - } else { - addNotification({ - type: 'success', - isHtml: true, - message: ` - ${$organization.name} will change to ${ - tierToPlan(billingPlan).name - } plan at the end of the current billing cycle.` - }); - } - trackEvent(isUpgrade ? Submit.OrganizationUpgrade : Submit.OrganizationDowngrade, { + addNotification({ + type: 'success', + message: 'Your organization has been upgraded' + }); + + trackEvent(Submit.OrganizationUpgrade, { plan: tierToPlan(billingPlan)?.name }); } catch (e) { @@ -236,7 +226,7 @@ type: 'error', message: e.message }); - trackError(e, isUpgrade ? Submit.OrganizationUpgrade : Submit.OrganizationDowngrade); + trackError(e, Submit.OrganizationUpgrade); } } @@ -324,6 +314,7 @@ bind:value={feedbackDowngradeReason} /> From 73aa179f679abc954c34624c5f28546bf685af72 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 27 Aug 2024 13:33:02 +0530 Subject: [PATCH 12/53] ran: `pnpm format`. --- src/lib/helpers/load.ts | 2 +- src/lib/layout/unauthenticated.svelte | 2 +- src/lib/stores/feedback.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/helpers/load.ts b/src/lib/helpers/load.ts index 05e043ddc..21e2f1ee6 100644 --- a/src/lib/helpers/load.ts +++ b/src/lib/helpers/load.ts @@ -21,7 +21,7 @@ export enum View { export function getView(url: URL, route: Page['route'], fallback: View): View { return (url.searchParams.get('view') ?? preferences.get(route).view) === View.Grid ? View.Grid - : View.Table ?? fallback; + : (View.Table ?? fallback); } export function getColumns(route: Page['route'], fallback: string[]): string[] { diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index 17745126f..5d11772eb 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -16,7 +16,7 @@ export let coupon: Coupon = null; $: selectedCampaign = campaigns.get(coupon?.campaign ?? campaign); - $: variation = (coupon?.campaign ?? campaign ? selectedCampaign?.template : 'default') as + $: variation = ((coupon?.campaign ?? campaign) ? selectedCampaign?.template : 'default') as | 'default' | CampaignData['template']; diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 7f9b6b200..7eaefca2d 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -71,8 +71,8 @@ export const feedbackData = createFeedbackDataStore(); function createFeedbackStore() { const { subscribe, update } = writable({ - elapsed: browser ? parseInt(localStorage.getItem('feedbackElapsed')) ?? 0 : 0, - visualized: browser ? parseInt(localStorage.getItem('feedbackVisualized')) ?? 0 : 0, + elapsed: browser ? (parseInt(localStorage.getItem('feedbackElapsed')) ?? 0) : 0, + visualized: browser ? (parseInt(localStorage.getItem('feedbackVisualized')) ?? 0) : 0, notification: false, type: 'general', show: false From 5c7248453c7332538cf975a92f8a4d2fcb248bc1 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 27 Aug 2024 12:54:11 +0200 Subject: [PATCH 13/53] fix: qa fixes --- src/lib/components/billing/planComparisonBox.svelte | 4 ++-- src/lib/elements/table/tableScroll.svelte | 6 +++++- src/lib/stores/roles.ts | 0 src/routes/(console)/onboarding/+page.svelte | 8 ++++---- .../functions/function-[function]/+page.svelte | 2 +- .../function-[function]/deploymentDomains.svelte | 13 ++++++++----- 6 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 src/lib/stores/roles.ts diff --git a/src/lib/components/billing/planComparisonBox.svelte b/src/lib/components/billing/planComparisonBox.svelte index e297d8e75..da10311f0 100644 --- a/src/lib/components/billing/planComparisonBox.svelte +++ b/src/lib/components/billing/planComparisonBox.svelte @@ -23,11 +23,11 @@ on:click={() => (selectedTab = BillingPlan.PRO)}> {tierPro.name} - (selectedTab = BillingPlan.SCALE)}> {tierScale.name} - + -->
diff --git a/src/lib/elements/table/tableScroll.svelte b/src/lib/elements/table/tableScroll.svelte index ee9953238..91a7c8018 100644 --- a/src/lib/elements/table/tableScroll.svelte +++ b/src/lib/elements/table/tableScroll.svelte @@ -45,7 +45,11 @@ }; -
+
(isOverflowing = v)}>
- - + + {domain.rules[0].domain} - - -
+ {#if hasAttributes && hasValidAttributes} + {#if data.documents.total} +
- - {:else if $hasPageQueries} - -
-
- Sorry, we couldn't find any documents. -

There are no documents that match your filters.

+ + {:else if $hasPageQueries} + +
+
+ Sorry, we couldn't find any documents. +

There are no documents that match your filters.

+
+
+ +
-
+ + {:else} + + {/if} + {:else} + (showCreateDropdown = true)}> +
+ Create an attribute to get started. +

+ Need a hand? Learn more in our documentation. +

+
+
+ + -
+
-
- {:else} - + {/if} - {:else} - (showCreateDropdown = true)}> -
- Create an attribute to get started. -

- Need a hand? Learn more in our documentation. -

-
-
- - - - -
-
- {/if} - + +{/key} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte index 248ce7735..8b8c7832d 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -1,5 +1,5 @@ @@ -73,9 +74,7 @@ id="size" label="Size" placeholder="Enter size" - bind:value={data.size} - required={!editing} - readonly={editing} /> + bind:value={data.size} /> {#if data.size >= 50} Date: Mon, 2 Sep 2024 16:32:27 +0200 Subject: [PATCH 30/53] fix: auth templates on mobile screens --- .../project-[project]/auth/templates/emailTemplate.svelte | 2 +- .../project-[project]/auth/templates/localeOptions.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[project]/auth/templates/emailTemplate.svelte b/src/routes/(console)/project-[project]/auth/templates/emailTemplate.svelte index 87d47ea93..14b4f44ba 100644 --- a/src/routes/(console)/project-[project]/auth/templates/emailTemplate.svelte +++ b/src/routes/(console)/project-[project]/auth/templates/emailTemplate.svelte @@ -130,7 +130,7 @@ >here.

-
+
diff --git a/src/routes/(console)/project-[project]/auth/templates/localeOptions.svelte b/src/routes/(console)/project-[project]/auth/templates/localeOptions.svelte index 8afd35725..084e6ec9c 100644 --- a/src/routes/(console)/project-[project]/auth/templates/localeOptions.svelte +++ b/src/routes/(console)/project-[project]/auth/templates/localeOptions.svelte @@ -18,7 +18,7 @@ -
+
Template language
From eb0412cd3cbf1ac4b5392bfd1d8497efe44c7436 Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:27:13 -0700 Subject: [PATCH 31/53] fix: update org invite url to include the /console base Since we've moved the console to a separate container, the path must start with /console so that the request (including the query string params) are passed to the console container. --- .../(console)/organization-[organization]/createMember.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/createMember.svelte b/src/routes/(console)/organization-[organization]/createMember.svelte index 6e0509539..ab7947ae7 100644 --- a/src/routes/(console)/organization-[organization]/createMember.svelte +++ b/src/routes/(console)/organization-[organization]/createMember.svelte @@ -1,4 +1,5 @@ diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte index a16869433..a2cd24a12 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/datetime.svelte @@ -30,7 +30,7 @@ data.key, data.required, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte index a67cd309a..d7a606fd5 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/email.svelte @@ -31,7 +31,7 @@ data.key, data.required, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte index 2bb0da7de..a8fce3f17 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/enum.svelte @@ -32,7 +32,7 @@ data.elements, data.required, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte index f23957e80..065ac2ecb 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/float.svelte @@ -34,7 +34,7 @@ data.min, data.max, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte index 4642ba40e..532a60222 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/integer.svelte @@ -34,7 +34,7 @@ data.min, data.max, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte index 1b5d07994..115deac83 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/ip.svelte @@ -29,7 +29,7 @@ data.key, data.required, data.default, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte index 337252c1d..173c35d5a 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/relationship.svelte @@ -41,7 +41,7 @@ collectionId, originalKey, data.onDelete, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts index f84794c37..05fa8b81c 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/store.ts @@ -32,7 +32,12 @@ export type Option = { key: string, data: Partial ) => Promise; - update: (databaseId: string, collectionId: string, data: Partial, originalKey: string) => Promise; + update: ( + databaseId: string, + collectionId: string, + data: Partial, + originalKey: string + ) => Promise; format?: 'email' | 'ip' | 'url' | 'enum'; icon: string; }; diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte index 16e3484f1..3e6e2f97c 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte @@ -31,7 +31,7 @@ data.required, data.default, data.size, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } @@ -72,11 +72,7 @@ $: handleDefaultState($required || $array); - + {#if data.size >= 50} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/string.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/string.svelte index d2d1f84b7..4b09b5384 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/string.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/string.svelte @@ -31,7 +31,7 @@ data.required, data.default, data.size, - data.key !== originalKey ? data.key : undefined, + data.key !== originalKey ? data.key : undefined ); } From 06509e23cc3d2aeed33160675f42bf0dc9048c7d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 6 Sep 2024 12:39:43 +0200 Subject: [PATCH 35/53] fix: edit attribute state --- .../collection-[collection]/attributes/edit.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte index f38616cc0..a42c7d890 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/attributes/edit.svelte @@ -56,6 +56,8 @@ currentAttr ??= { ...selectedAttribute }; originalKey = currentAttr.key; error = null; + } else { + currentAttr = null; } From 562b717db25c7a6084bdb587fb8fdacbc76965db Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 9 Sep 2024 19:16:48 +1200 Subject: [PATCH 36/53] Update SDK --- package-lock.json | 8 ++++---- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index f98ca048a..a91385e60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "@appwrite/console", "dependencies": { - "@appwrite.io/console": "1.1.0-rc.3", + "@appwrite.io/console": "1.1.0", "@appwrite.io/pink": "0.25.0", "@appwrite.io/pink-icons": "0.25.0", "@popperjs/core": "^2.11.8", @@ -149,9 +149,9 @@ "integrity": "sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==" }, "node_modules/@appwrite.io/console": { - "version": "1.1.0-rc.3", - "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-1.1.0-rc.3.tgz", - "integrity": "sha512-FGd3HVb2OVQ/n3NiF5aWPfgUmLg3hoF5xYwzhlHZGPFxJxyL92s6C06sTTg6CkqACZf4MHJJ68l6ivo2fmfhJA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-1.1.0.tgz", + "integrity": "sha512-jWg+NW9RJxh2pnE/14xwpXBcChiSLYBnG3Jkr5RnMJ1mH7BYmbAuLTyxFn3UFy5llB7jVq8pHNYGqA93ZoEMsQ==" }, "node_modules/@appwrite.io/pink": { "version": "0.25.0", diff --git a/package.json b/package.json index bffbefa0c..a1e12394c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "1.1.0-rc.3", + "@appwrite.io/console": "1.1.0", "@appwrite.io/pink": "0.25.0", "@appwrite.io/pink-icons": "0.25.0", "@popperjs/core": "^2.11.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ddec2676f..64f87bea5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@appwrite.io/console': - specifier: 1.1.0-rc.3 - version: 1.1.0-rc.3 + specifier: 1.1.0 + version: 1.1.0 '@appwrite.io/pink': specifier: 0.25.0 version: 0.25.0 @@ -193,8 +193,8 @@ packages: '@analytics/type-utils@0.6.2': resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==} - '@appwrite.io/console@1.1.0-rc.3': - resolution: {integrity: sha512-FGd3HVb2OVQ/n3NiF5aWPfgUmLg3hoF5xYwzhlHZGPFxJxyL92s6C06sTTg6CkqACZf4MHJJ68l6ivo2fmfhJA==} + '@appwrite.io/console@1.1.0': + resolution: {integrity: sha512-jWg+NW9RJxh2pnE/14xwpXBcChiSLYBnG3Jkr5RnMJ1mH7BYmbAuLTyxFn3UFy5llB7jVq8pHNYGqA93ZoEMsQ==} '@appwrite.io/pink-icons@0.25.0': resolution: {integrity: sha512-0O3i2oEuh5mWvjO80i+X6rbzrWLJ1m5wmv2/M3a1p2PyBJsFxN8xQMTEmTn3Wl/D26SsM7SpzbdW6gmfgoVU9Q==} @@ -3697,7 +3697,7 @@ snapshots: '@analytics/type-utils@0.6.2': {} - '@appwrite.io/console@1.1.0-rc.3': {} + '@appwrite.io/console@1.1.0': {} '@appwrite.io/pink-icons@0.25.0': {} From f2787f2e368542d1f722105476350101b05c7334 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 9 Sep 2024 14:37:09 +0200 Subject: [PATCH 37/53] fix: catch exception when chalege fails and re-enable button --- src/lib/components/mfaChallengeFormList.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index 96e77daf2..4cb2f1062 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -24,6 +24,7 @@ import { Dependencies } from '$lib/constants'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { AuthenticationFactor, type Models } from '@appwrite.io/console'; + import { addNotification } from '$lib/stores/notifications'; export let factors: Models.MfaFactors & { recoveryCode: boolean }; /** If true, the form will be submitted automatically when the code is entered. */ @@ -40,8 +41,16 @@ async function createChallenge(factor: AuthenticationFactor) { disabled = true; challengeType = factor; - challenge = await sdk.forConsole.account.createMfaChallenge(factor); - disabled = false; + try { + challenge = await sdk.forConsole.account.createMfaChallenge(factor); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } finally { + disabled = false; + } } onMount(async () => { From ffd60d22063816ebcb174ebe7fd3879e654a6048 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 9 Sep 2024 14:52:39 +0200 Subject: [PATCH 38/53] fix: function execute wizard --- .../function-[function]/executions/execute-function/+page.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte index f17a6fbc0..739b1b182 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte @@ -113,7 +113,6 @@ `${base}/project-${$page.params.project}/functions/function-${func.$id}/executions` ); invalidate(Dependencies.EXECUTIONS); - close(); addNotification({ type: 'success', message: `Function has been executed` From 964fc29360f47b817c0ff3fbad5265af2d835efe Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 9 Sep 2024 16:13:48 +0200 Subject: [PATCH 39/53] fix: show error when the file is over the max size --- src/lib/elements/forms/inputFile.svelte | 19 +++++++++++++++++++ .../bucket-[bucket]/create-file/step1.svelte | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/lib/elements/forms/inputFile.svelte b/src/lib/elements/forms/inputFile.svelte index 76c3babcc..ccff0a7a0 100644 --- a/src/lib/elements/forms/inputFile.svelte +++ b/src/lib/elements/forms/inputFile.svelte @@ -37,6 +37,13 @@ } return true; } + + function isFileOverSize(file: File) { + if (maxSize && file.size > maxSize) { + return true; + } + return false; + } function dropHandler(ev: DragEvent) { ev.dataTransfer.dropEffect = 'move'; hovering = false; @@ -47,6 +54,10 @@ error = 'Invalid file extension'; return; } + if (isFileOverSize(ev.dataTransfer.items[i].getAsFile())) { + error = 'File size exceeds the limit'; + return; + } if (ev.dataTransfer.items[i].kind === 'file') { const dataTransfer = new DataTransfer(); dataTransfer.items.add(ev.dataTransfer.items[i].getAsFile()); @@ -86,12 +97,20 @@ const fileExtension = file.name.split('.').pop(); return isFileExtensionAllowed(fileExtension); }); + const isOverSize = maxSize + ? Array.from(target.files).some((file) => isFileOverSize(file)) + : false; if (!isValidFiles) { error = 'Invalid file extension'; target.value = ''; return; } + if (isOverSize) { + error = 'File size exceeds the limit'; + target.value = ''; + return; + } setFiles(target.files); }; diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/create-file/step1.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/create-file/step1.svelte index baac12a12..ff4c02639 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/create-file/step1.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/create-file/step1.svelte @@ -47,7 +47,9 @@ required bind:files={$createFile.files} allowedFileExtensions={$bucket.allowedFileExtensions} - maxSize={$bucket.maximumFileSize} /> + maxSize={isCloud + ? $bucket.maximumFileSize + : ($bucket.maximumFileSize ?? sizeToBytes(service, 'MB', 1000))} />
{#if !showCustomId} From e12db74b9c24d592eecf3b0e17d7c071482e38f3 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 9 Sep 2024 16:20:39 +0200 Subject: [PATCH 40/53] fix: payment expired notification, add sessionstorage check --- src/lib/stores/billing.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index aba284f21..1ff549fbc 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -306,6 +306,8 @@ export async function paymentExpired(org: Organization) { org.paymentMethodId ); if (!payment?.expiryYear) return; + const sessionStorageNotification = sessionStorage.getItem('expiredPaymentNotification'); + if (sessionStorageNotification === 'true') return; const year = new Date().getFullYear(); const month = new Date().getMonth(); const expiredMessage = `The default payment method for ${org.name} has expired`; @@ -343,6 +345,7 @@ export async function paymentExpired(org: Organization) { ] }); } + sessionStorage.setItem('expiredPaymentNotification', 'true'); } export function checkForMarkedForDeletion(org: Organization) { From f75e43df81caad3e41de787fb1608292eccbdf87 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 9 Sep 2024 16:21:41 +0200 Subject: [PATCH 41/53] Update src/lib/elements/forms/inputFile.svelte Co-authored-by: Torsten Dittmann --- src/lib/elements/forms/inputFile.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/elements/forms/inputFile.svelte b/src/lib/elements/forms/inputFile.svelte index ccff0a7a0..21bb1e283 100644 --- a/src/lib/elements/forms/inputFile.svelte +++ b/src/lib/elements/forms/inputFile.svelte @@ -97,9 +97,7 @@ const fileExtension = file.name.split('.').pop(); return isFileExtensionAllowed(fileExtension); }); - const isOverSize = maxSize - ? Array.from(target.files).some((file) => isFileOverSize(file)) - : false; + const isOverSize = maxSize && Array.from(target.files).some((file) => isFileOverSize(file)); if (!isValidFiles) { error = 'Invalid file extension'; From 83e76df39c24d753c6769cc122e29e147b775477 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 9 Sep 2024 17:04:55 +0200 Subject: [PATCH 42/53] fix: command panel create org --- src/routes/(console)/+layout.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte index d0bb0ba18..41d1ea326 100644 --- a/src/routes/(console)/+layout.svelte +++ b/src/routes/(console)/+layout.svelte @@ -83,7 +83,7 @@ { label: 'Create new organization', callback: () => { - newOrgModal.set(true); + isCloud ? goto(`${base}/create-organization`) : newOrgModal.set(true); }, keys: ['c', 'o'], group: 'organizations' From c2c7866a41d86fa15ac479a6904c2af2a033edb9 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Mon, 9 Sep 2024 17:23:27 +0200 Subject: [PATCH 43/53] fix: update how pending uploads look 1. Remove Update button because it doesn't do anything 2. Fix spacing in the first column because the file name was unaligned --- .../storage/bucket-[bucket]/+page.svelte | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/+page.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/+page.svelte index c383c6135..e9a7fc50b 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/+page.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/+page.svelte @@ -147,14 +147,14 @@ Type Size Created - + {#each data.files.files as file, index} {#if file.chunksTotal / file.chunksUploaded !== 1} -
+
{file.name} @@ -172,12 +172,6 @@
-
From e063bfb5ad1e2ac61843a53d18e2f3db85796321 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 10 Sep 2024 12:56:57 +0200 Subject: [PATCH 53/53] chore: remove comment --- src/lib/layout/footer.svelte | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/layout/footer.svelte b/src/lib/layout/footer.svelte index 52c018963..89e130d74 100644 --- a/src/lib/layout/footer.svelte +++ b/src/lib/layout/footer.svelte @@ -48,16 +48,6 @@ Cookies - {/if}