From d86e1be800dd97d797353b29b2f70b5ec737bd27 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 13:29:21 +0530 Subject: [PATCH 01/10] update: show projects and members. --- .../organization-[organization]/settings/+page.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/console/organization-[organization]/settings/+page.svelte b/src/routes/console/organization-[organization]/settings/+page.svelte index 8407543078..73cc02e24e 100644 --- a/src/routes/console/organization-[organization]/settings/+page.svelte +++ b/src/routes/console/organization-[organization]/settings/+page.svelte @@ -5,6 +5,7 @@ import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import { members, organization } from '$lib/stores/organization'; + import { projects } from '../store'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { onMount } from 'svelte'; @@ -40,6 +41,8 @@ } $: avatars = $members.memberships.map((team) => team.userName); + $: orgProjects = `${$projects.total} ${$projects.total === 1 ? 'project' : 'projects'}`; + $: orgMembers = `${$organization.total} ${$organization.total === 1 ? 'member' : 'members'}`; @@ -85,7 +88,7 @@
{$organization.name}
-

{$organization.total} members

+

{orgMembers}, {orgProjects}

From c8fe12ae001c952b35b5e0f57189f0a80e466b0d Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 15:07:57 +0530 Subject: [PATCH 02/10] update: new org deletion flow. --- .../settings/deleteOrganizationModal.svelte | 162 +++++++++++++++--- 1 file changed, 134 insertions(+), 28 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index f071e61081..1618f8481f 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -1,9 +1,9 @@ - - {#if upcomingInvoice} -

- The organization {$organization.name} will be flagged for deletion. -

+
+ + {#if upcomingInvoice} + + + You have a pending {formatCurrency(upcomingInvoice.grossAmount)} invoice for your + {tierToPlan(upcomingInvoice.plan).name} plan + +

+ By proceeding, your invoice will be processed within the hour. Upon successful + payment, your organization will be deleted. +

+
+ {/if}

- All existing projects will be paused and the organization will be deleted once your - upcoming invoice is processed on {toLocaleDate($organization.billingNextInvoiceDate)}. -

- {: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. + {#if $projects.total > 0} + The following projects and all data associated with {$organization.name} will + be permanently deleted. This action is irreversible. + {:else} + {$organization.name} will be permanently deleted. This action is irreversible. + {/if}

- {/if} - - - - -
+ + {#if $projects.total > 0} +
+ + {#each tabs as { name, label, total }} + (selectedTab = name)}> + {label} ({total}) + + {/each} + + + + + {#each tabData.headers as header} + {header} + {/each} + + + {#each tabData.rows as row} + + {#each row.cells as cell, index} + {cell} + {/each} + + {/each} + + +
+ {/if} + + + + + + + + + + +
+ + From 82177dea5f5a96fff209cad97be70e675e7be47e Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 15:08:43 +0530 Subject: [PATCH 03/10] ran: `npm run format`. --- .../settings/deleteOrganizationModal.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 1618f8481f..71b6268f73 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -114,7 +114,8 @@ The following projects and all data associated with {$organization.name} will be permanently deleted. This action is irreversible. {:else} - {$organization.name} will be permanently deleted. This action is irreversible. + {$organization.name} will be permanently deleted. + This action is irreversible. {/if}

From 1d74b0cd16984be6f749e8bdac60e2889ddbb5a4 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 20 Aug 2024 16:51:54 +0530 Subject: [PATCH 04/10] address comment. Co-authored-by: Carla --- .../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 71b6268f73..0c7373a446 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -114,7 +114,7 @@ The following projects and all data associated with {$organization.name} will be permanently deleted. This action is irreversible. {:else} - {$organization.name} will be permanently deleted. + All data associated with {$organization.name} will be permanently deleted. This action is irreversible. {/if}

From 449d601e40d5479ed11d880970c40e3d8bcb65e5 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 20:44:18 +0530 Subject: [PATCH 05/10] update: horizontal scrolling, manage views per device type. --- .../settings/deleteOrganizationModal.svelte | 48 ++++++++++++++++--- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 0c7373a446..d27b310cd3 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -30,6 +30,10 @@ let selectedTab = 'projects'; let organizationName: string = null; + /* enable overflow-x */ + const columnWidth = 120; + const columnWidthSmall = columnWidth / 4; + async function deleteOrg() { try { if (isCloud) { @@ -60,8 +64,8 @@ } const tabs = [ - { name: 'projects', label: 'Projects', total: $projects.total }, - { name: 'members', label: 'Team members', total: $members.total } + { name: 'projects', label: { desktop: 'Projects', mobile: 'Projects' }, total: $projects.total }, + { name: 'members', label: { desktop: 'Total Members', mobile: 'Members' }, total: $members.total } ]; $: tabData = @@ -120,7 +124,7 @@

{#if $projects.total > 0} -
+
{#each tabs as { name, label, total }} (selectedTab = name)}> - {label} ({total}) + {label.desktop} ({total}) {/each} - + {#each tabData.headers as header} - {header} + {header} + {/each} + + + {#each tabData.rows as row} + + {#each row.cells as cell} + {cell} + {/each} + + {/each} + + +
+
+ + {#each tabs as { name, label, total }} + (selectedTab = name)}> + {label.mobile} ({total}) + + {/each} + + + + + {#each tabData.headers as header, index} + {header} {/each} {#each tabData.rows as row} {#each row.cells as cell, index} - {cell} + {cell} {/each} {/each} From 46e20498e97915caa39d205e983735cb31ff3949 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 21:05:08 +0530 Subject: [PATCH 06/10] fix: table styles. --- .../settings/deleteOrganizationModal.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index d27b310cd3..46f85b4615 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -124,7 +124,7 @@

{#if $projects.total > 0} -
+
{#each tabs as { name, label, total }}
-
+
{#each tabs as { name, label, total }} From 411627b292dae4439219c8329ea5150cf4c000d7 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 20 Aug 2024 21:05:57 +0530 Subject: [PATCH 07/10] ran: `npm run format`. --- .../settings/deleteOrganizationModal.svelte | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte index 46f85b4615..ad1fe547d6 100644 --- a/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/console/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -64,8 +64,16 @@ } const tabs = [ - { name: 'projects', label: { desktop: 'Projects', mobile: 'Projects' }, total: $projects.total }, - { name: 'members', label: { desktop: 'Total Members', mobile: 'Members' }, total: $members.total } + { + name: 'projects', + label: { desktop: 'Projects', mobile: 'Projects' }, + total: $projects.total + }, + { + name: 'members', + label: { desktop: 'Total Members', mobile: 'Members' }, + total: $members.total + } ]; $: tabData = @@ -170,14 +178,16 @@ {#each tabData.headers as header, index} - {header} + {header} {/each} {#each tabData.rows as row} {#each row.cells as cell, index} - {cell} + {cell} {/each} {/each} From 4d6e4175c712cd532fac9fc495a8da46a406ad83 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Tue, 27 Aug 2024 13:35:10 +0530 Subject: [PATCH 08/10] ran: `pnpm format`. --- src/lib/helpers/load.ts | 2 +- src/lib/layout/unauthenticated.svelte | 2 +- src/lib/stores/feedback.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/helpers/load.ts b/src/lib/helpers/load.ts index 05e043ddc9..21e2f1ee6e 100644 --- a/src/lib/helpers/load.ts +++ b/src/lib/helpers/load.ts @@ -21,7 +21,7 @@ export enum View { export function getView(url: URL, route: Page['route'], fallback: View): View { return (url.searchParams.get('view') ?? preferences.get(route).view) === View.Grid ? View.Grid - : View.Table ?? fallback; + : (View.Table ?? fallback); } export function getColumns(route: Page['route'], fallback: string[]): string[] { diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index b7e250b540..4d859d492e 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -16,7 +16,7 @@ export let coupon: Coupon = null; $: selectedCampaign = campaigns.get(coupon?.campaign ?? campaign); - $: variation = (coupon?.campaign ?? campaign ? selectedCampaign?.template : 'default') as + $: variation = ((coupon?.campaign ?? campaign) ? selectedCampaign?.template : 'default') as | 'default' | CampaignData['template']; diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 7f9b6b2004..7eaefca2d5 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -71,8 +71,8 @@ export const feedbackData = createFeedbackDataStore(); function createFeedbackStore() { const { subscribe, update } = writable({ - elapsed: browser ? parseInt(localStorage.getItem('feedbackElapsed')) ?? 0 : 0, - visualized: browser ? parseInt(localStorage.getItem('feedbackVisualized')) ?? 0 : 0, + elapsed: browser ? (parseInt(localStorage.getItem('feedbackElapsed')) ?? 0) : 0, + visualized: browser ? (parseInt(localStorage.getItem('feedbackVisualized')) ?? 0) : 0, notification: false, type: 'general', show: false From 7707bcc24e5168d4d0689e0cb7e778e2a9b033d4 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Thu, 3 Oct 2024 14:53:03 +0530 Subject: [PATCH 09/10] address comments. --- .../settings/deleteOrganizationModal.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte index 0c622ce5c4..7ba6a4cec5 100644 --- a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -219,17 +219,17 @@ From a66e46dbc179ae734dff7365d39536806502e5d6 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Thu, 3 Oct 2024 15:26:00 +0530 Subject: [PATCH 10/10] minor refactor. --- .../settings/deleteOrganizationModal.svelte | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte index 7ba6a4cec5..3ca94e1956 100644 --- a/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/deleteOrganizationModal.svelte @@ -132,7 +132,7 @@

{#if $projects.total > 0} -
+
{#each tabs as { name, label, total }}
-
+
{#each tabs as { name, label, total }} .box { padding: unset; - background-color: unset; border-radius: var(--border-radius-medium, 8px); } :global(.max-height-dialog dialog) { max-height: 650px; } - - :global(.no-inner-borders .table-with-scroll .table) { - box-shadow: unset; - border-radius: unset; - }