mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix(messaging): fix topics & targets empty state for non-draft
Show empty search and link to docs since they shouldn't edit it.
This commit is contained in:
3 files changed
+40
-6
No files matched your search
@@ -35,10 +35,12 @@
|
||||
<UpdateTopics
|
||||
messageId={$message.$id}
|
||||
messageType={$providerType}
|
||||
messageStatus={$message.status}
|
||||
selectedTopicsById={data.topicsById} />
|
||||
<UpdateTargets
|
||||
messageId={$message.$id}
|
||||
messageType={$providerType}
|
||||
messageStatus={$message.status}
|
||||
selectedTargetsById={data.targetsById} />
|
||||
{#if $message.status !== MessageStatus.Processing}
|
||||
<Delete message={$message} />
|
||||
|
||||
+19
-3
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { MessagingProviderType, type Models } from '@appwrite.io/console';
|
||||
import { MessageStatus, MessagingProviderType, type Models } from '@appwrite.io/console';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -8,7 +8,7 @@
|
||||
TableHeader,
|
||||
TableRow
|
||||
} from '$lib/elements/table';
|
||||
import { CardGrid, Heading, Empty, PaginationInline } from '$lib/components';
|
||||
import { CardGrid, Heading, Empty, PaginationInline, EmptySearch } from '$lib/components';
|
||||
import { onMount } from 'svelte';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
export let messageId: string;
|
||||
export let messageType: MessagingProviderType;
|
||||
export let messageStatus: string;
|
||||
export let selectedTargetsById: Record<string, Models.Target>;
|
||||
|
||||
let offset = 0;
|
||||
@@ -158,8 +159,23 @@
|
||||
<PaginationInline {sum} {limit} bind:offset />
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{:else if messageStatus == MessageStatus.Draft}
|
||||
<Empty on:click={() => (showTargets = true)}>Add a target</Empty>
|
||||
{:else}
|
||||
<EmptySearch hidePagination>
|
||||
<div class="u-text-center">
|
||||
No targets have been selected.
|
||||
<p>
|
||||
Need a hand? Check out our <Button
|
||||
link
|
||||
external
|
||||
href="https://appwrite.io/docs/products/messaging/targets"
|
||||
text>
|
||||
documentation</Button
|
||||
>.
|
||||
</p>
|
||||
</div>
|
||||
</EmptySearch>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="actions">
|
||||
|
||||
+19
-3
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { type Models, MessagingProviderType } from '@appwrite.io/console';
|
||||
import { type Models, MessagingProviderType, MessageStatus } from '@appwrite.io/console';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -8,7 +8,7 @@
|
||||
TableHeader,
|
||||
TableRow
|
||||
} from '$lib/elements/table';
|
||||
import { CardGrid, Heading, Empty, PaginationInline } from '$lib/components';
|
||||
import { CardGrid, Heading, Empty, PaginationInline, EmptySearch } from '$lib/components';
|
||||
import TopicsModal from '../topicsModal.svelte';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { invalidate } from '$app/navigation';
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
export let messageId: string;
|
||||
export let messageType: MessagingProviderType;
|
||||
export let messageStatus: string;
|
||||
export let selectedTopicsById: Record<string, Models.Topic>;
|
||||
|
||||
let offset = 0;
|
||||
@@ -141,8 +142,23 @@
|
||||
<PaginationInline {sum} {limit} bind:offset />
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{:else if messageStatus == MessageStatus.Draft}
|
||||
<Empty on:click={() => (showTopics = true)}>Add a topic</Empty>
|
||||
{:else}
|
||||
<EmptySearch hidePagination>
|
||||
<div class="u-text-center">
|
||||
No topics have been selected.
|
||||
<p>
|
||||
Need a hand? Check out our <Button
|
||||
link
|
||||
external
|
||||
href="https://appwrite.io/docs/products/messaging/topics"
|
||||
text>
|
||||
documentation</Button
|
||||
>.
|
||||
</p>
|
||||
</div>
|
||||
</EmptySearch>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="actions">
|
||||
|
||||
Reference in new issue
Block a user