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

Help user to choose a valid password in the reset password input #819

Merged

Conversation

Steffengreiner
Copy link
Contributor

Transfers the changes made #716 to the dev branch state after the reset

What was changed
Introduce current concept of main components and remove vaadin based components from rest password and new password sending components.
Additionally provide binders checking if the provided password and email is valid

@Steffengreiner Steffengreiner requested a review from a team as a code owner September 2, 2024 15:51
@Steffengreiner Steffengreiner changed the title Feature/dm 703 overhaul password reset functionality Help user to choose a valid password in the reset password input Sep 2, 2024
@KochTobi KochTobi self-requested a review September 4, 2024 07:15
Copy link
Member

@KochTobi KochTobi left a comment

Choose a reason for hiding this comment

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

The error messages should be the same. In the registration case, the box does not show a helper and shows the helper "xyz characters are required..." when the input is not valid. The helper disappears with valid input. In the password reset form, the helper text is always shown and password to short is shown when not enough characters are provided. Is this the intended design @Shraddha0903 ?
Screenshot 2024-09-04 at 09 25 05
Screenshot 2024-09-04 at 09 24 44

*
* @since 1.0.0
*/
public class BoxLayout extends VerticalLayout {
Copy link
Member

Choose a reason for hiding this comment

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

How is this change related to the issue? What happened here and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The BoxLayout was a remnant from the time in which we relied on the Vaadin specified styling(Vertical Layout). This change aims to harmonize on how the login, registration and password related components can be harmonized in our style format. (CSS based styling)

* Card styled Layout employed within all {@link Main} in the
* {@link life.qbic.datamanager.views.login.LoginLayout}
*/
public class CardLayout extends Div {
Copy link
Member

Choose a reason for hiding this comment

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

What is a Card Layout? where is it used? How can it look. I am confused about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the JD for more clarity. In a nutshell we currently employ the same card-like style for all components during password reset, registration and login. To avoid having to copy paste the css over and over again, this DIV based component contains the style necessary to make it look like a hovering card containing the input fields.

Screenshot 2024-09-05 at 17 14 41 Screenshot 2024-09-05 at 17 14 36

Copy link
Member

Choose a reason for hiding this comment

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

I updated the JD for more clarity. In a nutshell we currently employ the same card-like style for all components during password reset, registration and login. To avoid having to copy paste the css over and over again, this DIV based component contains the style necessary to make it look like a hovering card containing the input fields.

You do not need to copy paste anything but the css class name if I am not mistaken? I would vote in favor of composition over inheritance here. Components that extend card cannot extend anything else. If you want it to look like a card, why not only add the css class name. Shouldn't this be sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! For me it feels more like a feeling thing, we want to reuse the same styling for all the components in this context, so i'd like to have it as a general java class. But since it provides no functionality as of yet, we can also go for YAGNI and copy paste the css class. I adapted the PR accordingly and removed the cardlayout 🤔

*/
@SpringComponent
@UIScope
public class ResetEmailSentComponent extends CardLayout {
Copy link
Member

Choose a reason for hiding this comment

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

why not make this a page instead and rout to it from the reset page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question.
Currently there is not a real benefit to seperate this functionality into a different page, since the user will only be shown the reset email sent component if he triggered the process during the password reset main. Do you think there is a need to seperate this functionality into different routes?

Copy link
Member

Choose a reason for hiding this comment

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

I think that this information has nothing to do with the reset form. No strong feelings just feels like an independent informational page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to keep it like this for now if that's ok. Down the line if the need arises, it's easily changed to a seperate page 👍

*/
@SpringComponent
@UIScope
public class ResetPasswordComponent extends CardLayout {
Copy link
Member

Choose a reason for hiding this comment

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

According to the javadoc this component and NewPasswordSetComponent have the same purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch 👁️. I updated the JD to better reflect their purpose.
(Reset Password --> Inform user about new password set)

@@ -35,7 +35,7 @@
*/
@SpringComponent
@UIScope
public class UserRegistrationComponent extends Div {
public class UserRegistrationComponent extends CardLayout {
Copy link
Member

Choose a reason for hiding this comment

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

Why again the card layout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Cardlayout is a DIV Container with a specific style. This style is the same for all components related to password reset, user registration and login. Therefore it's easier to maintain if we have one java class which defines the style and reuse it in the different main classes

@KochTobi KochTobi self-requested a review September 10, 2024 09:21
@Shraddha0903
Copy link

Shraddha0903 commented Sep 10, 2024

The error messages should be the same. In the registration case, the box does not show a helper and shows the helper "xyz characters are required..." when the input is not valid. The helper disappears with valid input. In the password reset form, the helper text is always shown and password to short is shown when not enough characters are provided. Is this the intended design @Shraddha0903 ? Screenshot 2024-09-04 at 09 25 05 Screenshot 2024-09-04 at 09 24 44

@KochTobi Hmm i see the issue here, the text is redundant in the first case and the second case provides no information beforehand.
So instead of the helper text can we just keep the message "Minimum 12 characters required" as placeholder text for the password and then we can have the error validation message, "Please provide a password with at least 12 characters"? Same for both - registration form and password reset.

Copy link

sonarcloud bot commented Sep 17, 2024

@sven1103 sven1103 requested review from sven1103 and removed request for sven1103 September 24, 2024 12:57
@wow-such-code
Copy link
Member

The error messages should be the same. In the registration case, the box does not show a helper and shows the helper "xyz characters are required..." when the input is not valid. The helper disappears with valid input. In the password reset form, the helper text is always shown and password to short is shown when not enough characters are provided. Is this the intended design @Shraddha0903 ? Screenshot 2024-09-04 at 09 25 05 Screenshot 2024-09-04 at 09 24 44

@KochTobi Hmm i see the issue here, the text is redundant in the first case and the second case provides no information beforehand. So instead of the helper text can we just keep the message "Minimum 12 characters required" as placeholder text for the password and then we can have the error validation message, "Please provide a password with at least 12 characters"? Same for both - registration form and password reset.

It seems that this was not addressed, yet? Otherwise the PR is good to go imo.

@Steffengreiner Steffengreiner dismissed KochTobi’s stale review September 30, 2024 11:47

Andreas took over, thanks for the feedback <3

@Steffengreiner Steffengreiner merged commit 9f657e1 into development Sep 30, 2024
4 checks passed
@Steffengreiner Steffengreiner deleted the feature/dm-703-overhaul-password-reset-functionality branch September 30, 2024 11:47
@KochTobi KochTobi mentioned this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inform user on reason for password invalidity during password reset
4 participants