Skip to content

Commit f9a90a4

Browse files
authored
fix: problem displaying /account/ page after upgraded to redwood (#96)
* fix: account-mfe bug * refactor: remove unused useEffect in env.config.jsx and add comment
1 parent ef0bb22 commit f9a90a4

File tree

2 files changed

+48
-9
lines changed

2 files changed

+48
-9
lines changed

tutorindigo/plugin.py

+21-9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
4848
[
4949
("indigo", "build/openedx/themes"),
50+
("indigo/env.config.jsx", "plugins/mfe/build/mfe"),
5051
],
5152
)
5253

@@ -103,12 +104,16 @@ def _override_openedx_docker_image(
103104

104105
hooks.Filters.ENV_PATCHES.add_items(
105106
[
107+
# MFE will install header version 3.0.x and will include indigo-footer as a
108+
# separate package for use in env.config.jsx
106109
(
107110
"mfe-dockerfile-post-npm-install-learning",
108111
"""
109112
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
110-
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
111-
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
113+
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
114+
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
115+
116+
COPY indigo/env.config.jsx /openedx/app/
112117
""",
113118
),
114119
(
@@ -123,32 +128,39 @@ def _override_openedx_docker_image(
123128
"mfe-dockerfile-post-npm-install-discussions",
124129
"""
125130
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
126-
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
127-
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
131+
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
132+
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
133+
134+
COPY indigo/env.config.jsx /openedx/app/
128135
""",
129136
),
130137
(
131138
"mfe-dockerfile-post-npm-install-learner-dashboard",
132139
"""
133140
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
134-
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
141+
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
142+
143+
COPY indigo/env.config.jsx /openedx/app/
135144
""",
136145
),
137146
(
138147
"mfe-dockerfile-post-npm-install-profile",
139148
"""
140149
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
141-
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
142-
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
150+
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
151+
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
143152
153+
COPY indigo/env.config.jsx /openedx/app/
144154
""",
145155
),
146156
(
147157
"mfe-dockerfile-post-npm-install-account",
148158
"""
149159
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.0.0'{% if INDIGO_ENABLE_DARK_THEME %} --theme=dark{% endif %}
150-
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.0.0'
151-
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^2.0.0'
160+
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@~3.0.0'
161+
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
162+
163+
COPY indigo/env.config.jsx /openedx/app/
152164
""",
153165
),
154166
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
3+
import Footer from '@edly-io/indigo-frontend-component-footer';
4+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
5+
6+
const themePluginSlot = {
7+
keepDefault: false,
8+
plugins: [
9+
{
10+
op: PLUGIN_OPERATIONS.Insert,
11+
widget: {
12+
id: 'default_contents',
13+
type: DIRECT_PLUGIN,
14+
priority: 1,
15+
RenderWidget: <Footer />,
16+
},
17+
}
18+
],
19+
};
20+
21+
const config = {
22+
pluginSlots: {
23+
footer_slot: themePluginSlot,
24+
},
25+
};
26+
27+
export default config;

0 commit comments

Comments
 (0)