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

refactor(RegisterUserFormComponent): Extract duplicate createAccountError() #1428

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Sep 21, 2023

Changes

  • Extract Register[Student/Teacher]FormComponent.createAccountError() to parent RegisterUserFormComponent.createAccountError()
  • Clean up surrounding code
    • use this.user instead of this.studentUser and this.teacherUser in the components
    • move processing and passwordsFormGroup variables to RegisterUserFormComponent

Test

  • Send an invalid password to the server
    • Set a breakpoint in StudentService.registerStudentAccount() and change the studentUser's password to "1" before it is POST'ed to the server. => verify that RegisterUserFormComponent.createAccountError() is called, and it shows the error on the form
    • Do the same as above with TeacherService.registerTeacherAccount() when registering a new teacher user
  • Creating student/teacher accounts without any problems work as before

@hirokiterashima hirokiterashima self-assigned this Sep 21, 2023
@hirokiterashima hirokiterashima added this to the Tech Debt 20 -> 19 milestone Sep 21, 2023
@hirokiterashima hirokiterashima marked this pull request as ready for review September 21, 2023 22:44
Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

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

Looks good.

@hirokiterashima hirokiterashima merged commit 09286ee into develop Oct 4, 2023
@hirokiterashima hirokiterashima deleted the refactor-register-user-form-extract-createAccountError branch October 4, 2023 17:52
@hirokiterashima
Copy link
Member Author

🎉 This PR is included in version 5.115.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants