fix(messaging): update SMTP provider fields based on design review

- Use checkbox for autoTLS
- Add popover for mailer field
- Update description for autoTLS
- Update placeholder for host field
This commit is contained in:
Steven Nguyen committed 2024-02-23 17:31:55 -08:00
1 parent 4aac6c4415
commit d63efc0b0d
2 files changed
+25 -5

No files matched your search

@@ -10,6 +10,7 @@
InputText,
InputPassword
} from '$lib/elements/forms';
import InputCheckbox from '$lib/elements/forms/inputCheckbox.svelte';
import PopoverContent from './popoverContent.svelte';
import type {
ProviderInput,
@@ -122,6 +123,12 @@
{input.description}
</svelte:fragment>
</InputSwitch>
{:else if input.type === 'checkbox'}
<InputCheckbox label={input.label} id={input.name} bind:checked={params[input.name]}>
<svelte:fragment slot="description">
{input.description}
</svelte:fragment>
</InputCheckbox>
{:else if input.type === 'select'}
<InputSelect
label={input.label}
@@ -14,7 +14,16 @@ export const columns = writable<Column[]>([
export type ProviderInput = {
label: string;
name: string;
type: 'text' | 'password' | 'phone' | 'email' | 'domain' | 'file' | 'switch' | 'select';
type:
| 'text'
| 'password'
| 'phone'
| 'email'
| 'domain'
| 'file'
| 'switch'
| 'select'
| 'checkbox';
placeholder?: string;
description?: string;
popover?: string[];
@@ -311,7 +320,7 @@ export const providers: ProvidersMap = {
label: 'Server host',
name: 'host',
type: 'text',
placeholder: 'Enter host'
placeholder: 'smtp.server.com'
},
{
label: 'Server port',
@@ -347,8 +356,8 @@ export const providers: ProvidersMap = {
{
label: 'Auto TLS',
name: 'autoTLS',
description: 'Automatically uses TLS encryption',
type: 'switch',
description: 'Automatically uses TLS encryption if available.',
type: 'checkbox',
optional: true
},
{
@@ -356,7 +365,11 @@ export const providers: ProvidersMap = {
name: 'mailer',
type: 'text',
optional: true,
placeholder: 'Enter mailer'
placeholder: 'Enter mailer',
popover: [
'<b>What is the Mailer?</b>',
'The value to use for the X-Mailer header.'
]
}
]
}