From fb6f0ad45d2a5bc7082a3733162ef0b1701c5f25 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 18 Jul 2024 14:46:36 +0200 Subject: [PATCH 01/24] fix: allow address removal --- .../account/payments/billingAddress.svelte | 44 ++++++++-------- .../account/payments/paymentMethods.svelte | 39 ++++++++------- .../billing/billingAddress.svelte | 13 +++++ .../billing/paymentMethods.svelte | 9 ++-- .../billing/removeAddress.svelte | 50 +++++++++++++++++++ 5 files changed, 112 insertions(+), 43 deletions(-) create mode 100644 src/routes/console/organization-[organization]/billing/removeAddress.svelte diff --git a/src/routes/console/account/payments/billingAddress.svelte b/src/routes/console/account/payments/billingAddress.svelte index 0440237a8..fae9fdcfd 100644 --- a/src/routes/console/account/payments/billingAddress.svelte +++ b/src/routes/console/account/payments/billingAddress.svelte @@ -1,5 +1,12 @@ + + +

+ Are you sure you want to remove the billing address from {$organization?.name}? +

+ + + + +
From aaa08e9e531e3e73c21ab9db14fedfdf542d92c4 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 18 Jul 2024 15:09:52 +0200 Subject: [PATCH 02/24] fix: dropdown design --- .../account/payments/billingAddress.svelte | 29 ++++++++++--------- .../account/payments/paymentMethods.svelte | 16 +++++----- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/routes/console/account/payments/billingAddress.svelte b/src/routes/console/account/payments/billingAddress.svelte index fae9fdcfd..807fa9ee5 100644 --- a/src/routes/console/account/payments/billingAddress.svelte +++ b/src/routes/console/account/payments/billingAddress.svelte @@ -1,12 +1,5 @@ + + +
+ BAA +
+

After requesting a BAA, we will contact you via email for the next steps.

+ + +
+ Business Associate Agreement (BAA) +
+

+ A Business Associate Agreement (BAA) is a HIPAA-required document ensuring outside + services handling patient information for a healthcare organization follow privacy + rules. +

+ +
+
+
+ + diff --git a/src/routes/console/organization-[organization]/settings/BAAModal.svelte b/src/routes/console/organization-[organization]/settings/BAAModal.svelte new file mode 100644 index 000000000..bb846ab5e --- /dev/null +++ b/src/routes/console/organization-[organization]/settings/BAAModal.svelte @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + diff --git a/src/routes/console/organization-[organization]/settings/Soc2.svelte b/src/routes/console/organization-[organization]/settings/Soc2.svelte new file mode 100644 index 000000000..b4c882e77 --- /dev/null +++ b/src/routes/console/organization-[organization]/settings/Soc2.svelte @@ -0,0 +1,36 @@ + + + +
+ Soc-2 +
+

After requesting Soc-2, we will contact you via email for the next steps.

+ + +
+ Service Organization Control Type 2 (Soc-2) +
+

+ Soc-2 is a framework for managing and protecting sensitive information, ensuring + compliance with trust service criteria such as security, availability, processing + integrity, confidentiality, and privacy. +

