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

fix: problem displaying /account/ page after upgraded to redwood #96

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions tutorindigo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
[
("indigo", "build/openedx/themes"),
("indigo/env.config.jsx", "plugins/mfe/build/mfe"),
],
)

Expand Down Expand Up @@ -103,12 +104,16 @@ def _override_openedx_docker_image(

hooks.Filters.ENV_PATCHES.add_items(
[
# MFE will install header version 3.0.x and will include indigo-footer as a
# separate package for use in env.config.jsx
(
"mfe-dockerfile-post-npm-install-learning",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0

COPY indigo/env.config.jsx /openedx/app/
""",
),
(
Expand All @@ -123,32 +128,39 @@ def _override_openedx_docker_image(
"mfe-dockerfile-post-npm-install-discussions",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0

COPY indigo/env.config.jsx /openedx/app/
""",
),
(
"mfe-dockerfile-post-npm-install-learner-dashboard",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0

COPY indigo/env.config.jsx /openedx/app/
""",
),
(
"mfe-dockerfile-post-npm-install-profile",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0

COPY indigo/env.config.jsx /openedx/app/
""",
),
(
"mfe-dockerfile-post-npm-install-account",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0

COPY indigo/env.config.jsx /openedx/app/
""",
),
]
Expand Down
27 changes: 27 additions & 0 deletions tutorindigo/templates/indigo/env.config.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';

import Footer from '@edly-io/indigo-frontend-component-footer';
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

const themePluginSlot = {
keepDefault: false,
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'default_contents',
type: DIRECT_PLUGIN,
priority: 1,
RenderWidget: <Footer />,
},
}
],
};

const config = {
pluginSlots: {
footer_slot: themePluginSlot,
},
};

export default config;
Loading