From 7bd4b1a9cc37a852c10b243bd90a581bdf70ac80 Mon Sep 17 00:00:00 2001 From: Hina Khadim Date: Tue, 10 Dec 2024 14:07:43 +0500 Subject: [PATCH] fix: update env.config.jsx according to tutor-mfe#240 PR (#109) * fix: update env.config.jsx according to tutor-mfe#240 PR * chore: install tutor-mfe main branch --- .github/workflows/test.yml | 1 + .../mfe-env-config-buildtime-definitions} | 37 ------ .../patches/mfe-env-config-buildtime-imports | 4 + .../mfe-env-config-runtime-definitions | 2 + tutorindigo/plugin.py | 118 ++++++++++-------- 5 files changed, 73 insertions(+), 89 deletions(-) rename tutorindigo/{templates/indigo/env.config.jsx => patches/mfe-env-config-buildtime-definitions} (75%) create mode 100644 tutorindigo/patches/mfe-env-config-buildtime-imports create mode 100644 tutorindigo/patches/mfe-env-config-runtime-definitions diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a023449..e78ba603 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,5 +20,6 @@ jobs: - name: Install dependencies run: | pip install .[dev] + pip install --upgrade --editable git+https://github.com/overhangio/tutor-mfe.git@main#egg=tutor-mfe - name: Test lint, types, and format run: make test diff --git a/tutorindigo/templates/indigo/env.config.jsx b/tutorindigo/patches/mfe-env-config-buildtime-definitions similarity index 75% rename from tutorindigo/templates/indigo/env.config.jsx rename to tutorindigo/patches/mfe-env-config-buildtime-definitions index ca3b7044..96bf159b 100644 --- a/tutorindigo/templates/indigo/env.config.jsx +++ b/tutorindigo/patches/mfe-env-config-buildtime-definitions @@ -1,9 +1,4 @@ -import React, { useEffect } from 'react'; -import Cookies from 'universal-cookie'; -import Footer from '@edly-io/indigo-frontend-component-footer'; -import { getConfig } from '@edx/frontend-platform'; -import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; let themeCookie = 'indigo-toggle-dark'; let themeCookieExpiry = 90; // days @@ -70,35 +65,3 @@ const AddDarkTheme = () => { return (
); }; - -const themePluginSlot = { - keepDefault: false, - plugins: [ - { - op: PLUGIN_OPERATIONS.Insert, - widget: { - id: 'default_contents', - type: DIRECT_PLUGIN, - priority: 1, - RenderWidget: