Skip to content

Commit ea4865e

Browse files
Muhammad Faraz  MaqsoodMuhammad Faraz  Maqsood
authored andcommitted
feat: Add support to override indigo footer
Add support to override indigo footer using plugin slot. Related conversation: #181 (comment).
1 parent 3b3297e commit ea4865e

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [Enhancement] Add support to override indigo footer using plugin slot. (by @Faraz32123)
2+
Related conversation: https://github.com/overhangio/tutor-indigo/pull/181#issuecomment-3834617842.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
if (config.pluginSlots && config.pluginSlots['org.openedx.frontend.layout.footer.v1']) {
3+
const footerPluginsToInsert =
4+
config.pluginSlots['org.openedx.frontend.layout.footer.v1'].plugins.filter(plugin => plugin.op === 'insert');
5+
6+
if (footerPluginsToInsert.length > 2) {
7+
config.pluginSlots['org.openedx.frontend.layout.footer.v1'].plugins =
8+
config.pluginSlots['org.openedx.frontend.layout.footer.v1'].plugins.filter(plugin => {
9+
if (plugin.op === 'insert') {
10+
const widgetId = plugin.widget?.id;
11+
return widgetId !== 'indigo_footer';
12+
}
13+
return true;
14+
});
15+
}
16+
}

tutorindigo/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def _override_openedx_docker_image(
201201
{
202202
op: PLUGIN_OPERATIONS.Insert,
203203
widget: {
204-
id: 'custom_footer',
204+
id: 'indigo_footer',
205205
type: DIRECT_PLUGIN,
206206
priority: 1,
207207
RenderWidget: IndigoFooter,

0 commit comments

Comments
 (0)