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 LOGO_URL runtime configuration #238

Closed
wants to merge 2 commits into from

Conversation

mariajgrimaldi
Copy link
Member

Description

This PR supports LOGO_URL runtime configurations, which can be taken from the env or the MFE_CONFIG_OVERRIDES configuration.

How to test

I used a tutor development env for testing:

  1. Create an inline tutor plugin so you can add:
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-development-settings",

        """
LEARNER_HOME_MICROFRONTEND_URL = "http://{{MFE_HOST}}:1990"
LEARNER_HOME_MFE_REDIRECT_PERCENTAGE = 100
CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:1990")
LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}:1990")
CSRF_TRUSTED_ORIGINS.append("http://{{ MFE_HOST }}:1990")
MFE_CONFIG_OVERRIDES = {
    "learner-dashboard": {
        "LOGO_URL": "https://files.edx.org/openedx-logos/edx-openedx-logo-tag.png"
    }
}
"""
    )
)
  1. After cloning this repo, modify .env.development so it looks like this:
NODE_ENV='development'
PORT=1990
BASE_URL='apps.local.overhang.io:1990'
LMS_BASE_URL='http://local.overhang.io:8000'
ECOMMERCE_BASE_URL='http://localhost:18130'
LOGIN_URL='http://local.overhang.io:8000/login'
LOGOUT_URL='http://local.overhang.io:8000/logout'
LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
LOGO_POWERED_BY_OPEN_EDX_URL_SVG=https://edx-cdn.org/v3/stage/open-edx-tag.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
REFRESH_ACCESS_TOKEN_ENDPOINT='http://local.overhang.io:8000/login_refresh'
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
USER_INFO_COOKIE_NAME='edx-user-info'
SITE_NAME=localhost
DATA_API_BASE_URL='http://localhost:8000'
// LMS_CLIENT_ID should match the lms DOT client application id your LMS containe
LMS_CLIENT_ID='login-service-client-id'
SEGMENT_KEY=''
FEATURE_FLAGS={}
MARKETING_SITE_BASE_URL='http://local.overhang.io:8000'
SUPPORT_URL='http://local.overhang.io:8000/support'
CONTACT_URL='http://local.overhang.io:8000/contact'
OPEN_SOURCE_URL='http://local.overhang.io:8000/openedx'
TERMS_OF_SERVICE_URL='http://local.overhang.io:8000/terms-of-service'
PRIVACY_POLICY_URL='http://local.overhang.io:8000/privacy-policy'
FACEBOOK_URL='https://www.facebook.com'
TWITTER_URL='https://twitter.com'
YOU_TUBE_URL='https://www.youtube.com'
LINKED_IN_URL='https://www.linkedin.com'
REDDIT_URL='https://www.reddit.com'
APPLE_APP_STORE_URL='https://www.apple.com/ios/app-store/'
GOOGLE_PLAY_URL='https://play.google.com/store'
ENTERPRISE_MARKETING_URL='http://example.com'
ENTERPRISE_MARKETING_UTM_SOURCE='example.com'
ENTERPRISE_MARKETING_UTM_CAMPAIGN='example.com Referral'
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM='Footer'
LEARNING_BASE_URL='http://localhost:2000'
SESSION_COOKIE_DOMAIN='local.overhang.io'
ZENDESK_KEY=''
HOTJAR_APP_ID=''
HOTJAR_VERSION='6'
HOTJAR_DEBUG=''
ACCOUNT_SETTINGS_URL='http://localhost:1997'
ACCOUNT_PROFILE_URL='http://localhost:1995'
ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY=''
APP_ID='learner-dashboard'
MFE_CONFIG_API_URL='/api/mfe_config/v1'
EXPERIMENT_08_23_VAN_PAINTED_DOOR=false
ENABLE_EDX_PERSONAL_DASHBOARD=true
  1. Then run:
nvm use 18.0.0
npm install
npm start

Then:
image

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 7, 2023
@openedx-webhooks
Copy link

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

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b83f128) 96.45% compared to head (bc350ab) 96.45%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #238   +/-   ##
=======================================
  Coverage   96.45%   96.45%           
=======================================
  Files         194      194           
  Lines        1835     1835           
  Branches      322      322           
=======================================
  Hits         1770     1770           
  Misses         60       60           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@itsjeyd
Copy link

itsjeyd commented Nov 8, 2023

@mariajgrimaldi Thank you for this contribution! Let us know when the changes are ready for review.

@itsjeyd itsjeyd added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 8, 2023
@mariajgrimaldi
Copy link
Member Author

@itsjeyd: it's ready! Thanks

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@itsjeyd
Copy link

itsjeyd commented Nov 17, 2023

@mariajgrimaldi Looks like this just needs a rebase and then it will be ready for merge.

@hurtstotouchfire hurtstotouchfire added the needs maintainer attention Issue or PR specifically needs the attention of the maintainer. label Nov 20, 2023
@itsjeyd
Copy link

itsjeyd commented Nov 29, 2023

Hey @mariajgrimaldi, a friendly ping about rebasing this to get it ready for merge.

CC @hurtstotouchfire

@mariajgrimaldi
Copy link
Member Author

@itsjeyd: Done! Thanks

@arbrandes
Copy link
Contributor

Looks like a version of this already got in master! Thanks, @mariajgrimaldi!

@arbrandes arbrandes closed this Dec 6, 2023
@openedx-webhooks
Copy link

@mariajgrimaldi Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

@itsjeyd itsjeyd added duplicate This issue or pull request already exists elsewhere and removed needs maintainer attention Issue or PR specifically needs the attention of the maintainer. waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core contributor PR author is a Core Contributor (who may or may not have write access to this repo). duplicate This issue or pull request already exists elsewhere open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants