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: allow runtime configuration #274

Merged
merged 5 commits into from
Dec 7, 2022

Conversation

MaferMazu
Copy link
Contributor

@MaferMazu MaferMazu commented Oct 14, 2022

Description

This PR is part of the work to make it possible to configure the frontend applications at runtime.

Related

openedx/wg-frontend#103
https://discuss.openedx.org/t/mfe-runtime-configuration/8495/1

Changes

Update frontend-platform to version 2.5.0
Create a component Head that uses the Helmet library and integrates internationalization to change the MFE name in the title tag according to the language, and change the favicon in runtime.

How to test

To allow runtime configuration, set new environment variables MFE_CONFIG_API_URL and APP_ID in the env file and add the API URL ( To test this, you can use the API from this openedx/edx-platform#30473 or use an external tool to mock the API response).
The API should respond with a JSON with the config values, something like:

{
  "SITE_NAME": "Test Site",
  "LOGO_URL": "https://testimage.com/logo.svg",
  "LOGO_TRADEMARK_URL": "https://testimage.com/logo.svg",
  "LOGO_WHITE_URL": "https://testimage.com/logo.svg",
  "FAVICON_URL": "https://testimage.com/favicon.ico",
}

The initialize process should work normally.
Note: You can combine build time and runtime configuration

Screenshot

support tools evidence

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 14, 2022
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 14, 2022

Thanks for the pull request, @MaferMazu! 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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@MaferMazu MaferMazu changed the title feat: allow runtieme configuration feat: allow runtime configuration Oct 14, 2022
@MaferMazu MaferMazu marked this pull request as ready for review October 18, 2022 15:49
@MaferMazu
Copy link
Contributor Author

This PR is ready for review. I'm attentive to feedback 😊
cc @Ian2012 @dcoa @arbrandes

@arbrandes arbrandes merged commit b3ffcfc into openedx:master Dec 7, 2022
@openedx-webhooks
Copy link

@MaferMazu 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

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
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants