From 2c9ff6547f6f3f72bc66095d9d2d6e6d2931eaff Mon Sep 17 00:00:00 2001 From: Darshan Date: Fri, 17 Jan 2025 13:09:43 +0530 Subject: [PATCH 01/20] hotfix: add a default value until I can test multi-region instance. --- src/lib/stores/preferences.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/stores/preferences.ts b/src/lib/stores/preferences.ts index a5350a555..fcd1f79e0 100644 --- a/src/lib/stores/preferences.ts +++ b/src/lib/stores/preferences.ts @@ -62,7 +62,7 @@ function createPreferences() { getCustomCollectionColumns: (collectionId: string): Preferences['columns'] => { return ( preferences[sdk.forProject.client.config.project]?.collections?.[collectionId] ?? - null + [] ); }, setLimit: (limit: Preferences['limit']) => From b416032b0d83a233c07fe3bc090d36062dda7b14 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sat, 18 Jan 2025 18:42:59 +0530 Subject: [PATCH 02/20] ran: formatter. --- CONTRIBUTING.md | 46 +++++++++++++++++------------------ README.md | 4 +-- src/lib/stores/preferences.ts | 3 +-- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fcb73389..3d78e77a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,9 +108,9 @@ pnpm run lint Diagnostic tool that checks for the following: -- Unused CSS -- Svelte A11y hints -- TypeScript compiler errors +- Unused CSS +- Svelte A11y hints +- TypeScript compiler errors ```bash pnpm run check @@ -130,11 +130,11 @@ doc-548-submit-a-pull-request-section-to-contribution-guide When `TYPE` can be: -- **feat** - is a new feature -- **doc** - documentation only changes -- **cicd** - changes related to CI/CD system -- **fix** - a bug fix -- **refactor** - code change that neither fixes a bug nor adds a feature +- **feat** - is a new feature +- **doc** - documentation only changes +- **cicd** - changes related to CI/CD system +- **fix** - a bug fix +- **refactor** - code change that neither fixes a bug nor adds a feature **All PRs must include a commit message with a description of the changes made!** @@ -175,12 +175,12 @@ $ git push origin [name_of_your_new_branch] Before committing always make sure to run all available tools to improve the codebase: -- Formatter - - `pnpm run format` -- Tests - - `pnpm test` -- Diagnostics - - `pnpm run check` +- Formatter + - `pnpm run format` +- Tests + - `pnpm test` +- Diagnostics + - `pnpm run check` ### Performance @@ -188,9 +188,9 @@ Page load times are a key consideration for users of all browsers and device typ There are some general things we can do in front-end development: -- Minimize HTTP requests -- Minimize blocking – content should be readable before client-side processing -- Lazy load "supplementary" content, especially images +- Minimize HTTP requests +- Minimize blocking – content should be readable before client-side processing +- Lazy load "supplementary" content, especially images ### Don't Repeat Yourself (DRY) @@ -202,12 +202,12 @@ If you stick to this principle, you will ensure that you will only ever need to Separate _structure_ from _presentation_ from _behavior_ to aid maintainability and understanding. -- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component -- Avoid writing inline CSS or Javascript in HTML -- Avoid writing CSS or HTML in Javascript -- Don't choose HTML elements to imply style -- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions -- Try to use templates when defining markup in Javascript +- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component +- Avoid writing inline CSS or Javascript in HTML +- Avoid writing CSS or HTML in Javascript +- Don't choose HTML elements to imply style +- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions +- Try to use templates when defining markup in Javascript ### Write code to be read diff --git a/README.md b/README.md index e37369791..9e113f121 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Appwrite Console has been built with the following frameworks: -- [Svelte](https://svelte.dev/) -- [Svelte Kit](https://kit.svelte.dev/) +- [Svelte](https://svelte.dev/) +- [Svelte Kit](https://kit.svelte.dev/) ## Developer Experience diff --git a/src/lib/stores/preferences.ts b/src/lib/stores/preferences.ts index fcd1f79e0..d75cfcad1 100644 --- a/src/lib/stores/preferences.ts +++ b/src/lib/stores/preferences.ts @@ -61,8 +61,7 @@ function createPreferences() { getCustomCollectionColumns: (collectionId: string): Preferences['columns'] => { return ( - preferences[sdk.forProject.client.config.project]?.collections?.[collectionId] ?? - [] + preferences[sdk.forProject.client.config.project]?.collections?.[collectionId] ?? [] ); }, setLimit: (limit: Preferences['limit']) => From 1ff9cdbb23a3485947f878e32d13dc394e84dff8 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sat, 18 Jan 2025 19:55:41 +0530 Subject: [PATCH 03/20] ci: empty commit From e879bbd07664bcb889ed19859df21f7fb1058385 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 19 Jan 2025 12:01:37 +0530 Subject: [PATCH 04/20] fix: broken flags due to invalid or non-existing project IDs. --- src/lib/elements/flag.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elements/flag.svelte b/src/lib/elements/flag.svelte index d1dfe2849..560df6a5c 100644 --- a/src/lib/elements/flag.svelte +++ b/src/lib/elements/flag.svelte @@ -12,7 +12,7 @@ export function getFlag(country: string, width: number, height: number, quality: number) { if (!isValueOfStringEnum(Flag, country)) return ''; - let flag = sdk.forProject.avatars + let flag = sdk.forConsole.avatars .getFlag(country, width * 2, height * 2, quality) ?.toString(); flag?.includes('&project=') From 78b61da2f1133e9d59709cf321f0fb22dbb37d0d Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 19 Jan 2025 12:12:10 +0530 Subject: [PATCH 05/20] run: formatter again! --- CONTRIBUTING.md | 46 +++++++++++++++++++++++----------------------- README.md | 4 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d78e77a4..8fcb73389 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,9 +108,9 @@ pnpm run lint Diagnostic tool that checks for the following: -- Unused CSS -- Svelte A11y hints -- TypeScript compiler errors +- Unused CSS +- Svelte A11y hints +- TypeScript compiler errors ```bash pnpm run check @@ -130,11 +130,11 @@ doc-548-submit-a-pull-request-section-to-contribution-guide When `TYPE` can be: -- **feat** - is a new feature -- **doc** - documentation only changes -- **cicd** - changes related to CI/CD system -- **fix** - a bug fix -- **refactor** - code change that neither fixes a bug nor adds a feature +- **feat** - is a new feature +- **doc** - documentation only changes +- **cicd** - changes related to CI/CD system +- **fix** - a bug fix +- **refactor** - code change that neither fixes a bug nor adds a feature **All PRs must include a commit message with a description of the changes made!** @@ -175,12 +175,12 @@ $ git push origin [name_of_your_new_branch] Before committing always make sure to run all available tools to improve the codebase: -- Formatter - - `pnpm run format` -- Tests - - `pnpm test` -- Diagnostics - - `pnpm run check` +- Formatter + - `pnpm run format` +- Tests + - `pnpm test` +- Diagnostics + - `pnpm run check` ### Performance @@ -188,9 +188,9 @@ Page load times are a key consideration for users of all browsers and device typ There are some general things we can do in front-end development: -- Minimize HTTP requests -- Minimize blocking – content should be readable before client-side processing -- Lazy load "supplementary" content, especially images +- Minimize HTTP requests +- Minimize blocking – content should be readable before client-side processing +- Lazy load "supplementary" content, especially images ### Don't Repeat Yourself (DRY) @@ -202,12 +202,12 @@ If you stick to this principle, you will ensure that you will only ever need to Separate _structure_ from _presentation_ from _behavior_ to aid maintainability and understanding. -- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component -- Avoid writing inline CSS or Javascript in HTML -- Avoid writing CSS or HTML in Javascript -- Don't choose HTML elements to imply style -- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions -- Try to use templates when defining markup in Javascript +- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component +- Avoid writing inline CSS or Javascript in HTML +- Avoid writing CSS or HTML in Javascript +- Don't choose HTML elements to imply style +- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions +- Try to use templates when defining markup in Javascript ### Write code to be read diff --git a/README.md b/README.md index 9e113f121..e37369791 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Appwrite Console has been built with the following frameworks: -- [Svelte](https://svelte.dev/) -- [Svelte Kit](https://kit.svelte.dev/) +- [Svelte](https://svelte.dev/) +- [Svelte Kit](https://kit.svelte.dev/) ## Developer Experience From 860cc5e41ccb50bd62f8b54815b2f5eb36c2c63b Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 20 Jan 2025 13:53:27 +0100 Subject: [PATCH 06/20] Show only the size limit for the bucket --- .../bucket-[bucket]/create-file/step1.svelte | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) 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 bdce4159b..90a49a46e 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 @@ -1,43 +1,37 @@ File Upload a file to add it to your bucket. - {#if isCloud} - {@const size = humanFileSize(sizeToBytes(service, 'MB', 1000))} - {@const plan = tierToPlan($organization?.billingPlan)} + {#if isCloud && fileError === 'File size exceeds the limit'} + {@const size = humanFileSize($bucket.maximumFileSize ?? sizeToBytes(service, 'MB', 1000))}

- The {plan.name} plan has a maximum upload file size limit of {Math.floor( - parseInt(size.value) - )}{size.unit}. - {#if $organization?.billingPlan === BillingPlan.FREE} - Upgrade to allow files of a larger size. - {/if} + The maximum file upload size for this bucket is {parseInt(size.value)}{size.unit}. + Edit this number in your + bucket settings.

- - {#if $organization?.billingPlan === BillingPlan.FREE} -
- -
- {/if} -
{/if} @@ -47,6 +41,7 @@ required bind:files={$createFile.files} allowedFileExtensions={$bucket.allowedFileExtensions} + bind:error={fileError} maxSize={isCloud ? $bucket.maximumFileSize : ($bucket.maximumFileSize ?? sizeToBytes(service, 'MB', 1000))} /> From 6e249cdd72979b51f8a749a27206da3e61eace86 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 20 Jan 2025 15:51:07 +0100 Subject: [PATCH 07/20] Set limit to 100 --- .../collection-[collection]/attributes/relationship.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 1af15500b..600c3fbb8 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 @@ -92,7 +92,9 @@ ); return collections; } else { - const collections = await sdk.forProject.databases.listCollections(databaseId); + const collections = await sdk.forProject.databases.listCollections(databaseId, [ + Query.limit(100) + ]); return collections; } } From d898d916a27050289bbc8443528ded2a654b80b7 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Tue, 21 Jan 2025 10:14:40 +0100 Subject: [PATCH 08/20] new copy --- .../storage/bucket-[bucket]/create-file/step1.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 90a49a46e..f0e5a595f 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 @@ -26,7 +26,7 @@

