Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-13546967 - Fix change password form #1634

Merged
merged 5 commits into from
Jan 8, 2024

Conversation

bendvc
Copy link
Collaborator

@bendvc bendvc commented Jan 5, 2024

Description

The "change password" form in V3 isn't working as expected as a result of a code regression. This was most likely due to the hook integration work. The user was able to change their password, but the follow up action of logging in with said new password would fail as the login action was being called with the wrong arguments. Additionally, no error was being shown and 2 success toasts were being displayed.

This PR fixes all these issues and adds some tests to ensure another regression doesn't happen.

In the below recording you'll see the broken behaviour. First I try to change the password using a current password that isn't the actual value, and as you can see, it visually succeeds. Next I try to change the password to something new using the actual current password, and as you can see there is a login error in the network window.

PasswordUpdateBroken.mov

Now in the recording below I do similar actions to which they are all working.

PasswordChangeFixed.mov

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Changes

  • Ensure correct arguments are being passed to the login action after the password changed.
  • Add onError handler to set global error when one occurs changing the password.
  • Fix global error setting (submit button was disabled when "root" namespace isn't used)
  • Reset the current/new password fields after success

How to Test-Drive This PR

  • Follow the STR in this Gus ticket

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

@bendvc bendvc changed the title W-13546967 - Fix change password form WIP W-13546967 - Fix change password form Jan 5, 2024
@bendvc bendvc marked this pull request as ready for review January 5, 2024 21:59
@bendvc bendvc requested a review from a team as a code owner January 5, 2024 21:59
@alexvuong
Copy link
Collaborator

Thanks for posting those videos, they are very helpful!

Comment on lines -286 to -293
toast({
title: formatMessage({
defaultMessage: 'Password updated',
id: 'password_card.info.password_updated'
}),
status: 'success',
isClosable: true
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocking comment, but I notice we're changing the UX and no longer showing a "✅ success" message. Does it not work with the altered functionality?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a duplicate that was erroneously being shown either when there was an error or for a second time if it succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants