Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions src/routes/console/project-[project]/messaging/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,14 @@
total={data.messages.total} />
{:else if $hasPageQueries}
<EmptyFilter resource="messages" />
<!-- TODO: remove data.search != 'empty' when the API is ready with data -->
{:else if data.search && data.search != 'empty'}
{:else if data.search}
<EmptySearch>
<div class="u-text-center">
<b>Sorry, we couldn't find '{data.search}'</b>
<p>There are no messages that match your search.</p>
</div>
<div class="u-flex u-gap-16">
<!-- TODO: update docs link -->
<Button
external
href="https://appwrite.io/docs/products/storage/upload-download"
text>
<Button external href="https://appwrite.io/docs/products/messaging/messages" text>
Documentation
</Button>
<Button secondary href={`/console/project-${$page.params.project}/messaging`}>
Expand All @@ -246,12 +241,7 @@
</div>
</EmptySearch>
{:else}
<!-- TODO: update docs link -->
<Empty
single
href="https://appwrite.io/docs"
target="message"
on:click={() => ($showCreate = true)}>
<Empty single target="message" on:click={() => ($showCreate = true)}>
<div class="u-text-center">
<Heading size="7" tag="h2" trimmed={false}>
Create your first message to get started.
Expand All @@ -263,7 +253,7 @@
<div class="u-flex u-flex-wrap u-gap-16 u-main-center">
<Button
external
href="https://appwrite.io/docs/references/cloud/client-web/messages"
href="https://appwrite.io/docs/products/messaging/messages"
text
event="empty_documentation"
ariaLabel={`create message`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
</Button>
</EmptySearch>
{:else}
<!-- TODO: Update docs links -->
<Empty single target="provider">
<div class="u-text-center">
<Heading size="7" tag="h2" trimmed={false}>
Expand All @@ -95,7 +94,7 @@
<div class="u-flex u-flex-wrap u-gap-16 u-main-center">
<Button
external
href="https://appwrite.io/docs/references/cloud/client-web/providers"
href="https://appwrite.io/docs/products/messaging/providers"
text
event="empty_documentation"
ariaLabel={`create provider`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
total={data.topics.total} />
{:else if $hasPageQueries}
<EmptyFilter resource="topics" />
<!-- TODO: remove data.search != 'empty' when the API is ready with data -->
{:else if data.search && data.search != 'empty'}
{:else if data.search}
<EmptySearch>
<div class="u-text-center">
<b>Sorry, we couldn't find '{data.search}'</b>
Expand All @@ -94,11 +93,10 @@
</Button>
</EmptySearch>
{:else}
<!-- TODO: update docs link -->
<Empty
single
on:click={() => ($showCreate = true)}
href="https://appwrite.io/docs/references/cloud/client-web/teams"
href="https://appwrite.io/docs/products/messaging/topics"
target="topic" />
{/if}
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@
total={data.subscribers.total} />
{:else if $hasPageQueries}
<EmptyFilter resource="subscribers" />
<!-- TODO: remove data.search != 'empty' when the API is ready with data -->
{:else if data.search && data.search != 'empty'}
{:else if data.search}
<EmptySearch>
<div class="u-text-center">
<b>Sorry, we couldn't find '{data.search}'</b>
Expand All @@ -139,11 +138,10 @@
</Button>
</EmptySearch>
{:else}
<!-- TODO: update docs link -->
<Empty
single
on:click={() => (showAdd = true)}
href="https://appwrite.io/docs/references/cloud/client-web/teams"
href="https://appwrite.io/docs/products/messaging/topics/#subscribe-targets-to-topics"
target="subscriber" />
{/if}
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<p>There are no topics that match your search.</p>
</div>
<div class="u-flex u-gap-16 common-section u-main-center">
<Button external href="https://appwrite.io/docs/products/auth/accounts" text
<Button external href="https://appwrite.io/docs/products/messaging/topics" text
>Documentation</Button>
<Button secondary on:click={() => (search = '')}>Clear search</Button>
</div>
Expand All @@ -134,10 +134,9 @@
<p class="text u-line-height-1-5">
You have no topics. Create a topic to see them here.
</p>
<!-- TODO: link to topics docs -->
<p class="text u-line-height-1-5">
Need a hand? Learn more in our <a
href="https://appwrite.io/docs/products/auth/quick-start"
href="https://appwrite.io/docs/products/messaging/topics"
target="_blank"
rel="noopener noreferrer">
documentation</a
Expand Down
25 changes: 22 additions & 3 deletions src/routes/console/project-[project]/messaging/wizard/step1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import SmsFormList from './smsFormList.svelte';
import PushFormList, { validateData } from './pushFormList.svelte';
import { MessagingProviderType } from '@appwrite.io/console';
import { Button } from '$lib/elements/forms';

let docsUrl = `https://appwrite.io/docs/products/messaging`;

async function beforeSubmit() {}

Expand All @@ -17,8 +20,20 @@
article = lastLetter === 's' ? '' : article;

providerText = providerText.toLowerCase() === 'sms' ? 'SMS messages' : providerText;
return `Create ${article} ${providerText} that will be displayed to your subscribers. Learn more in our documentation.`;
return `Create ${article} ${providerText} that will be displayed to your subscribers.`;
};

switch ($providerType) {
case MessagingProviderType.Email:
docsUrl += '/send-email-messages';
break;
case MessagingProviderType.Sms:
docsUrl += '/send-sms-messages';
break;
case MessagingProviderType.Push:
docsUrl += '/send-push-notifications';
break;
}
</script>

<WizardStep
Expand All @@ -27,8 +42,12 @@
!!validateData($messageParams[MessagingProviderType.Push].data)}>
<svelte:fragment slot="title">Message</svelte:fragment>
<svelte:fragment slot="subtitle">
<!-- TODO: update documentation link -->
{createMessage(providers[$providerType].text)}
{createMessage(providers[$providerType].text)} Learn more in our <Button
link
external
text
href={docsUrl}>documentation</Button
>.
</svelte:fragment>
{#if $providerType === MessagingProviderType.Email}
<EmailFormList />
Expand Down
25 changes: 21 additions & 4 deletions src/routes/console/project-[project]/messaging/wizard/step3.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { FormList, InputDate, InputSelect, InputTime } from '$lib/elements/forms';
import { Button, FormList, InputDate, InputSelect, InputTime } from '$lib/elements/forms';
import Helper from '$lib/elements/forms/helper.svelte';
import { WizardStep } from '$lib/layout';
import { MessageType } from '@appwrite.io/console';
import { MessageType, MessagingProviderType } from '@appwrite.io/console';
import { messageParams, providerType } from './store';

let when: 'now' | 'later' = 'now';
Expand All @@ -12,6 +12,19 @@
let date: string;
let time: string;
let dateTime: Date;
let docsUrl = `https://appwrite.io/docs/products/messaging`;

switch ($providerType) {
case MessagingProviderType.Email:
docsUrl += '/send-email-messages';
break;
case MessagingProviderType.Sms:
docsUrl += '/send-sms-messages';
break;
case MessagingProviderType.Push:
docsUrl += '/send-push-notifications';
break;
}

const options = [
{ label: 'Now', value: 'now' },
Expand Down Expand Up @@ -52,9 +65,13 @@

<WizardStep {beforeSubmit}>
<svelte:fragment slot="title">Schedule</svelte:fragment>
<!-- TODO: Add link to docs -->
<svelte:fragment slot="subtitle"
>Schedule the time you want to deliver this message. Learn more in our documentation.</svelte:fragment>
>Schedule the time you want to deliver this message. Learn more in our <Button
link
external
text
href={docsUrl}>documentation</Button
>.</svelte:fragment>
<FormList>
<div
class="u-grid u-gap-24"
Expand Down