Skip to content

Implemented Toast Notifications for Error Handling During User Settings Update #2972

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

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

Keshav-0907
Copy link
Contributor

Fixes #2965

Added toast notification for error handling when users update their settings, addressing scenarios of Empty Current Password Field and Incorrect Current Password.

Changes:

Screen.Recording.2024-01-28.at.10.14.57.PM.mov

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #2965

submitSettings(formValues)
.then((response) => {
dispatch(updateSettingsSuccess(response.data));
dispatch(showToast(5500));
dispatch(setToastText('Toast.SettingsSaved'));
resolve();
})
.catch((error) => resolve({ error }))
);
.catch((error) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we can look here and check if it's specifically a 401 error so that we know it's an incorrect password. If it's a 500 we could show a generic "something went wrong". We could also think about using the message from the server which plays into a larger discussion on translating server-side messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that sounds like a good approach. Differentiating between specific HTTP status codes like :

  • 401 for incorrect passwords
  • 500 for generic errors

On it

@lindapaiste lindapaiste added the Enhancement Improvement to an existing feature label Jan 28, 2024
@raclim raclim merged commit 686e4f4 into processing:develop Aug 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No indication that the current password entered is incorrect when changing password
3 participants