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

feat: extend the account fields with the already existing extended_profile_fields #1193

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

bra-i-am
Copy link

@bra-i-am bra-i-am commented Feb 17, 2025

Description

This PR aims to allow the extension of the default account fields by using the extended_profile_fields feature with a custom form app like the example

Main changes

How Has This Been Tested?

  1. Init a Sumac environment
  2. Git clone and mount this MFE with tutor mounts add /path/to/cloned/mfe
  3. Git clone this custom form app which counts with checkbox, select and text fields
  4. Mount the custom form app with tutor mounts add lms:/path/to/cloned/custom-form-app:/openedx/extra-deps and install it using tutor dev exec lms pip install -e ../extra-deps/custom-form-app
  5. Add the following env variables
    # lms.env.yml
    ADDL_INSTALLED_APPS:
      - "custom_reg_form"
    ENABLE_COMBINED_LOGIN_REGISTRATION: true
    REGISTRATION_EXTENSION_FORM: "custom_reg_form.forms.ExtraInfoForm"
    
    # cms.env.yml
    ENABLE_COMBINED_LOGIN_REGISTRATION: true
  6. Add the following settings to the Site Configurations > local.openedx.io:8000:
    {
        "ENABLE_DYNAMIC_REGISTRATION_FIELDS": true,
        "MFE_CONFIG": {
            "ENABLE_DYNAMIC_REGISTRATION_FIELDS": true,
        },
        "extended_profile_fields": [
            "employment_situation",
            "allow_newsletter",
            "favorite_movie",
            "data_authorization"
        ]
    }
  7. Run tutor dev restart
  8. When you go to your account (Account MFE), you'll be able to interact with the extended fields added through the custom form app

Screenshots/sandbox (optional):

image
image

@openedx-webhooks
Copy link

openedx-webhooks commented Feb 17, 2025

Thanks for the pull request, @bra-i-am!

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.


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 the open-source-contribution PR author is not from Axim or 2U label Feb 17, 2025
@bra-i-am bra-i-am changed the title [WIP] feat: extend the account fields with the already existing extended_profile_fields feat: extend the account fields with the already existing extended_profile_fields Feb 17, 2025
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Feb 19, 2025
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 73.25581% with 23 lines in your changes missing coverage. Please review.

Project coverage is 60.22%. Comparing base (9eda5e5) to head (9762d3b).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/account-settings/data/service.js 0.00% 7 Missing and 1 partial ⚠️
src/account-settings/EditableCheckboxField.jsx 82.85% 6 Missing ⚠️
src/account-settings/data/reducers.js 0.00% 4 Missing and 1 partial ⚠️
src/account-settings/AccountSettingsPage.jsx 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1193      +/-   ##
==========================================
+ Coverage   58.53%   60.22%   +1.68%     
==========================================
  Files         117      119       +2     
  Lines        2320     2406      +86     
  Branches      639      668      +29     
==========================================
+ Hits         1358     1449      +91     
+ Misses        901      898       -3     
+ Partials       61       59       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@e0d
Copy link

e0d commented Feb 21, 2025

@bra-i-am looks like this PR introduces some code coverage issues, can you please have a look?

@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Feb 21, 2025
@bra-i-am bra-i-am force-pushed the bc/add-extended-profile-fields branch from 191fca6 to 9301a87 Compare February 25, 2025 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants