Skip to content

Commit 1121eed

Browse files
committed
fix: update plugin-slots version and documentation
1 parent a7dd82f commit 1121eed

File tree

7 files changed

+29
-17
lines changed

7 files changed

+29
-17
lines changed

src/courseware/data/redux.test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ describe('Data layer integration tests', () => {
136136
axiosMock.onGet(courseHomeMetadataUrl).reply(200, courseHomeMetadata);
137137
axiosMock.onGet(courseUrl).reply(200, courseMetadata);
138138
axiosMock.onGet(learningSequencesUrlRegExp).reply(200, simpleOutline);
139-
axiosMock.onGet(coursewareSidebarSettingsUrl).reply(200, {
140-
enableCompletionTracking: false,
141-
});
142139

143140
await executeThunk(thunks.fetchCourse(courseId), store.dispatch);
144141

src/plugin-slots/CourseBreadcrumbsSlot/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Course Breadcrumbs Slot
22

3-
### Slot ID: `org.openedx.frontend.learning.course_breadcrumbs.v1`
3+
### Slot ID: `org.openedx.frontend.learning.course_breadcrumbs.v2`
44

55
### Slot ID Aliases
66
* `course_breadcrumbs_slot`
@@ -25,7 +25,7 @@ import CourseBreadcrumbs from './src/courseware/course/breadcrumbs';
2525

2626
const config = {
2727
pluginSlots: {
28-
'org.openedx.frontend.learning.course_breadcrumbs.v1': {
28+
'org.openedx.frontend.learning.course_breadcrumbs.v2': {
2929
keepDefault: false,
3030
plugins: [
3131
{
@@ -62,7 +62,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6262

6363
const config = {
6464
pluginSlots: {
65-
'org.openedx.frontend.learning.course_breadcrumbs.v1': {
65+
'org.openedx.frontend.learning.course_breadcrumbs.v2': {
6666
keepDefault: false,
6767
plugins: [
6868
{
@@ -82,3 +82,7 @@ const config = {
8282

8383
export default config;
8484
```
85+
86+
## Version Notes
87+
88+
- `v2`: Removed default slot content.

src/plugin-slots/CourseBreadcrumbsSlot/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const CourseBreadcrumbsSlot : React.FC<Props> = ({
1414
courseId, sectionId, sequenceId, unitId, isStaff,
1515
}) => (
1616
<PluginSlot
17-
id="org.openedx.frontend.learning.course_breadcrumbs.v1"
17+
id="org.openedx.frontend.learning.course_breadcrumbs.v2"
1818
idAliases={['course_breadcrumbs_slot']}
1919
slotOptions={{
2020
mergeProps: true,

src/plugin-slots/SequenceNavigationSlot/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sequence Navigation Slot
22

3-
### Slot ID: `org.openedx.frontend.learning.sequence_navigation.v1`
3+
### Slot ID: `org.openedx.frontend.learning.sequence_navigation.v2`
44

55
### Props:
66
* `sequenceId` (string) — Current sequence identifier
@@ -29,7 +29,7 @@ import { SequenceNavigation } from './src/courseware/course/sequence/sequence-na
2929

3030
const config = {
3131
pluginSlots: {
32-
'org.openedx.frontend.learning.sequence_navigation.v1': {
32+
'org.openedx.frontend.learning.sequence_navigation.v2': {
3333
keepDefault: false,
3434
plugins: [
3535
{
@@ -66,7 +66,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6666

6767
const config = {
6868
pluginSlots: {
69-
'org.openedx.frontend.learning.sequence_navigation.v1': {
69+
'org.openedx.frontend.learning.sequence_navigation.v2': {
7070
keepDefault: false,
7171
plugins: [
7272
{
@@ -116,3 +116,7 @@ const config = {
116116

117117
export default config;
118118
```
119+
120+
## Version Notes
121+
122+
- `v2`: Removed default slot content.

src/plugin-slots/SequenceNavigationSlot/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const SequenceNavigationSlot = ({
1010
previousHandler,
1111
}) => (
1212
<PluginSlot
13-
id="org.openedx.frontend.learning.sequence_navigation.v1"
13+
id="org.openedx.frontend.learning.sequence_navigation.v2"
1414
slotOptions={{
1515
mergeProps: true,
1616
}}

src/plugin-slots/UnitTitleSlot/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Unit Title Slot
22

3-
### Slot ID: `org.openedx.frontend.learning.unit_title.v1`
3+
### Slot ID: `org.openedx.frontend.learning.unit_title.v2`
44

55
### Slot ID Aliases
66
* `unit_title_slot`
77

88
### Props:
99
* `unitId`
1010
* `unit`
11-
* `isEnabledOutlineSidebar`
1211
* `renderUnitNavigation`
1312

1413
## Description
1514

1615
This slot is used for adding content before or after the Unit title.
16+
`isEnabledOutlineSidebar` is no longer used in the default implementation,
17+
but is still passed as a plugin prop with a default value of `true` for backward compatibility.
1718

1819
## Example
1920

@@ -26,17 +27,17 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
2627

2728
const config = {
2829
pluginSlots: {
29-
'org.openedx.frontend.learning.unit_title.v1': {
30+
'org.openedx.frontend.learning.unit_title.v2': {
3031
plugins: [
3132
{
3233
// Insert custom content after unit title
3334
op: PLUGIN_OPERATIONS.Insert,
3435
widget: {
3536
id: 'custom_unit_title_content',
3637
type: DIRECT_PLUGIN,
37-
RenderWidget: ({ unitId, unit, isEnabledOutlineSidebar, renderUnitNavigation }) => (
38+
RenderWidget: ({ unitId, unit, renderUnitNavigation }) => (
3839
<>
39-
{isEnabledOutlineSidebar && renderUnitNavigation(true)}
40+
{renderUnitNavigation(true)}
4041
<p>📙: {unit.title}</p>
4142
<p>📙: {unitId}</p>
4243
</>
@@ -50,3 +51,8 @@ const config = {
5051

5152
export default config;
5253
```
54+
55+
## Version Notes
56+
57+
- `v2`: Removed default slot content. `isEnabledOutlineSidebar` is no longer used internally,
58+
but still passed as a plugin prop (`true`) to maintain compatibility.

src/plugin-slots/UnitTitleSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ const UnitTitleSlot = ({
1515

1616
return (
1717
<PluginSlot
18-
id="org.openedx.frontend.learning.unit_title.v1"
18+
id="org.openedx.frontend.learning.unit_title.v2"
1919
idAliases={['unit_title_slot']}
2020
pluginProps={{
2121
unitId,
2222
unit,
23+
isEnabledOutlineSidebar: true,
2324
renderUnitNavigation,
2425
}}
2526
>

0 commit comments

Comments
 (0)