+ +
+
+
+ + diff --git a/src/routes/console/organization-[organization]/settings/Soc2Modal.svelte b/src/routes/console/organization-[organization]/settings/Soc2Modal.svelte new file mode 100644 index 000000000..815a09251 --- /dev/null +++ b/src/routes/console/organization-[organization]/settings/Soc2Modal.svelte @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + From fd465adab58d29112726f7b6cd4ee3e536688633 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 20 Aug 2024 17:13:30 +0200 Subject: [PATCH 06/24] fix: account billing address --- src/routes/console/account/payments/+page.ts | 11 +++++++++-- .../console/account/payments/billingAddress.svelte | 7 ++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/routes/console/account/payments/+page.ts b/src/routes/console/account/payments/+page.ts index 28fa52025..8a45229d1 100644 --- a/src/routes/console/account/payments/+page.ts +++ b/src/routes/console/account/payments/+page.ts @@ -6,8 +6,15 @@ export const load: PageLoad = async ({ parent, depends }) => { await parent(); depends(Dependencies.PAYMENT_METHODS); depends(Dependencies.ADDRESS); + + const [paymentMethods, addressList, organizations] = await Promise.all([ + sdk.forConsole.billing.listPaymentMethods(), + sdk.forConsole.billing.listAddresses(), + sdk.forConsole.teams.list() + ]); return { - paymentMethods: await sdk.forConsole.billing.listPaymentMethods(), - addressList: await sdk.forConsole.billing.listAddresses() + organizations, + paymentMethods, + addressList }; }; diff --git a/src/routes/console/account/payments/billingAddress.svelte b/src/routes/console/account/payments/billingAddress.svelte index 99187e77d..d0304ee22 100644 --- a/src/routes/console/account/payments/billingAddress.svelte +++ b/src/routes/console/account/payments/billingAddress.svelte @@ -35,6 +35,8 @@ }); $: orgList = $organizationList.teams as unknown as Organization[]; + + $: console.log(orgList); @@ -94,11 +96,6 @@ href={`${base}/console/organization-${org.$id}/billing`}> {org.name} - - {org.name} - {/each} From d25f6f019e3d827f6d8646fe9f2ad36dd121822f Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 30 Aug 2024 10:28:10 +0200 Subject: [PATCH 07/24] feat: add support metafields --- .../settings/BAAModal.svelte | 11 ++++++++--- .../settings/Soc2Modal.svelte | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte index bb846ab5e..2db74cfda 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -17,7 +17,7 @@ import { onMount } from 'svelte'; export let show = false; let email = ''; - let employees = null; + let employees: string = null; let employeesOptions = [ { value: '1-5', @@ -67,14 +67,19 @@ subject: 'support', email: email, firstName: $user?.name ?? '', - message: 'message', + message: '', tags: ['cloud'], customFields: [ { id: '41612', value: 'BAA' }, { id: '48493', value: $user?.name ?? '' }, { id: '48492', value: $organization?.$id ?? '' }, { id: '48490', value: $user?.$id ?? '' } - ] + ], + metaFields: { + employees: employees, + country: country, + role: role + } }) }); trackEvent(Submit.RequestBAA); diff --git a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte index 815a09251..c0b9703cc 100644 --- a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte @@ -11,7 +11,7 @@ import { onMount } from 'svelte'; export let show = false; let email = ''; - let employees = null; + let employees: string = null; let employeesOptions = [ { value: '1-5', @@ -61,14 +61,19 @@ subject: 'support', email: email, firstName: $user?.name ?? '', - message: 'message', + message: '', tags: ['cloud'], customFields: [ { id: '41612', value: 'Soc-2' }, { id: '48493', value: $user?.name ?? '' }, { id: '48492', value: $organization?.$id ?? '' }, { id: '48490', value: $user?.$id ?? '' } - ] + ], + metaFields: { + employees: employees, + country: country, + role: role + } }) }); trackEvent(Submit.RequestSoc2); From d03df6fd239843cb9774408f2b49d75c8cdd6088 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 30 Aug 2024 11:09:29 +0200 Subject: [PATCH 08/24] fix: support message missing --- .../settings/BAAModal.svelte | 11 ++++++----- .../settings/Soc2Modal.svelte | 12 +++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte index 2db74cfda..bd6726ada 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -42,6 +42,8 @@ let role = ''; + let error: string; + onMount(async () => { const countryList = await sdk.forProject.locale.listCountries(); const locale = await sdk.forProject.locale.get(); @@ -67,7 +69,7 @@ subject: 'support', email: email, firstName: $user?.name ?? '', - message: '', + message: 'BAA', tags: ['cloud'], customFields: [ { id: '41612', value: 'BAA' }, @@ -85,11 +87,9 @@ trackEvent(Submit.RequestBAA); if (response.status !== 200) { trackError(new Error(response.status.toString()), Submit.RequestBAA); - addNotification({ - message: 'There was an error submitting your request. Please try again later.', - type: 'error' - }); + error = 'There was an error submitting your request. Please try again later.'; } else { + show = false; addNotification({ message: `Your request was sent, we will get in contact with you at ${email} in a few working days`, type: 'success' @@ -99,6 +99,7 @@ { const countryList = await sdk.forProject.locale.listCountries(); const locale = await sdk.forProject.locale.get(); @@ -61,7 +63,7 @@ subject: 'support', email: email, firstName: $user?.name ?? '', - message: '', + message: 'Soc-2', tags: ['cloud'], customFields: [ { id: '41612', value: 'Soc-2' }, @@ -79,11 +81,10 @@ trackEvent(Submit.RequestSoc2); if (response.status !== 200) { trackError(new Error(response.status.toString()), Submit.RequestSoc2); - addNotification({ - message: 'There was an error submitting your request. Please try again later.', - type: 'error' - }); + error = 'There was an error submitting your request. Please try again later.'; } else { + show = false; + addNotification({ message: `Your request was sent, we will get in contact with you at ${email} in a few working days`, type: 'success' @@ -93,6 +94,7 @@ Date: Fri, 30 Aug 2024 14:14:46 +0200 Subject: [PATCH 09/24] fix: design review --- .../settings/BAAModal.svelte | 13 +++---------- .../settings/Soc2Modal.svelte | 6 +++--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte index bd6726ada..2644c6e01 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -1,14 +1,7 @@ - - - - - - - - + {#if $project?.$id} + + + + + + + + + {/if} diff --git a/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte b/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte index f73df991f..9db581f0b 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateMockNumbers.svelte @@ -22,7 +22,6 @@ let numbers: Models.MockNumber[] = $project?.authMockNumbers ?? []; let initialNumbers = []; - let projectId: string = $project.$id; $: initialNumbers = $project?.authMockNumbers?.map((num) => ({ ...num })) ?? []; $: isSubmitDisabled = JSON.stringify(numbers) === JSON.stringify(initialNumbers); @@ -39,7 +38,7 @@ async function updateMockNumbers() { try { - await sdk.forConsole.projects.updateMockNumbers(projectId, numbers); + await sdk.forConsole.projects.updateMockNumbers($project.$id, numbers); await invalidate(Dependencies.PROJECT); addNotification({ type: 'success', diff --git a/src/routes/(console)/project-[project]/auth/security/updatePasswordDictionary.svelte b/src/routes/(console)/project-[project]/auth/security/updatePasswordDictionary.svelte index 2cc776a02..67b9ad5a6 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePasswordDictionary.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePasswordDictionary.svelte @@ -8,13 +8,12 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const projectId = $project.$id; - let passwordDictionary = $project.authPasswordDictionary ?? false; + let passwordDictionary = $project?.authPasswordDictionary ?? false; async function updatePasswordDictionary() { try { await sdk.forConsole.projects.updateAuthPasswordDictionary( - projectId, + $project.$id, passwordDictionary ); await invalidate(Dependencies.PROJECT); @@ -56,7 +55,7 @@ - diff --git a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte index 40bfec487..b44e63cb2 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte @@ -9,15 +9,14 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const projectId = $project.$id; let passwordHistory = $project.authPasswordHistory < 1 ? 5 : $project.authPasswordHistory; - let passwordHistoryEnabled = ($project.authPasswordHistory ?? 0) != 0; + let passwordHistoryEnabled = ($project?.authPasswordHistory ?? 0) != 0; let initialPasswordHistoryEnabled = passwordHistoryEnabled; async function updatePasswordHistoryLimit() { try { await sdk.forConsole.projects.updateAuthPasswordHistory( - projectId, + $project.$id, passwordHistoryEnabled ? passwordHistory : 0 ); await invalidate(Dependencies.PROJECT); @@ -67,8 +66,8 @@ diff --git a/src/routes/(console)/project-[project]/auth/security/updatePersonalDataCheck.svelte b/src/routes/(console)/project-[project]/auth/security/updatePersonalDataCheck.svelte index 2a758875f..2bee05aed 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePersonalDataCheck.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePersonalDataCheck.svelte @@ -9,7 +9,7 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - let authPersonalDataCheck = $project.authPersonalDataCheck ?? false; + let authPersonalDataCheck = $project?.authPersonalDataCheck ?? false; async function updatePersonalDataCheck() { try { @@ -50,7 +50,7 @@ - diff --git a/src/routes/(console)/project-[project]/auth/security/updateSessionAlerts.svelte b/src/routes/(console)/project-[project]/auth/security/updateSessionAlerts.svelte index 7ad63290c..c6f176ffa 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateSessionAlerts.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateSessionAlerts.svelte @@ -9,7 +9,7 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - let authSessionAlerts = $project.authSessionAlerts ?? false; + let authSessionAlerts = $project?.authSessionAlerts ?? false; async function updateSessionAlerts() { try { @@ -46,7 +46,7 @@ - diff --git a/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte b/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte index 848f2bbf8..c4348175d 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte @@ -9,13 +9,12 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const projectId = $project.$id; const { value, unit, baseValue, units } = createTimeUnitPair($project.authDuration); const options = units.map((v) => ({ label: v.name, value: v.name })); async function updateSessionLength() { try { - await sdk.forConsole.projects.updateAuthDuration(projectId, $baseValue); + await sdk.forConsole.projects.updateAuthDuration($project.$id, $baseValue); await invalidate(Dependencies.PROJECT); addNotification({ diff --git a/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte b/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte index 5fe3d16f9..51d32fe37 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte @@ -8,13 +8,11 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const projectId = $project.$id; - let maxSessions = $project.authSessionsLimit; async function updateSessionsLimit() { try { - await sdk.forConsole.projects.updateAuthSessionsLimit(projectId, maxSessions); + await sdk.forConsole.projects.updateAuthSessionsLimit($project.$id, maxSessions); await invalidate(Dependencies.PROJECT); addNotification({ @@ -43,7 +41,7 @@ - + diff --git a/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte b/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte index e2ec75549..6f67ceae0 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte @@ -10,15 +10,13 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const projectId = $project.$id; - - let isLimited = $project.authLimit !== 0; - let newLimit = isLimited ? $project.authLimit : 100; + let isLimited = $project?.authLimit !== 0; + let newLimit = isLimited ? $project?.authLimit : 100; $: btnDisabled = (function isBtnDisabled() { if ( - (!isLimited && $project.authLimit === 0) || - (isLimited && $project.authLimit === newLimit) + (!isLimited && $project?.authLimit === 0) || + (isLimited && $project?.authLimit === newLimit) ) { return true; } @@ -28,7 +26,7 @@ async function updateLimit() { try { - await sdk.forConsole.projects.updateAuthLimit(projectId, isLimited ? newLimit : 0); + await sdk.forConsole.projects.updateAuthLimit($project?.$id, isLimited ? newLimit : 0); await invalidate(Dependencies.PROJECT); addNotification({ type: 'success', diff --git a/src/routes/(console)/project-[project]/auth/templates/+page.svelte b/src/routes/(console)/project-[project]/auth/templates/+page.svelte index 59ccc5fa7..d7555d889 100644 --- a/src/routes/(console)/project-[project]/auth/templates/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/templates/+page.svelte @@ -33,11 +33,9 @@ diff --git a/src/routes/(console)/project-[project]/messaging/topics/table.svelte b/src/routes/(console)/project-[project]/messaging/topics/table.svelte index 7344c142f..aa1652427 100644 --- a/src/routes/(console)/project-[project]/messaging/topics/table.svelte +++ b/src/routes/(console)/project-[project]/messaging/topics/table.svelte @@ -16,12 +16,12 @@ } from '$lib/elements/table'; import { addNotification } from '$lib/stores/notifications'; import type { PageData } from './$types'; - import { project } from '$routes/(console)/project-[project]/store'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import { sdk } from '$lib/stores/sdk'; import { toLocaleDateTime } from '$lib/helpers/date'; import type { Column } from '$lib/helpers/types'; + import { page } from '$app/stores'; export let columns: Column[]; export let data: PageData; @@ -72,7 +72,7 @@ {#each data.topics.topics as topic (topic.$id)} + href={`${base}/project-${$page.params.project}/messaging/topics/topic-${topic.$id}`}> {#each columns as column (column.id)} From d31e86f962400862f40b11276ab26b51f0384b3f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 18 Sep 2024 17:59:26 +0200 Subject: [PATCH 11/24] fix: functions page --- src/lib/helpers/sizeConvertion.ts | 1 + .../functions/function-[function]/+page.svelte | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/sizeConvertion.ts b/src/lib/helpers/sizeConvertion.ts index bd0da8f64..8d108f8c8 100644 --- a/src/lib/helpers/sizeConvertion.ts +++ b/src/lib/helpers/sizeConvertion.ts @@ -14,6 +14,7 @@ export function calculateSize(bytes: number, decimals = 1, base: 1000 | 1024 = 1 } export function sizeToBytes(value: number, unit: Size, base = 1000) { + if (typeof value !== 'number') return 0; const index = sizes.indexOf(unit); return value * Math.pow(base, index); } diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte index 36ba1d69e..25ace1284 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte @@ -16,7 +16,6 @@ import Create from './create.svelte'; import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import { readOnly } from '$lib/stores/billing'; - import { project } from '../../store'; import { writable } from 'svelte/store'; import type { Column } from '$lib/helpers/types'; import Table from './table.svelte'; @@ -196,7 +195,7 @@ From afac668945616542ab7fd8d4b9f2d595f244f224 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 19 Sep 2024 15:09:02 +0200 Subject: [PATCH 12/24] fix: clearer code --- src/lib/helpers/unit.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/helpers/unit.ts b/src/lib/helpers/unit.ts index 857874fdc..bc24429bd 100644 --- a/src/lib/helpers/unit.ts +++ b/src/lib/helpers/unit.ts @@ -70,8 +70,7 @@ export function createTimeUnitPair(initialValue = 0) { { name: 'Minutes', value: 60 }, { name: 'Seconds', value: 1 } ]; - if (!initialValue) return { ...createValueUnitPair(0, units), units }; - return { ...createValueUnitPair(initialValue, units), units }; + return { ...createValueUnitPair(initialValue || 0, units), units }; } export function createByteUnitPair(initialValue = 0, base: 1000 | 1024 = 1000) { From 810c280ff9fa3769291a87d8d6b54ba1e01b8193 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 19 Sep 2024 16:20:30 +0200 Subject: [PATCH 13/24] fix: remove if condition --- .../auth/security/+page.svelte | 18 ++++++++---------- .../auth/security/updatePasswordHistory.svelte | 2 +- .../auth/security/updateSessionLength.svelte | 2 +- .../auth/security/updateSessionsLimit.svelte | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/routes/(console)/project-[project]/auth/security/+page.svelte b/src/routes/(console)/project-[project]/auth/security/+page.svelte index 06a36de25..a78bd2649 100644 --- a/src/routes/(console)/project-[project]/auth/security/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/security/+page.svelte @@ -12,14 +12,12 @@ - {#if $project?.$id} - - - - - - - - - {/if} + + + + + + + + diff --git a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte index b44e63cb2..1c7007366 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte @@ -9,7 +9,7 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - let passwordHistory = $project.authPasswordHistory < 1 ? 5 : $project.authPasswordHistory; + let passwordHistory = $project?.authPasswordHistory < 1 ? 5 : $project?.authPasswordHistory; let passwordHistoryEnabled = ($project?.authPasswordHistory ?? 0) != 0; let initialPasswordHistoryEnabled = passwordHistoryEnabled; diff --git a/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte b/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte index c4348175d..cbac619cb 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateSessionLength.svelte @@ -9,7 +9,7 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - const { value, unit, baseValue, units } = createTimeUnitPair($project.authDuration); + const { value, unit, baseValue, units } = createTimeUnitPair($project?.authDuration); const options = units.map((v) => ({ label: v.name, value: v.name })); async function updateSessionLength() { diff --git a/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte b/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte index 51d32fe37..2172756ba 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateSessionsLimit.svelte @@ -8,7 +8,7 @@ import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; - let maxSessions = $project.authSessionsLimit; + let maxSessions = $project?.authSessionsLimit; async function updateSessionsLimit() { try { From 755b424a08c703a7c2371a9cf9316def5542b0b3 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 24 Sep 2024 14:57:11 +0200 Subject: [PATCH 14/24] fix: merge --- src/routes/(console)/account/payments/+page.ts | 7 ++++--- .../(console)/account/payments/billingAddress.svelte | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/routes/(console)/account/payments/+page.ts b/src/routes/(console)/account/payments/+page.ts index d2a85ed56..e8886a6d9 100644 --- a/src/routes/(console)/account/payments/+page.ts +++ b/src/routes/(console)/account/payments/+page.ts @@ -6,12 +6,13 @@ export const load: PageLoad = async ({ depends }) => { depends(Dependencies.PAYMENT_METHODS); depends(Dependencies.ADDRESS); - const [paymentMethods, addressList] = await Promise.all([ + const [paymentMethods, addressList, organizations] = await Promise.all([ sdk.forConsole.billing.listPaymentMethods(), - sdk.forConsole.billing.listAddresses() + sdk.forConsole.billing.listAddresses(), + sdk.forConsole.teams.list() ]); - return { + organizations, paymentMethods, addressList }; diff --git a/src/routes/(console)/account/payments/billingAddress.svelte b/src/routes/(console)/account/payments/billingAddress.svelte index d0304ee22..5df72574e 100644 --- a/src/routes/(console)/account/payments/billingAddress.svelte +++ b/src/routes/(console)/account/payments/billingAddress.svelte @@ -35,8 +35,6 @@ }); $: orgList = $organizationList.teams as unknown as Organization[]; - - $: console.log(orgList); From 01417f2f4bcdcb240b2fc199e68488482ecfae2b Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 27 Sep 2024 11:03:52 +0200 Subject: [PATCH 15/24] fix: review --- .../auth/security/updatePasswordHistory.svelte | 2 +- .../(console)/project-[project]/auth/templates/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte index 1c7007366..a308e9962 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte @@ -10,7 +10,7 @@ import { project } from '../../store'; let passwordHistory = $project?.authPasswordHistory < 1 ? 5 : $project?.authPasswordHistory; - let passwordHistoryEnabled = ($project?.authPasswordHistory ?? 0) != 0; + let passwordHistoryEnabled = ($project?.authPasswordHistory ?? 0) !== 0; let initialPasswordHistoryEnabled = passwordHistoryEnabled; async function updatePasswordHistoryLimit() { diff --git a/src/routes/(console)/project-[project]/auth/templates/+page.svelte b/src/routes/(console)/project-[project]/auth/templates/+page.svelte index d7555d889..369080543 100644 --- a/src/routes/(console)/project-[project]/auth/templates/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/templates/+page.svelte @@ -103,7 +103,7 @@ - {#if !data.project?.smtpEnabled} + {#if !data.project.smtpEnabled}
Date: Fri, 27 Sep 2024 15:50:17 +0530 Subject: [PATCH 16/24] update: hide promotions logic. --- src/lib/components/bottomModalAlert.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/bottomModalAlert.svelte b/src/lib/components/bottomModalAlert.svelte index c0623b24d..bab0c7f5e 100644 --- a/src/lib/components/bottomModalAlert.svelte +++ b/src/lib/components/bottomModalAlert.svelte @@ -52,7 +52,7 @@ function handleClose() { const modalAlert = currentModalAlert; dismissBottomModalAlert(modalAlert.id); - hideNotification(modalAlert.id); + hideNotification(modalAlert.id, { coolOffPeriod: (24 * 365) }); if (modalAlert.closed) modalAlert.closed(); if (currentIndex === filteredModalAlerts.length - 1 && filteredModalAlerts.length > 1) { From f4ea908eb8a0dac03003a523ebc5198fe056f9d8 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Fri, 27 Sep 2024 15:52:40 +0530 Subject: [PATCH 17/24] ran: formatter --- src/lib/components/bottomModalAlert.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/bottomModalAlert.svelte b/src/lib/components/bottomModalAlert.svelte index bab0c7f5e..ec070db93 100644 --- a/src/lib/components/bottomModalAlert.svelte +++ b/src/lib/components/bottomModalAlert.svelte @@ -52,7 +52,7 @@ function handleClose() { const modalAlert = currentModalAlert; dismissBottomModalAlert(modalAlert.id); - hideNotification(modalAlert.id, { coolOffPeriod: (24 * 365) }); + hideNotification(modalAlert.id, { coolOffPeriod: 24 * 365 }); if (modalAlert.closed) modalAlert.closed(); if (currentIndex === filteredModalAlerts.length - 1 && filteredModalAlerts.length > 1) { From f477470fa857affe1deb01cf2fe7e733a0db9cfd Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 30 Sep 2024 09:07:40 +0200 Subject: [PATCH 18/24] Fix "undefined" on console usage --- src/lib/components/progressBarBig.svelte | 2 +- .../organization-[organization]/usage/[[invoice]]/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/progressBarBig.svelte b/src/lib/components/progressBarBig.svelte index e858e53d9..7e012f649 100644 --- a/src/lib/components/progressBarBig.svelte +++ b/src/lib/components/progressBarBig.svelte @@ -26,7 +26,7 @@

{maxValue} - {maxUnit && maxUnit} + {maxUnit ? maxUnit : ''}

{/if} diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index cfa038e9f..5e716cfab 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -237,7 +237,7 @@ From d899c9381afff56c39ce369d3dd201adcc7dc36a Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 30 Sep 2024 09:22:37 +0200 Subject: [PATCH 19/24] Remove padding-left on project breakdown table --- .../usage/[[invoice]]/ProjectBreakdown.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte index 3b922bc98..c7fc534de 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte @@ -59,7 +59,7 @@ Project breakdown - Project + Project Usage {#if $canSeeProjects} @@ -68,7 +68,7 @@ {#each groupByProject(metric).sort((a, b) => b.usage - a.usage) as project} - + {getProjectName(project.projectId)} {format(project.usage)} From a8fbc6feb0592f5daaccf813dc0dc7b8c35b9c94 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 30 Sep 2024 09:29:36 +0200 Subject: [PATCH 20/24] Prettier fixes --- src/lib/components/progressBarBig.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/progressBarBig.svelte b/src/lib/components/progressBarBig.svelte index 7e012f649..01d47ed26 100644 --- a/src/lib/components/progressBarBig.svelte +++ b/src/lib/components/progressBarBig.svelte @@ -26,7 +26,7 @@

{maxValue} - {maxUnit ? maxUnit : ''} + {maxUnit ? maxUnit : ''}

{/if} From 8e030148861cf1af1dab0153925603fc604ee136 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 1 Oct 2024 11:09:09 +0200 Subject: [PATCH 21/24] fix: linter --- .../(console)/project-[project]/auth/security/+page.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/auth/security/+page.svelte b/src/routes/(console)/project-[project]/auth/security/+page.svelte index a78bd2649..1067d9cb2 100644 --- a/src/routes/(console)/project-[project]/auth/security/+page.svelte +++ b/src/routes/(console)/project-[project]/auth/security/+page.svelte @@ -1,6 +1,5 @@