From 17fb53316d0b4ff8f39c6bcac69a1f7c48bcc4e3 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sun, 14 Apr 2024 15:59:10 +0530 Subject: [PATCH 1/5] fix: allow org. deletion on self-hosted. --- .../console/organization-[organization]/settings/+page.svelte | 4 +--- .../settings/deleteOrganizationModal.svelte | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/+page.svelte b/src/routes/console/organization-[organization]/settings/+page.svelte index 4b09765ee..840754307 100644 --- a/src/routes/console/organization-[organization]/settings/+page.svelte +++ b/src/routes/console/organization-[organization]/settings/+page.svelte @@ -99,6 +99,4 @@ {/if} -{#if isCloud && data.invoices} - -{/if} + diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index b017bff83..48f168cd4 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -51,7 +51,7 @@ } } - $: upcomingInvoice = invoices.invoices.find((i) => i.status === 'upcoming' && i.amount > 0); + $: upcomingInvoice = invoices?.invoices.find((i) => i.status === 'upcoming' && i.amount > 0); Date: Sun, 14 Apr 2024 16:00:54 +0530 Subject: [PATCH 2/5] update: navigate user to an organization if one exists instead of onboarding. --- .../settings/deleteOrganizationModal.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 48f168cd4..47c9c7660 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -37,6 +37,8 @@ : $organizationList.teams[0].$id; await goto(`${base}/console/organization-${teamId}`); + } else if ($organizationList?.total == 1) { + await goto(`${base}/console/organization-${$organizationList.teams[0].$id}`); } else { await goto(`${base}/console/onboarding`); } From f34fc26b374585f68a735dc11d356efeae267bc4 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sun, 14 Apr 2024 16:02:37 +0530 Subject: [PATCH 3/5] update: improve deletion message. --- .../settings/deleteOrganizationModal.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 47c9c7660..7cc7c3537 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -75,9 +75,16 @@

{:else}

- Are you sure you want to delete {$organization.name}? All projects ({$projects.total}) - and data associated with this organization will be deleted. This action is irreversible. + Are you sure you want to delete {$organization.name}? + {#if $projects.total > 0} + All projects ({$projects.total}) and data associated with this organization will be + deleted. + {:else} + There are no projects associated with this organization. + {/if}

+ +

This action is irreversible.

{/if} From 94b79f34ff7e98bf1c49fa7a546b3565beed99b9 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sun, 14 Apr 2024 18:19:58 +0530 Subject: [PATCH 4/5] update: navigate to onboarding page as before, after org. deletion. --- .../settings/deleteOrganizationModal.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 7cc7c3537..0af3f11db 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -37,8 +37,6 @@ : $organizationList.teams[0].$id; await goto(`${base}/console/organization-${teamId}`); - } else if ($organizationList?.total == 1) { - await goto(`${base}/console/organization-${$organizationList.teams[0].$id}`); } else { await goto(`${base}/console/onboarding`); } From 7e25aeb2dfb71a7987df33b0ee7ee7f7a165bd4c Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 16 Apr 2024 14:34:18 +0530 Subject: [PATCH 5/5] revert: modal confirmation message. --- .../settings/deleteOrganizationModal.svelte | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 0af3f11db..48f168cd4 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -73,16 +73,9 @@

{:else}

- Are you sure you want to delete {$organization.name}? - {#if $projects.total > 0} - All projects ({$projects.total}) and data associated with this organization will be - deleted. - {:else} - There are no projects associated with this organization. - {/if} + Are you sure you want to delete {$organization.name}? All projects ({$projects.total}) + and data associated with this organization will be deleted. This action is irreversible.

- -

This action is irreversible.

{/if}