[Bugfix:System] Preserve signup fields#12939
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12939 +/- ##
============================================
- Coverage 21.40% 21.40% -0.01%
- Complexity 9944 9945 +1
============================================
Files 268 268
Lines 37124 37131 +7
Branches 494 494
============================================
Hits 7948 7948
- Misses 28686 28693 +7
Partials 490 490
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
dandrecollins07-ctrl
left a comment
There was a problem hiding this comment.
Please fix the title name.
dandrecollins07-ctrl
left a comment
There was a problem hiding this comment.
Tested on main and PR branch.
On main, triggering a server-side validation error ("This email is not accepted") cleared all form fields after redirecting back to the signup page.
On the PR branch, the email, user ID, given name, and family name fields remained populated while the password and confirm password fields were correctly cleared.
Also verified that duplicate-account validation preserves the non-password fields as expected.
|
@RohanOnKeys I saw that you closed the PR, but created a new one with just an edit in the Testing. If that was all that was changed, you can just edit the message here and reopen the PR as the code is identical, and seems to fix the issue it's intended to. |
|
Looks like the latest workflow runs need maintainer approval before they can start. I don't have permission to rerun them from my side. |
|
Cypress E2E tests with pam auth is failing everytime |
Hi, may you please put the original description back? This will be important for future reviewers to properly understand. |
|
Doneee.. |
### What is the current behavior? When server-side validation rejects the self-account creation form, the redirect back to the signup page clears every field. This includes failures that cannot be prevented by client-side validation, such as duplicate user IDs or email addresses. ### What is the new behavior? The controller stores only the submitted email, user ID, given name, and family name for the redirect request. The signup form consumes those values once and repopulates the corresponding fields. Password and confirmation values are intentionally never stored or repopulated. This keeps server-side validation authoritative and covers every existing validation/error redirect rather than only rules that can be duplicated in JavaScript. ### Testing The self-account-creation Cypress flow now verifies that: - all four non-password fields remain populated after an invalid email-domain response; - password and confirmation fields are empty after the redirect; - subsequent validation paths can replace the preserved values cleanly. Local checks: `git diff --check` and JavaScript syntax validation passed. Full PHP lint and Cypress execution require the Submitty development environment and are left to CI. Closes Submitty#12490 This is a server-side replacement for the incomplete client-side approach in Submitty#12679. Co-authored-by: Barb Cutler <[email protected]>
* main: (78 commits) [Bugfix:TAGrading] Auto-open single file (#12625) [Feature:InstructorUI] Add sortable columns to manage students (#12957) [Dependency] Bump php-ds/php-ds from 1.7.0 to 2.0.1 in /site (#12827) [Refactor:TAGrading] Events Infrastructure & StatusBanner (#12941) [Dependency] Bump sqlalchemy from 2.0.48 to 2.0.51 in /.setup/pip (#12884) [Bugfix:Developer] trust hashicorp for vagrant install (#12968) [Feature:TAGrading] Backend for submission clustering (#12886) [Bugfix:InstructorUI] Missing Subsection in the Edit User form (#12955) [Bugfix:Submission] Warning Banners Accessibility Fix (#12956) [Bugfix:System] Preserve signup fields (#12939) [Bugfix:InstructorUI] Fix Csv Download of Subsections (#12954) [Bugfix:InstructorUI] Fix Manage Students Toggle Columns (#12953) [Feature:TAGrading] Persistent Auto-Open (#12931) [Bugfix:Submission] Dot File Upload (#12924) [Refactor:System] Declutter workers (#12815) [Bugfix:Developer] save/restore autograding_containers.json (#12952) [Bugfix:InstructorUI] Create Course Validation (#12949) [Testing:Notifications] Fix grade_inquiries.spec.js (#12950) [UI/UX:System] Add fullscreen button vue component (#12936) [Bugfix:TAGrading] Student Name Resize (#12946) ... # Conflicts: # .pylintrc
What is the current behavior?
When server-side validation rejects the self-account creation form, the redirect back to the signup page clears every field. This includes failures that cannot be prevented by client-side validation, such as duplicate user IDs or email addresses.
What is the new behavior?
The controller stores only the submitted email, user ID, given name, and family name for the redirect request. The signup form consumes those values once and repopulates the corresponding fields.
Password and confirmation values are intentionally never stored or repopulated.
This keeps server-side validation authoritative and covers every existing validation/error redirect rather than only rules that can be duplicated in JavaScript.
Testing
The self-account-creation Cypress flow now verifies that:
Local checks:
git diff --checkand JavaScript syntax validation passed. Full PHP lint and Cypress execution require the Submitty development environment and are left to CI.Closes #12490
This is a server-side replacement for the incomplete client-side approach in #12679.