-
Notifications
You must be signed in to change notification settings - Fork 159
feat: add slot to extend the profile fields #1254
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: add slot to extend the profile fields #1254
Conversation
Thanks for the pull request, @bra-i-am! 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. 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1254 +/- ##
==========================================
- Coverage 60.39% 59.93% -0.47%
==========================================
Files 118 120 +2
Lines 2343 2371 +28
Branches 670 675 +5
==========================================
+ Hits 1415 1421 +6
- Misses 868 890 +22
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e81d047
to
3e17e09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing this PluginSlot, thanks to README It was easy. I like this kind of contributions.We need to expand our range of plugin slots and it is good to have this example base.
I only have a doubt if I need to add new extra fields I just have to add them here https://github.com/bra-i-am/custom-form-app/blob/master/custom_reg_form/forms.py and the https://www.npmjs.com/package/@edunext/frontend-component-extended-fields is in charge of doing the GET and rendering them
@jignaciopm, thank you so much for your review 🙏
Yeah, that's how it works! Just to clarify: in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me. The implementation is clean and follows the expected patterns to add a slot. No issues from my testing on my local env. Great work!
Hello @arbrandes and @brian-smith-tcril, I just tagged you in a related PR for the profile page that just as this has also been waiting for a review for a few Months. This PR would be the other side of the coin, the extensibility to add components in the account page so that info is stored for the user can also be edited by the user. As well as profile, this app has not received many UI slots yet. This slot would be closely aligned with the main reason of being for this MFE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
Overall this looks good! Left a few comments (most are quite similar to my comments here openedx/frontend-app-profile#1211 (review)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for addressing my change requests!
It looks like this branch has some conflicts and tests didn't run. Would you be able to rebase it (I'm hoping that will also trigger a CI run)?
Once conflicts are resolved and CI is passing I'll be happy to approve/merge!
@@ -0,0 +1,87 @@ | |||
# Extended Profile Fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Extended Profile Fields | |
# Additional Profile Fields |
…lot and update documentation
…itionalProfileFieldsSlot
f579c34
to
ff81465
Compare
hey @brian-smith-tcril, thanks a lot for your review!! ✨ I remember you asked about why I located the ![]() On the other hand, I have a question: the coverage is failing because of the plugin slot and the example. Would I test those parts too? 🤔 Thanks for your help! |
I think moving away from using the
That could definitely be cool! I think that would be a nice thing to consider for a future PR, and we can keep this one focused on the "Profile Information" section. |
It looks like the main issue is with the example file. I'm happy to merge this with that uncovered (most examples just live directly in the markdown and aren't covered). |
Description
This PR creates a slot
ExtendedProfileFieldsSlot
and inserts it intoAccountSettingPage.jsx
. The main goal of this change is to allow the extension of the profile fields.This use case is required by NAU and can be validated by @igobranco
Screenshots
How Has This Been Tested?
In case you want to test my implementation, I'll leave you a little guide down below:
Have a tutor environment (I used
Tutor Main
)You have to mount this MFE on the branch of this PR so you can use the slot:
a. Add this script to the following tutor plugin to override the branch of
Account MFE
b. Another way we can do this in the queue is by
tutor mounts add
the MFE in our Tutor local env. To do this, we must:Install the
@edunext/frontend-component-extended-fields@latest
package in our MFE Profile.Create an
env.config.jsx
file in the root of the MFE with the following configuration:Create a tutor plugin and enable it:
Run
tutor images build mfe --no-cache
Add this in the
config.yml
to add the custom form:Add the following env variables
Run
tutor images build openedx --no-cache
Run
tutor local start
Add the following settings to the
Site Configurations > local.openedx.io
:Run
tutor local restart
to update the settings