Skip to content

Commit efafa3c

Browse files
committed
fixup! feat: Add slots for video and file upload components and alerts
1 parent 5239f20 commit efafa3c

9 files changed

Lines changed: 167 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Course Files Slot
2+
3+
### Slot ID: `files_upload_page_table_slot`
4+
5+
## Description
6+
7+
This slot is used to replace/modify/hide the course file table UI.
8+
9+
## Example
10+
11+
### Wrapped with a div with dashed border
12+
![Red Border around Files UI](./screenshot_files_border_wrap.png)
13+
14+
The following `env.config.jsx` will wrap the files component with a div that has a large red dashed redborder.
15+
16+
```js
17+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
18+
19+
const config = {
20+
pluginSlots: {
21+
files_upload_page_table_slot: {
22+
keepDefault: true,
23+
plugins: [
24+
{
25+
op: PLUGIN_OPERATIONS.Wrap,
26+
widgetId: 'default_contents',
27+
wrapper: ({component}) => (
28+
<div style={{border:'thick dashed red'}}>
29+
{component}
30+
</div>
31+
)
32+
},
33+
]
34+
}
35+
},
36+
}
37+
38+
export default config;
39+
```
92.3 KB
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Course Outline Page Alerts Slot
2+
3+
### Slot ID: `course_outline_page_alerts_slot`
4+
5+
## Description
6+
7+
This slot is used to add alerts to the course outline page.
8+
9+
## Example
10+
11+
### Additional Alert
12+
![Additional Alerts in Outline Page](./screenshot_outline_alert_added.png)
13+
14+
The following `env.config.jsx` will wrap the files component with a div that has a large red dashed redborder.
15+
16+
```js
17+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
18+
import { Alert } from '@openedx/paragon';
19+
20+
const config = {
21+
pluginSlots: {
22+
course_outline_page_alerts_slot: {
23+
keepDefault: true,
24+
plugins: [
25+
{
26+
op: PLUGIN_OPERATIONS.Insert,
27+
widget: {
28+
id: 'test-alert',
29+
type: DIRECT_PLUGIN,
30+
RenderWidget: () => (
31+
<Alert variant="warning">
32+
This is a test alert
33+
</Alert>
34+
)
35+
}
36+
},
37+
]
38+
}
39+
},
40+
}
41+
42+
export default config;
43+
```
139 KB
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Course Video Upload Page Slot
2+
3+
### Slot ID: `videos_upload_page_table_slot`
4+
5+
## Description
6+
7+
This slot is used to replace/modify/hide the course video upload page UI.
8+
9+
## Example
10+
11+
### Wrapped with a div with dashed border
12+
![Red Border around Videos UI](./screenshot_videos_border_wrap.png)
13+
14+
The following `env.config.jsx` will wrap the files component with a div that has a large red dashed redborder.
15+
16+
```js
17+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
18+
19+
const config = {
20+
pluginSlots: {
21+
videos_upload_page_table_slot: {
22+
keepDefault: true,
23+
plugins: [
24+
{
25+
op: PLUGIN_OPERATIONS.Wrap,
26+
widgetId: 'default_contents',
27+
wrapper: ({component}) => (
28+
<div style={{border:'thick dashed red'}}>
29+
{component}
30+
</div>
31+
)
32+
},
33+
]
34+
}
35+
},
36+
}
37+
38+
export default config;
39+
```
60.4 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# File and Videos Page Alerts Slot
2+
3+
### Slot ID: `edit_file_error_alerts_slot`
4+
5+
## Description
6+
7+
This slot is used to add alerts to the course file edit page.
8+
9+
## Example
10+
11+
### Additional Alert on Files Page
12+
![🍞 in breadcrumbs slot](./screenshot_files_alert_added.png)
13+
14+
### Additional Alert on Videos Page
15+
![🍞 in breadcrumbs slot](./screenshot_videos_alert_added.png)
16+
17+
The following `env.config.jsx` will wrap the files component with a div that has a large red dashed redborder.
18+
19+
```js
20+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
21+
import { Alert } from '@openedx/paragon';
22+
23+
const config = {
24+
pluginSlots: {
25+
edit_file_error_alerts_slot: {
26+
keepDefault: true,
27+
plugins: [
28+
{
29+
op: PLUGIN_OPERATIONS.Insert,
30+
widget: {
31+
id: 'test-alert',
32+
type: DIRECT_PLUGIN,
33+
RenderWidget: () => (
34+
<Alert variant="warning">
35+
This is a test alert
36+
</Alert>
37+
)
38+
}
39+
},
40+
]
41+
}
42+
},
43+
}
44+
45+
export default config;
46+
```
19.9 KB
Loading
23.2 KB
Loading

0 commit comments

Comments
 (0)