File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed
Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ # A Sample Plugin
2+
3+ This repository contains a sample plugin for the Open edX project that aims to
4+ provide examples for the various different plugin interfaces in the Open edX
5+ platform.
6+
7+ The ` frontend ` folder makes use of the frontend-plugin-framework and slots to
8+ add new components and functionality to multiple open edx frotends.
9+
10+ The ` backend ` folder will contain a python django app that can that can be
11+ installed alongside edx-platform and makes use of the events and filters
12+ capabilities to modify and work with existing functionality.
13+
14+ The ` tutor ` folder contains a tutor plugin that will install and setup both the
15+ backend and frontend plugins in a deployment of tutor.
16+
17+ # Local Development for the Frontend Plugin w/Tutor
18+
19+ When developing with tutor, it's useful to use tutor to start up the rest of
20+ the stack and then startup the specific MFE you want to develop on your local
21+ machine. We just need to tell tutor to not start the specific MFE as a part of
22+ the tutor-mfe plugin.
23+
24+ ```
25+ # Example using the `learner-dashboard` MFE
26+ # Tell tutor to start this MFE in dev mode
27+ tutor dev start learner-dashbard
28+ tutor dev launch
29+
30+ # Go to the `profile` MFE folder locally.
31+ # TODO Edits needed to load our plugin locally.
32+
33+ # Start up the service
34+ npm ci
35+ npm start dev
36+ ```
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @feanil/sample-plugin" ,
3+ "version" : " 0.0.1"
4+ }
Original file line number Diff line number Diff line change 1+ function customCourseListPlugin ( courseListData ) {
2+
3+ const courses = courseListData . visibleList ;
4+ // Render a list of course names
5+ return (
6+ < div >
7+ { courses . map ( courseData => (
8+ < p >
9+ { courseData . course . courseName }
10+ </ p >
11+ ) ) }
12+ </ div >
13+ )
14+ }
Original file line number Diff line number Diff line change 1+ from tutormfe .hooks import PLUGIN_SLOTS
2+
3+ PLUGIN_SLOTS .add_items ([
4+ # Replace the course_list
5+ (
6+ "learner-dashboard" ,
7+ "custom_course_list" ,
8+ """
9+ {
10+ op: PLUGIN_OPERATIONS.Insert,
11+ type: DIRECT_PLUGIN,
12+ priority: 50,
13+ RenderWidget:
14+ }"""
15+ ),
16+ ])
You can’t perform that action at this time.
0 commit comments