From 8a4cbfb46452fe413f1851876db067ef2c77a1d9 Mon Sep 17 00:00:00 2001 From: Arman Date: Mon, 29 Jul 2024 16:39:21 +0200 Subject: [PATCH 1/4] feat: BAA and Soc-2 --- src/lib/actions/analytics.ts | 4 +- .../settings/+page.svelte | 4 + .../settings/BAA.svelte | 36 +++++ .../settings/BAAModal.svelte | 132 ++++++++++++++++++ .../settings/Soc2.svelte | 36 +++++ .../settings/Soc2Modal.svelte | 126 +++++++++++++++++ 6 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 src/routes/console/organization-[organization]/settings/BAA.svelte create mode 100644 src/routes/console/organization-[organization]/settings/BAAModal.svelte create mode 100644 src/routes/console/organization-[organization]/settings/Soc2.svelte create mode 100644 src/routes/console/organization-[organization]/settings/Soc2Modal.svelte diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 744a4e3517..608e94897d 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -314,5 +314,7 @@ export enum Submit { MessagingTopicUpdateName = 'submit_messaging_topic_update_name', MessagingTopicUpdatePermissions = 'submit_messaging_topic_update_permissions', MessagingTopicSubscriberAdd = 'submit_messaging_topic_subscriber_add', - MessagingTopicSubscriberDelete = 'submit_messaging_topic_subscriber_delete' + MessagingTopicSubscriberDelete = 'submit_messaging_topic_subscriber_delete', + RequestBAA = 'submit_request_baa', + RequestSoc2 = 'submit_request_soc2' } diff --git a/src/routes/console/organization-[organization]/settings/+page.svelte b/src/routes/console/organization-[organization]/settings/+page.svelte index 8407543078..ee06bc6e8b 100644 --- a/src/routes/console/organization-[organization]/settings/+page.svelte +++ b/src/routes/console/organization-[organization]/settings/+page.svelte @@ -12,6 +12,8 @@ import DownloadDPA from './downloadDPA.svelte'; import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { isCloud } from '$lib/system'; + import Baa from './BAA.svelte'; + import Soc2 from './Soc2.svelte'; export let data; let name: string; @@ -67,6 +69,8 @@ {#if isCloud} + + {/if} diff --git a/src/routes/console/organization-[organization]/settings/BAA.svelte b/src/routes/console/organization-[organization]/settings/BAA.svelte new file mode 100644 index 0000000000..9707358323 --- /dev/null +++ b/src/routes/console/organization-[organization]/settings/BAA.svelte @@ -0,0 +1,36 @@ + + + +
+ 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 0000000000..bb846ab5e8 --- /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 0000000000..b4c882e778 --- /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 0000000000..815a092510 --- /dev/null +++ b/src/routes/console/organization-[organization]/settings/Soc2Modal.svelte @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + From d25f6f019e3d827f6d8646fe9f2ad36dd121822f Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 30 Aug 2024 10:28:10 +0200 Subject: [PATCH 2/4] 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 bb846ab5e8..2db74cfda4 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 815a092510..c0b9703cc1 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 3/4] 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 2db74cfda4..bd6726adaf 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 4/4] 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 bd6726adaf..2644c6e010 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -1,14 +1,7 @@