feat(onboarding): Add Yahoo and iCloud and fix styling

This commit is contained in:
Jackie Luo 2017-01-10 18:14:49 -08:00
parent 2f2cf5be4e
commit 3a6a4299af
4 changed files with 20 additions and 18 deletions

View file

@ -7,26 +7,12 @@
// color: '#1ea2a3', // color: '#1ea2a3',
// }, // },
// { // {
// type: 'icloud',
// displayName: 'iCloud',
// icon: 'ic-settings-account-icloud.png',
// headerIcon: 'setup-icon-provider-icloud.png',
// color: '#61bfe9',
// },
// {
// type: 'outlook', // type: 'outlook',
// displayName: 'Outlook.com', // displayName: 'Outlook.com',
// icon: 'ic-settings-account-outlook.png', // icon: 'ic-settings-account-outlook.png',
// headerIcon: 'setup-icon-provider-outlook.png', // headerIcon: 'setup-icon-provider-outlook.png',
// color: '#1174c3', // color: '#1174c3',
// }, // },
// {
// type: 'yahoo',
// displayName: 'Yahoo',
// icon: 'ic-settings-account-yahoo.png',
// headerIcon: 'setup-icon-provider-yahoo.png',
// color: '#a76ead',
// },
// ] // ]
const AccountTypes = [ const AccountTypes = [
@ -44,6 +30,20 @@ const AccountTypes = [
headerIcon: 'setup-icon-provider-outlook.png', headerIcon: 'setup-icon-provider-outlook.png',
color: '#0078d7', color: '#0078d7',
}, },
{
type: 'yahoo',
displayName: 'Yahoo',
icon: 'ic-settings-account-yahoo.png',
headerIcon: 'setup-icon-provider-yahoo.png',
color: '#a76ead',
},
{
type: 'icloud',
displayName: 'iCloud',
icon: 'ic-settings-account-icloud.png',
headerIcon: 'setup-icon-provider-icloud.png',
color: '#61bfe9',
},
{ {
type: 'imap', type: 'imap',
displayName: 'IMAP / SMTP Setup', displayName: 'IMAP / SMTP Setup',

View file

@ -85,8 +85,10 @@ export function buildGmailAuthURL(sessionKey) {
export function runAuthRequest(accountInfo) { export function runAuthRequest(accountInfo) {
const {username, type, email, name} = accountInfo; const {username, type, email, name} = accountInfo;
const provider = ['gmail', 'office365'].includes(type) ? type : 'imap';
const data = { const data = {
provider: type, provider: provider,
email: email, email: email,
name: name, name: name,
settings: Object.assign({}, accountInfo), settings: Object.assign({}, accountInfo),
@ -109,7 +111,7 @@ export function runAuthRequest(accountInfo) {
* Only include the required IMAP fields. Auth validation does not allow * Only include the required IMAP fields. Auth validation does not allow
* extra fields * extra fields
*/ */
if (type === "imap") { if (provider === "imap") {
for (const key of Object.keys(data.settings)) { for (const key of Object.keys(data.settings)) {
if (!IMAP_FIELDS.has(key)) { if (!IMAP_FIELDS.has(key)) {
delete data.settings[key] delete data.settings[key]

View file

@ -56,7 +56,7 @@ class AccountBasicSettingsForm extends React.Component {
} }
submit() { submit() {
if (this.props.accountInfo.type === 'imap') { if (!['gmail', 'office365'].includes(this.props.accountInfo.type)) {
const accountInfo = accountInfoWithIMAPAutocompletions(this.props.accountInfo); const accountInfo = accountInfoWithIMAPAutocompletions(this.props.accountInfo);
OnboardingActions.setAccountInfo(accountInfo); OnboardingActions.setAccountInfo(accountInfo);
OnboardingActions.moveToPage('account-settings-imap'); OnboardingActions.moveToPage('account-settings-imap');

View file

@ -240,7 +240,7 @@
.page.account-choose { .page.account-choose {
h2 { h2 {
margin-top: 155px; margin-top: 100px;
} }
.provider-list { .provider-list {