platform-plugin-aspects 1.2.0__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {platform_plugin_aspects-1.2.0/platform_plugin_aspects.egg-info → platform_plugin_aspects-2.0.0}/PKG-INFO +21 -5
  2. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/README.rst +20 -4
  3. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/__init__.py +1 -1
  4. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/extensions/filters.py +29 -0
  5. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/settings/common.py +3 -3
  6. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/urls.py +5 -0
  7. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/views.py +61 -0
  8. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0/platform_plugin_aspects.egg-info}/PKG-INFO +21 -5
  9. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/LICENSE +0 -0
  10. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/MANIFEST.in +0 -0
  11. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/apps.py +0 -0
  12. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/extensions/__init__.py +0 -0
  13. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/management/__init__.py +0 -0
  14. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/management/commands/__init__.py +0 -0
  15. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
  16. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
  17. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
  18. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/settings/__init__.py +0 -0
  19. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/settings/production.py +0 -0
  20. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/signals.py +0 -0
  21. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/__init__.py +0 -0
  22. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/base_sink.py +0 -0
  23. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/course_enrollment_sink.py +0 -0
  24. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
  25. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
  26. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/serializers.py +0 -0
  27. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/tag_sink.py +0 -0
  28. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
  29. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
  30. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/css/superset.css +0 -0
  31. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/html/superset.html +0 -0
  32. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/html/superset_student.html +0 -0
  33. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/js/embed_dashboard.js +0 -0
  34. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/js/install_required.js +0 -0
  35. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/static/js/superset.js +0 -0
  36. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/tasks.py +0 -0
  37. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
  38. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/utils.py +0 -0
  39. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/waffle.py +0 -0
  40. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects/xblock.py +0 -0
  41. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
  42. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
  43. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
  44. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
  45. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/requires.txt +0 -0
  46. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
  47. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/requirements/base.in +0 -0
  48. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/requirements/constraints.txt +0 -0
  49. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/setup.cfg +0 -0
  50. {platform_plugin_aspects-1.2.0 → platform_plugin_aspects-2.0.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: platform-plugin-aspects
3
- Version: 1.2.0
3
+ Version: 2.0.0
4
4
  Summary: Aspects plugins for edx-platform
5
5
  Home-page: https://github.com/openedx/platform-plugin-aspects
6
6
  Author: Open edX Project
@@ -176,6 +176,8 @@ The Instructor Dashboard integration uses the `Open edX Filters`_. To learn more
176
176
  the filters, see the `Open edX Filters`_ documentation. Make sure to configure the
177
177
  superset pipeline into the filter as follows:
178
178
 
179
+ for legacy instructor dashboard:
180
+
179
181
  .. code-block:: python
180
182
 
181
183
  OPEN_EDX_FILTERS_CONFIG = {
@@ -187,6 +189,19 @@ superset pipeline into the filter as follows:
187
189
  },
188
190
  }
189
191
 
192
+ for new instructor dashboard:
193
+
194
+ .. code-block:: python
195
+
196
+ OPEN_EDX_FILTERS_CONFIG = {
197
+ "org.openedx.learning.instructor.dashboard.tabs.requested.v1": {
198
+ "fail_silently": False,
199
+ "pipeline": [
200
+ "platform_plugin_superset.extensions.filters.AddSupersetTabToInstructorDashboard",
201
+ ]
202
+ },
203
+ }
204
+
190
205
  - ``SUPERSET_CONFIG`` - This setting is used to configure the Superset Embedded SDK.
191
206
  The configuration is a dictionary that contains the following keys:
192
207
 
@@ -245,10 +260,11 @@ Event Sink Configuration
245
260
  - ``module`` - The module path of the model.
246
261
  - ``model`` - The model class name.
247
262
 
248
- Event Sinks are disabled by default. To enable them, you need to enable the following
249
- waffle flag: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name is the name
250
- of the model that you want to enable. Or, you can enable them via settings by setting
251
- ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
263
+ Event Sinks are disabled by default from this repository, but enabled in the Aspects Tutor
264
+ plugin (tutor-contrib-aspects). If not using the Tutor plugin you will need to enable the
265
+ following waffle flags: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name
266
+ is the name of the model that you want to enable. Or, you can enable them via settings by
267
+ setting ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
252
268
 
253
269
 
254
270
  Getting Help
@@ -129,6 +129,8 @@ The Instructor Dashboard integration uses the `Open edX Filters`_. To learn more
129
129
  the filters, see the `Open edX Filters`_ documentation. Make sure to configure the
130
130
  superset pipeline into the filter as follows:
131
131
 
132
+ for legacy instructor dashboard:
133
+
132
134
  .. code-block:: python
133
135
 
