platform-plugin-aspects 0.6.0__tar.gz → 0.7.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 (53) hide show
  1. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/CHANGELOG.rst +8 -0
  2. platform_plugin_aspects-0.7.0/PKG-INFO +345 -0
  3. platform_plugin_aspects-0.7.0/README.rst +228 -0
  4. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/__init__.py +1 -1
  5. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/apps.py +8 -1
  6. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/extensions/filters.py +3 -12
  7. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/signals.py +14 -2
  8. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/static/html/superset.html +2 -2
  9. platform_plugin_aspects-0.7.0/platform_plugin_aspects/static/js/embed_dashboard.js +68 -0
  10. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/static/js/superset.js +2 -2
  11. platform_plugin_aspects-0.7.0/platform_plugin_aspects/urls.py +25 -0
  12. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/utils.py +59 -46
  13. platform_plugin_aspects-0.7.0/platform_plugin_aspects/views.py +132 -0
  14. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/xblock.py +34 -4
  15. platform_plugin_aspects-0.7.0/platform_plugin_aspects.egg-info/PKG-INFO +345 -0
  16. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/SOURCES.txt +2 -0
  17. platform-plugin-aspects-0.6.0/PKG-INFO +0 -207
  18. platform-plugin-aspects-0.6.0/README.rst +0 -98
  19. platform-plugin-aspects-0.6.0/platform_plugin_aspects/static/js/embed_dashboard.js +0 -33
  20. platform-plugin-aspects-0.6.0/platform_plugin_aspects.egg-info/PKG-INFO +0 -207
  21. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/LICENSE +0 -0
  22. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/MANIFEST.in +0 -0
  23. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/extensions/__init__.py +0 -0
  24. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/management/__init__.py +0 -0
  25. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/management/commands/__init__.py +0 -0
  26. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
  27. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
  28. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
  29. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/settings/__init__.py +0 -0
  30. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/settings/common.py +0 -0
  31. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/settings/production.py +0 -0
  32. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/__init__.py +0 -0
  33. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/base_sink.py +0 -0
  34. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
  35. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
  36. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/serializers.py +0 -0
  37. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
  38. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
  39. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/static/css/superset.css +0 -0
  40. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/static/html/superset_student.html +0 -0
  41. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/static/js/install_required.js +0 -0
  42. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/tasks.py +0 -0
  43. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
  44. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects/waffle.py +0 -0
  45. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
  46. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
  47. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
  48. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/requires.txt +0 -0
  49. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
  50. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/requirements/base.in +0 -0
  51. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/requirements/constraints.txt +0 -0
  52. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/setup.cfg +0 -0
  53. {platform-plugin-aspects-0.6.0 → platform_plugin_aspects-0.7.0}/setup.py +0 -0
@@ -16,6 +16,14 @@ Unreleased
16
16
 
17
17
  *
18
18
 
19
+ 0.7.0 - 2024-04-12
20
+ ******************
21
+
22
+ Added
23
+ =====
24
+
25
+ * Add endpoint for fetchGuestToken
26
+
19
27
  0.6.0 - 2024-04-08
20
28
  ******************
21
29
 
