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: update MFE to use dynamically injected theme #55

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

ArturGaspar
Copy link
Member

@ArturGaspar ArturGaspar commented Jul 25, 2024

Description

Updates the MFE to use alpha version of frontend build, platform and paragon to support runtime theming.

Supporting information

https://openedx.atlassian.net/wiki/spaces/BPL/pages/3770744958/Migrating+MFEs+to+Paragon+design+tokens+and+CSS+variables

Testing instructions

  1. Clone https://github.com/open-craft/edx-simple-theme and check out branch artur/design-tokens-update.
  2. Build it (npm ci && npm run build).
  3. Run a local server from the dist directory (e.g. python3 -m http.server 9100, use same port for brandOverride in MFE_CONFIG below).
  4. Set MFE_CONFIG as in example Tutor plugin below.
  5. Go to http://apps.local.edly.io:2001/course-authoring/course/course-v1:OpenedX+DemoX+DemoCourse
  6. See that theming works.
  7. Check that http://localhost:9100/light.min.css was loaded.
Example Tutor plugin to set MFE_CONFIG
name: mfe_config
version: 0.1.0
patches:
  mfe-lms-common-settings: |
    MFE_CONFIG.update({
        "PARAGON_THEME_URLS": {
            "core": {
                "urls": {
                    "default": "https://cdn.jsdelivr.net/npm/@openedx/[email protected]/dist/core.min.css",
                    "brandOverride": "https://cdn.jsdelivr.net/npm/@edx/[email protected]/dist/core.min.css"
                }
            },
            "variants": {
                "light": {
                    "urls": {
                        "default": "https://cdn.jsdelivr.net/npm/@openedx/[email protected]/dist/light.min.css",
                        "brandOverride": "http://localhost:9100/light.min.css"
                    },
                    "default": True,
                    "dark": False
                }
            }
        }
    })

Deadline

ASAP

Other information

Internal-ref: https://tasks.opencraft.com/browse/BB-9023

@ArturGaspar ArturGaspar force-pushed the artur/asu-moe/redwood-css branch 5 times, most recently from d2b2de2 to 81fd3b1 Compare July 26, 2024 19:16
Updates the MFE to use alpha version of frontend build, platform and paragon to
support runtime theming.
@ArturGaspar ArturGaspar force-pushed the artur/asu-moe/redwood-css branch 6 times, most recently from d7e6235 to 71a97cc Compare July 29, 2024 14:48
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (asu-moe/redwood-css@b66238c). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             asu-moe/redwood-css      #55   +/-   ##
======================================================
  Coverage                       ?   92.43%           
======================================================
  Files                          ?      708           
  Lines                          ?    12539           
  Branches                       ?     2731           
======================================================
  Hits                           ?    11591           
  Misses                         ?      913           
  Partials                       ?       35           

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

@ArturGaspar ArturGaspar marked this pull request as ready for review July 29, 2024 15:18
Copy link
Member

@0x29a 0x29a left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +200 to +201
// TODO
// await waitFor(() => expect(window.location.pathname).toEqual(`/course/${courseId}/pages-and-resources`));
Copy link
Member

Choose a reason for hiding this comment

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

Are we going to resolve this (and another one) TODO items?

@ArturGaspar ArturGaspar merged commit aac0f18 into asu-moe/redwood-css Jul 31, 2024
5 checks passed
@ArturGaspar ArturGaspar deleted the artur/asu-moe/redwood-css branch July 31, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants