Skip to content

[SE-5480] Copy theme files into MFE build dir.

Matjaz Gregoric requested to merge mtyaka/SE-5480-mfe-theming into main

Description

This change makes the default edx-simple-theme work with MFEs. MFEs support a different mechanism from comprehensive theming in edx-platform. They require a npm package with the branding material to be installed into each MFE environment.

The edx-simple-theme comprehensive theme includes a NPM package for MFEs as well. This codes copies edx-simple-theme after all sass/static file overrides had been applied into the tutor mfe build folder, so that the patch tutor-contrib-grove plugin (see tutor-contrib-grove!7 (merged)) can find the NPM package and install it while building the images.

Testing instructions

  1. Check out this pipeline, which was run using the code from this branch and the related MRs to deploy this test instance.

  2. Create an account on the instance and verify that the theme is applied to all pages, including MFEs (the account page and the profile page are implemented as MFEs).

  3. TBD

Dependencies

Screenshots

Themed profile MFE:

Screenshot_2022-07-15_at_10.42.50

Author notes and concerns

I am not happy with the code. The entire theme folder gets copied to the mfe build dir to avoid having to do the same git checkout/sass/static file patching twice. However this creates a dependency between the comprehensive theme and MFE theming and means that you cannot easily use a MFE branding package other than the one that might be present in the comprehensive theme itself.

Also while most theming settings are in grove.yml, the MFE theming is done in the tutor-contrib-grove plugin and therefore the configuration variables needs to be in config.yml and prefixed with GROVE_. It just feels off.

Ideally all theming would be done by a tutor plugin, but I'm not sure if that's even possible with the current tutor plugin architecture.

Checklist

If any of the items below is not applicable, do not remove them, but put a check in it.

  • All providers include the new feature/change
  • All affected providers can provision new clusters
  • Unit tests are added/updated
  • Documentation is added/updated
  • The TOOLS_CONTAINER_IMAGE_VERSION in ci_vars.yml is updated
  • The grove-template repository is updated
Edited by Matjaz Gregoric

Merge request reports