feat: extra registration fields improvements#1669
feat: extra registration fields improvements#1669BryanttV wants to merge 11 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @BryanttV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1669 +/- ##
==========================================
+ Coverage 91.02% 91.09% +0.07%
==========================================
Files 110 110
Lines 2350 2359 +9
Branches 656 671 +15
==========================================
+ Hits 2139 2149 +10
+ Misses 206 205 -1
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…and option handling
ce8bdba to
e545490
Compare
Description
This PR improves the
FormFieldRenderercomponent and the configurable registration form with better UX feedback, input validation, and more robust error message handling.textandtextareafields inFormFieldRenderer.maxLengthrestriction applied natively on text inputs usingfieldData.restrictions.max_length.fieldData.instructionswhile the field is focused, usingTransitionReplace.normalizeErrorMessageutility that converts backend error messages arriving as objects (e.g.,{ required: "..." }) to strings, preventing[object Object]from being displayed.[['key', 'value']]) and object ({ key: 'value' }) formats viaObject.entries()conversion.Testing Instructions
Using Tutor:
Create a mount of the MFE, cloning this repository in your tutor root environment, and run
tutor mounts add frontend-app-authn.In the MFE folder, run
nvm use && npm installIn your tutor root environment, run
tutor dev start -dInstall this Django app to use user extra fields: https://github.com/BryanttV/custom-extra-fields
Add the following setting to your platform:
Create a new site configuration in http://local.openedx.io:8000/admin/site_configuration/siteconfiguration/add/ and add the following json:
{ "ENABLE_DYNAMIC_REGISTRATION_FIELDS": "true", "MFE_CONFIG": { "ENABLE_DYNAMIC_REGISTRATION_FIELDS": "true" }, "REGISTRATION_EXTRA_FIELDS": { "nickname": "required", "birthdate": "required", "interests": "required", "wants_newsletter": "required", "favorite_language": "required" }, "extended_profile_fields": [ "nickname", "birthdate", "interests", "wants_newsletter", "favorite_language" ] }Go to the registration page
You can test the new validations, user feedback, and error messages.
Screenshots/sandbox (optional):
Merge Checklist
Post-merge Checklist