The maximum file upload size for this bucket is {parseInt(size.value)}{size.unit}. - Edit this number in your + You can adjust it in your  bucket settings Date: Tue, 21 Jan 2025 10:18:00 +0100 Subject: [PATCH 09/20] new copy --- .../storage/bucket-[bucket]/create-file/step1.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f0e5a595f..43454a461 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 @@ -26,7 +26,7 @@

The maximum file upload size for this bucket is {parseInt(size.value)}{size.unit}. - You can adjust it in your  + You can adjust it in your bucket settings Date: Wed, 22 Jan 2025 14:12:00 +0900 Subject: [PATCH 10/20] Update Console SDK Version --- package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 8a2056de8..428927dc5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "e2e:ui": "playwright test tests/e2e --ui" }, "dependencies": { - "@appwrite.io/console": "1.4.6", + "@appwrite.io/console": "1.4.7", "@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 399c26707..a31a13a9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@appwrite.io/console': - specifier: 1.4.6 - version: 1.4.6 + specifier: 1.4.7 + version: 1.4.7 '@appwrite.io/pink': specifier: 0.25.0 version: 0.25.0 @@ -95,7 +95,7 @@ importers: version: 6.6.3 '@testing-library/svelte': specifier: ^5.2.4 - version: 5.2.4(svelte@4.2.19)(vite@5.4.11(@types/node@22.9.0)(sass@1.81.0))(vitest@1.6.0) + version: 5.2.4(svelte@4.2.19)(vite@5.4.11(@types/node@22.9.0)(sass@1.81.0))(vitest@1.6.0(@types/node@22.9.0)(@vitest/ui@1.6.0)(jsdom@22.1.0)(sass@1.81.0)) '@testing-library/user-event': specifier: ^14.5.2 version: 14.5.2(@testing-library/dom@10.4.0) @@ -199,8 +199,8 @@ packages: '@analytics/type-utils@0.6.2': resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==} - '@appwrite.io/console@1.4.6': - resolution: {integrity: sha512-oGA5gkecpy9E/fKJkaGn26JP9mgknc2Vn8hS6xhRBhmUPg8Vqlz0vgPpx1EQbPB2C5HWIf4yToSicOH31XGx6Q==} + '@appwrite.io/console@1.4.7': + resolution: {integrity: sha512-5zx+c5nWRm/UJNxgtOi4vj1pYW+wusfnOX2hqEGDLLuNZRc1rViYRefNuezosp5SPtjClCIYn9TGuFlz/XLwhw==} '@appwrite.io/pink-icons@0.25.0': resolution: {integrity: sha512-0O3i2oEuh5mWvjO80i+X6rbzrWLJ1m5wmv2/M3a1p2PyBJsFxN8xQMTEmTn3Wl/D26SsM7SpzbdW6gmfgoVU9Q==} @@ -3834,7 +3834,7 @@ snapshots: '@analytics/type-utils@0.6.2': {} - '@appwrite.io/console@1.4.6': {} + '@appwrite.io/console@1.4.7': {} '@appwrite.io/pink-icons@0.25.0': {} @@ -5075,7 +5075,7 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/svelte@5.2.4(svelte@4.2.19)(vite@5.4.11(@types/node@22.9.0)(sass@1.81.0))(vitest@1.6.0)': + '@testing-library/svelte@5.2.4(svelte@4.2.19)(vite@5.4.11(@types/node@22.9.0)(sass@1.81.0))(vitest@1.6.0(@types/node@22.9.0)(@vitest/ui@1.6.0)(jsdom@22.1.0)(sass@1.81.0))': dependencies: '@testing-library/dom': 10.4.0 svelte: 4.2.19 From 19e52351d45823fdb662d2cd52e801c4435c110e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 22 Jan 2025 17:36:04 +0900 Subject: [PATCH 11/20] Fix github secrets --- .github/workflows/publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index efb347fd2..66fe72d42 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,8 +17,8 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 @@ -54,8 +54,8 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 @@ -90,8 +90,8 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 From 403744e9bbf72bfb2721ec9944498bfce57088c7 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 22 Jan 2025 17:39:21 +0900 Subject: [PATCH 12/20] Use vars for username instead of secret --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 66fe72d42..ab33a8f37 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta @@ -54,7 +54,7 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta @@ -90,7 +90,7 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta From 5a1e391752c70b0048787e4266be83cd41251cb0 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 22 Jan 2025 15:30:09 +0100 Subject: [PATCH 13/20] chore: enable scale plan --- .../billing/planComparisonBox.svelte | 6 +-- .../components/billing/planSelection.svelte | 46 ++++++++----------- src/routes/(console)/onboarding/+page.svelte | 8 ++-- 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/lib/components/billing/planComparisonBox.svelte b/src/lib/components/billing/planComparisonBox.svelte index c48dabfc3..e297d8e75 100644 --- a/src/lib/components/billing/planComparisonBox.svelte +++ b/src/lib/components/billing/planComparisonBox.svelte @@ -1,7 +1,7 @@ -{#if $organization?.billingPlan === BillingPlan.FREE && invoiceList.total > 0} - - Payment history + + Payment history -

- Transaction history for this organization. Download invoices for more details about your - payments. -

- - {#if invoiceList.total > 0} - - - Due Date - Status - Amount Due - - - - {#each invoiceList?.invoices as invoice, i} - {@const status = invoice.status} - - - {toLocaleDate(invoice.dueAt)} - - - {#if invoice?.lastError} - - (showFailedError = true)} - button> - {status === 'requires_authentication' - ? 'failed' - : status} - - -
  • - The scheduled payment has failed. - - . -
  • -
    -
    - {:else} +

    + Transaction history for this organization. Download invoices for more details about your + payments. +

    + + {#if invoiceList.total > 0} + + + Due Date + Status + Amount Due + + + + {#each invoiceList?.invoices as invoice, i} + {@const status = invoice.status} + + + {toLocaleDate(invoice.dueAt)} + + + {#if invoice?.lastError} + + warning={status === 'pending'} + on:click={() => (showFailedError = true)} + button> {status === 'requires_authentication' ? 'failed' : status} - {/if} - - - {formatCurrency(invoice.grossAmount)} - - - - - - (showDropdown[i] = !showDropdown[i])} - event="view_invoice"> - View invoice - - { - showDropdown[i] = !showDropdown[i]; - }} - event="download_invoice"> - Download PDF - - {#if status === 'overdue' || status === 'failed'} - + The scheduled payment has failed. + + . + - - - {/each} - - -
    -

    Total results: {invoiceList?.total ?? 0}

    - -
    - {:else} - -

    - You have no payment history. After you receive your first invoice, you'll - see it here. -

    -
    - {/if} -
    - -{/if} + {:else} + + {status === 'requires_authentication' ? 'failed' : status} + + {/if} +
    + + {formatCurrency(invoice.grossAmount)} + + + + + + (showDropdown[i] = !showDropdown[i])} + event="view_invoice"> + View invoice + + { + showDropdown[i] = !showDropdown[i]; + }} + event="download_invoice"> + Download PDF + + {#if status === 'overdue' || status === 'failed'} + { + retryPayment(invoice); + showDropdown[i] = !showDropdown[i]; + trackEvent(`click_retry_payment`, { + from: 'button', + source: 'billing_invoice_menu' + }); + }}> + Retry payment + + {/if} + + + +
    + {/each} +
    +
    +
    +

    Total results: {invoiceList.total}

    + +
    + {:else if isLoadingInvoices} +
    +
    +
    + {:else} + +

    + You have no payment history. After you receive your first invoice, you'll see it + here. +

    +
    + {/if} + + + + From df94359c8eabbe460c1e8ad84650c29073ca4a9c Mon Sep 17 00:00:00 2001 From: Darshan Date: Fri, 24 Jan 2025 14:00:25 +0530 Subject: [PATCH 20/20] skip: loader for now. --- .../billing/paymentHistory.svelte | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte index dd3b9ecf7..baee0abfe 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte @@ -32,7 +32,7 @@ let showDropdown = []; let showFailedError = false; - let isLoadingInvoices = true; + // let isLoadingInvoices = true; let offset = 0; let invoiceList: InvoiceList = { @@ -46,7 +46,7 @@ onMount(request); async function request() { - isLoadingInvoices = true; + // isLoadingInvoices = true; invoiceList = await sdk.forConsole.billing.listInvoices($page.params.organization, [ Query.limit(limit), Query.offset(offset), @@ -54,7 +54,7 @@ Query.notEqual('status', 'pending'), Query.orderDesc('$createdAt') ]); - isLoadingInvoices = false; + // isLoadingInvoices = false; } function retryPayment(invoice: Invoice) { @@ -192,10 +192,10 @@

    Total results: {invoiceList.total}

    - {:else if isLoadingInvoices} -
    -
    -
    + + + + {:else}

    @@ -207,10 +207,10 @@ - + + + + + + +