From 80e81b1cf5f2d96e09df4d330d25ce1c0cbc1e3a Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 29 Nov 2023 21:09:45 -0800 Subject: [PATCH 1/4] Update create message wizard to support SMS --- .../messaging/smsPhone.svelte | 14 ++ .../messaging/wizard/smsFormList.svelte | 137 ++++++++++++++++++ .../messaging/wizard/step1.svelte | 8 +- .../messaging/wizard/step2.svelte | 3 +- 4 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 src/routes/console/project-[project]/messaging/smsPhone.svelte create mode 100644 src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte diff --git a/src/routes/console/project-[project]/messaging/smsPhone.svelte b/src/routes/console/project-[project]/messaging/smsPhone.svelte new file mode 100644 index 0000000000..c7db28c112 --- /dev/null +++ b/src/routes/console/project-[project]/messaging/smsPhone.svelte @@ -0,0 +1,14 @@ + + + +
+ {content} +
+ + diff --git a/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte b/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte new file mode 100644 index 0000000000..02de8c60f0 --- /dev/null +++ b/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte @@ -0,0 +1,137 @@ + + + + +
+ +
+ + + + + + + + + + Enter the phone number to which the test message will be +
(selected = 'other')} + on:keyup|self={clickOnEnter} + role="button" + tabindex="0"> + +
+
+
+ + + + + +
+
+ + + {#if !showCustomId} +
+ (showCustomId = !showCustomId)} + > +
+ {:else} + + {/if} +
+ +
diff --git a/src/routes/console/project-[project]/messaging/wizard/step1.svelte b/src/routes/console/project-[project]/messaging/wizard/step1.svelte index 01c7048733..dcdc4ed00b 100644 --- a/src/routes/console/project-[project]/messaging/wizard/step1.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/step1.svelte @@ -2,7 +2,9 @@ import { WizardStep } from '$lib/layout'; import { messageParams, providerType } from './store'; import { providers } from '../providers/store'; + import { ProviderTypes } from '../providerType.svelte'; import EmailFormList from './emailFormList.svelte'; + import SmsFormList from './smsFormList.svelte'; async function beforeSubmit() { console.log($messageParams[$providerType]); @@ -16,5 +18,9 @@ Create an {providers[$providerType].text} that will be displayed to your subscribers. Learn more in our documentation. - + {#if $providerType === ProviderTypes.Email} + + {:else if $providerType === ProviderTypes.Sms} + + {/if} diff --git a/src/routes/console/project-[project]/messaging/wizard/step2.svelte b/src/routes/console/project-[project]/messaging/wizard/step2.svelte index 60f734edff..3b1c0433fa 100644 --- a/src/routes/console/project-[project]/messaging/wizard/step2.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/step2.svelte @@ -1,7 +1,6 @@ {#if $message.providerType === ProviderTypes.Email} + {:else if $message.providerType === ProviderTypes.Sms} + {/if} diff --git a/src/routes/console/project-[project]/messaging/message-[message]/smsPreview.svelte b/src/routes/console/project-[project]/messaging/message-[message]/smsPreview.svelte new file mode 100644 index 0000000000..5648c9bf23 --- /dev/null +++ b/src/routes/console/project-[project]/messaging/message-[message]/smsPreview.svelte @@ -0,0 +1,29 @@ + + + +
+ Preview + +
+ + + + + + + + + + + +
From 6a39aaadaa444b69541b0a60f72e37f88d43a5a1 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 2 Jan 2024 15:54:41 +0100 Subject: [PATCH 3/4] Update src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte --- .../project-[project]/messaging/wizard/smsFormList.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte b/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte index 02de8c60f0..fe5842dfaa 100644 --- a/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/smsFormList.svelte @@ -41,7 +41,6 @@ async function sendTestSMS() { const email = selected === 'self' ? $user.email : otherEmail; - console.log(email); createSMSMessage({ topics: $messageParams[ProviderTypes.Email]?.topics || [], From f9931d23f3d0b1d693c65d73d939632f541fa2e6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 2 Jan 2024 15:54:46 +0100 Subject: [PATCH 4/4] Update src/routes/console/project-[project]/messaging/wizard/step1.svelte --- .../console/project-[project]/messaging/wizard/step1.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/console/project-[project]/messaging/wizard/step1.svelte b/src/routes/console/project-[project]/messaging/wizard/step1.svelte index dcdc4ed00b..7ef32a000d 100644 --- a/src/routes/console/project-[project]/messaging/wizard/step1.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/step1.svelte @@ -7,7 +7,6 @@ import SmsFormList from './smsFormList.svelte'; async function beforeSubmit() { - console.log($messageParams[$providerType]); }