{#if $page.data?.header} From 98502a85c5cd8c90d0c8fab9b0674ded3c0bfe85 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 08:19:57 +0200 Subject: [PATCH 16/38] Update to route.id --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index be7c289f4..9544d0555 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.url.pathname.includes('project-'); + $: isProjectPage = $page.route.id.includes('project-'); function handleResize() { $isSidebarOpen = false; From 44701389bce673a93973d59766c723fb40636e06 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 08:26:14 +0200 Subject: [PATCH 17/38] Nullable --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index 9544d0555..012670367 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.route.id.includes('project-'); + $: isProjectPage = $page.route?.id.includes('project-'); function handleResize() { $isSidebarOpen = false; From 7646605d8987eb2f1757d9d2fd83e900d2d94e01 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 10:29:24 +0200 Subject: [PATCH 18/38] Nullable --- src/lib/layout/shell.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index 012670367..9c6b2ec1e 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -113,7 +113,7 @@ $: state = $isSidebarOpen ? 'open' : 'closed'; let isProjectPage; - $: isProjectPage = $page.route?.id.includes('project-'); + $: isProjectPage = $page.route?.id?.includes('project-'); function handleResize() { $isSidebarOpen = false; From 727a6f3ac9c5256f7d27eb035a8b495eb3e0bb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:13:02 +0200 Subject: [PATCH 19/38] Fix missing rules (redirect); remove double protocol; improve placeholders for dns records; fix www subdomain rules --- src/lib/helpers/tlds.ts | 1 - .../domain-[domain]/createRecordModal.svelte | 16 +++++++++++++++- .../domain-[domain]/updateRecordModal.svelte | 17 ++++++++++++++++- .../domains/add-domain/+page.svelte | 2 +- .../sites/site-[site]/domains/+page.ts | 15 ++++++++++----- .../site-[site]/domains/add-domain/+page.svelte | 2 +- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/lib/helpers/tlds.ts b/src/lib/helpers/tlds.ts index 23adffb4c..6de3c3888 100644 --- a/src/lib/helpers/tlds.ts +++ b/src/lib/helpers/tlds.ts @@ -15,7 +15,6 @@ export function isASubdomain(domain: string | null): boolean { const { domain: apex, subdomain } = parse(domain); if (!apex) return false; - if (subdomain === 'www') return false; return !!subdomain; } diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte index 644732c58..e1f1205d6 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte @@ -30,6 +30,20 @@ let weight: number; let port: number; + const placeholders: Record = { + 'A': '76.75.21.21', + 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + 'CNAME': 'stage.example.com', + 'MX': 'mail.example.com', + 'TXT': 'v=spf1 include:_spf.example.com ~all', + 'NS': 'ns1.example.com', + 'SRV': '10 5 8080 example.com', + 'CAA': '0 issue "letsencrypt.org"', + 'HTTPS': 'https://example.com', + 'ALIAS': 'www.example.com' + }; + $: placeholder = placeholders[type] ?? 'Enter value'; + async function handleSubmit() { const record = { name, @@ -77,7 +91,7 @@ - + diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 9155339ca..0102fb376 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -19,12 +19,27 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import type { Models } from '@appwrite.io/console'; + import type { RecordType } from '$lib/stores/domains'; export let show = false; export let selectedRecord: Models.DnsRecord; let record = deepClone(selectedRecord); let error = ''; + + const placeholders: Record = { + 'A': '76.75.21.21', + 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + 'CNAME': 'stage.example.com', + 'MX': 'mail.example.com', + 'TXT': 'v=spf1 include:_spf.example.com ~all', + 'NS': 'ns1.example.com', + 'SRV': '10 5 8080 example.com', + 'CAA': '0 issue "letsencrypt.org"', + 'HTTPS': 'https://example.com', + 'ALIAS': 'www.example.com' + }; + $: placeholder = placeholders[record.type] ?? 'Enter value'; async function handleSubmit() { try { @@ -173,7 +188,7 @@ - + diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte index 2c931b0a9..a303f4477 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte @@ -72,7 +72,7 @@ } else if (behaviour === 'REDIRECT') { rule = await sdk .forProject(page.params.region, page.params.project) - .proxy.createRedirectRule(domainName, $regionalProtocol + redirect, statusCode); + .proxy.createRedirectRule(domainName, redirect, statusCode); } else if (behaviour === 'ACTIVE') { rule = await sdk .forProject(page.params.region, page.params.project) diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts index 88ec63f09..126e1ced7 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts @@ -27,12 +27,17 @@ export const load = async ({ params, depends, url, route }) => { .proxy.listRules( [ Query.or([ - Query.equal('type', RuleType.DEPLOYMENT), - Query.equal('type', RuleType.REDIRECT) + Query.and([ + Query.equal('type', RuleType.REDIRECT), + Query.equal('trigger', RuleTrigger.MANUAL), + ]), + Query.and([ + Query.equal('type', RuleType.DEPLOYMENT), + Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('deploymentResourceType', DeploymentResourceType.SITE), + Query.equal('deploymentResourceId', params.site), + ]), ]), - Query.equal('deploymentResourceType', DeploymentResourceType.SITE), - Query.equal('deploymentResourceId', params.site), - Query.equal('trigger', RuleTrigger.MANUAL), Query.limit(limit), Query.offset(offset), Query.orderDesc(''), diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte index 0bb99fee4..cc1a89b99 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte @@ -76,7 +76,7 @@ } else if (behaviour === 'REDIRECT') { rule = await sdk .forProject(page.params.region, page.params.project) - .proxy.createRedirectRule(domainName, $regionalProtocol + redirect, statusCode); + .proxy.createRedirectRule(domainName, redirect, statusCode); } else if (behaviour === 'ACTIVE') { rule = await sdk .forProject(page.params.region, page.params.project) From 277f96b0b7a6f8d4f5f861615ec145553faa9132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:13:18 +0200 Subject: [PATCH 20/38] Formatting fix --- .../domain-[domain]/createRecordModal.svelte | 22 ++++++++--------- .../domain-[domain]/updateRecordModal.svelte | 24 +++++++++---------- .../sites/site-[site]/domains/+page.ts | 14 +++++------ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte index e1f1205d6..14f0adc61 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte @@ -31,16 +31,16 @@ let port: number; const placeholders: Record = { - 'A': '76.75.21.21', - 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', - 'CNAME': 'stage.example.com', - 'MX': 'mail.example.com', - 'TXT': 'v=spf1 include:_spf.example.com ~all', - 'NS': 'ns1.example.com', - 'SRV': '10 5 8080 example.com', - 'CAA': '0 issue "letsencrypt.org"', - 'HTTPS': 'https://example.com', - 'ALIAS': 'www.example.com' + A: '76.75.21.21', + AAAA: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + CNAME: 'stage.example.com', + MX: 'mail.example.com', + TXT: 'v=spf1 include:_spf.example.com ~all', + NS: 'ns1.example.com', + SRV: '10 5 8080 example.com', + CAA: '0 issue "letsencrypt.org"', + HTTPS: 'https://example.com', + ALIAS: 'www.example.com' }; $: placeholder = placeholders[type] ?? 'Enter value'; @@ -91,7 +91,7 @@ - + diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 0102fb376..c72ca86bd 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -26,18 +26,18 @@ let record = deepClone(selectedRecord); let error = ''; - + const placeholders: Record = { - 'A': '76.75.21.21', - 'AAAA': '2001:0db8:85a3:0000:0000:8a2e:0370:7334', - 'CNAME': 'stage.example.com', - 'MX': 'mail.example.com', - 'TXT': 'v=spf1 include:_spf.example.com ~all', - 'NS': 'ns1.example.com', - 'SRV': '10 5 8080 example.com', - 'CAA': '0 issue "letsencrypt.org"', - 'HTTPS': 'https://example.com', - 'ALIAS': 'www.example.com' + A: '76.75.21.21', + AAAA: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + CNAME: 'stage.example.com', + MX: 'mail.example.com', + TXT: 'v=spf1 include:_spf.example.com ~all', + NS: 'ns1.example.com', + SRV: '10 5 8080 example.com', + CAA: '0 issue "letsencrypt.org"', + HTTPS: 'https://example.com', + ALIAS: 'www.example.com' }; $: placeholder = placeholders[record.type] ?? 'Enter value'; @@ -188,7 +188,7 @@ - + diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts index 126e1ced7..ebe497444 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts @@ -28,15 +28,15 @@ export const load = async ({ params, depends, url, route }) => { [ Query.or([ Query.and([ - Query.equal('type', RuleType.REDIRECT), - Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('type', RuleType.REDIRECT), + Query.equal('trigger', RuleTrigger.MANUAL) ]), Query.and([ - Query.equal('type', RuleType.DEPLOYMENT), - Query.equal('trigger', RuleTrigger.MANUAL), - Query.equal('deploymentResourceType', DeploymentResourceType.SITE), - Query.equal('deploymentResourceId', params.site), - ]), + Query.equal('type', RuleType.DEPLOYMENT), + Query.equal('trigger', RuleTrigger.MANUAL), + Query.equal('deploymentResourceType', DeploymentResourceType.SITE), + Query.equal('deploymentResourceId', params.site) + ]) ]), Query.limit(limit), Query.offset(offset), From a1d1045e87c6d0b7ffe64af02f55beaef76c47d1 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 13:26:38 +0200 Subject: [PATCH 21/38] Only untrack when no installation is set --- src/lib/components/git/repositories.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index c1c3eefca..a9b94904f 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -49,7 +49,9 @@ async function loadInstallations() { if (installationList) { if (installationList.installations.length) { - untrack(() => (selectedInstallation = installationList.installations[0].$id)); + if (!selectedInstallation) { + untrack(() => (selectedInstallation = installationList.installations[0].$id)); + } installation.set( installationList.installations.find( (entry) => entry.$id === selectedInstallation @@ -62,7 +64,9 @@ .forProject(page.params.region, page.params.project) .vcs.listInstallations(); if (installations.length) { - untrack(() => (selectedInstallation = installations[0].$id)); + if (!selectedInstallation) { + untrack(() => (selectedInstallation = installationList.installations[0].$id)); + } installation.set(installations.find((entry) => entry.$id === selectedInstallation)); } return installations; From 14d21912ad8edffc87522486470c3f1c438c4339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 13:40:17 +0200 Subject: [PATCH 22/38] Fix SRV record update; fix priority input; fix linter --- src/lib/helpers/domains.ts | 99 ++++++++++++++++ .../domain-[domain]/updateRecordModal.svelte | 108 +----------------- .../domains/add-domain/+page.svelte | 2 +- .../domains/add-domain/+page.svelte | 2 +- 4 files changed, 103 insertions(+), 108 deletions(-) diff --git a/src/lib/helpers/domains.ts b/src/lib/helpers/domains.ts index 7d11aa59d..d8a65c745 100644 --- a/src/lib/helpers/domains.ts +++ b/src/lib/helpers/domains.ts @@ -90,6 +90,105 @@ export async function createRecord(record: Partial, domainId: } } +export async function updateRecord(record: Partial, domainId: string) { + switch (record.type) { + case 'A': + return await sdk.forConsole.domains.updateRecordA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'AAAA': + return await sdk.forConsole.domains.updateRecordAAAA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'CNAME': + return await sdk.forConsole.domains.updateRecordCNAME( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'MX': + return await sdk.forConsole.domains.updateRecordMX( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.priority, + record.comment + ); + case 'TXT': + return await sdk.forConsole.domains.updateRecordTXT( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'NS': + return await sdk.forConsole.domains.updateRecordNS( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'SRV': + return await sdk.forConsole.domains.updateRecordSRV( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.priority, + record.weight, + record.port, + record?.comment || undefined + ); + case 'CAA': + return await sdk.forConsole.domains.updateRecordCAA( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'HTTPS': + return await sdk.forConsole.domains.updateRecordHTTPS( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + case 'ALIAS': + return await sdk.forConsole.domains.updateRecordAlias( + domainId, + record.$id, + record.name, + record.value, + record.ttl, + record.comment + ); + } +} + export type ParsedRecords = { A: Partial[]; AAAA: Partial[]; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index c72ca86bd..d46e31aa3 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -20,6 +20,7 @@ import { Dependencies } from '$lib/constants'; import type { Models } from '@appwrite.io/console'; import type { RecordType } from '$lib/stores/domains'; + import { updateRecord } from '$lib/helpers/domains'; export let show = false; export let selectedRecord: Models.DnsRecord; @@ -43,112 +44,7 @@ async function handleSubmit() { try { - switch (record.type) { - case 'A': - await sdk.forConsole.domains.updateRecordA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'AAAA': - await sdk.forConsole.domains.updateRecordAAAA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'CNAME': - await sdk.forConsole.domains.updateRecordCNAME( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'MX': - await sdk.forConsole.domains.updateRecordMX( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.priority, - record.comment - ); - - break; - case 'TXT': - await sdk.forConsole.domains.updateRecordTXT( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'NS': - await sdk.forConsole.domains.updateRecordNS( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - - case 'CAA': - await sdk.forConsole.domains.updateRecordCAA( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'HTTPS': - await sdk.forConsole.domains.updateRecordHTTPS( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - case 'ALIAS': - await sdk.forConsole.domains.updateRecordAlias( - page.params.domain, - record.$id, - record.name, - record.value, - record.ttl, - record.comment - ); - - break; - - default: - break; - } + await updateRecord(record, page.params.domain); show = false; invalidate(Dependencies.DOMAINS); addNotification({ diff --git a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte index a303f4477..3af8bb2e4 100644 --- a/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/add-domain/+page.svelte @@ -18,7 +18,7 @@ import { ConnectRepoModal } from '$lib/components/git/index.js'; import { isValueOfStringEnum } from '$lib/helpers/types.js'; import { isCloud } from '$lib/system'; - import { project, regionalProtocol } from '$routes/(console)/project-[region]-[project]/store'; + import { project } from '$routes/(console)/project-[region]-[project]/store'; import { getApexDomain } from '$lib/helpers/tlds'; const routeBase = `${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/domains`; diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte index cc1a89b99..ea8388747 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/add-domain/+page.svelte @@ -22,7 +22,7 @@ import { writable } from 'svelte/store'; import { onMount } from 'svelte'; import { ConnectRepoModal } from '$lib/components/git/index.js'; - import { project, regionalProtocol } from '$routes/(console)/project-[region]-[project]/store'; + import { project } from '$routes/(console)/project-[region]-[project]/store'; import { isCloud } from '$lib/system'; import { getApexDomain } from '$lib/helpers/tlds'; From 4947a84f19cb9dfb69c49ee8983405f6e243dba1 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 2 Jun 2025 13:40:21 +0200 Subject: [PATCH 23/38] Fix responsiveness --- src/lib/components/git/repositories.svelte | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index a9b94904f..1688d5f87 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -5,6 +5,7 @@ import { sdk } from '$lib/stores/sdk'; import { repositories } from '$routes/(console)/project-[region]-[project]/functions/function-[function]/store'; import { installation, installations, repository } from '$lib/stores/vcs'; + import { isSmallViewport } from '$lib/stores/viewport'; import { Layout, Table, @@ -137,7 +138,7 @@ {:then installations} - + + alignItems="center" + justifyContent="space-between"> @@ -249,27 +251,25 @@ icon={IconLockClosed} color="--fgcolor-neutral-tertiary" /> {/if} - - - {#if action === 'button'} - + {#if !$isSmallViewport} + + {/if} + {#if action === 'button'} connect(repo)}> Connect - - {/if} + {/if} + From 12b0fc9247e8d38c8b080317cf1d00b2093a0e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 14:27:14 +0200 Subject: [PATCH 24/38] linter fix --- .../domains/domain-[domain]/updateRecordModal.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index d46e31aa3..379bac0ba 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -13,7 +13,6 @@ import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; import { symmetricDifference } from '$lib/helpers/array'; import { deepClone } from '$lib/helpers/object'; - import { sdk } from '$lib/stores/sdk'; import { page } from '$app/state'; import { recordTypes } from './store'; import { invalidate } from '$app/navigation'; From c2d727efe30f4417260c99ec49b4f4b92c9fa100 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Jun 2025 19:51:53 +0530 Subject: [PATCH 25/38] remove: sites waitlist; fix: domains table. --- src/lib/helpers/waitlist.ts | 30 -- .../domains/domain-[domain]/store.ts | 2 +- .../domains/domain-[domain]/table.svelte | 24 +- .../domain-[domain]/updateRecordModal.svelte | 31 +- .../(images)/empty-sites-dark-mobile.svg | 119 ------- .../sites/(images)/empty-sites-dark.svg | 239 ------------- .../(images)/empty-sites-light-mobile.svg | 157 --------- .../sites/(images)/empty-sites-light.svg | 321 ------------------ .../sites/+page.svelte | 151 ++------ 9 files changed, 72 insertions(+), 1002 deletions(-) delete mode 100644 src/lib/helpers/waitlist.ts delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg delete mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg diff --git a/src/lib/helpers/waitlist.ts b/src/lib/helpers/waitlist.ts deleted file mode 100644 index 773b04a24..000000000 --- a/src/lib/helpers/waitlist.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { get } from 'svelte/store'; -import { user } from '$lib/stores/user'; -import { sdk } from '$lib/stores/sdk'; -const userPreferences = () => get(user)?.prefs; - -export const joinWaitlistSites = () => { - const prefs = userPreferences(); - const newPrefs = { - ...prefs, - joinWaitlistSites: true - }; - - sdk.forConsole.account.updatePrefs(newPrefs); - - if (sessionStorage) { - sessionStorage.setItem('joinWaitlistSites', 'true'); - } -}; - -export const isOnWaitlistSites = (): boolean => { - const prefs = userPreferences(); - const joinedInPrefs = 'joinWaitlistSites' in prefs; - - let joinedInSession = false; - if (sessionStorage) { - joinedInSession = sessionStorage.getItem('joinWaitlistSites') === 'true'; - } - - return joinedInSession || joinedInPrefs; -}; diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts index b3a5d2b2c..a8c38a8b9 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/store.ts @@ -5,7 +5,7 @@ import { derived, writable } from 'svelte/store'; export const domain = derived(page, ($page) => $page.data.domain as Models.Domain); export const columns = writable([ - { id: 'name', title: 'Name', type: 'string', width: { min: 150 } }, + { id: 'name', title: 'Name', type: 'string', width: { min: 200 } }, { id: 'type', title: 'Type', type: 'string', width: 125 }, { id: 'value', title: 'Value', type: 'string', width: 250 }, { id: 'ttl', title: 'TTL', type: 'integer', width: 100 }, diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index 4b8c1e958..f25e433d7 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -29,6 +29,15 @@ let showEdit = false; let showDelete = false; let selectedRecord: Models.DnsRecord = null; + + function formatRecordName(name: string) { + const limit = 30; + return { + value: name.length > limit ? `${name.slice(0, limit)}...` : name, + truncated: name.length > limit, + whole: name + }; + } @@ -47,9 +56,16 @@ {#each $columns as column} {#if column.id === 'name'} - - {record.name} - + {@const formatted = formatRecordName(record.name)} + + {formatted.value} + + {formatted.whole} + + {:else if column.id === 'type'} {record.type} @@ -70,7 +86,7 @@ {:else if column.id === 'priority'} - {record?.priority ?? '-'} + {record?.priority || '-'} {:else if column.id === 'comment'} diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte index 379bac0ba..c22d18a00 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/updateRecordModal.svelte @@ -63,6 +63,9 @@ $: isDisabled = !symmetricDifference(Object.values(record), Object.values(selectedRecord)) ?.length; + + $: showPriority = + record.name.toLocaleLowerCase() === 'mx' || record.name.toLocaleLowerCase() === 'srv'; @@ -101,19 +104,21 @@ - - - - - Sets the priority for this DNS record. Lower numbers indicate higher - priority (e.g., 10 is higher than 20). - - - + {#if showPriority} + + + + + Sets the priority for this DNS record. Lower numbers indicate higher + priority (e.g., 10 is higher than 20). + + + + {/if} - -
- - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg deleted file mode 100644 index b64811a48..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg deleted file mode 100644 index 8bd4b239e..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg +++ /dev/null @@ -1,157 +0,0 @@ - - -
- - - - -
-
- - - - -
-
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg deleted file mode 100644 index a0314acfc..000000000 --- a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/routes/(console)/project-[region]-[project]/sites/+page.svelte b/src/routes/(console)/project-[region]-[project]/sites/+page.svelte index a933b669f..be8278543 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/+page.svelte @@ -11,14 +11,12 @@ import { isServiceLimited } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; import { canWriteSites } from '$lib/stores/roles.js'; - import { Card, Icon, Layout, Typography } from '@appwrite.io/pink-svelte'; + import { Icon, Layout } from '@appwrite.io/pink-svelte'; import { Button } from '$lib/elements/forms'; import { app } from '$lib/stores/app'; import CreateSiteModal from './createSiteModal.svelte'; import EmptyLight from './(images)/empty-sites-light.svg'; import EmptyDark from './(images)/empty-sites-dark.svg'; - import EmptyLightMobile from './(images)/empty-sites-light-mobile.svg'; - import EmptyDarkMobile from './(images)/empty-sites-dark-mobile.svg'; import Grid from './grid.svelte'; import { IconPlus } from '@appwrite.io/pink-icons-svelte'; import { columns } from './store'; @@ -28,15 +26,10 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { sdk } from '$lib/stores/sdk'; - import { APPWRITE_OFFICIALS_ORG, isCloud } from '$lib/system'; - import { addNotification } from '$lib/stores/notifications'; - import { isOnWaitlistSites, joinWaitlistSites } from '$lib/helpers/waitlist'; - import { isSmallViewport } from '$lib/stores/viewport'; export let data; let show = false; - let isOnWaitlist = isOnWaitlistSites(); $: $registerCommands([ { @@ -46,7 +39,6 @@ }, keys: ['c'], disabled: - !showSites || isServiceLimited('sites', $organization?.billingPlan, data.siteList?.total) || !$canWriteSites, icon: IconPlus, @@ -63,123 +55,46 @@ } }); }); - - /** - * Controls visibility of Sites feature: - * - Shown if running on self-hosted - * - Shown on cloud only if the organization is Appwrite's. - * - Hidden on cloud for any non-Appwrite organization. - */ - $: showSites = !isCloud || $organization.$id === APPWRITE_OFFICIALS_ORG; - - $: isDark = $app.themeInUse === 'dark'; - - $: imgSrc = isDark - ? $isSmallViewport - ? EmptyDarkMobile - : EmptyDark - : $isSmallViewport - ? EmptyLightMobile - : EmptyLight; - - $: imgClass = $isSmallViewport ? 'mobile' : 'desktop'; - - function addToWaitlist() { - joinWaitlistSites(); - addNotification({ - type: 'success', - title: 'Waitlist joined', - message: "We'll let you know as soon as Appwrite Sites is ready for you." - }); - - isOnWaitlist = true; - } - {#if showSites} - - - - - - - {#if $canWriteSites} - - {/if} - + + + - {#if data.siteList.total} - {#if data.view === View.Grid} - - {:else} - + + + {#if $canWriteSites} + {/if} - - {:else if data.search} - + + + {#if data.siteList.total} + {#if data.view === View.Grid} + {:else} - (show = true)}> - +
{/if} + + {:else if data.search} + {:else} - - - - - - {#if isOnWaitlist} - - You've successfully joined the Sites waitlist - - - - We can't wait for you to try out Sites on Cloud. You will get access - soon. - - {:else} - - - Appwrite Sites is in high demand - - -
- - To ensure a smooth experience for everyone, we’re rolling out - access gradually. Join the waitlist and be one of the first to - deploy with Sites. - -
- -
- -
-
- {/if} -
-
-
+ (show = true)}> + {/if} From 7353396c38939ecaa5f9b3f6c357300c6ef2e5fe Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Jun 2025 20:03:13 +0530 Subject: [PATCH 26/38] fix: priority checks. --- .../domains/domain-[domain]/createRecordModal.svelte | 3 ++- .../domains/domain-[domain]/table.svelte | 11 ++++++++++- .../domains/domain-[domain]/updateRecordModal.svelte | 6 ++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte index 14f0adc61..1ddcdb4e6 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte @@ -17,6 +17,7 @@ import { invalidate } from '$app/navigation'; import type { RecordType } from '$lib/stores/domains'; import { createRecord } from '$lib/helpers/domains'; + import { showPriority } from './table.svelte'; export let show = false; @@ -110,7 +111,7 @@ - {#if type === 'MX'} + {#if showPriority(type)} + import type { RecordType } from '$lib/stores/domains'; + + export function showPriority(record: Models.DnsRecord | RecordType): boolean { + const type = typeof record === 'string' ? record : record.type; + return type.toLowerCase() === 'mx' || type.toLowerCase() === 'srv'; + } + + @@ -104,7 +102,7 @@ - {#if showPriority} + {#if showPriority(record)} Date: Mon, 2 Jun 2025 16:37:53 +0200 Subject: [PATCH 27/38] PR review changes --- .../domains/domain-[domain]/table.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte index f7f6d76ee..006738f20 100644 --- a/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte +++ b/src/routes/(console)/organization-[organization]/domains/domain-[domain]/table.svelte @@ -95,7 +95,7 @@ {:else if column.id === 'priority'} - {showPriority(record) ? record?.priority || '-' : '-'} + {showPriority(record) ? (record?.priority ?? '0') : '-'} {:else if column.id === 'comment'} From a2fd05b50c2d8c2bc8b77e040bbc4830fe784224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 16:38:44 +0200 Subject: [PATCH 28/38] Add missing images --- .../(images)/empty-sites-dark-mobile.svg | 119 +++++++ .../sites/(images)/empty-sites-dark.svg | 239 +++++++++++++ .../(images)/empty-sites-light-mobile.svg | 157 +++++++++ .../sites/(images)/empty-sites-light.svg | 321 ++++++++++++++++++ 4 files changed, 836 insertions(+) create mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg create mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg create mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg create mode 100644 src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg new file mode 100644 index 000000000..39c7917cf --- /dev/null +++ b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark-mobile.svg @@ -0,0 +1,119 @@ + + +
+ + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg new file mode 100644 index 000000000..b64811a48 --- /dev/null +++ b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-dark.svg @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg new file mode 100644 index 000000000..8bd4b239e --- /dev/null +++ b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light-mobile.svg @@ -0,0 +1,157 @@ + + +
+ + + + +
+
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg new file mode 100644 index 000000000..a0314acfc --- /dev/null +++ b/src/routes/(console)/project-[region]-[project]/sites/(images)/empty-sites-light.svg @@ -0,0 +1,321 @@ + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
From 92308b6c63aae48178a61026a3599ffdff3d9c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Jun 2025 18:32:36 +0200 Subject: [PATCH 29/38] Fix sites to be public --- .../project-[region]-[project]/sites/+page.ts | 9 +-------- .../sites/site-[site]/+layout.ts | 12 ++---------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/sites/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/+page.ts index afaf7b02d..62eeb026a 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/+page.ts @@ -2,15 +2,8 @@ import { Query } from '@appwrite.io/console'; import { sdk } from '$lib/stores/sdk'; import { getLimit, getPage, getSearch, getView, pageToOffset, View } from '$lib/helpers/load'; import { CARD_LIMIT, Dependencies } from '$lib/constants'; -import { APPWRITE_OFFICIALS_ORG, isCloud } from '$lib/system'; - -export const load = async ({ url, depends, route, params, parent }) => { - // don't load anything on cloud unless org is appwrite atm! - const { organization } = await parent(); - if (isCloud && organization?.$id !== APPWRITE_OFFICIALS_ORG) { - return; - } +export const load = async ({ url, depends, route, params }) => { depends(Dependencies.SITES); const page = getPage(url); diff --git a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/+layout.ts b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/+layout.ts index 5ac8edfa3..491697969 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/site-[site]/+layout.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/site-[site]/+layout.ts @@ -2,17 +2,9 @@ import Breadcrumbs from './breadcrumbs.svelte'; import Header from './header.svelte'; import { Dependencies } from '$lib/constants'; import { sdk } from '$lib/stores/sdk'; -import { error, redirect } from '@sveltejs/kit'; -import { APPWRITE_OFFICIALS_ORG, isCloud } from '$lib/system'; -import { base } from '$app/paths'; - -export const load = async ({ depends, params, parent }) => { - // don't load anything on cloud unless org is appwrite atm! - const { organization } = await parent(); - if (isCloud && organization?.$id !== APPWRITE_OFFICIALS_ORG) { - redirect(307, `${base}/project-${params.region}-${params.project}/sites`); - } +import { error } from '@sveltejs/kit'; +export const load = async ({ depends, params }) => { depends(Dependencies.SITE); try { const [site] = await Promise.all([ From 7569ec6aca717a34804bdc6f7141242892de3aad Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Mon, 2 Jun 2025 12:12:33 -0700 Subject: [PATCH 30/38] fix: 404 error fetching countries --- src/routes/(console)/account/payments/addressModal.svelte | 7 ++----- .../(console)/account/payments/billingAddress.svelte | 5 +---- .../(console)/account/payments/editAddressModal.svelte | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/routes/(console)/account/payments/addressModal.svelte b/src/routes/(console)/account/payments/addressModal.svelte index 55405deb1..5e9a827bc 100644 --- a/src/routes/(console)/account/payments/addressModal.svelte +++ b/src/routes/(console)/account/payments/addressModal.svelte @@ -1,6 +1,5 @@ From 16b2278bab073d9ba5724d0e6f64655212604497 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Mon, 2 Jun 2025 16:56:32 -0700 Subject: [PATCH 33/38] fix: update EstimatedTotalBox to display data from estimation --- .../billing/discountsApplied.svelte | 37 +++++++++++++++++++ .../billing/estimatedTotalBox.svelte | 23 ++++++------ 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 src/lib/components/billing/discountsApplied.svelte diff --git a/src/lib/components/billing/discountsApplied.svelte b/src/lib/components/billing/discountsApplied.svelte new file mode 100644 index 000000000..eed7a2bc7 --- /dev/null +++ b/src/lib/components/billing/discountsApplied.svelte @@ -0,0 +1,37 @@ + + +{#if adjustedValue > 0} + +
+

+ + + {label} + +

+
+ {#if value >= 100} +

Credits applied

+ {:else} + -{formatCurrency(adjustedValue)} + {/if} +
+{/if} diff --git a/src/lib/components/billing/estimatedTotalBox.svelte b/src/lib/components/billing/estimatedTotalBox.svelte index 438120824..dd7878890 100644 --- a/src/lib/components/billing/estimatedTotalBox.svelte +++ b/src/lib/components/billing/estimatedTotalBox.svelte @@ -7,6 +7,7 @@ import { CreditsApplied } from '.'; import { sdk } from '$lib/stores/sdk'; import { AppwriteException } from '@appwrite.io/console'; + import DiscountsApplied from './discountsApplied.svelte'; export let billingPlan: Tier; export let collaborators: string[]; @@ -35,7 +36,8 @@ if ( e.type === 'billing_coupon_not_found' || e.type === 'billing_coupon_already_used' || - e.type === 'billing_credit_unsupported' + e.type === 'billing_credit_unsupported' || + e.type === 'billing_coupon_not_eligible' ) { couponData = { code: null, @@ -65,7 +67,8 @@ if ( e.type === 'billing_coupon_not_found' || e.type === 'billing_coupon_already_used' || - e.type === 'billing_credit_unsupported' + e.type === 'billing_credit_unsupported' || + e.type === 'billing_coupon_not_eligible' ) { couponData = { code: null, @@ -80,13 +83,6 @@ $: organizationId ? getUpdatePlanEstimate(organizationId, billingPlan, collaborators, couponData?.code) : getEstimate(billingPlan, collaborators, couponData?.code); - - $: estimatedTotal = - couponData?.status === 'active' - ? estimation?.grossAmount - couponData.credits >= 0 - ? estimation?.grossAmount - couponData.credits - : 0 - : estimation?.grossAmount; {#if estimation} @@ -102,6 +98,9 @@ >{formatCurrency(item.value)}
{/each} + {#each estimation.discounts ?? [] as item} + + {/each} {#if couponData?.status === 'active'} @@ -110,15 +109,15 @@ Total due - {formatCurrency(estimatedTotal)} + {formatCurrency(estimation.grossAmount)} - You'll pay {formatCurrency(estimatedTotal)} + You'll pay {formatCurrency(estimation.grossAmount)} now. {#if couponData?.code}Once your credits run out,{:else}Then{/if} you'll be charged - {formatCurrency(estimation.grossAmount)} every 30 days. + {formatCurrency(estimation.amount)} every 30 days. Date: Mon, 2 Jun 2025 17:07:38 -0700 Subject: [PATCH 34/38] fix: update Change plan to show Payment box when upgrading This will allow adding credits when upgrading. --- .../organization-[organization]/change-plan/+page.svelte | 3 +-- 1 file changed, 1 insertion(+), 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 efe13f1a3..b96c875c8 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -302,8 +302,7 @@ - - {#if selectedPlan !== BillingPlan.FREE && data.organization.billingPlan === BillingPlan.FREE} + {#if isUpgrade}
Date: Tue, 3 Jun 2025 05:33:56 +0200 Subject: [PATCH 35/38] Fix responsiveness --- src/lib/components/git/repositories.svelte | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index 1688d5f87..b82781169 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -240,27 +240,32 @@ direction="row" alignItems="center" justifyContent="space-between"> - - {repo.name} - - {#if repo.private} - - {/if} - {#if !$isSmallViewport} - - {/if} + + + {repo.name} + + {#if repo.private} + + {/if} + {#if !$isSmallViewport} + + {/if} + {#if action === 'button'} Date: Tue, 3 Jun 2025 06:00:04 +0200 Subject: [PATCH 36/38] Bump pink-svelte --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 47f174dec..a0c0c7833 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@appwrite.io/pink-icons": "0.25.0", "@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1", "@appwrite.io/pink-legacy": "^1.0.3", - "@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@d74b893", + "@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86", "@popperjs/core": "^2.11.8", "@sentry/sveltekit": "^8.38.0", "@stripe/stripe-js": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8275a29b..6107139fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^1.0.3 version: 1.0.3 '@appwrite.io/pink-svelte': - specifier: https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@d74b893 - version: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d74b893(svelte@5.25.3) + specifier: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86 + version: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86(svelte@5.25.3) '@popperjs/core': specifier: ^2.11.8 version: 2.11.8 @@ -281,8 +281,8 @@ packages: '@appwrite.io/pink-legacy@1.0.3': resolution: {integrity: sha512-GGde5fmPhs+s6/3aFeMPc/kKADG/gTFkYQSy6oBN8pK0y0XNCLrZZgBv+EBbdhwdtqVEWXa0X85Mv9w7jcIlwQ==} - '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d74b893': - resolution: {tarball: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d74b893} + '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86': + resolution: {tarball: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86} version: 2.0.0-RC.2 peerDependencies: svelte: ^4.0.0 @@ -3654,7 +3654,7 @@ snapshots: '@appwrite.io/pink-icons': 1.0.0 the-new-css-reset: 1.11.3 - '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d74b893(svelte@5.25.3)': + '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86(svelte@5.25.3)': dependencies: '@appwrite.io/pink-icons-svelte': 2.0.0-RC.1(svelte@5.25.3) '@floating-ui/dom': 1.6.13 From d70488d1082991eca689345ec660957f90985e8a Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 3 Jun 2025 09:50:09 +0530 Subject: [PATCH 37/38] fix: use pink2 components. --- .../billing/discountsApplied.svelte | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/components/billing/discountsApplied.svelte b/src/lib/components/billing/discountsApplied.svelte index eed7a2bc7..3ff2d7add 100644 --- a/src/lib/components/billing/discountsApplied.svelte +++ b/src/lib/components/billing/discountsApplied.svelte @@ -1,6 +1,9 @@ {#if adjustedValue > 0} - -
-

- - - {label} - -

-
+ + + + {label} + {#if value >= 100} -

Credits applied

+ {:else} - -{formatCurrency(adjustedValue)} + -{formatCurrency(adjustedValue)} {/if} -
+ {/if} From 8305330ad3f641a9ac755af7d61ff44746b80bbd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 3 Jun 2025 11:10:39 +0545 Subject: [PATCH 38/38] Fix: typography color --- src/lib/components/billing/discountsApplied.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/billing/discountsApplied.svelte b/src/lib/components/billing/discountsApplied.svelte index 3ff2d7add..d32f67a8f 100644 --- a/src/lib/components/billing/discountsApplied.svelte +++ b/src/lib/components/billing/discountsApplied.svelte @@ -25,7 +25,7 @@ - {label} + {label} {#if value >= 100}