134
136
  OPEN_EDX_FILTERS_CONFIG = {
@@ -140,6 +142,19 @@ superset pipeline into the filter as follows:
140
142
  },
141
143
  }
142
144
 
145
+ for new instructor dashboard:
146
+
147
+ .. code-block:: python
148
+
149
+ OPEN_EDX_FILTERS_CONFIG = {
150
+ "org.openedx.learning.instructor.dashboard.tabs.requested.v1": {
151
+ "fail_silently": False,
152
+ "pipeline": [
153
+ "platform_plugin_superset.extensions.filters.AddSupersetTabToInstructorDashboard",
154
+ ]
155
+ },
156
+ }
157
+
143
158
  - ``SUPERSET_CONFIG`` - This setting is used to configure the Superset Embedded SDK.
144
159
  The configuration is a dictionary that contains the following keys:
145
160
 
@@ -198,10 +213,11 @@ Event Sink Configuration
198
213
  - ``module`` - The module path of the model.
199
214
  - ``model`` - The model class name.
200
215
 
201
- Event Sinks are disabled by default. To enable them, you need to enable the following
202
- waffle flag: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name is the name
203
- of the model that you want to enable. Or, you can enable them via settings by setting
204
- ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
216
+ Event Sinks are disabled by default from this repository, but enabled in the Aspects Tutor
217
+ plugin (tutor-contrib-aspects). If not using the Tutor plugin you will need to enable the
218
+ following waffle flags: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name
219
+ is the name of the model that you want to enable. Or, you can enable them via settings by
220
+ setting ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
205
221
 
206
222
 
207
223
  Getting Help
@@ -5,6 +5,6 @@ Aspects plugins for edx-platform.
5
5
  import os
6
6
  from pathlib import Path
7
7
 
8
- __version__ = "1.2.0"
8
+ __version__ = "2.0.0"
9
9
 
10
10
  ROOT_DIRECTORY = Path(os.path.dirname(os.path.abspath(__file__)))
@@ -77,3 +77,32 @@ class AddSupersetTab(PipelineStep):
77
77
  )
78
78
 
79
79
  return data
80
+
81
+
82
+ class AddSupersetTabToInstructorDashboard(PipelineStep):
83
+ """
84
+ Add superset tab to instructor dashboard app.
85
+ """
86
+
87
+ def run_filter(
88
+ self, tabs, user, course_key
89
+ ): # pylint: disable=arguments-differ, unused-argument
90
+ """Execute filter that modifies the instructor dashboard context.
91
+ Args:
92
+ tabs (list): the list of tabs for the instructor dashboard.
93
+ user (User): the current user.
94
+ course_key (str): the course key.
95
+ """
96
+ modified_tabs = tabs.copy()
97
+ tab_id = "aspects"
98
+ course_id = str(course_key)
99
+
100
+ custom_tab = {
101
+ "tab_id": tab_id,
102
+ "title": _("Reports"),
103
+ "url": f"/instructor-dashboard/{course_id}/{tab_id}/",
104
+ "sort_order": 120,
105
+ }
106
+
107
+ modified_tabs.append(custom_tab)
108
+ return {"tabs": modified_tabs}
@@ -94,13 +94,13 @@ def plugin_settings(settings):
94
94
  "module": "openedx.core.djangoapps.user_api.models",
95
95
  "model": "UserPreference",
96
96
  },
97
- "tag": {"module": "openedx_tagging.core.tagging.models", "model": "Tag"},
97
+ "tag": {"module": "openedx_tagging.models.base", "model": "Tag"},
98
98
  "taxonomy": {
99
- "module": "openedx_tagging.core.tagging.models",
99
+ "module": "openedx_tagging.models.base",
100
100
  "model": "Taxonomy",
101
101
  },
102
102
  "object_tag": {
103
- "module": "openedx_tagging.core.tagging.models",
103
+ "module": "openedx_tagging.models.base",
104
104
  "model": "ObjectTag",
105
105
  },
106
106
  }
@@ -25,6 +25,11 @@ app_url_patterns = (
25
25
  views.SupersetInContextDashboardView.as_view(),
26
26
  name="superset_in_context_dashboard",
27
27
  ),
28
+ re_path(
29
+ rf"superset_instructor_dashboard/{COURSE_ID_PATTERN}/?$",
30
+ views.SupersetInstructorDashboardView.as_view(),
31
+ name="superset_instructor_dashboard",
32
+ ),
28
33
  ],
29
34
  "platform_plugin_aspects",
30
35
  )
@@ -20,6 +20,7 @@ from .utils import (
20
20
  _,
21
21
  build_filter,
22
22
  generate_guest_token,
23
+ generate_superset_context,
23
24
  get_localized_uuid,
24
25
  get_model,
25
26
  get_user_dashboard_locale,
@@ -248,3 +249,63 @@ class SupersetInContextDashboardView(GenericAPIView):
248
249
  "defaultCourseRun": course_key.run,
249
250
  }
