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

Show error message from the password validation response #2378

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

milanmajchrak
Copy link
Contributor

@milanmajchrak milanmajchrak commented Jul 20, 2023

References

Add references/links to any related issues or PRs. These may include:

Description

When the user is changing the password the more specific validation error message is popped up instead of unclear, the default message. The error message is loaded from the response error message.

Instructions for Reviewers

Updated profile-page.component.ts: The validation patch response is processed in the way that the error message from the response is added into notification message.

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

Try to change the password for some user.

  1. Fill in a correct password.
  2. Fill in a new password into password input fields which is less than 8 characters. Click to Save and the more specific error message will be popped up.
  3. Fill in a new password into password input fields which is more than 8 characters and provide a wrong original password. Click to Save and the more specific error message will be popped up.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@milanmajchrak milanmajchrak changed the title Show error message from the password validation error Show error message from the password validation response Jul 20, 2023
@tdonohue tdonohue added bug authentication: password related to built in password authentication 1 APPROVAL pull request only requires a single approval to merge labels Jul 20, 2023
@tdonohue tdonohue self-requested a review July 27, 2023 14:22
@alanorth
Copy link
Contributor

alanorth commented Aug 3, 2023

Thanks @milanmajchrak for the patch and the easy instructions. I reviewed this by testing on DSpace 7.6.

Before, DSpace would display a toast saying that an error occurred:

After, DSpace shows a message saying the password must be at least eight characters long:

P.S. my only feedback would be to rebase this pull request branch to remove those two unwanted reverts. Better to fix that before merging so we don't have such commits in the main branch forever. You could simply "squash" these three commits into one so they contain the actual changes and force-push the branch.

@alanorth alanorth self-requested a review August 3, 2023 09:24
@tdonohue
Copy link
Member

tdonohue commented Aug 3, 2023

@milanmajchrak : Would you be willing to squash these 3 commits into one? It should be possible to do easily via something like git rebase -i HEAD~3 (which should rebase the last 3 commits & open them in an editor). Then add "fixup" next to the last two. That should merge all 3 commits into one.

If you are not able to do this or don't feel comfortable with git commandline, I can see if I can do it on your behalf. But that may require creating a new PR & cherry-picking these commits into it.

@milanmajchrak
Copy link
Contributor Author

@tdonohue @alanorth I've fixed it following the command git rebase -i HEAD~3. Thank you for your instructions.

Copy link
Contributor

@alanorth alanorth left a comment

Choose a reason for hiding this comment

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

Reviewed by inspection after rebase. Looks good to me.

@alanorth alanorth added the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 4, 2023
@alanorth alanorth merged commit 2cfd19f into DSpace:main Aug 4, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 4, 2023
@tdonohue tdonohue added this to the 8.0 milestone Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge authentication: password related to built in password authentication bug
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Cannot change the user password - unclear error message
4 participants