Skip to content

feat: extra registration fields improvements#1669

Draft
BryanttV wants to merge 11 commits intoopenedx:masterfrom
eduNEXT:bav/extra-registration-fields-improvements
Draft

feat: extra registration fields improvements#1669
BryanttV wants to merge 11 commits intoopenedx:masterfrom
eduNEXT:bav/extra-registration-fields-improvements

Conversation

@BryanttV
Copy link
Copy Markdown

@BryanttV BryanttV commented Apr 28, 2026

Description

This PR improves the FormFieldRenderer component and the configurable registration form with better UX feedback, input validation, and more robust error message handling.

  1. Placeholder support for text and textarea fields in FormFieldRenderer.
  2. maxLength restriction applied natively on text inputs using fieldData.restrictions.max_length.
  3. Animated help text on focus, displays fieldData.instructions while the field is focused, using TransitionReplace.
  4. Error message normalization, new normalizeErrorMessage utility that converts backend error messages arriving as objects (e.g., { required: "..." }) to strings, preventing [object Object] from being displayed.
  5. Flexible options format for select fields, automatically handling both array ([['key', 'value']]) and object ({ key: 'value' }) formats via Object.entries() conversion.

Testing Instructions

Using Tutor:

  1. Create a mount of the MFE, cloning this repository in your tutor root environment, and run tutor mounts add frontend-app-authn.

  2. In the MFE folder, run nvm use && npm install

  3. In your tutor root environment, run tutor dev start -d

  4. Install this Django app to use user extra fields: https://github.com/BryanttV/custom-extra-fields

  5. Add the following setting to your platform:

    REGISTRATION_EXTENSION_FORM = "custom_extra_fields.forms.CustomExtraFieldsForm"
  6. 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"
      ]
    }
  7. Go to the registration page

  8. You can test the new validations, user feedback, and error messages.

Screenshots/sandbox (optional):

Before After
Required field message ERROR 💥 image
Dropdown Field ERROR! 💥 image
Without placeholder and help text image With placeholder and help text image
Without max length restriction image With max length restriction image

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Sandbox, if applicable.
  • Is there adequate test coverage for your changes?

Post-merge Checklist

  • Deploy the changes to prod after verifying on stage or ask @openedx/2u-infinity to do it.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @BryanttV!

This repository is currently maintained by @openedx/2u-infinity.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

Your 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Apr 28, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Apr 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.09%. Comparing base (2bca0ec) to head (e545490).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 29, 2026
@BryanttV BryanttV force-pushed the bav/extra-registration-fields-improvements branch from ce8bdba to e545490 Compare April 29, 2026 19:36
@BryanttV BryanttV requested a review from bra-i-am April 30, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

3 participants