There are plugins which return context which is then embedded/used accordingly. So in instructor dashboard we need a flow/function which get/fetches the context from external plugins and updates the existing context with the context returned from external plugins. This has been done via a function get_plugins_view_context of edx_django_utils.plugins. A separate constant file has been created in instructor which consists of a constant: INSTRUCTOR_DASHBOARD_PLUGIN_VIEW_NAME. Any external plugin which uses this constant, will return context to instructor dashboard.
While installing an external plugin, all the settings should be derived first and add_plugins function should be called afterwards in lms -> envs -> production.py but currently add_plugins function is being called before derive_settings function, hence their order has been switched. Same goes for cms -> envs -> production.py
In lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html, we include the html files of sections from relative path, but in case of plugin, we need to give absolute path, as plugin's html file is inside plugin so in order to give absolute path we need to add a prefix "/".
Supporting information
None
Testing instructions
Any external plugin which uses the constant INSTRUCTOR_DASHBOARD_PLUGIN_VIEW_NAME to return any context, will be received in instructor dashboard.
If we call the add_plugins function before derive_settings function, then an exception can be seen while adding plugin's template in app_dirs.
If we call the add_plugins function after derive_settings function, then plugin's template is successfully added in app_dirs.
If we don't place a prefix "/" while including a html file from some other directory/app then an exception can be seen as it automatically adds relative path to it while including and the file can not be found on this path because plugin's html file is inside plugin templates.
If we place a prefix "/" while including a html file from some other directory/app then it includes the file successfully as now absolute path is provided by appending this prefix.
Description
There are plugins which return context which is then embedded/used accordingly. So in instructor dashboard we need a flow/function which get/fetches the context from external plugins and updates the existing context with the context returned from external plugins. This has been done via a function get_plugins_view_context of edx_django_utils.plugins. A separate constant file has been created in instructor which consists of a constant: INSTRUCTOR_DASHBOARD_PLUGIN_VIEW_NAME. Any external plugin which uses this constant, will return context to instructor dashboard.
While installing an external plugin, all the settings should be derived first and add_plugins function should be called afterwards in lms -> envs -> production.py but currently add_plugins function is being called before derive_settings function, hence their order has been switched. Same goes for cms -> envs -> production.py
In lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html, we include the html files of sections from relative path, but in case of plugin, we need to give absolute path, as plugin's html file is inside plugin so in order to give absolute path we need to add a prefix "/".
Supporting information
None
Testing instructions
Deadline
None
Other information
None