Skip to content

Commit 8c8caaa

Browse files
authored
Merge pull request #2497 from appwrite/fix-SER-SER-416-More-Messaging-flow-issues
2 parents 6f57562 + a2494c2 commit 8c8caaa

12 files changed

Lines changed: 87 additions & 59 deletions

File tree

src/lib/components/imagePreview.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
style="inline-size: 100%; block-size: 100%;"
1313
target="_blank"
1414
rel="noopener noreferrer"
15+
on:click|stopPropagation
16+
on:mousedown|stopPropagation
1517
aria-label="open file in new window">
1618
<div class="file-preview-image">
1719
<img src={$app.themeInUse === 'dark' ? darkSrc : lightSrc} {alt} />

src/lib/elements/forms/helper.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</script>
66

77
<p
8-
class="helper u-margin-block-start-8 {classes}"
8+
class="helper u-margin-block-start-6 {classes}"
99
class:u-color-text-info={type === 'info'}
1010
class:u-color-text-danger={type === 'error'}
1111
class:u-color-text-success={type === 'success'}

src/lib/layout/responsiveContainerHeader.svelte

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<script lang="ts">
22
import { SearchQuery, ViewSelector } from '$lib/components';
3-
import { FiltersBottomSheet, ParsedTagList, queryParamToMap } from '$lib/components/filters';
3+
import {
4+
FiltersBottomSheet,
5+
ParsedTagList,
6+
queryParamToMap,
7+
Filters
8+
} from '$lib/components/filters';
49
import QuickFilters from '$lib/components/filters/quickFilters.svelte';
510
import Button from '$lib/elements/forms/button.svelte';
611
import { View } from '$lib/helpers/load';
@@ -23,6 +28,7 @@
2328
hasSearch = false,
2429
searchPlaceholder = 'Search by ID',
2530
hasFilters = false,
31+
hasCustomFiltersOnly = false,
2632
analyticsSource = '',
2733
children
2834
}: {
@@ -33,6 +39,7 @@
3339
hasSearch?: boolean;
3440
searchPlaceholder?: string;
3541
hasFilters?: boolean;
42+
hasCustomFiltersOnly?: boolean;
3643
analyticsSource?: string;
3744
children?: Snippet;
3845
} = $props();
@@ -109,7 +116,11 @@
109116
</Layout.Stack>
110117
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
111118
{#if hasFilters && $columns?.length}
112-
<QuickFilters {columns} {analyticsSource} {filterCols} />
119+
{#if hasCustomFiltersOnly}
120+
<Filters query="[]" {columns} {analyticsSource} />
121+
{:else}
122+
<QuickFilters {columns} {analyticsSource} {filterCols} />
123+
{/if}
113124
{/if}
114125
{#if hasDisplaySettings}
115126
<ViewSelector ui="new" {view} {columns} {hideView} {hideColumns} />

src/routes/(console)/project-[region]-[project]/messaging/createMessageDropdown.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { page } from '$app/state';
88
</script>
99

10-
<Popover let:toggle padding="none" placement="bottom-start">
10+
<Popover let:toggle padding="none" placement="bottom-end">
1111
<slot {toggle}>
1212
<Button on:click={toggle} event="create_message">
1313
<Icon icon={IconPlus} slot="start" size="s" />

src/routes/(console)/project-[region]-[project]/messaging/message-[message]/updateTargets.svelte

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { MessagingProviderType, type Models } from '@appwrite.io/console';
3-
import { CardGrid, Empty, PaginationInline, EmptySearch } from '$lib/components';
3+
import { CardGrid, Empty, PaginationInline } from '$lib/components';
44
import { onMount } from 'svelte';
55
import { sdk } from '$lib/stores/sdk';
66
import { invalidate } from '$app/navigation';
@@ -12,8 +12,17 @@
1212
import UserTargetsModal from '../userTargetsModal.svelte';
1313
import { isValueOfStringEnum } from '$lib/helpers/types';
1414
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
15-
import { Alert, Icon, Layout, Table, Typography } from '@appwrite.io/pink-svelte';
15+
import {
16+
Alert,
17+
Card,
18+
Empty as PinkEmpty,
19+
Icon,
20+
Layout,
21+
Table,
22+
Typography
23+
} from '@appwrite.io/pink-svelte';
1624
import { page } from '$app/state';
25+
import { Link } from '$lib/elements';
1726
1827
export let message: Models.Message & { data: Record<string, unknown> };
1928
export let selectedTargetsById: Record<string, Models.Target>;
@@ -207,17 +216,17 @@
207216
{:else if isDraft}
208217
<Empty on:click={() => (showTargets = true)}>Add a target</Empty>
209218
{:else if !sum && !hasDeletedUsers}
210-
<EmptySearch hidePagination>
211-
<div class="u-text-center">
212-
No targets have been selected.
213-
<p>
214-
Need a hand? Check out our <Button
215-
href="https://appwrite.io/docs/products/messaging/targets">
216-
documentation</Button
219+
<Card.Base padding="none">
220+
<PinkEmpty type="secondary" title="No targets were selected">
221+
<svelte:fragment slot="description">
222+
Need a hand? Check out our <Link
223+
variant="muted"
224+
href="https://appwrite.io/docs/products/messaging/targets"
225+
external>documentation</Link
217226
>.
218-
</p>
219-
</div>
220-
</EmptySearch>
227+
</svelte:fragment>
228+
</PinkEmpty>
229+
</Card.Base>
221230
{/if}
222231
</svelte:fragment>
223232
<svelte:fragment slot="actions">

src/routes/(console)/project-[region]-[project]/messaging/providers/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
view={View.Table}
2424
hideView
2525
hasFilters
26+
hasCustomFiltersOnly
2627
hasSearch
2728
analyticsSource="messaging_providers"
2829
searchPlaceholder="Search by name or ID">

src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
}
201201
</script>
202202

203-
<Wizard title="Create provider" columnSize="l">
203+
<Wizard title="Create provider" columnSize="l" confirmExit>
204204
<Form bind:this={formRef} onSubmit={create} isModal={false}>
205205
<Layout.Stack gap="xxl">
206206
<Fieldset legend="Provider">

src/routes/(console)/project-[region]-[project]/messaging/providers/createProviderDropdown.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { ActionMenu, Popover } from '@appwrite.io/pink-svelte';
1010
</script>
1111

12-
<Popover let:toggle padding="none" placement="bottom-start">
12+
<Popover let:toggle padding="none" placement="bottom-end">
1313
<slot {toggle} />
1414
<ActionMenu.Root slot="tooltip">
1515
{#each Object.entries(providers) as [type, option]}

src/routes/(console)/project-[region]-[project]/messaging/topics/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
view={View.Table}
7171
hideView
7272
hasFilters
73+
hasCustomFiltersOnly
7374
hasSearch
7475
analyticsSource="messaging_topics_filter"
7576
searchPlaceholder="Search by name or ID">

src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.svelte

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
await Promise.all(promises);
7373
addNotification({
7474
type: 'success',
75-
message: `${targetIds.length} subscriber${targetIds.length !== 1 ? 's' : ''} have been added`
75+
message: `${targetIds.length} subscriber${targetIds.length !== 1 ? 's' : ''} created`
7676
});
7777
trackEvent(Submit.MessagingTopicSubscriberAdd);
7878
await invalidate(Dependencies.MESSAGING_TOPIC_SUBSCRIBERS);
@@ -88,7 +88,7 @@
8888

8989
<Container>
9090
<Layout.Stack direction="row" justifyContent="space-between">
91-
<SearchQuery placeholder="Search by type or IDs"></SearchQuery>
91+
<SearchQuery placeholder="Search by type or ID"></SearchQuery>
9292
<Layout.Stack direction="row" inline>
9393
<Filters query={data.query} {columns} analyticsSource="messaging_topics" />
9494
<ViewSelector ui="new" view={View.Table} {columns} hideView />
@@ -99,7 +99,7 @@
9999
}}
100100
event="create_subscriber">
101101
<Icon icon={IconPlus} slot="start" size="s" />
102-
Add subscriber
102+
Create subscriber
103103
</Button>
104104
</Layout.Stack>
105105
</Layout.Stack>
@@ -115,14 +115,11 @@
115115
{:else if $hasPageQueries}
116116
<EmptyFilter resource="subscribers" />
117117
{:else if data.search}
118-
<EmptySearch>
119-
<div class="u-text-center">
120-
<b>Sorry, we couldn't find '{data.search}'</b>
121-
<p>There are no subscribers that match your search.</p>
122-
</div>
118+
<EmptySearch bind:search={data.search} target="subscribers">
123119
<Button
124120
secondary
125121
href={`${base}/project-${page.params.region}-${page.params.project}/messaging/topics/topic-${page.params.topic}/subscribers`}>
122+
Clear Search
126123
</Button>
127124
</EmptySearch>
128125
{:else}
@@ -141,7 +138,7 @@
141138
on:update={addTargets}>
142139
<svelte:fragment slot="description">
143140
<Typography.Text>
144-
Add subscribers to this topic by selecting the targets for directing messages.{' '}
141+
Create subscribers for this topic by selecting the targets for directing messages.{' '}
145142
<Link
146143
href="https://appwrite.io/docs/products/messaging/topics#subscribe-targets-to-topics"
147144
external>

0 commit comments

Comments
 (0)