-
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:
|
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
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 in the PR looks good to me overall. One suggestion: it might be better to update the plugin so that it only installs the form for the profile/account MFE. This would help keep things more scoped and prevent unnecessary installations. couldn't replicate the changes locally due to some environment configs not loading, but the logic looks solid.
I tested with this plugin and I could build the MFE images with no problems:
from tutormfe.hooks import PLUGIN_SLOTS
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-dockerfile-post-npm-install-profile",
"""
# npm package
RUN npm install '@edunext/frontend-component-extended-fields@latest' --force
""",
)
)
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-dockerfile-post-npm-install-account",
"""
# npm package
RUN npm install '@edunext/frontend-component-extended-fields@latest' --force
""",
)
)
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-env-config-buildtime-imports-profile",
"""
import { ExtendedProfileFields } from '@edunext/frontend-component-extended-fields';
""",
)
)
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-env-config-buildtime-imports-account",
"""
import { ExtendedProfileFields } from '@edunext/frontend-component-extended-fields';
""",
)
)
PLUGIN_SLOTS.add_items(
[
(
"profile",
"extended_profile_fields_slot",
"""
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'extended_profile_fields',
type: DIRECT_PLUGIN,
RenderWidget: ExtendedProfileFields,
},
}""",
),
]
)
I want to take this opportunity to mention a few things in the steps to test this development: There is no mention of the use of this branch in our Local TutorAdd the next script to tutor plugin to override the branch of Profle MFE from tutormfe.hooks import MFE_APPS
@MFE_APPS.add()
def _add_my_mfe(mfes):
mfes["profile"] = {
"repository": "https://github.com/edunext/frontend-app-profile.git",
"port": 1995,
"version": "bc/add-extra-fields-slot",
} Another way we can do this in the queue is by using
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
import { ExtendedProfileFields } from '@edunext/frontend-component-extended-fields';
// Load environment variables from .env file
const config = {
...process.env,
pluginSlots: {
extended_profile_fields_slot: {
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'extended_profile_fields',
type: DIRECT_PLUGIN,
RenderWidget: ExtendedProfileFields,
},
},
],
},
},
};
export default config; Problem with backend to update valuesI think this problem is not associate with this PR, but maybe we have to mention this in troubleshooting section Install dependency only in Profile and Account MFEWhat Andres mentions is important, we don't have to install Finally @bra-i-am I don't see anything about the PR of |
@Asespinel, thank you for your review. I'll be working on the change of the plugin you mentioned! I hope the issue is gone, and you can test it properly. Please let me know any other comments/questions you have ✨ |
@jignaciopm, thank you again for your review 🙏✨
You're right, I forgot to mention that really important thing... with your permission, I'll paste the steps you give in the cover letter of this PR 😅
I already reviewed this: it was an error with the handling I was doing in the
Yees, you are right... I'll be checking this out
Honestly, I didn't create any PR for those things... but the repositories are not too big, so if you take a look at them, it would be great! |
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:
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
Profle 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