-
Notifications
You must be signed in to change notification settings - Fork 119
feat: add slot to extend the profile fields #1211
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
base: master
Are you sure you want to change the base?
Conversation
… fields components
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1211 +/- ##
==========================================
+ Coverage 66.82% 66.93% +0.11%
==========================================
Files 51 52 +1
Lines 856 862 +6
Branches 176 179 +3
==========================================
+ Hits 572 577 +5
- Misses 273 274 +1
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
const extendedProfileValues = useSelector((state) => state.profilePage.account.extendedProfile); | ||
|
||
const pluginProps = { | ||
refreshUserProfile: (username) => dispatch(fetchProfile(username)), |
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.
The refreshUserProfile function is redefined every render. You could use useCallback to avoid unnecessary renderings in plugins that rely on this function.
refreshUserProfile: (username) => dispatch(fetchProfile(username)), | |
refreshUserProfile: useCallback((username) => dispatch(fetchProfile(username)), [dispatch]), |
keepDefault: false, | ||
plugins: [ | ||
{ | ||
// Insert a custom ExtendedProfileFields component |
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 think this comment is unnecessary.
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
Description
This PR creates a slot
ExtendedProfileFieldsSlot
and inserts it intoProfilePage.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:
Tutor Main
)tutor images build mfe --no-cache
config.yml
to add the custom form:tutor images build openedx --no-cache
tutor local start
Site Configurations > local.openedx.io
:tutor local restart
to update the settings