From 98e7188d71618b695838857cc468fabf8b6cf7de Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 30 Nov 2023 16:44:43 -0800 Subject: [PATCH] Update create message wizard to support push --- .../project-[project]/messaging/create.svelte | 4 +- .../messaging/pushPhone.svelte | 16 ++ .../messaging/wizard/pushFormList.svelte | 142 ++++++++++++++++++ .../messaging/wizard/step1.svelte | 3 + 4 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 src/routes/console/project-[project]/messaging/pushPhone.svelte create mode 100644 src/routes/console/project-[project]/messaging/wizard/pushFormList.svelte diff --git a/src/routes/console/project-[project]/messaging/create.svelte b/src/routes/console/project-[project]/messaging/create.svelte index 3c9924a976..d0aa3a6097 100644 --- a/src/routes/console/project-[project]/messaging/create.svelte +++ b/src/routes/console/project-[project]/messaging/create.svelte @@ -56,9 +56,7 @@ case ProviderTypes.Push: response = await sdk.forProject.client.call( 'POST', - new URL( - sdk.forProject.client.config.endpoint + '/messaging/providers/telesign' - ), + new URL(sdk.forProject.client.config.endpoint + '/messaging/messages/push'), { 'X-Appwrite-Project': sdk.forProject.client.config.project, 'content-type': 'application/json', diff --git a/src/routes/console/project-[project]/messaging/pushPhone.svelte b/src/routes/console/project-[project]/messaging/pushPhone.svelte new file mode 100644 index 0000000000..2acfc19f85 --- /dev/null +++ b/src/routes/console/project-[project]/messaging/pushPhone.svelte @@ -0,0 +1,16 @@ + + + +
+

{title}

+

{body}

+
+ + diff --git a/src/routes/console/project-[project]/messaging/wizard/pushFormList.svelte b/src/routes/console/project-[project]/messaging/wizard/pushFormList.svelte new file mode 100644 index 0000000000..0895ecc176 --- /dev/null +++ b/src/routes/console/project-[project]/messaging/wizard/pushFormList.svelte @@ -0,0 +1,142 @@ + + + + +
+ + + +
+ + + + + + + + + + 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 dcdc4ed00b..822a332b41 100644 --- a/src/routes/console/project-[project]/messaging/wizard/step1.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/step1.svelte @@ -5,6 +5,7 @@ import { ProviderTypes } from '../providerType.svelte'; import EmailFormList from './emailFormList.svelte'; import SmsFormList from './smsFormList.svelte'; + import PushFormList from './pushFormList.svelte'; async function beforeSubmit() { console.log($messageParams[$providerType]); @@ -22,5 +23,7 @@ {:else if $providerType === ProviderTypes.Sms} + {:else if $providerType === ProviderTypes.Push} + {/if}