Skip to content

Commit 867b03b

Browse files
committed
fix: apns provider key file upload input
Don't hardcode the upload dropzone to be for service account JSON files only.
1 parent 468473a commit 867b03b

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

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

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
APNSProviderParams
2525
} from './store';
2626
import TooltipPopover from './tooltipPopover.svelte';
27-
import { Icon, Tooltip, Upload, Layout, Typography } from '@appwrite.io/pink-svelte';
28-
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
27+
import { Upload, Layout, Typography } from '@appwrite.io/pink-svelte';
2928
import { InvalidFileType, removeFile } from '$lib/helpers/files';
3029
import { addNotification } from '$lib/stores/notifications';
3130
@@ -122,25 +121,15 @@
122121
{:else if input.type === 'file'}
123122
<Upload.Dropzone
124123
on:invalid={handleInvalid}
125-
extensions={['json']}
124+
extensions={input.allowedFileExtensions}
126125
bind:files={files[input.name]}
127126
maxSize={10000000}
128127
required={!input.optional}>
129-
<Layout.Stack alignItems="center" gap="s">
130-
<Layout.Stack alignItems="center" gap="s">
131-
<Layout.Stack alignItems="center" justifyContent="center" direction="row" gap="s">
132-
<Typography.Text variant="l-500">
133-
Drag and drop service account JSON here or click to upload
134-
</Typography.Text>
135-
<Tooltip>
136-
<Layout.Stack alignItems="center" justifyContent="center" inline>
137-
<Icon icon={IconInfo} size="s" />
138-
</Layout.Stack>
139-
<svelte:fragment slot="tooltip">Only .json files allowed</svelte:fragment>
140-
</Tooltip>
141-
</Layout.Stack>
142-
<Typography.Caption variant="400">Max file size 10MB</Typography.Caption>
143-
</Layout.Stack>
128+
<Layout.Stack alignItems="center" justifyContent="center" direction="row" gap="xxs">
129+
<Typography.Text variant="l-500">
130+
Drag and drop your {input.label} here or click to upload
131+
</Typography.Text>
132+
<TooltipPopover {popover} {popoverProps} tooltip={input.tooltip} />
144133
</Layout.Stack>
145134
</Upload.Dropzone>
146135
{#if files[input.name]?.length}

src/routes/(console)/project-[region]-[project]/messaging/providers/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const providers: ProvidersMap = {
8585
],
8686
configure: [
8787
{
88-
label: 'Service account JSON (.json file)',
88+
label: 'service account JSON (.json file)',
8989
name: 'serviceAccountJSON',
9090
type: 'file',
9191
allowedFileExtensions: ['json'],
@@ -164,7 +164,7 @@ export const providers: ProvidersMap = {
164164
}
165165
},
166166
{
167-
label: 'Auth key (.p8 file)',
167+
label: 'auth key (.p8 file)',
168168
name: 'authKey',
169169
type: 'file',
170170
allowedFileExtensions: ['p8'],

0 commit comments

Comments
 (0)