Skip to content

Commit 7292d97

Browse files
committed
not need to enter password if not validated recovery email
1 parent 0cbd493 commit 7292d97

File tree

9 files changed

+42
-28
lines changed

9 files changed

+42
-28
lines changed

email_composer/src/containers/Composer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class ComposerWrapper extends Component {
393393

394394
handleConfirmVerifyRecoveryEmail = async () => {
395395
const recoveryEmail = this.state.recoveryEmail;
396-
if (recoveryEmail !== '') {
396+
if (recoveryEmail === '') {
397397
this.saveTemporalDraft();
398398
sendEventToMailbox('open-recovery-email-mailbox', undefined);
399399
this.setState({

email_mailbox/src/components/ChangeRecoveryEmailPopup.js

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,7 @@ const ChangeRecoveryEmailPopup = props => {
3131
hasError={props.recoveryEmailPopupInputEmail.hasError}
3232
errorMessage={props.recoveryEmailPopupInputEmail.errorMessage}
3333
/>
34-
<div className="popup-paragraph">
35-
<p>{passwordText}</p>
36-
</div>
37-
<ChangePasswordPopupInput
38-
name={props.recoveryEmailPopupInputPassword.name}
39-
type={props.recoveryEmailPopupInputPassword.type}
40-
value={props.recoveryEmailPopupInputPassword.value}
41-
icon={props.recoveryEmailPopupInputPassword.icon}
42-
placeholder={
43-
string.popups.change_recovery_email.input.password.placeholder
44-
}
45-
onChangeValue={props.onChangeInputValueOnChangeRecoveryEmailPopup}
46-
onChangeType={props.onClickChangeRecoveryEmailInputType}
47-
hasError={props.recoveryEmailPopupInputPassword.hasError}
48-
errorMessage={props.recoveryEmailPopupInputPassword.errorMessage}
49-
/>
50-
<div className="forgot-password-link">
51-
<button
52-
className="button button-b"
53-
onClick={props.onClickForgotPasswordLink}
54-
>
55-
{string.popups.change_recovery_email.input.password.button}
56-
</button>
57-
</div>
34+
{renderPasswordIfRecoveryEmailIsConfirmed(props)}
5835
</div>
5936
<div className="popup-paragraph change-recovery-email-note">
6037
<p>
@@ -98,6 +75,39 @@ const ChangePasswordPopupInput = ({
9875
</div>
9976
);
10077

78+
const renderPasswordIfRecoveryEmailIsConfirmed = props => {
79+
if (props.recoveryEmailConfirmed) {
80+
return (
81+
<div>
82+
<div className="popup-paragraph">
83+
<p>{passwordText}</p>
84+
</div>
85+
<ChangePasswordPopupInput
86+
name={props.recoveryEmailPopupInputPassword.name}
87+
type={props.recoveryEmailPopupInputPassword.type}
88+
value={props.recoveryEmailPopupInputPassword.value}
89+
icon={props.recoveryEmailPopupInputPassword.icon}
90+
placeholder={
91+
string.popups.change_recovery_email.input.password.placeholder
92+
}
93+
onChangeValue={props.onChangeInputValueOnChangeRecoveryEmailPopup}
94+
onChangeType={props.onClickChangeRecoveryEmailInputType}
95+
hasError={props.recoveryEmailPopupInputPassword.hasError}
96+
errorMessage={props.recoveryEmailPopupInputPassword.errorMessage}
97+
/>
98+
<div className="forgot-password-link">
99+
<button
100+
className="button button-b"
101+
onClick={props.onClickForgotPasswordLink}
102+
>
103+
{string.popups.change_recovery_email.input.password.button}
104+
</button>
105+
</div>
106+
</div>
107+
);
108+
}
109+
};
110+
101111
const InputErrorMessage = ({ hasError, errorMessage, value }) => {
102112
const shouldRenderMessage =
103113
hasError && errorMessage.length > 0 && value.length > 0;

email_mailbox/src/components/SettingAccount.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const SettingAccount = props => (
9494
onConfirmDeleteAlias={props.onConfirmDeleteAlias}
9595
onConfirmDeleteCustomDomain={props.onConfirmDeleteCustomDomain}
9696
onShowSettingsPopup={props.onShowSettingsPopup}
97+
recoveryEmailConfirmed={props.recoveryEmailConfirmed}
9798
deleteAliasParams={props.deleteAliasParams}
9899
deleteCustomDomainsParams={props.deleteCustomDomainsParams}
99100
setReplyToPopupParams={props.setReplyToPopupParams}
@@ -444,6 +445,7 @@ SettingAccount.propTypes = {
444445
onSelectBackupFolder: PropTypes.func,
445446
onSetExportBackupPassword: PropTypes.func,
446447
onShowSettingsPopup: PropTypes.func,
448+
recoveryEmailConfirmed: PropTypes.bool,
447449
setReplyToPopupParams: PropTypes.object,
448450
settingsPopupType: PropTypes.string,
449451
upgradeToPlusType: PropTypes.string

email_mailbox/src/components/SettingAccountWrapper.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,6 @@ class SettingAccountWrapper extends Component {
12741274
inputName = 'recoveryEmailInput';
12751275
}
12761276
}
1277-
1278-
errorMessage = 'This is the current recovery email';
1279-
inputName = 'recoveryEmailInput';
12801277
}
12811278
const changeRecoveryEmailPopupParams = {
12821279
...this.state.changeRecoveryEmailPopupParams,

email_mailbox/src/lang/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@
539539
},
540540
"errors": {
541541
"wrong_password": "Wrong password",
542+
"password_must_exist": "Password must be enter",
542543
"invalid_email": "Invalid email",
543544
"criptext_email_not_confirmed": "This address has no verified recovery email.",
544545
"email_max_reached": "This address has already been used {0} times.",

email_mailbox/src/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@
546546
},
547547
"errors": {
548548
"wrong_password": "Wrong password",
549+
"password_must_exist": "Password must be enter",
549550
"invalid_email": "Invalid email",
550551
"criptext_email_not_confirmed": "This address has no verified recovery email.",
551552
"email_max_reached": "This address has already been used {0} times.",

email_mailbox/src/lang/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@
546546
},
547547
"errors": {
548548
"wrong_password": "Contraseña incorrecta",
549+
"password_must_exist": "La contraseña debe ser ingresada",
549550
"invalid_email": "Dirección de correo inválida",
550551
"criptext_email_not_confirmed": "Esta dirección de correo no esta confirmada",
551552
"email_max_reached": "Esta dirección de correo ya ha sido usada {0} veces.",

email_mailbox/src/lang/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@
539539
},
540540
"errors": {
541541
"wrong_password": "Wrong password",
542+
"password_must_exist": "Password must be enter",
542543
"invalid_email": "Invalid email",
543544
"criptext_email_not_confirmed": "This address has no verified recovery email.",
544545
"email_max_reached": "This address has already been used {0} times.",

email_mailbox/src/lang/ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@
539539
},
540540
"errors": {
541541
"wrong_password": "Wrong password",
542+
"password_must_exist": "Password must be enter",
542543
"invalid_email": "Invalid email",
543544
"criptext_email_not_confirmed": "This address has no verified recovery email.",
544545
"email_max_reached": "This address has already been used {0} times.",

0 commit comments

Comments
 (0)