App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-12-06] Change Password - Error message not displayed in red for incorrect new password

Open isagoico opened this issue 5 years ago • 51 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Launch the app and login
  2. Navigate to settings by clicking on the user avatar over LHN
  3. Click on change password
  4. Enter correct old password
  5. Enter password not meeting the requirement for new password

Expected Result:

Error message displayed in red

Actual Result:

No error message displayed and only message displayed in black about password requirement

Workaround:

None needed, visual issue.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.0.92-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

image

Expensify/Expensify Issue URL:

View all open jobs on GitHub

isagoico avatar Sep 01 '21 22:09 isagoico

Triggered auto assignment to @Jag96 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Sep 01 '21 22:09 MelvinBot

I had worked on the confirm password error message on this page. I would propose a very small fix here,

We should retain the prompt and only change the color of the message when the password doesn't match the requirement. So basically remove this.state.isPasswordRequirementsVisible and change the block to the following:

{(
      <Text style={[styles.textLabelSupporting, styles.mt1, !this.isValidPassword() && styles.formError]}>
          {this.props.translate('passwordPage.newPasswordPrompt')}
      </Text>
  )}

mananjadhav avatar Sep 02 '21 17:09 mananjadhav

Here is my suggestion. We need to start validating (i.e. 1 capital letter, 1 lowercase letter, 1 number) new password as soon as some character entered. So as soon as start entering character in new password field, it will show message in red color due to password not match with rule initially. Now user go on typing new password and as soon as it become valid, the message shows in normal color.

So based on my thinking I will suggest to add condition at line 150 (within PasswordPage.js file), So overall behaviour remain same and it will just show message in red color whenever new password input value is not valid.

Code Before Update: https://github.com/Expensify/App/blob/c2f83f3249e9b07cad15ca403bf19ef37e7b7aee/src/pages/settings/PasswordPage.js#L149-L153

Code After Update ( condition added at line 150):

{this.state.isPasswordRequirementsVisible && (
    <Text style={[styles.textLabelSupporting, styles.mt1, (this.state.newPassword && !this.isValidPassword()) && styles.formError]}>
        {this.props.translate('passwordPage.newPasswordPrompt')}
    </Text>
)}

Below is the screen recording how its looks once the suggested solution implemented.

https://user-images.githubusercontent.com/7823358/132018151-743d282c-9139-40aa-893b-64e11301656f.mov

I understand that External label not set with this issue. So at present consider this as my suggestion. I hope it will be helpful to someone who handle it internally. If this issue considered as external and my solution accepted then kindly invite me on Upwork once project posted. Here is my upwork profile: https://www.upwork.com/freelancers/~01c718889ed7821f82 Thanks.

PrashantMangukiya avatar Sep 03 '21 14:09 PrashantMangukiya

@isagoico was there a slack thread for this one? I didn't see one but just double-checking so I can have all the context

Jag96 avatar Sep 03 '21 20:09 Jag96

@Jag96 This was raised as part of our internal QA that's why there's no slack thread linked in this one.

isagoico avatar Sep 03 '21 21:09 isagoico

Issue reproducible during KI retests

isagoico avatar Sep 05 '21 23:09 isagoico

@Jag96 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MelvinBot avatar Sep 07 '21 19:09 MelvinBot

I think for this one we should keep the same convention from https://github.com/Expensify/App/pull/5093, where:

  1. Initially, the passwordPage.newPasswordPrompt message shows with grey text, even when the user hasn't typed anything
  2. When the user starts typing, the passwordPage.newPasswordPrompt message shows w/ formError styles
  3. Once the requirements are met, the passwordPage.newPasswordPrompt message shows w/ grey text again, even when the user goes to the next field

So the message will always be shown if that makes sense. @mananjadhav @PrashantMangukiya can you post updated proposals to match that convention?

Jag96 avatar Sep 07 '21 21:09 Jag96

Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Sep 07 '21 21:09 MelvinBot

@Jag96 If you see my proposal https://github.com/Expensify/App/issues/4995#issuecomment-911916821 it does exactly the same.

I proposed two changes in the code:

  1. Remove this.state.isPasswordRequirementsVisible check so that the hint is always visible
  2. Add !this.isValidPassword() && styles.formError in styles so that formError style is shown when the password is invalid.

I hope it clarifies what you expected.

mananjadhav avatar Sep 07 '21 21:09 mananjadhav

@mananjadhav it looks like your proposal results in the initial state of the message being shown w/ formError, rather than it starting off grey and only showing w/ formError once the user starts typing:

image

Jag96 avatar Sep 07 '21 22:09 Jag96

You're right @Jag96.

Updated Proposal Extending the proposal in the comment (https://github.com/Expensify/App/issues/4995#issuecomment-911916821), I'll update the check for the form style with the following:

<Text style={[styles.textLabelSupporting, styles.mt1, this.state.newPassword && !this.isValidPassword() && styles.formError]}>
    {this.props.translate('passwordPage.newPasswordPrompt')}
                            </Text>

We would still remove the isPasswordRequirementsVisible as it won't be used.

and we can move this.state.newPassword && !this.isValidPassword() check into a function say isInvalidPassword or showFormError.

Does that make sense?

mananjadhav avatar Sep 07 '21 22:09 mananjadhav

@mananjadhav that sounds good to me, I like the improvement of moving the state check into a new isInvalidPassword function! @puneetlath can you please hire @mananjadhav for this job once you create the Upwork post? @mananjadhav feel free to get started on a PR once you've been hired in Upwork.

Jag96 avatar Sep 07 '21 22:09 Jag96

Hi @Jag96 and @puneetlath I already suggested this condition from beginning that shows code as under, As you can see within https://github.com/Expensify/App/issues/4995#issuecomment-912573194

{this.state.isPasswordRequirementsVisible && (
    <Text style={[styles.textLabelSupporting, styles.mt1, (this.state.newPassword && !this.isValidPassword()) && styles.formError]}>
        {this.props.translate('passwordPage.newPasswordPrompt')}
    </Text>
)}

Should I submit updated proposal from my side based on the suggested steps mentioned in https://github.com/Expensify/App/issues/4995#issuecomment-914647313 ? If already decided to go within other proposal then it is ok.

Please let me know should I put the updated proposal from my side now?

PrashantMangukiya avatar Sep 07 '21 23:09 PrashantMangukiya

@PrashantMangukiya your initial proposal did have that included, but it was also hiding the message after the user went to the confirm field. Both initial proposals didn't match the behavior posted in this comment (because the ideal behavior wasn't listed initially), so in this case, I gave the job to @mananjadhav since he posted his initial proposal first and his updated proposal met the requirements.

Jag96 avatar Sep 07 '21 23:09 Jag96

Hi @Jag96 Thanks for the updates. Its ok no problem. I will not submit updated proposal now. @mananjadhav congrats..

PrashantMangukiya avatar Sep 07 '21 23:09 PrashantMangukiya

@puneetlath can you please hire @mananjadhav for this job once you create the Upwork post?

Done!

puneetlath avatar Sep 07 '21 23:09 puneetlath

Issue reproducible during KI retests.

isagoico avatar Sep 13 '21 15:09 isagoico

Hi @mananjadhav, I've placed this issue on hold as per this update, as we are prioritising issues related to a feature release scheduled for 9/24. As an apology for the delay, we will add a $100 bonus as a thank you for waiting.

kadiealexander avatar Sep 16 '21 03:09 kadiealexander

Issue reproducible during KI retests.

isagoico avatar Sep 20 '21 15:09 isagoico