mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
run formatter
This commit is contained in:
1 parent
34ffc29446
commit
e3664b8d55
7 files changed
+38
-7685
No files matched your search
Generated
-7647
File diff suppressed because it is too large.
Load diff
@@ -116,4 +116,3 @@
|
||||
</Container>
|
||||
|
||||
<Create bind:show={showAdd} on:close={() => (showAdd = false)} />
|
||||
|
||||
@@ -32,19 +32,16 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
|
||||
// TODO: remove when the API is ready with data
|
||||
// This allows us to mock w/ data and when search returns 0 results
|
||||
const targets: { targets: Target[]; total: number } =
|
||||
await sdk.forProject.client.call(
|
||||
'GET',
|
||||
new URL(
|
||||
`${sdk.forProject.client.config.endpoint}/users/${params.user}/targets`
|
||||
),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
payload
|
||||
);
|
||||
const targets: { targets: Target[]; total: number } = await sdk.forProject.client.call(
|
||||
'GET',
|
||||
new URL(`${sdk.forProject.client.config.endpoint}/users/${params.user}/targets`),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
payload
|
||||
);
|
||||
|
||||
const promisesById: Record<string, Promise<any>> = {};
|
||||
targets.targets.forEach((target) => {
|
||||
@@ -71,13 +68,13 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
providersById[provider.$id] = provider;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
offset,
|
||||
limit,
|
||||
search,
|
||||
query,
|
||||
targets,
|
||||
providersById,
|
||||
providersById
|
||||
};
|
||||
};
|
||||
@@ -24,7 +24,7 @@
|
||||
const providerTypeOptions = [
|
||||
{ label: 'Push', value: ProviderTypes.Push },
|
||||
{ label: 'Email', value: ProviderTypes.Email },
|
||||
{ label: 'SMS', value: ProviderTypes.Sms },
|
||||
{ label: 'SMS', value: ProviderTypes.Sms }
|
||||
];
|
||||
|
||||
const create = async () => {
|
||||
@@ -53,7 +53,7 @@
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
payload,
|
||||
payload
|
||||
);
|
||||
show = false;
|
||||
addNotification({
|
||||
@@ -64,7 +64,7 @@
|
||||
invalidate(Dependencies.USER_TARGETS);
|
||||
trackEvent(Submit.UserTargetCreate, {
|
||||
customId: !!id,
|
||||
providerType: providerType,
|
||||
providerType: providerType
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
@@ -92,18 +92,22 @@
|
||||
|
||||
<Modal title="Create target" size="big" bind:show onSubmit={create}>
|
||||
<FormList>
|
||||
<InputSelect id="provider-type" label="Provider Type" bind:value={providerType} options={providerTypeOptions} />
|
||||
<InputSelect
|
||||
id="provider-type"
|
||||
label="Provider Type"
|
||||
bind:value={providerType}
|
||||
options={providerTypeOptions} />
|
||||
{#if providerType === ProviderTypes.Push}
|
||||
<InputText
|
||||
id="provider-id"
|
||||
label="Provider ID"
|
||||
placeholder='Enter provider ID'
|
||||
placeholder="Enter provider ID"
|
||||
bind:value={providerId}
|
||||
required />
|
||||
<InputText
|
||||
id="identifier"
|
||||
label="Identifier"
|
||||
placeholder='Enter push token'
|
||||
placeholder="Enter push token"
|
||||
bind:value={identifier}
|
||||
required />
|
||||
<InputText
|
||||
@@ -116,14 +120,14 @@
|
||||
<InputEmail
|
||||
id="identifier"
|
||||
label="Identifier"
|
||||
placeholder='Enter email'
|
||||
placeholder="Enter email"
|
||||
bind:value={identifier}
|
||||
required />
|
||||
{:else if providerType === ProviderTypes.Sms}
|
||||
<InputPhone
|
||||
id="identifier"
|
||||
label="Identifier"
|
||||
placeholder='Enter phone number'
|
||||
placeholder="Enter phone number"
|
||||
bind:value={identifier}
|
||||
required />
|
||||
{/if}
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
import type { PageData } from './$types';
|
||||
import { columns } from './store';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import ProviderType, { ProviderTypes } from '$routes/console/project-[project]/messaging/providerType.svelte';
|
||||
import ProviderType, {
|
||||
ProviderTypes
|
||||
} from '$routes/console/project-[project]/messaging/providerType.svelte';
|
||||
import Provider from '$routes/console/project-[project]/messaging/provider.svelte';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { page } from '$app/stores';
|
||||
@@ -24,7 +26,6 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { invalidate } from '$app/navigation';
|
||||
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
let selectedIds: string[] = [];
|
||||
@@ -57,9 +58,7 @@
|
||||
});
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${selectedIds.length} target${
|
||||
selectedIds.length > 1 ? 's' : ''
|
||||
} deleted`
|
||||
message: `${selectedIds.length} target${selectedIds.length > 1 ? 's' : ''} deleted`
|
||||
});
|
||||
invalidate(Dependencies.USER_TARGETS);
|
||||
} catch (error) {
|
||||
@@ -73,7 +72,6 @@
|
||||
showDelete = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<TableScroll>
|
||||
@@ -97,11 +95,11 @@
|
||||
{#if column.show}
|
||||
{#if column.id === '$id'}
|
||||
{#key $columns}
|
||||
<TableCell title={column.title}>
|
||||
<Id value={target[column.id]}>
|
||||
{target[column.id]}
|
||||
</Id>
|
||||
</TableCell>
|
||||
<TableCell title={column.title}>
|
||||
<Id value={target[column.id]}>
|
||||
{target[column.id]}
|
||||
</Id>
|
||||
</TableCell>
|
||||
{/key}
|
||||
{:else if column.id === 'target'}
|
||||
<TableCell title={column.title}>
|
||||
@@ -121,7 +119,7 @@
|
||||
<Provider provider={provider.provider} size="s" />
|
||||
{/if}
|
||||
</TableCellText>
|
||||
{:else if column.id === '$createdAt'}
|
||||
{:else if column.id === '$createdAt'}
|
||||
<TableCellText title={column.title} width={column.width}>
|
||||
{toLocaleDateTime(target[column.id])}
|
||||
</TableCellText>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
Mailgun = 'mailgun',
|
||||
Sendgrid = 'sendgrid',
|
||||
FCM = 'fcm',
|
||||
APNS = 'apns',
|
||||
APNS = 'apns'
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
+3
-1
@@ -99,7 +99,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO: fix width of search input in mobile -->
|
||||
<SearchQuery search={data.search} placeholder="Search by subscriber ID, target ID, user ID, or type">
|
||||
<SearchQuery
|
||||
search={data.search}
|
||||
placeholder="Search by subscriber ID, target ID, user ID, or type">
|
||||
<div class="u-flex u-gap-16 is-not-mobile">
|
||||
<Filters query={data.query} {columns} />
|
||||
<ViewSelector
|
||||
|
||||
Reference in new issue
Block a user