Skip to content

Commit d7dd587

Browse files
committed
Fix the order create message/provider drop items
1 parent 7312153 commit d7dd587

1 file changed

Lines changed: 173 additions & 172 deletions

File tree

  • src/routes/console/project-[project]/messaging/providers

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

Lines changed: 173 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,179 @@ type ProvidersMap = {
3838
};
3939

4040
export const providers: ProvidersMap = {
41+
[ProviderTypes.Push]: {
42+
name: 'Push notification',
43+
text: 'notifications',
44+
icon: 'device-mobile',
45+
providers: {
46+
[Providers.FCM]: {
47+
imageIcon: 'firebase',
48+
title: 'FCM',
49+
description: 'Firebase Cloud Messaging',
50+
configure: [
51+
{
52+
label: 'Server key (.json file)',
53+
name: 'serverKey',
54+
type: 'file',
55+
allowedFileExtensions: ['json'],
56+
placeholder: 'Enter server key',
57+
popover: [
58+
'<b>How to get the FCM server key?</b>',
59+
'Head to <b>Project settings -> Service accounts -> Generate new private key.</b>',
60+
'Generating the new key will result in the download of a JSON file.'
61+
]
62+
}
63+
]
64+
},
65+
[Providers.APNS]: {
66+
imageIcon: 'apple',
67+
title: 'APNS',
68+
description: 'Apple Push Notification Service',
69+
configure: [
70+
{
71+
label: 'Team ID',
72+
name: 'teamId',
73+
type: 'text',
74+
placeholder: 'Enter team ID',
75+
popover: [
76+
'<b>How to get the team ID?</b>',
77+
'Head to <b>Apple Developer Member Center -> Membership details -> Team ID.</b>'
78+
]
79+
},
80+
{
81+
label: 'Bundle ID',
82+
name: 'bundleId',
83+
type: 'text',
84+
placeholder: 'Enter bundle ID',
85+
popover: [
86+
'<b>How to get the bundle ID?</b>',
87+
'Head to <b>Apple Developer Member Center -> Certificates, Identifiers & Profiles -> Identifiers.</b>',
88+
`<a
89+
href="/images/apns-bundle-id.png"
90+
class="file-preview is-with-image"
91+
target="_blank"
92+
rel="noopener noreferrer"
93+
aria-label="open file in new window">
94+
<div class="file-preview-image">
95+
<img
96+
width="205"
97+
height="125"
98+
src="/images/apns-bundle-id.png"
99+
alt="Screenshot of Bundle ID in Apple" />
100+
</div>
101+
<div class="file-preview-content">
102+
<div class="avatar">
103+
<span class="icon-external-link" aria-hidden="true" />
104+
</div>
105+
</div>
106+
</a>`
107+
]
108+
},
109+
{
110+
label: 'Authentication key ID',
111+
name: 'authKeyId',
112+
type: 'text',
113+
placeholder: 'Enter key ID',
114+
popover: [
115+
'<b>How to get the auth key ID?</b>',
116+
'Head to <b>Apple Developer Member Center -> Certificates, Identifiers & Profiles -> Keys.</b>',
117+
'Click on your key to view details.'
118+
]
119+
},
120+
{
121+
label: 'Auth key (.p8 file)',
122+
name: 'authKey',
123+
type: 'file',
124+
allowedFileExtensions: ['p8'],
125+
popover: [
126+
'<b>How to get the authentication key?</b>',
127+
'Head to <b>Apple Developer Member Center</b> (under Program resources) <b>-> Certificates, Identifiers & Profiles -> Keys.</b>',
128+
'Create a key and give it a name. Enable the Apple Push Notifications service (APNS), and register your key.'
129+
]
130+
}
131+
]
132+
}
133+
// [Providers.MQTT]: {
134+
// imageIcon: 'mqtt',
135+
// title: 'MQTT',
136+
// description: 'Message Queuing Telemtry Transport'
137+
// }
138+
}
139+
},
140+
[ProviderTypes.Email]: {
141+
name: 'Email',
142+
text: 'emails',
143+
icon: 'mail',
144+
providers: {
145+
[Providers.Mailgun]: {
146+
imageIcon: 'mailgun',
147+
title: 'Mailgun',
148+
description: '',
149+
configure: [
150+
{
151+
label: 'API key',
152+
name: 'apiKey',
153+
type: 'text',
154+
placeholder: 'Enter API key',
155+
popover: [
156+
'<b>How to get the API key?</b>',
157+
'Create an account in Mailgun.',
158+
'Head to <b>Profile -> API Security -> Add new key.</b>'
159+
]
160+
},
161+
{
162+
label: 'Domain',
163+
name: 'domain',
164+
type: 'domain',
165+
placeholder: 'Enter domain',
166+
popover: [
167+
'<b>How to create a domain?</b>',
168+
'Head to <b>Sending -> Domains -> Add new domain.</b>',
169+
'Follow <b>Mailgun instructions</b> to verify the domain name.'
170+
]
171+
},
172+
{
173+
label: 'EU region',
174+
name: 'isEuRegion',
175+
type: 'switch',
176+
description:
177+
'Enable the EU region setting if your domain is within the European Union.'
178+
},
179+
{
180+
label: 'Sender email',
181+
name: 'from',
182+
type: 'email',
183+
placeholder: 'Enter email'
184+
}
185+
]
186+
},
187+
[Providers.Sendgrid]: {
188+
imageIcon: 'sendgrid',
189+
title: 'Sendgrid',
190+
description: '',
191+
configure: [
192+
{
193+
label: 'API key',
194+
name: 'apiKey',
195+
type: 'text',
196+
placeholder: 'Enter API key',
197+
popover: [
198+
'<b>How to get the API key?</b>',
199+
'Create an account in Mailgun.',
200+
'Head to <b>Profile -> API Security -> Add new key.</b>'
201+
]
202+
},
203+
{
204+
label: 'Sender email',
205+
name: 'from',
206+
type: 'email',
207+
placeholder: 'Enter email'
208+
}
209+
]
210+
}
211+
}
212+
},
213+
41214
[ProviderTypes.Sms]: {
42215
name: 'SMS',
43216
text: 'SMS',
@@ -205,177 +378,5 @@ export const providers: ProvidersMap = {
205378
]
206379
}
207380
}
208-
},
209-
[ProviderTypes.Email]: {
210-
name: 'Email',
211-
text: 'emails',
212-
icon: 'mail',
213-
providers: {
214-
[Providers.Mailgun]: {
215-
imageIcon: 'mailgun',
216-
title: 'Mailgun',
217-
description: '',
218-
configure: [
219-
{
220-
label: 'API key',
221-
name: 'apiKey',
222-
type: 'text',
223-
placeholder: 'Enter API key',
224-
popover: [
225-
'<b>How to get the API key?</b>',
226-
'Create an account in Mailgun.',
227-
'Head to <b>Profile -> API Security -> Add new key.</b>'
228-
]
229-
},
230-
{
231-
label: 'Domain',
232-
name: 'domain',
233-
type: 'domain',
234-
placeholder: 'Enter domain',
235-
popover: [
236-
'<b>How to create a domain?</b>',
237-
'Head to <b>Sending -> Domains -> Add new domain.</b>',
238-
'Follow <b>Mailgun instructions</b> to verify the domain name.'
239-
]
240-
},
241-
{
242-
label: 'EU region',
243-
name: 'isEuRegion',
244-
type: 'switch',
245-
description:
246-
'Enable the EU region setting if your domain is within the European Union.'
247-
},
248-
{
249-
label: 'Sender email',
250-
name: 'from',
251-
type: 'email',
252-
placeholder: 'Enter email'
253-
}
254-
]
255-
},
256-
[Providers.Sendgrid]: {
257-
imageIcon: 'sendgrid',
258-
title: 'Sendgrid',
259-
description: '',
260-
configure: [
261-
{
262-
label: 'API key',
263-
name: 'apiKey',
264-
type: 'text',
265-
placeholder: 'Enter API key',
266-
popover: [
267-
'<b>How to get the API key?</b>',
268-
'Create an account in Mailgun.',
269-
'Head to <b>Profile -> API Security -> Add new key.</b>'
270-
]
271-
},
272-
{
273-
label: 'Sender email',
274-
name: 'from',
275-
type: 'email',
276-
placeholder: 'Enter email'
277-
}
278-
]
279-
}
280-
}
281-
},
282-
[ProviderTypes.Push]: {
283-
name: 'Push notification',
284-
text: 'notifications',
285-
icon: 'device-mobile',
286-
providers: {
287-
[Providers.FCM]: {
288-
imageIcon: 'firebase',
289-
title: 'FCM',
290-
description: 'Firebase Cloud Messaging',
291-
configure: [
292-
{
293-
label: 'Server key (.json file)',
294-
name: 'serverKey',
295-
type: 'file',
296-
allowedFileExtensions: ['json'],
297-
placeholder: 'Enter server key',
298-
popover: [
299-
'<b>How to get the FCM server key?</b>',
300-
'Head to <b>Project settings -> Service accounts -> Generate new private key.</b>',
301-
'Generating the new key will result in the download of a JSON file.'
302-
]
303-
}
304-
]
305-
},
306-
[Providers.APNS]: {
307-
imageIcon: 'apple',
308-
title: 'APNS',
309-
description: 'Apple Push Notification Service',
310-
configure: [
311-
{
312-
label: 'Team ID',
313-
name: 'teamId',
314-
type: 'text',
315-
placeholder: 'Enter team ID',
316-
popover: [
317-
'<b>How to get the team ID?</b>',
318-
'Head to <b>Apple Developer Member Center -> Membership details -> Team ID.</b>'
319-
]
320-
},
321-
{
322-
label: 'Bundle ID',
323-
name: 'bundleId',
324-
type: 'text',
325-
placeholder: 'Enter bundle ID',
326-
popover: [
327-
'<b>How to get the bundle ID?</b>',
328-
'Head to <b>Apple Developer Member Center -> Certificates, Identifiers & Profiles -> Identifiers.</b>',
329-
`<a
330-
href="/images/apns-bundle-id.png"
331-
class="file-preview is-with-image"
332-
target="_blank"
333-
rel="noopener noreferrer"
334-
aria-label="open file in new window">
335-
<div class="file-preview-image">
336-
<img
337-
width="205"
338-
height="125"
339-
src="/images/apns-bundle-id.png"
340-
alt="Screenshot of Bundle ID in Apple" />
341-
</div>
342-
<div class="file-preview-content">
343-
<div class="avatar">
344-
<span class="icon-external-link" aria-hidden="true" />
345-
</div>
346-
</div>
347-
</a>`
348-
]
349-
},
350-
{
351-
label: 'Authentication key ID',
352-
name: 'authKeyId',
353-
type: 'text',
354-
placeholder: 'Enter key ID',
355-
popover: [
356-
'<b>How to get the auth key ID?</b>',
357-
'Head to <b>Apple Developer Member Center -> Certificates, Identifiers & Profiles -> Keys.</b>',
358-
'Click on your key to view details.'
359-
]
360-
},
361-
{
362-
label: 'Auth key (.p8 file)',
363-
name: 'authKey',
364-
type: 'file',
365-
allowedFileExtensions: ['p8'],
366-
popover: [
367-
'<b>How to get the authentication key?</b>',
368-
'Head to <b>Apple Developer Member Center</b> (under Program resources) <b>-> Certificates, Identifiers & Profiles -> Keys.</b>',
369-
'Create a key and give it a name. Enable the Apple Push Notifications service (APNS), and register your key.'
370-
]
371-
}
372-
]
373-
}
374-
// [Providers.MQTT]: {
375-
// imageIcon: 'mqtt',
376-
// title: 'MQTT',
377-
// description: 'Message Queuing Telemtry Transport'
378-
// }
379-
}
380381
}
381382
};

0 commit comments

Comments
 (0)