From a6c07f5cab46167c0d4b4da665fcb95707bd8ed2 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 16 Oct 2024 13:35:59 +0200 Subject: [PATCH 01/24] Hide invoices with status 'pending' --- .../billing/paymentHistory.svelte | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte index d8594d2baa..45224f80cd 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte @@ -45,12 +45,22 @@ onMount(request); async function request() { - invoiceList = await sdk.forConsole.billing.listInvoices($page.params.organization, [ - Query.limit(limit), - Query.offset(offset), - Query.notEqual('from', $organization.billingCurrentInvoiceDate), - Query.orderDesc('$createdAt') - ]); + const unfilteredInvoiceList = await sdk.forConsole.billing.listInvoices( + $page.params.organization, + [ + Query.limit(limit), + Query.offset(offset), + Query.notEqual('from', $organization.billingCurrentInvoiceDate), + Query.orderDesc('$createdAt') + ] + ); + const filteredInvoices = unfilteredInvoiceList.invoices.filter( + (invoice) => invoice.status !== 'pending' + ); + invoiceList = { + invoices: filteredInvoices, + total: filteredInvoices.length + }; } function retryPayment(invoice: Invoice) { From 8f181b899c2d466ca1ba8c8f35f7cf421ae88958 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 17 Oct 2024 14:52:31 +0200 Subject: [PATCH 02/24] Stay on billing page --- .../organization-[organization]/change-plan/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index 6b70855165..bc5d3574be 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -149,7 +149,7 @@ }) }); - await goto(`${base}/organization-${$organization.$id}`); + await goto(`${base}/organization-${$organization.$id}/billing`); addNotification({ type: 'success', isHtml: true, From c6c3016e324334e618e9ab10d261ae54efae4b6f Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 17 Oct 2024 15:06:02 +0200 Subject: [PATCH 03/24] Stay on billing page --- .../organization-[organization]/change-plan/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index bc5d3574be..24c61601f6 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -217,7 +217,7 @@ await invalidate(Dependencies.ACCOUNT); await invalidate(Dependencies.ORGANIZATION); - await goto(`${base}/organization-${org.$id}`); + await goto(`${base}/organization-${org.$id}/billing`); addNotification({ type: 'success', message: 'Your organization has been upgraded' From 592c64c96bf33da0d2c083fee0c9a3c99316d09f Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 17 Oct 2024 15:06:18 +0200 Subject: [PATCH 04/24] Correct deletion message --- .../settings/deleteOrganizationModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte index 3ca94e1956..78c9e29463 100644 --- a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -55,7 +55,7 @@ showDelete = false; addNotification({ type: 'success', - message: `${$organization.name} has been flagged for deletion` + message: `${$organization.name} has been deleted` }); } catch (e) { error = e.message; From c1d7953c2c13abb189aa0ba90e857dda734d02d1 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 17 Oct 2024 16:57:57 +0200 Subject: [PATCH 05/24] Differentiate text on organization tier --- .../settings/deleteOrganizationModal.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte index 78c9e29463..9eaec30b85 100644 --- a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -6,7 +6,7 @@ import { members, organization, organizationList } from '$lib/stores/organization'; import { goto, invalidate } from '$app/navigation'; import { base } from '$app/paths'; - import { Dependencies } from '$lib/constants'; + import { BillingPlan, Dependencies } from '$lib/constants'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { projects } from '../store'; import { toLocaleDate } from '$lib/helpers/date'; @@ -55,7 +55,10 @@ showDelete = false; addNotification({ type: 'success', - message: `${$organization.name} has been deleted` + message: + $organization.billingPlan === BillingPlan.FREE + ? `${$organization.name} has been deleted` + : `${$organization.name} has been flagged for deletion` }); } catch (e) { error = e.message; From 0d4cccf855b23c19e865b8000609c788b9df8773 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 17 Oct 2024 17:27:35 +0200 Subject: [PATCH 06/24] Use previous page --- .../organization-[organization]/change-plan/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index 24c61601f6..3682491c7f 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -149,7 +149,7 @@ }) }); - await goto(`${base}/organization-${$organization.$id}/billing`); + await goto(previousPage); addNotification({ type: 'success', isHtml: true, @@ -217,7 +217,7 @@ await invalidate(Dependencies.ACCOUNT); await invalidate(Dependencies.ORGANIZATION); - await goto(`${base}/organization-${org.$id}/billing`); + await goto(previousPage); addNotification({ type: 'success', message: 'Your organization has been upgraded' From ee1dc83391db9b868559f171ff467f2e0c957490 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Fri, 18 Oct 2024 10:09:15 +0200 Subject: [PATCH 07/24] Adjust filtering --- .../billing/paymentHistory.svelte | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte index 45224f80cd..211f5f4ebc 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte @@ -45,22 +45,13 @@ onMount(request); async function request() { - const unfilteredInvoiceList = await sdk.forConsole.billing.listInvoices( - $page.params.organization, - [ - Query.limit(limit), - Query.offset(offset), - Query.notEqual('from', $organization.billingCurrentInvoiceDate), - Query.orderDesc('$createdAt') - ] - ); - const filteredInvoices = unfilteredInvoiceList.invoices.filter( - (invoice) => invoice.status !== 'pending' - ); - invoiceList = { - invoices: filteredInvoices, - total: filteredInvoices.length - }; + invoiceList = await sdk.forConsole.billing.listInvoices($page.params.organization, [ + Query.limit(limit), + Query.offset(offset), + Query.notEqual('from', $organization.billingCurrentInvoiceDate), + Query.notEqual('status', 'pending'), + Query.orderDesc('$createdAt') + ]); } function retryPayment(invoice: Invoice) { From 2d63ff03bb8f0779bf3a5e25179906fa4eeb10fe Mon Sep 17 00:00:00 2001 From: ernstmul Date: Fri, 18 Oct 2024 14:32:56 +0200 Subject: [PATCH 08/24] More test retries --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 0d8c2beda1..e990c35586 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,7 +4,7 @@ const config: PlaywrightTestConfig = { timeout: 120000, reportSlowTests: null, reporter: [['html', { open: 'never' }]], - retries: 1, + retries: 3, use: { baseURL: 'http://localhost:4173/console/', trace: 'on-first-retry' From 9b9c20dd1b946586b21719f094f75b90cdb85e11 Mon Sep 17 00:00:00 2001 From: Zayd Krunz <70227235+ShrootBuck@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:38:08 -0700 Subject: [PATCH 09/24] Fix broken link for mock phone numbers --- .../project-[project]/auth/security/updateMockNumbers.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte index 9db581f0b3..10e230e573 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte @@ -87,7 +87,7 @@ Generate fictional numbers to simulate phone verification when testing demo accounts for submitting your application to the App Store or Google Play. From 950b6d882e5c5ab7c4a5fd53476cf325f3d672f3 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 14:00:33 +0100 Subject: [PATCH 10/24] Update test --- tests/e2e/journeys/upgrade-free-tier.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/journeys/upgrade-free-tier.spec.ts b/tests/e2e/journeys/upgrade-free-tier.spec.ts index 0b7d114b64..0243798207 100644 --- a/tests/e2e/journeys/upgrade-free-tier.spec.ts +++ b/tests/e2e/journeys/upgrade-free-tier.spec.ts @@ -14,6 +14,6 @@ test('upgrade - free tier', async ({ page }) => { await enterCreditCard(page); // skip members await page.getByRole('button', { name: 'change plan' }).click(); - await page.waitForURL('./organization-**'); + await page.waitForURL('**/console/project-*/overview/platforms'); }); }); From a470430016b969a1cb4f9244f242ddce349c2f87 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 15:29:31 +0100 Subject: [PATCH 11/24] Better fallback values --- .../billing/planSummary.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte index b6da73ee87..a6e8322c7c 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -38,7 +38,7 @@ availableCredit = creditList.available; }); - $: extraUsage = (currentInvoice?.amount ?? 0) - (currentPlan?.price ?? 0); + $: extraUsage = currentInvoice && currentPlan ? currentInvoice.amount - currentPlan.price : 0; $: extraAddons = currentInvoice?.usage?.length ?? 0; $: isTrial = new Date($organization?.billingStartDate).getTime() - today.getTime() > 0 && @@ -64,7 +64,11 @@ {tierToPlan($organization?.billingPlan)?.name} plan
- {isTrial ? formatCurrency(0) : formatCurrency(currentPlan?.price)} + {isTrial + ? formatCurrency(0) + : currentPlan + ? formatCurrency(currentPlan?.price) + : ''}
{#if $organization?.billingPlan !== BillingPlan.FREE && extraUsage > 0} From 6539ad3190466108e3d7c14e230e5e9dbfbea728 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 16:03:02 +0100 Subject: [PATCH 12/24] Fix prefs nullpointer --- src/lib/helpers/notifications.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index e5f9ae1435..7084d0f0bd 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -14,12 +14,12 @@ export type NotificationCoolOffOptions = { exponentialBackoffFactor?: number; }; -const userPreferences = () => get(user).prefs; +const userPreferences = () => get(user)?.prefs; const notificationPrefs = (): Record => { const prefs = userPreferences(); // for some reason, the prefs become array as default or on all clear. let's reset. - return Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; + return prefs && Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; }; function updateNotificationPrefs(parsedPrefs: Record) { From ffd09ff89ff415cf569fbaf180391e9a28aa3e05 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 17:42:19 +0100 Subject: [PATCH 13/24] Fix inputid regex --- src/lib/elements/forms/inputId.svelte | 2 +- .../(console)/organization-[organization]/wizard/step1.svelte | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elements/forms/inputId.svelte b/src/lib/elements/forms/inputId.svelte index 8a10aeb2b3..b0128ef37b 100644 --- a/src/lib/elements/forms/inputId.svelte +++ b/src/lib/elements/forms/inputId.svelte @@ -8,7 +8,7 @@ let element: HTMLInputElement; let icon = 'info'; - const pattern = String.raw`^[a-zA-Z0-9][a-zA-Z0-9\-]*$`; + const pattern = String.raw`^[a-zA-Z0-9][a-zA-Z0-9._\-]*$`; onMount(() => { if (element && autofocus) { diff --git a/src/routes/(console)/organization-[organization]/wizard/step1.svelte b/src/routes/(console)/organization-[organization]/wizard/step1.svelte index adc596fe2d..acbf986518 100644 --- a/src/routes/(console)/organization-[organization]/wizard/step1.svelte +++ b/src/routes/(console)/organization-[organization]/wizard/step1.svelte @@ -33,6 +33,7 @@ {/if} From 1fe9bc06a4f24b45335b9dbea8d8bbbe0b656363 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 17:42:52 +0100 Subject: [PATCH 14/24] Inner modal full width --- .../databases/database-[database]/createCollection.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte index 5e7fe25e1a..88d7e040d9 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte @@ -70,7 +70,12 @@ {:else} - + {/if} From 40c0a5ae2ab97f0710e1e2a1b4cc5b2ef53dd11e Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 28 Oct 2024 17:53:53 +0100 Subject: [PATCH 15/24] Fix tests --- tests/unit/elements/inputId.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/elements/inputId.test.ts b/tests/unit/elements/inputId.test.ts index c004e80ffd..0a6666cd34 100644 --- a/tests/unit/elements/inputId.test.ts +++ b/tests/unit/elements/inputId.test.ts @@ -3,9 +3,9 @@ import { render } from '@testing-library/svelte'; import userEvent from '@testing-library/user-event'; import { InputId } from '../../../src/lib/elements/forms'; -const validStrings = ['valid-string', 'validstring', 'validstring123', 'valid-']; +const validStrings = ['valid_string', 'valid-string', 'valid.string', 'validstring123', 'valid_']; -const invalidStrings = ['-invalid', '.invalid', 'in_valid', 'in.va.lid']; +const invalidStrings = ['-invalid', '.invalid', '_invalid']; test('shows id input', () => { const { getByPlaceholderText } = render(InputId); From 97e4224a4a2abfc5aa121aa38fb978892df46f73 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 29 Oct 2024 16:12:15 +1300 Subject: [PATCH 16/24] FIx migrations query --- .../(console)/project-[project]/settings/migrations/+page.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/settings/migrations/+page.ts b/src/routes/(console)/project-[project]/settings/migrations/+page.ts index 94efc38ab5..755ebadfb5 100644 --- a/src/routes/(console)/project-[project]/settings/migrations/+page.ts +++ b/src/routes/(console)/project-[project]/settings/migrations/+page.ts @@ -9,7 +9,10 @@ export async function load({ depends }) { const { migrations } = await sdk.forProject.migrations.list([ // hides backups/restorations from migrations page. Query.equal('source', ['Appwrite', 'Firebase', 'NHost', 'Supabase']), - Query.equal('destination', ['Appwrite', 'Firebase', 'NHost', 'Supabase']) + Query.or([ + Query.equal('destination', ['Appwrite', 'Firebase', 'NHost', 'Supabase']), + Query.isNull('destination'), + ]), ]); return { From c527db1cb05c1e9aa1d4bdfdc254d8ae082b5043 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 29 Oct 2024 16:48:48 +1300 Subject: [PATCH 17/24] Lint --- .../(console)/project-[project]/settings/migrations/+page.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[project]/settings/migrations/+page.ts b/src/routes/(console)/project-[project]/settings/migrations/+page.ts index 755ebadfb5..6ce0dd60b5 100644 --- a/src/routes/(console)/project-[project]/settings/migrations/+page.ts +++ b/src/routes/(console)/project-[project]/settings/migrations/+page.ts @@ -11,8 +11,8 @@ export async function load({ depends }) { Query.equal('source', ['Appwrite', 'Firebase', 'NHost', 'Supabase']), Query.or([ Query.equal('destination', ['Appwrite', 'Firebase', 'NHost', 'Supabase']), - Query.isNull('destination'), - ]), + Query.isNull('destination') + ]) ]); return { From 87d1a07ad44d641e205089079effda482899e9f8 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Tue, 29 Oct 2024 07:55:54 +0100 Subject: [PATCH 18/24] Update helper text --- src/lib/elements/forms/inputId.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elements/forms/inputId.svelte b/src/lib/elements/forms/inputId.svelte index b0128ef37b..6100210b47 100644 --- a/src/lib/elements/forms/inputId.svelte +++ b/src/lib/elements/forms/inputId.svelte @@ -55,6 +55,6 @@ class="u-cross-center u-line-height-1 u-color-text-gray" aria-hidden="true" /> - Allowed characters: alphanumeric and non-leading hyphen + Allowed characters: alphanumeric, non-leading hyphen, underscore, period From 2c4560396dcd10e9a7c78725de214a386a05b13b Mon Sep 17 00:00:00 2001 From: ernstmul Date: Tue, 29 Oct 2024 10:15:26 +0100 Subject: [PATCH 19/24] Make size show as required when adding string attribute --- .../collection-[collection]/attributes/string.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 3e6e2f97ce..a14302350e 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 @@ -72,7 +72,12 @@ $: handleDefaultState($required || $array); - + {#if data.size >= 50} Date: Tue, 29 Oct 2024 10:39:22 +0100 Subject: [PATCH 20/24] Add more clear overview over expected future payments --- .../billing/estimatedTotalBox.svelte | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/components/billing/estimatedTotalBox.svelte b/src/lib/components/billing/estimatedTotalBox.svelte index 4945598e1d..b7ab73af7d 100644 --- a/src/lib/components/billing/estimatedTotalBox.svelte +++ b/src/lib/components/billing/estimatedTotalBox.svelte @@ -52,17 +52,28 @@ {/if}
-

Estimated total

+

+ Upcoming charge
Due on {!currentPlan.trialDays + ? toLocaleDate(billingPayDate.toString()) + : toLocaleDate(trialEndDate.toString())} +

{formatCurrency(estimatedTotal)}

- Your payment method will be charged this amount plus usage fees every 30 days {!currentPlan.trialDays - ? `starting ${toLocaleDate(billingPayDate.toString())}` - : ` after your trial period ends on ${toLocaleDate(trialEndDate.toString())}`}. + You'll pay {formatCurrency(estimatedTotal)} now, with our first + billing cycle starting on + {!currentPlan.trialDays + ? toLocaleDate(billingPayDate.toString()) + : toLocaleDate(trialEndDate.toString())}. Once your credits run out, you'll be charged + {formatCurrency(currentPlan.price)} plus usage fees every 30 days.

+ Date: Tue, 29 Oct 2024 10:56:26 +0100 Subject: [PATCH 21/24] Add more clear overview over expected future payments --- src/lib/helpers/notifications.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index 7084d0f0bd..bd67a8ac56 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -18,8 +18,13 @@ const userPreferences = () => get(user)?.prefs; const notificationPrefs = (): Record => { const prefs = userPreferences(); + + if (prefs === null) { + return {}; + } + // for some reason, the prefs become array as default or on all clear. let's reset. - return prefs && Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; + return Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; }; function updateNotificationPrefs(parsedPrefs: Record) { From ce3f35fcbf1d130c3a0fc06740b5b75c4d552112 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 30 Oct 2024 09:39:30 +0100 Subject: [PATCH 22/24] Increase limit (default is 25) for shown number of collections in sidepanel --- .../database-[database]/collection-[collection]/+layout.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/+layout.ts b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/+layout.ts index 80cb127c2f..5f71632d25 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/+layout.ts +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/+layout.ts @@ -12,7 +12,10 @@ export const load: LayoutLoad = async ({ params, depends }) => { try { const [collection, allCollections] = await Promise.all([ sdk.forProject.databases.getCollection(params.database, params.collection), - sdk.forProject.databases.listCollections(params.database, [Query.orderDesc('')]) + sdk.forProject.databases.listCollections(params.database, [ + Query.orderDesc(''), + Query.limit(100) + ]) ]); return { From 710d3dce2905efdc1ffdf4423b2acee97e524e7c Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 31 Oct 2024 11:09:24 +0100 Subject: [PATCH 23/24] Remove notification --- .../createAttribute.svelte | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte index 83ffb505b8..d7b30ce2bc 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte @@ -42,37 +42,6 @@ type: 'success', message: `Attribute ${key ?? data?.key} has been created` }); - if ($option.type === 'relationship') { - let counter = localStorage.getItem('createRelationshipCounter'); - - if (counter) { - const parsedCounter = parseInt(counter); - if (parsedCounter === 2) { - addNotification({ - type: 'info', - icon: 'question-mark-circle', - message: `How is your experience with our new "Relationships" feature? We'd love to hear your feedback!`, - timeout: 15000, - buttons: [ - { - name: 'Give Feedback', - method: () => { - feedback.toggleFeedback(); - dismissAllNotifications(); - } - } - ] - }); - } else if (parsedCounter < 2) { - localStorage.setItem( - 'createRelationshipCounter', - (parsedCounter + 1).toString() - ); - } - } else { - localStorage.setItem('createRelationshipCounter', '1'); - } - } showCreate = false; trackEvent(Submit.AttributeCreate); } catch (e) { From 9d42d817aac19b1821b7d4fd1ff1ae9d7df737eb Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 31 Oct 2024 11:10:25 +0100 Subject: [PATCH 24/24] cleanup --- .../collection-[collection]/createAttribute.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte index d7b30ce2bc..84a530fc99 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/createAttribute.svelte @@ -5,12 +5,11 @@ import { goto, invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { page } from '$app/stores'; - import { addNotification, dismissAllNotifications } from '$lib/stores/notifications'; + import { addNotification } from '$lib/stores/notifications'; import { base } from '$app/paths'; import type { Attributes } from './store'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { preferences } from '$lib/stores/preferences'; - import { feedback } from '$lib/stores/feedback'; export let showCreate = false; export let selectedOption: Option['name'] = null;