250
251
  )
252
+
253
+
254
+ class SupersetInstructorDashboardView(GenericAPIView):
255
+ """
256
+ Endpoint for instructor dashboard Superset configuration.
257
+
258
+ Returns the Superset context needed by the frontend app to embed
259
+ the instructor dashboards, including dashboard list, URLs, and
260
+ display settings.
261
+ """
262
+
263
+ authentication_classes = (SessionAuthentication,)
264
+ permission_classes = (
265
+ permissions.IsAuthenticated,
266
+ IsStaffOrReadOnly | IsCourseStaffInstructor,
267
+ )
268
+
269
+ lookup_field = "course_id"
270
+
271
+ def get_object(self):
272
+ """
273
+ Return a CourseKey for the requested course_id.
274
+ """
275
+ course_id = self.kwargs.get(self.lookup_field, "")
276
+ try:
277
+ course_key = CourseKey.from_string(course_id)
278
+ except InvalidKeyError as exc:
279
+ raise NotFound(
280
+ _("Invalid course id: '{course_id}'").format(course_id=course_id)
281
+ ) from exc
282
+
283
+ course = _get_course(course_key)
284
+
285
+ # May raise a permission denied
286
+ self.check_object_permissions(self.request, course)
287
+
288
+ return course_key
289
+
290
+ def get(self, request, *args, **kwargs):
291
+ """
292
+ Return Superset context for embedding the instructor dashboards.
293
+ """
294
+ course_key = self.get_object()
295
+
296
+ language = get_user_dashboard_locale(request.user)
297
+ context = {"course_id": str(course_key)}
298
+ context = generate_superset_context(
299
+ context,
300
+ dashboards=settings.ASPECTS_INSTRUCTOR_DASHBOARDS,
301
+ language=language,
302
+ )
303
+
304
+ return Response(
305
+ {
306
+ "superset_dashboards": context["superset_dashboards"],
307
+ "superset_url": context["superset_url"],
308
+ "superset_guest_token_url": context["superset_guest_token_url"],
309
+ "show_dashboard_link": settings.SUPERSET_SHOW_INSTRUCTOR_DASHBOARD_LINK,
310
+ }
311
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: platform-plugin-aspects
3
- Version: 1.2.0
3
+ Version: 2.0.0
4
4
  Summary: Aspects plugins for edx-platform
5
5
  Home-page: https://github.com/openedx/platform-plugin-aspects
6
6
  Author: Open edX Project
@@ -176,6 +176,8 @@ The Instructor Dashboard integration uses the `Open edX Filters`_. To learn more
176
176
  the filters, see the `Open edX Filters`_ documentation. Make sure to configure the
177
177
  superset pipeline into the filter as follows:
178
178
 
179
+ for legacy instructor dashboard:
180
+
179
181
  .. code-block:: python
180
182
 
181
183
  OPEN_EDX_FILTERS_CONFIG = {
@@ -187,6 +189,19 @@ superset pipeline into the filter as follows:
187
189
  },
188
190
  }
189
191
 
192
+ for new instructor dashboard:
193
+
194
+ .. code-block:: python
195
+
196
+ OPEN_EDX_FILTERS_CONFIG = {
197
+ "org.openedx.learning.instructor.dashboard.tabs.requested.v1": {
198
+ "fail_silently": False,
199
+ "pipeline": [
200
+ "platform_plugin_superset.extensions.filters.AddSupersetTabToInstructorDashboard",
201
+ ]
202
+ },
203
+ }
204
+
190
205
  - ``SUPERSET_CONFIG`` - This setting is used to configure the Superset Embedded SDK.
191
206
  The configuration is a dictionary that contains the following keys:
192
207
 
@@ -245,10 +260,11 @@ Event Sink Configuration
245
260
  - ``module`` - The module path of the model.
246
261
  - ``model`` - The model class name.
247
262
 
248
- Event Sinks are disabled by default. To enable them, you need to enable the following
249
- waffle flag: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name is the name
250
- of the model that you want to enable. Or, you can enable them via settings by setting
251
- ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
263
+ Event Sinks are disabled by default from this repository, but enabled in the Aspects Tutor
264
+ plugin (tutor-contrib-aspects). If not using the Tutor plugin you will need to enable the
265
+ following waffle flags: ``event_sink_clickhouse.{{model_name}}.enabled``, where model_name
266
+ is the name of the model that you want to enable. Or, you can enable them via settings by
267
+ setting ``EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED`` to ``True``.
252
268
 
253
269
 
254
270
  Getting Help