mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-27 19:07:15 +08:00
feat(onboarding): Nylas Pro onboarding overhaul
Summary: Rip out all invite-related code Enable Templates and Translate by default Scrub packages page, unused code in onboarding pkg Remove resizing New onboarding screens IMAP provider list, validation Call success with response object as well Renaming and tweaks Test Plan: No tests yet Reviewers: evan, juan, jackie Differential Revision: https://phab.nylas.com/D2985
This commit is contained in:
parent
dc9ea45ca9
commit
7110217fd4
1 changed files with 22 additions and 118 deletions
|
@ -1,154 +1,58 @@
|
|||
class AccountType {
|
||||
constructor({type, title, displayName, icon, headerIcon, color, settings}) {
|
||||
this.type = type;
|
||||
this.title = title;
|
||||
this.displayName = displayName;
|
||||
this.icon = icon;
|
||||
this.headerIcon = headerIcon;
|
||||
this.color = color;
|
||||
this.settings = settings;
|
||||
}
|
||||
}
|
||||
|
||||
const AccountTypes = [
|
||||
new AccountType({
|
||||
{
|
||||
type: 'gmail',
|
||||
displayName: 'Gmail or Google Apps',
|
||||
icon: 'ic-settings-account-gmail.png',
|
||||
headerIcon: 'setup-icon-provider-gmail.png',
|
||||
color: '#e99999',
|
||||
settings: [],
|
||||
}),
|
||||
new AccountType({
|
||||
},
|
||||
{
|
||||
type: 'exchange',
|
||||
displayName: 'Microsoft Exchange',
|
||||
icon: 'ic-settings-account-eas.png',
|
||||
headerIcon: 'setup-icon-provider-exchange.png',
|
||||
color: '#1ea2a3',
|
||||
settings: [
|
||||
{
|
||||
name: 'username',
|
||||
type: 'text',
|
||||
placeholder: 'MYCORP\\bob (if known)',
|
||||
label: 'Username (optional)',
|
||||
}, {
|
||||
name: 'password',
|
||||
type: 'password',
|
||||
placeholder: 'Password',
|
||||
label: 'Password',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'eas_server_host',
|
||||
type: 'text',
|
||||
placeholder: 'mail.company.com',
|
||||
label: 'Exchange server (optional)',
|
||||
page: 1,
|
||||
},
|
||||
],
|
||||
}),
|
||||
new AccountType({
|
||||
},
|
||||
{
|
||||
type: 'icloud',
|
||||
displayName: 'iCloud',
|
||||
icon: 'ic-settings-account-icloud.png',
|
||||
headerIcon: 'setup-icon-provider-icloud.png',
|
||||
color: '#61bfe9',
|
||||
}),
|
||||
new AccountType({
|
||||
},
|
||||
{
|
||||
type: 'outlook',
|
||||
displayName: 'Outlook.com',
|
||||
icon: 'ic-settings-account-outlook.png',
|
||||
headerIcon: 'setup-icon-provider-outlook.png',
|
||||
color: '#1174c3',
|
||||
}),
|
||||
new AccountType({
|
||||
},
|
||||
{
|
||||
type: 'yahoo',
|
||||
displayName: 'Yahoo',
|
||||
icon: 'ic-settings-account-yahoo.png',
|
||||
headerIcon: 'setup-icon-provider-yahoo.png',
|
||||
color: '#a76ead',
|
||||
settings: [{
|
||||
name: 'password',
|
||||
type: 'password',
|
||||
placeholder: 'Password',
|
||||
label: 'Password',
|
||||
required: true,
|
||||
}],
|
||||
}),
|
||||
new AccountType({
|
||||
},
|
||||
{
|
||||
type: 'imap',
|
||||
displayName: 'IMAP / SMTP Setup',
|
||||
title: 'Setup your account',
|
||||
icon: 'ic-settings-account-imap.png',
|
||||
headerIcon: 'setup-icon-provider-imap.png',
|
||||
color: '#aaa',
|
||||
settings: [
|
||||
{
|
||||
name: 'imap_host',
|
||||
type: 'text',
|
||||
placeholder: 'imap.domain.com',
|
||||
label: 'IMAP Server',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'imap_port',
|
||||
type: 'text',
|
||||
placeholder: '993',
|
||||
label: 'Port (optional)',
|
||||
className: 'half',
|
||||
initial: 993,
|
||||
format: 'integer',
|
||||
}, {
|
||||
name: 'ssl_required',
|
||||
type: 'checkbox',
|
||||
label: 'Require SSL',
|
||||
className: 'half',
|
||||
initial: true,
|
||||
}, {
|
||||
name: 'imap_username',
|
||||
type: 'text',
|
||||
placeholder: 'Username',
|
||||
label: 'Username',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'imap_password',
|
||||
type: 'password',
|
||||
placeholder: 'Password',
|
||||
label: 'Password',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'smtp_host',
|
||||
type: 'text',
|
||||
placeholder: 'smtp.domain.com',
|
||||
label: 'SMTP Server',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'smtp_port',
|
||||
type: 'text',
|
||||
placeholder: '587',
|
||||
label: 'Port (optional)',
|
||||
className: 'half',
|
||||
format: 'integer',
|
||||
initial: 587,
|
||||
}, {
|
||||
name: 'ssl_required',
|
||||
type: 'checkbox',
|
||||
label: 'Require SSL',
|
||||
className: 'half',
|
||||
initial: true,
|
||||
}, {
|
||||
name: 'smtp_username',
|
||||
type: 'text',
|
||||
placeholder: 'Username',
|
||||
label: 'Username',
|
||||
required: true,
|
||||
}, {
|
||||
name: 'smtp_password',
|
||||
type: 'password',
|
||||
placeholder: 'Password',
|
||||
label: 'Password',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
]
|
||||
|
||||
export function accountTypeForProvider(provider) {
|
||||
if (provider === 'eas') {
|
||||
return 'exchange';
|
||||
}
|
||||
if (provider === 'custom') {
|
||||
return 'imap';
|
||||
}
|
||||
return provider;
|
||||
}
|
||||
|
||||
export default AccountTypes;
|
||||
|
|
Loading…
Reference in a new issue