-
Notifications
You must be signed in to change notification settings - Fork 83
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: allow runtieme configuration #253
feat: allow runtieme configuration #253
Conversation
Thanks for the pull request, @dcoa! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
@dcoa Thank you for your contribution. Is this ready for our review? |
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #253 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 108 110 +2
Lines 1260 1264 +4
Branches 248 248
=========================================
+ Hits 1260 1264 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hi @natabene , yes is ready. |
@dcoa I had a review on this PR. I would like to request the following:
|
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.
Added some inline comments as well.
src/App.jsx
Outdated
@@ -28,6 +29,7 @@ const App = () => ( | |||
<Footer logo={process.env.LOGO_POWERED_BY_OPEN_EDX_URL_SVG} /> | |||
</div> | |||
</Router> | |||
<Head /> |
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.
It's weird to me that Head
element is lower than the Footer
element. Can you help me understand the reason for this sequence?
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 agree, I fix this
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.
Why not just put this (without the head component, just directly in here) at the top of this 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 use a component because there are specific related changes (title and favicon) and I thought was better to maintain a simple App component and because I'm using injectIntl
(from @edx/frontend-platform/i18n
) which wraps the component to make it possible to change the MFE name according to the language and that needs access the IntlProvider
that is inside AppProvider
Hi @schenedx,
The main idea form this PR is to allow gradebook to use the runtime configuration option when this is activated (now in frontend-platform check this PR openedx/frontend-platform#335).
Yes, I added a screenshot of the area impacted by Head component the main idea is to maintain the actual UI. The main idea of runtime configuration is to set or override any variable this includes @muselesscreator, understanding that, is necessary to apply these changes with code (accessing the method
Yes, I tried to make a contribution to the main code. Like the issue openedx/wg-frontend#103 describes I want to implement those changes in different apps (availables by default in tutor-mfe by now), that includes Gradebook and Account where was approved openedx/frontend-app-account#603 I will be attentive if you require more information 🤓 |
@schenedx and @muselesscreator -- I plan to approve and merge this on Monday 10/17 unless you folks had any specific concerns. |
I tested it, and it works. Thanks for your explanation and the images @dcoa 🙌 |
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.
.env
Outdated
APP_ID= | ||
MFE_CONFIG_API_URL= |
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.
Nit -- I recommend using single quotes, just for consistency with the rest of the file.
APP_ID= | |
MFE_CONFIG_API_URL= | |
APP_ID='' | |
MFE_CONFIG_API_URL='' |
.env.development
Outdated
APP_ID= | ||
MFE_CONFIG_API_URL= |
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.
APP_ID= | |
MFE_CONFIG_API_URL= | |
APP_ID='' | |
MFE_CONFIG_API_URL='' |
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.
@kdmccormick No. If @muselesscreator approved. I am good.
@muselesscreator When is a good time for us to merge and deploy this change?
c00d62b
to
b26b9fb
Compare
Hi @kdmccormick I already rebase it and add the single quotes. |
@dcoa 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Allows frontend-app-gradebook to be configured at runtime using the LMS's new MFE Configuration API. Part of openedx/wg-frontend#103
Description
This PR is part of the work to make it possible to configure the frontend applications at runtime (you can referer to this openedx/wg-frontend#103).
Changes
Screenshot
![gradebook-title](https://user-images.githubusercontent.com/66016493/189684637-95f3fc03-4e9b-4e82-ab7b-4ec2d3968f05.png)
Values come from runtime configuration
![response runtime-config](https://user-images.githubusercontent.com/66016493/189715913-d7476531-6d70-4747-a222-ede0210e2e28.png)
How to test
MFE_CONFIG_API_URL
andAPP_ID
in the env file and add the api url ( To test this you can use the API from this feat: add mfe config api edx-platform#30473 or use an external tool to mock the API response).Note: You can combine buildtime and runtime configuration