@@ -0,0 +1,345 @@
1
+ Metadata-Version: 2.1
2
+ Name: platform-plugin-aspects
3
+ Version: 0.7.0
4
+ Summary: Aspects plugins for edx-platform
5
+ Home-page: https://github.com/openedx/platform-plugin-aspects
6
+ Author: Open edX Project
7
+ Author-email: oscm@openedx.org
8
+ License: AGPL 3.0
9
+ Keywords: Python edx
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: Django
12
+ Classifier: Framework :: Django :: 3.2
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
15
+ Classifier: Natural Language :: English
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Requires-Python: >=3.8
19
+ License-File: LICENSE
20
+ Requires-Dist: Django
21
+ Requires-Dist: XBlock
22
+ Requires-Dist: celery
23
+ Requires-Dist: django_crum
24
+ Requires-Dist: djangorestframework
25
+ Requires-Dist: edx-django-utils
26
+ Requires-Dist: edx-opaque-keys
27
+ Requires-Dist: edx-toggles
28
+ Requires-Dist: openedx-atlas
29
+ Requires-Dist: openedx-filters
30
+ Requires-Dist: redis
31
+ Requires-Dist: requests
32
+ Requires-Dist: superset-api-client
33
+ Requires-Dist: web_fragments
34
+
35
+ Platform Plugin Aspects
36
+ #######################
37
+
38
+ Purpose
39
+ *******
40
+
41
+ This repository holds various Aspects plugins for the Open edX platform.
42
+
43
+ Sinks
44
+ *****
45
+
46
+ Sinks are components that listen for events and store them in ClickHouse. The
47
+ events are emitted by the Open edX platform via `Open edX events`_ or Django signals.
48
+
49
+ Available Sinks
50
+ ===============
51
+
52
+ - `CourseOverviewSink` - Listens for the `COURSE_PUBLISHED` event and stores the
53
+ course structure data through `XBlockSink` in ClickHouse.
54
+ - `ExternalIdSink` - Listens for the `post_save` Django signal on the `ExternalId`
55
+ model and stores the external id data in ClickHouse.
56
+ - `UserProfile` - Listens for the `post_save` Django signal on the `UserProfile`
57
+ model and stores the user profile data in ClickHouse.
58
+ - `UserRetirementSink` - Listen for the `USER_RETIRE_LMS_MISC` Django signal and
59
+ remove the user PII information from ClickHouse.
60
+
61
+ Commands
62
+ ========
63
+
64
+ In addition to being an event listener, this package provides the following commands:
65
+
66
+ - `dump_data_to_clickhouse` - This command allows bulk export of the data from the Sinks.
67
+ Allows bootstrapping a new data platform or backfilling lost or missing data.
68
+
69
+ ``python manage.py cms dump_data_to_clickhouse``
70
+
71
+ - `load_test_tracking_events` - This command allows loading test tracking events into
72
+ ClickHouse. This is useful for testing the ClickHouse connection to measure the performance of the
73
+ different data pipelines such as Vector, Event Bus (Redis and Kafka), and Celery.
74
+
75
+ Do not use this command in production as it will generate a large amount of data
76
+ and will slow down the system.
77
+
78
+ ``python manage.py cms load_test_tracking_events``
79
+
80
+ - `monitor_load_test_tracking` - Monitors the load test tracking script and saves
81
+ output for later analysis.
82
+
83
+ ``python manage.py cms monitor_load_test_tracking``
84
+
85
+ Instructor Dashboard Integration
86
+ ================================
87
+
88
+ Dashboards from `Aspects`_ are integrated into the Instructor Dashboard via `Superset Embedded SDK`_.
89
+ See `Configuration`_ for more details.
90
+
91
+ Getting Started with Development
92
+ ********************************
93
+
94
+ Please see the Open edX documentation for `guidance on Python development <https://docs.openedx.org/en/latest/developers/how-tos/get-ready-for-python-dev.html>`_ in this repo.
95
+
96
+ Deploying
97
+ *********
98
+
99
+ The `Platform Plugin Aspects` component is a django plugin which doesn't
100
+ need independent deployment. Therefore, its setup is reasonably straightforward.
101
+ First, it needs to be added to your service requirements, and then it will be
102
+ installed alongside requirements of the service.
103
+
104
+ Configuration
105
+ *************
106
+
107
+ Instructor Dashboard Configuration
108
+ ==================================
109
+
110
+ The Instructor Dashboard integration uses the `Open edX Filters`_. To learn more about
111
+ the filters, see the `Open edX Filters`_ documentation. Make sure to configure the
112
+ superset pipeline into the filter as follows:
113
+
114
+ .. code-block:: python
115
+
116
+ OPEN_EDX_FILTERS_CONFIG = {
117
+ "org.openedx.learning.instructor.dashboard.render.started.v1": {
118
+ "fail_silently": False,
119
+ "pipeline": [
120
+ "platform_plugin_superset.extensions.filters.AddSupersetTab",
121
+ ]
122
+ },
123
+ }
124
+
125
+ - `SUPERSET_CONFIG` - This setting is used to configure the Superset Embedded SDK.
126
+ The configuration is a dictionary that contains the following keys:
127
+
128
+ - `internal_service_url` - The URL of the Superset instance (useful in development, omit in production).
129
+ - `service_url` - The URL of the Superset instance.
130
+ - `username` - The username of the Superset user.
131
+ - `password` - The password of the Superset user.
132
+
133
+ - `ASPECTS_INSTRUCTOR_DASHBOARDS` - This setting is used to configure the dashboards
134
+ that will be displayed in the Instructor Dashboard. The configuration is a list of
135
+ dictionaries that contains the following keys:
136
+
137
+ - `name` - The name of the dashboard.
138
+ - `slug` - The slug of the dashboard.
139
+ - `uuid` - The UUID of the dashboard.
140
+ - `allow_translations` - A boolean value that determines if the dashboard
141
+ is translated in `Aspects`_.
142
+
143
+ - `SUPERSET_EXTRA_FILTERS_FORMAT` - This setting is used to configure the extra filters
144
+ that will be applied to the dashboards. The configuration is a list of strings that
145
+ can be formatted with the following variables:
146
+
147
+ - `user` - The user object.
148
+ - `course` - The course object.
149
+
150
+ - `SUPERSET_DASHBOARD_LOCALES` - This setting is used to configure the available locales
151
+ for the dashboards. The configuration is a list of supported locales by `Aspects`_.
152
+
153
+ Event Sink Configuration
154
+ ========================
155
+
156
+ - `EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG` - This setting is used to configure the ClickHouse
157
+ connection. The configuration is a dictionary that contains the following keys:
158
+
159
+ - `url` - The host of the ClickHouse instance.
160
+ - `database` - The database name.
161
+ - `username` - The username of the ClickHouse user.
162
+ - `password` - The password of the ClickHouse user.
163
+ - `timeout_secs` - The timeout in seconds for the ClickHouse connection.
164
+
165
+ - `EVENT_SINK_CLICKHOUSE_PII_MODELS` - This setting is used to configure the models that
166
+ contain PII information. The configuration is a list of strings that contain the
167
+ table names where the PII information is stored.
168
+
169
+ - `EVENT_SINK_CLICKHOUSE_MODEL_CONFIG` - This setting is used to provide compatibility
170
+ with multiple Open edX models. The configuration is a dictionary that contains the
171
+ following a key per model that contains a dictionary with the following keys:
172
+
173
+ - `module` - The module path of the model.
174
+ - `model` - The model class name.
175
+
176
+ Event Sinks are disabled by default. To enable them, you need to enable the following
177
+ waffle flag: `event_sink_clickhouse.{{model_name}}.enabled` where model name is the name
178
+ of the model that you want to enable. Or, you can enable them via settings by setting
179
+ `EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED` to `True`.
180
+
181
+
182
+ Getting Help
183
+ ************
184
+
185
+ Documentation
186
+ =============
187
+
188
+ PLACEHOLDER: Start by going through `the documentation`_. If you need more help see below.
189
+
190
+ .. _the documentation: https://docs.openedx.org/projects/platform-plugin-aspects
191
+
192
+ (TODO: `Set up documentation <https://openedx.atlassian.net/wiki/spaces/DOC/pages/21627535/Publish+Documentation+on+Read+the+Docs>`_)
193
+
194
+ More Help
195
+ =========
196
+
197
+ If you're having trouble, we have discussion forums at
198
+ https://discuss.openedx.org where you can connect with others in the
199
+ community.
200
+
201
+ Our real-time conversations are on Slack. You can request a `Slack
202
+ invitation`_, then join our `community Slack workspace`_.
203
+
204
+ For anything non-trivial, the best path is to open an issue in this
205
+ repository with as many details about the issue you are facing as you
206
+ can provide.
207
+
208
+ https://github.com/openedx/platform-plugin-aspects/issues
209
+
210
+ For more information about these options, see the `Getting Help <https://openedx.org/getting-help>`__ page.
211
+
212
+ .. _Slack invitation: https://openedx.org/slack
213
+ .. _community Slack workspace: https://openedx.slack.com/
214
+
215
+ License
216
+ *******
217
+
218
+ The code in this repository is licensed under the AGPL 3.0 unless
219
+ otherwise noted.
220
+
221
+ Please see `LICENSE.txt <LICENSE.txt>`_ for details.
222
+
223
+ Contributing
224
+ ************
225
+
226
+ Contributions are very welcome.
227
+ Please read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.
228
+
229
+ This project is currently accepting all types of contributions, bug fixes,
230
+ security fixes, maintenance work, or new features. However, please make sure
231
+ to have a discussion about your new feature idea with the maintainers prior to
232
+ beginning development to maximize the chances of your change being accepted.
233
+ You can start a conversation by creating a new issue on this repo summarizing
234
+ your idea.
235
+
236
+ The Open edX Code of Conduct
237
+ ****************************
238
+
239
+ All community members are expected to follow the `Open edX Code of Conduct`_.
240
+
241
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
242
+
243
+ People
244
+ ******
245
+
246
+ The assigned maintainers for this component and other project details may be
247
+ found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
248
+ file in this repo.
249
+
250
+ .. _Backstage: https://backstage.openedx.org/catalog/default/component/platform-plugin-aspects
251
+
252
+ Reporting Security Issues
253
+ *************************
254
+
255
+ Please do not report security issues in public. Please email security@openedx.org.
256
+
257
+ .. _Open edX events: https://github.com/openedx/openedx-events
258
+ .. _Edx Platform: https://github.com/openedx/edx-platform
259
+ .. _ClickHouse: https://clickhouse.com
260
+ .. _Aspects: https://docs.openedx.org/projects/openedx-aspects/en/latest/index.html
261
+ .. _Superset Embedded SDK: https://www.npmjs.com/package/@superset-ui/embedded-sdk
262
+ .. _Open edX Filters: https://docs.openedx.org/projects/openedx-filters/en/latest/
263
+
264
+
265
+ Change Log
266
+ ##########
267
+
268
+ ..
269
+ All enhancements and patches to platform_plugin_aspects will be documented
270
+ in this file. It adheres to the structure of https://keepachangelog.com/ ,
271
+ but in reStructuredText instead of Markdown (for ease of incorporation into
272
+ Sphinx documentation and the PyPI description).
273
+
274
+ This project adheres to Semantic Versioning (https://semver.org/).
275
+
276
+ .. There should always be an "Unreleased" section for changes pending release.
277
+
278
+ Unreleased
279
+ **********
280
+
281
+ *
282
+
283
+ 0.7.0 - 2024-04-12
284
+ ******************
285
+
286
+ Added
287
+ =====
288
+
289
+ * Add endpoint for fetchGuestToken
290
+
291
+ 0.6.0 - 2024-04-08
292
+ ******************
293
+
294
+ Added
295
+ =====
296
+
297
+ * Allow to embed translated Superset Dashboards.
298
+
299
+ 0.5.0 - 2024-04-01
300
+ ******************
301
+
302
+ Added
303
+ =====
304
+
305
+ * Load testing and test monitoring scripts.
306
+
307
+ 0.4.0 - 2024-03-18
308
+ ******************
309
+
310
+ Added
311
+ =====
312
+
313
+ * Embed multiple Superset Dashboards.
314
+
315
+ 0.3.1 - 2024-03-14
316
+ ******************
317
+
318
+ Added
319
+ =====
320
+
321
+ * Fixed development server configuration.
322
+
323
+ 0.3.0 – 2024-03-10
324
+ ******************
325
+
326
+ Added
327
+ =====
328
+
329
+ * Imported XBlock code from platform-plugin-superset
330
+
331
+ 0.2.0 – 2024-03-05
332
+ ******************
333
+
334
+ Added
335
+ =====
336
+
337
+ * Imported code from event-sink-clickhouse.
338
+
339
+ 0.1.0 – 2024-02-29
340
+ **********************************************
341
+
342
+ Added
343
+ =====
344
+
345
+ * First release on PyPI.
@@ -0,0 +1,228 @@
1
+ Platform Plugin Aspects
2
+ #######################
3
+
4
+ Purpose
5
+ *******
6
+
7
+ This repository holds various Aspects plugins for the Open edX platform.
8
+
9
+ Sinks
10
+ *****
11
+
12
+ Sinks are components that listen for events and store them in ClickHouse. The
13
+ events are emitted by the Open edX platform via `Open edX events`_ or Django signals.
14
+
15
+ Available Sinks
16
+ ===============
17
+
18
+ - `CourseOverviewSink` - Listens for the `COURSE_PUBLISHED` event and stores the
19
+ course structure data through `XBlockSink` in ClickHouse.
20
+ - `ExternalIdSink` - Listens for the `post_save` Django signal on the `ExternalId`
21
+ model and stores the external id data in ClickHouse.
22
+ - `UserProfile` - Listens for the `post_save` Django signal on the `UserProfile`
23
+ model and stores the user profile data in ClickHouse.
24
+ - `UserRetirementSink` - Listen for the `USER_RETIRE_LMS_MISC` Django signal and
25
+ remove the user PII information from ClickHouse.
26
+
27
+ Commands
28
+ ========
29
+
30
+ In addition to being an event listener, this package provides the following commands:
31
+
32
+ - `dump_data_to_clickhouse` - This command allows bulk export of the data from the Sinks.
33
+ Allows bootstrapping a new data platform or backfilling lost or missing data.
34
+
35
+ ``python manage.py cms dump_data_to_clickhouse``
36
+
37
+ - `load_test_tracking_events` - This command allows loading test tracking events into
38
+ ClickHouse. This is useful for testing the ClickHouse connection to measure the performance of the
39
+ different data pipelines such as Vector, Event Bus (Redis and Kafka), and Celery.
40
+
41
+ Do not use this command in production as it will generate a large amount of data
42
+ and will slow down the system.
43
+
44
+ ``python manage.py cms load_test_tracking_events``
45
+
46
+ - `monitor_load_test_tracking` - Monitors the load test tracking script and saves
47
+ output for later analysis.
48
+
49
+ ``python manage.py cms monitor_load_test_tracking``
50
+
51
+ Instructor Dashboard Integration
52
+ ================================
53
+
54
+ Dashboards from `Aspects`_ are integrated into the Instructor Dashboard via `Superset Embedded SDK`_.
55
+ See `Configuration`_ for more details.
56
+
57
+ Getting Started with Development
58
+ ********************************
59
+
60
+ Please see the Open edX documentation for `guidance on Python development <https://docs.openedx.org/en/latest/developers/how-tos/get-ready-for-python-dev.html>`_ in this repo.
61
+
62
+ Deploying
63
+ *********
64
+
65
+ The `Platform Plugin Aspects` component is a django plugin which doesn't
66
+ need independent deployment. Therefore, its setup is reasonably straightforward.
67
+ First, it needs to be added to your service requirements, and then it will be
68
+ installed alongside requirements of the service.
69
+
70
+ Configuration
71
+ *************
72
+
73
+ Instructor Dashboard Configuration
74
+ ==================================
75
+
76
+ The Instructor Dashboard integration uses the `Open edX Filters`_. To learn more about
77
+ the filters, see the `Open edX Filters`_ documentation. Make sure to configure the
78
+ superset pipeline into the filter as follows:
79
+
80
+ .. code-block:: python
81
+
82
+ OPEN_EDX_FILTERS_CONFIG = {
83
+ "org.openedx.learning.instructor.dashboard.render.started.v1": {
84
+ "fail_silently": False,
85
+ "pipeline": [
86
+ "platform_plugin_superset.extensions.filters.AddSupersetTab",
87
+ ]
88
+ },
89
+ }
90
+
91
+ - `SUPERSET_CONFIG` - This setting is used to configure the Superset Embedded SDK.
92
+ The configuration is a dictionary that contains the following keys:
93
+
94
+ - `internal_service_url` - The URL of the Superset instance (useful in development, omit in production).
95
+ - `service_url` - The URL of the Superset instance.
96
+ - `username` - The username of the Superset user.
97
+ - `password` - The password of the Superset user.
98
+
99
+ - `ASPECTS_INSTRUCTOR_DASHBOARDS` - This setting is used to configure the dashboards
100
+ that will be displayed in the Instructor Dashboard. The configuration is a list of
101
+ dictionaries that contains the following keys:
102
+
103
+ - `name` - The name of the dashboard.
104
+ - `slug` - The slug of the dashboard.
105
+ - `uuid` - The UUID of the dashboard.
106
+ - `allow_translations` - A boolean value that determines if the dashboard
107
+ is translated in `Aspects`_.
108
+
109
+ - `SUPERSET_EXTRA_FILTERS_FORMAT` - This setting is used to configure the extra filters
110
+ that will be applied to the dashboards. The configuration is a list of strings that
111
+ can be formatted with the following variables:
112
+
113
+ - `user` - The user object.
114
+ - `course` - The course object.
115
+
116
+ - `SUPERSET_DASHBOARD_LOCALES` - This setting is used to configure the available locales
117
+ for the dashboards. The configuration is a list of supported locales by `Aspects`_.
118
+
119
+ Event Sink Configuration
120
+ ========================
121
+
122
+ - `EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG` - This setting is used to configure the ClickHouse
123
+ connection. The configuration is a dictionary that contains the following keys:
124
+
125
+ - `url` - The host of the ClickHouse instance.
126
+ - `database` - The database name.
127
+ - `username` - The username of the ClickHouse user.
128
+ - `password` - The password of the ClickHouse user.
129
+ - `timeout_secs` - The timeout in seconds for the ClickHouse connection.
130
+
131
+ - `EVENT_SINK_CLICKHOUSE_PII_MODELS` - This setting is used to configure the models that
132
+ contain PII information. The configuration is a list of strings that contain the
133
+ table names where the PII information is stored.
134
+
135
+ - `EVENT_SINK_CLICKHOUSE_MODEL_CONFIG` - This setting is used to provide compatibility
136
+ with multiple Open edX models. The configuration is a dictionary that contains the
137
+ following a key per model that contains a dictionary with the following keys:
138
+
139
+ - `module` - The module path of the model.
140
+ - `model` - The model class name.
141
+
142
+ Event Sinks are disabled by default. To enable them, you need to enable the following
143
+ waffle flag: `event_sink_clickhouse.{{model_name}}.enabled` where model name is the name
144
+ of the model that you want to enable. Or, you can enable them via settings by setting
145
+ `EVENT_SINK_CLICKHOUSE_{{model_name}}_ENABLED` to `True`.
146
+
147
+
148
+ Getting Help
149
+ ************
150
+
151
+ Documentation
152
+ =============
153
+
154
+ PLACEHOLDER: Start by going through `the documentation`_. If you need more help see below.
155
+
156
+ .. _the documentation: https://docs.openedx.org/projects/platform-plugin-aspects
157
+
158
+ (TODO: `Set up documentation <https://openedx.atlassian.net/wiki/spaces/DOC/pages/21627535/Publish+Documentation+on+Read+the+Docs>`_)
159
+
160
+ More Help
161
+ =========
162
+
163
+ If you're having trouble, we have discussion forums at
164
+ https://discuss.openedx.org where you can connect with others in the
165
+ community.
166
+
167
+ Our real-time conversations are on Slack. You can request a `Slack
168
+ invitation`_, then join our `community Slack workspace`_.
169
+
170
+ For anything non-trivial, the best path is to open an issue in this
171
+ repository with as many details about the issue you are facing as you
172
+ can provide.
173
+
174
+ https://github.com/openedx/platform-plugin-aspects/issues
175
+
176
+ For more information about these options, see the `Getting Help <https://openedx.org/getting-help>`__ page.
177
+
178
+ .. _Slack invitation: https://openedx.org/slack
179
+ .. _community Slack workspace: https://openedx.slack.com/
180
+
181
+ License
182
+ *******
183
+
184
+ The code in this repository is licensed under the AGPL 3.0 unless
185
+ otherwise noted.
186
+
187
+ Please see `LICENSE.txt <LICENSE.txt>`_ for details.
188
+
189
+ Contributing
190
+ ************
191
+
192
+ Contributions are very welcome.
193
+ Please read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.
194
+
195
+ This project is currently accepting all types of contributions, bug fixes,
196
+ security fixes, maintenance work, or new features. However, please make sure
197
+ to have a discussion about your new feature idea with the maintainers prior to
198
+ beginning development to maximize the chances of your change being accepted.
199
+ You can start a conversation by creating a new issue on this repo summarizing
200
+ your idea.
201
+
202
+ The Open edX Code of Conduct
203
+ ****************************
204
+
205
+ All community members are expected to follow the `Open edX Code of Conduct`_.
206
+
207
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
208
+
209
+ People
210
+ ******
211
+
212
+ The assigned maintainers for this component and other project details may be
213
+ found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
214
+ file in this repo.
215
+
216
+ .. _Backstage: https://backstage.openedx.org/catalog/default/component/platform-plugin-aspects
217
+
218
+ Reporting Security Issues
219
+ *************************
220
+
221
+ Please do not report security issues in public. Please email security@openedx.org.
222
+
223
+ .. _Open edX events: https://github.com/openedx/openedx-events
224
+ .. _Edx Platform: https://github.com/openedx/edx-platform
225
+ .. _ClickHouse: https://clickhouse.com
226
+ .. _Aspects: https://docs.openedx.org/projects/openedx-aspects/en/latest/index.html
227
+ .. _Superset Embedded SDK: https://www.npmjs.com/package/@superset-ui/embedded-sdk
228
+ .. _Open edX Filters: https://docs.openedx.org/projects/openedx-filters/en/latest/
@@ -5,6 +5,6 @@ Aspects plugins for edx-platform.
5
5
  import os
6
6
  from pathlib import Path
7
7
 
8
- __version__ = "0.6.0"
8
+ __version__ = "0.7.0"
9
9
 
10
10
  ROOT_DIRECTORY = Path(os.path.dirname(os.path.abspath(__file__)))
@@ -3,7 +3,7 @@ platform_plugin_aspects Django application initialization.
3
3
  """
4
4
 
5
5
  from django.apps import AppConfig
6
- from edx_django_utils.plugins import PluginSettings, PluginSignals
6
+ from edx_django_utils.plugins import PluginSettings, PluginSignals, PluginURLs
7
7
 
8
8
 
9
9
  class PlatformPluginAspectsConfig(AppConfig):
@@ -14,6 +14,13 @@ class PlatformPluginAspectsConfig(AppConfig):
14
14
  name = "platform_plugin_aspects"
15
15
 
16
16
  plugin_app = {
17
+ PluginURLs.CONFIG: {
18
+ "lms.djangoapp": {
19
+ PluginURLs.NAMESPACE: "",
20
+ PluginURLs.REGEX: r"^aspects/",
21
+ PluginURLs.RELATIVE_PATH: "urls",
22
+ },
23
+ },
17
24
  PluginSettings.CONFIG: {
18
25
  "lms.djangoapp": {
19
26
  "production": {PluginSettings.RELATIVE_PATH: "settings.production"},
@@ -14,12 +14,6 @@ from platform_plugin_aspects.utils import _, generate_superset_context, get_mode
14
14
  TEMPLATE_ABSOLUTE_PATH = "/instructor_dashboard/"
15
15
  BLOCK_CATEGORY = "aspects"
16
16
 
17
- ASPECTS_SECURITY_FILTERS_FORMAT = [
18
- "org = '{course.org}'",
19
- "course_name = '{course.display_name}'",
20
- "course_run = '{course.id.run}'",
21
- ]
22
-
23
17
 
24
18
  class AddSupersetTab(PipelineStep):
25
19
  """
@@ -36,9 +30,6 @@ class AddSupersetTab(PipelineStep):
36
30
  """
37
31
  course = context["course"]
38
32
  dashboards = settings.ASPECTS_INSTRUCTOR_DASHBOARDS
39
- extra_filters_format = settings.SUPERSET_EXTRA_FILTERS_FORMAT
40
-
41
- filters = ASPECTS_SECURITY_FILTERS_FORMAT + extra_filters_format
42
33
 
43
34
  user = get_current_user()
44
35
 
@@ -49,11 +40,10 @@ class AddSupersetTab(PipelineStep):
49
40
  if formatted_language not in settings.SUPERSET_DASHBOARD_LOCALES:
50
41
  formatted_language = "en_US"
51
42
 
43
+ context["course_id"] = course.id
52
44
  context = generate_superset_context(
53
45
  context,
54
- user,
55
46
  dashboards=dashboards,
56
- filters=filters,
57
47
  language=formatted_language,
58
48
  )
59
49
 
@@ -66,7 +56,8 @@ class AddSupersetTab(PipelineStep):
66
56
  "fragment": frag,
67
57
  "section_key": BLOCK_CATEGORY,
68
58
  "section_display_name": _("Analytics"),
69
- "course_id": str(course.id),
59
+ "course_id": str(context.get("course_id")),
60
+ "superset_guest_token_url": str(context.get("superset_guest_token_url")),
70
61
  "superset_url": str(context.get("superset_url")),
71
62
  "template_path_prefix": TEMPLATE_ABSOLUTE_PATH,
72
63
  }
@@ -33,7 +33,6 @@ def receive_course_publish( # pylint: disable=unused-argument # pragma: no cov
33
33
  dump_course_to_clickhouse.delay(str(course_key))
34
34
 
35
35
 
36
- @receiver(post_save, sender=get_model("user_profile"))
37
36
  def on_user_profile_updated( # pylint: disable=unused-argument # pragma: no cover
38
37
  sender, instance, **kwargs
39
38
  ):
@@ -53,7 +52,13 @@ def on_user_profile_updated( # pylint: disable=unused-argument # pragma: no co
53
52
  )
54
53
 
55
54
 
56
- @receiver(post_save, sender=get_model("external_id"))
55
+ # Connect the UserProfile.post_save signal handler only if we have a model to attach to.
56
+ # (prevents celery errors during tests)
57
+ _user_profile = get_model("user_profile")
58
+ if _user_profile:
59
+ post_save.connect(on_user_profile_updated, sender=_user_profile) # pragma: no cover
60
+
61
+
57
62
  def on_externalid_saved( # pylint: disable=unused-argument # pragma: no cover
58
63
  sender, instance, **kwargs
59
64
  ):
@@ -73,6 +78,13 @@ def on_externalid_saved( # pylint: disable=unused-argument # pragma: no cover
73
78
  )
74
79
 
75
80
 
81
+ # Connect the ExternalId.post_save signal handler only if we have a model to attach to.
82
+ # (prevents celery errors during tests)
83
+ _external_id = get_model("external_id")
84
+ if _external_id:
85
+ post_save.connect(on_externalid_saved, sender=_external_id) # pragma: no cover
86
+
87
+
76
88
  @receiver(USER_RETIRE_LMS_MISC)
77
89
  def on_user_retirement( # pylint: disable=unused-argument # pragma: no cover
78
90
  sender, user, **kwargs