platform-plugin-aspects 0.5.0__tar.gz → 0.6.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.
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/CHANGELOG.rst +10 -1
- {platform-plugin-aspects-0.5.0/platform_plugin_aspects.egg-info → platform-plugin-aspects-0.6.0}/PKG-INFO +12 -3
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/__init__.py +1 -1
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/extensions/filters.py +10 -2
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/settings/common.py +7 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/settings/production.py +3 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/utils.py +19 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0/platform_plugin_aspects.egg-info}/PKG-INFO +12 -3
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/requires.txt +1 -1
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/requirements/base.in +1 -1
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/LICENSE +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/MANIFEST.in +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/README.rst +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/apps.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/extensions/__init__.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/management/__init__.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/management/commands/__init__.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/settings/__init__.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/signals.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/__init__.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/base_sink.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/serializers.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/css/superset.css +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/html/superset.html +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/html/superset_student.html +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/js/embed_dashboard.js +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/js/install_required.js +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/static/js/superset.js +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/tasks.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/waffle.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/xblock.py +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/requirements/constraints.txt +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/setup.cfg +0 -0
- {platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/setup.py +0 -0
|
@@ -16,6 +16,14 @@ Unreleased
|
|
|
16
16
|
|
|
17
17
|
*
|
|
18
18
|
|
|
19
|
+
0.6.0 - 2024-04-08
|
|
20
|
+
******************
|
|
21
|
+
|
|
22
|
+
Added
|
|
23
|
+
=====
|
|
24
|
+
|
|
25
|
+
* Allow to embed translated Superset Dashboards.
|
|
26
|
+
|
|
19
27
|
0.5.0 - 2024-04-01
|
|
20
28
|
******************
|
|
21
29
|
|
|
@@ -24,7 +32,6 @@ Added
|
|
|
24
32
|
|
|
25
33
|
* Load testing and test monitoring scripts.
|
|
26
34
|
|
|
27
|
-
|
|
28
35
|
0.4.0 - 2024-03-18
|
|
29
36
|
******************
|
|
30
37
|
|
|
@@ -43,6 +50,7 @@ Added
|
|
|
43
50
|
|
|
44
51
|
0.3.0 – 2024-03-10
|
|
45
52
|
******************
|
|
53
|
+
|
|
46
54
|
Added
|
|
47
55
|
=====
|
|
48
56
|
|
|
@@ -50,6 +58,7 @@ Added
|
|
|
50
58
|
|
|
51
59
|
0.2.0 – 2024-03-05
|
|
52
60
|
******************
|
|
61
|
+
|
|
53
62
|
Added
|
|
54
63
|
=====
|
|
55
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.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
|
|
@@ -20,8 +20,8 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: Django
|
|
21
21
|
Requires-Dist: XBlock
|
|
22
22
|
Requires-Dist: celery
|
|
23
|
-
Requires-Dist: django-rest-framework
|
|
24
23
|
Requires-Dist: django_crum
|
|
24
|
+
Requires-Dist: djangorestframework
|
|
25
25
|
Requires-Dist: edx-django-utils
|
|
26
26
|
Requires-Dist: edx-opaque-keys
|
|
27
27
|
Requires-Dist: edx-toggles
|
|
@@ -150,6 +150,14 @@ Unreleased
|
|
|
150
150
|
|
|
151
151
|
*
|
|
152
152
|
|
|
153
|
+
0.6.0 - 2024-04-08
|
|
154
|
+
******************
|
|
155
|
+
|
|
156
|
+
Added
|
|
157
|
+
=====
|
|
158
|
+
|
|
159
|
+
* Allow to embed translated Superset Dashboards.
|
|
160
|
+
|
|
153
161
|
0.5.0 - 2024-04-01
|
|
154
162
|
******************
|
|
155
163
|
|
|
@@ -158,7 +166,6 @@ Added
|
|
|
158
166
|
|
|
159
167
|
* Load testing and test monitoring scripts.
|
|
160
168
|
|
|
161
|
-
|
|
162
169
|
0.4.0 - 2024-03-18
|
|
163
170
|
******************
|
|
164
171
|
|
|
@@ -177,6 +184,7 @@ Added
|
|
|
177
184
|
|
|
178
185
|
0.3.0 – 2024-03-10
|
|
179
186
|
******************
|
|
187
|
+
|
|
180
188
|
Added
|
|
181
189
|
=====
|
|
182
190
|
|
|
@@ -184,6 +192,7 @@ Added
|
|
|
184
192
|
|
|
185
193
|
0.2.0 – 2024-03-05
|
|
186
194
|
******************
|
|
195
|
+
|
|
187
196
|
Added
|
|
188
197
|
=====
|
|
189
198
|
|
|
@@ -9,7 +9,7 @@ from django.template import Context, Template
|
|
|
9
9
|
from openedx_filters import PipelineStep
|
|
10
10
|
from web_fragments.fragment import Fragment
|
|
11
11
|
|
|
12
|
-
from platform_plugin_aspects.utils import generate_superset_context
|
|
12
|
+
from platform_plugin_aspects.utils import _, generate_superset_context, get_model
|
|
13
13
|
|
|
14
14
|
TEMPLATE_ABSOLUTE_PATH = "/instructor_dashboard/"
|
|
15
15
|
BLOCK_CATEGORY = "aspects"
|
|
@@ -42,11 +42,19 @@ class AddSupersetTab(PipelineStep):
|
|
|
42
42
|
|
|
43
43
|
user = get_current_user()
|
|
44
44
|
|
|
45
|
+
user_language = (
|
|
46
|
+
get_model("user_preference").get_value(user, "pref-lang") or "en_US"
|
|
47
|
+
)
|
|
48
|
+
formatted_language = user_language.replace("-", "_")
|
|
49
|
+
if formatted_language not in settings.SUPERSET_DASHBOARD_LOCALES:
|
|
50
|
+
formatted_language = "en_US"
|
|
51
|
+
|
|
45
52
|
context = generate_superset_context(
|
|
46
53
|
context,
|
|
47
54
|
user,
|
|
48
55
|
dashboards=dashboards,
|
|
49
56
|
filters=filters,
|
|
57
|
+
language=formatted_language,
|
|
50
58
|
)
|
|
51
59
|
|
|
52
60
|
template = Template(self.resource_string("static/html/superset.html"))
|
|
@@ -57,7 +65,7 @@ class AddSupersetTab(PipelineStep):
|
|
|
57
65
|
section_data = {
|
|
58
66
|
"fragment": frag,
|
|
59
67
|
"section_key": BLOCK_CATEGORY,
|
|
60
|
-
"section_display_name":
|
|
68
|
+
"section_display_name": _("Analytics"),
|
|
61
69
|
"course_id": str(course.id),
|
|
62
70
|
"superset_url": str(context.get("superset_url")),
|
|
63
71
|
"template_path_prefix": TEMPLATE_ABSOLUTE_PATH,
|
|
@@ -23,10 +23,13 @@ def plugin_settings(settings):
|
|
|
23
23
|
settings.ASPECTS_INSTRUCTOR_DASHBOARDS = [
|
|
24
24
|
{
|
|
25
25
|
"name": "Instructor Dashboard",
|
|
26
|
+
"slug": "instructor-dashboard",
|
|
26
27
|
"uuid": "1d6bf904-f53f-47fd-b1c9-6cd7e284d286",
|
|
28
|
+
"allow_translations": True,
|
|
27
29
|
},
|
|
28
30
|
]
|
|
29
31
|
settings.SUPERSET_EXTRA_FILTERS_FORMAT = []
|
|
32
|
+
settings.SUPERSET_DASHBOARD_LOCALES = ["en_US"]
|
|
30
33
|
settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = {
|
|
31
34
|
# URL to a running ClickHouse server's HTTP interface. ex: https://foo.openedx.org:8443/ or
|
|
32
35
|
# http://foo.openedx.org:8123/ . Note that we only support the ClickHouse HTTP interface
|
|
@@ -64,4 +67,8 @@ def plugin_settings(settings):
|
|
|
64
67
|
"module": "lms.djangoapps.ccx.models",
|
|
65
68
|
"model": "CustomCourseForEdX",
|
|
66
69
|
},
|
|
70
|
+
"user_preference": {
|
|
71
|
+
"module": "openedx.core.djangoapps.user_api.models",
|
|
72
|
+
"model": "UserPreference",
|
|
73
|
+
},
|
|
67
74
|
}
|
|
@@ -17,6 +17,9 @@ def plugin_settings(settings):
|
|
|
17
17
|
settings.SUPERSET_EXTRA_FILTERS_FORMAT = getattr(settings, "ENV_TOKENS", {}).get(
|
|
18
18
|
"SUPERSET_EXTRA_FILTERS_FORMAT", settings.SUPERSET_EXTRA_FILTERS_FORMAT
|
|
19
19
|
)
|
|
20
|
+
settings.SUPERSET_DASHBOARD_LOCALES = getattr(settings, "ENV_TOKENS", {}).get(
|
|
21
|
+
"SUPERSET_DASHBOARD_LOCALES", settings.SUPERSET_DASHBOARD_LOCALES
|
|
22
|
+
)
|
|
20
23
|
settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = settings.ENV_TOKENS.get(
|
|
21
24
|
"EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG",
|
|
22
25
|
settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG,
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/utils.py
RENAMED
|
@@ -6,6 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
8
|
import os
|
|
9
|
+
import uuid
|
|
9
10
|
from importlib import import_module
|
|
10
11
|
|
|
11
12
|
from django.conf import settings
|
|
@@ -30,6 +31,7 @@ def generate_superset_context( # pylint: disable=dangerous-default-value
|
|
|
30
31
|
user,
|
|
31
32
|
dashboards,
|
|
32
33
|
filters=[],
|
|
34
|
+
language=None,
|
|
33
35
|
):
|
|
34
36
|
"""
|
|
35
37
|
Update context with superset token and dashboard id.
|
|
@@ -40,10 +42,18 @@ def generate_superset_context( # pylint: disable=dangerous-default-value
|
|
|
40
42
|
superset_config (dict): superset config.
|
|
41
43
|
dashboards (list): list of superset dashboard uuid.
|
|
42
44
|
filters (list): list of filters to apply to the dashboard.
|
|
45
|
+
language (str): the language code of the end user.
|
|
43
46
|
"""
|
|
44
47
|
course = context["course"]
|
|
45
48
|
superset_config = settings.SUPERSET_CONFIG
|
|
46
49
|
|
|
50
|
+
if language:
|
|
51
|
+
for dashboard in dashboards:
|
|
52
|
+
if not dashboard["allow_translations"]:
|
|
53
|
+
continue
|
|
54
|
+
dashboard["slug"] = f"{dashboard['slug']}-{language}"
|
|
55
|
+
dashboard["uuid"] = str(get_uuid5(dashboard["uuid"], language))
|
|
56
|
+
|
|
47
57
|
superset_token, dashboards = _generate_guest_token(
|
|
48
58
|
user=user,
|
|
49
59
|
course=course,
|
|
@@ -220,3 +230,12 @@ def get_ccx_courses(course_id):
|
|
|
220
230
|
if settings.FEATURES.get("CUSTOM_COURSES_EDX"):
|
|
221
231
|
return get_model("custom_course_edx").objects.filter(course_id=course_id)
|
|
222
232
|
return []
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def get_uuid5(base_uuid, language):
|
|
236
|
+
"""
|
|
237
|
+
Generate an idempotent uuid.
|
|
238
|
+
"""
|
|
239
|
+
base_uuid = uuid.UUID(base_uuid)
|
|
240
|
+
base_namespace = uuid.uuid5(base_uuid, "superset")
|
|
241
|
+
return uuid.uuid5(base_namespace, language)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.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
|
|
@@ -20,8 +20,8 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: Django
|
|
21
21
|
Requires-Dist: XBlock
|
|
22
22
|
Requires-Dist: celery
|
|
23
|
-
Requires-Dist: django-rest-framework
|
|
24
23
|
Requires-Dist: django_crum
|
|
24
|
+
Requires-Dist: djangorestframework
|
|
25
25
|
Requires-Dist: edx-django-utils
|
|
26
26
|
Requires-Dist: edx-opaque-keys
|
|
27
27
|
Requires-Dist: edx-toggles
|
|
@@ -150,6 +150,14 @@ Unreleased
|
|
|
150
150
|
|
|
151
151
|
*
|
|
152
152
|
|
|
153
|
+
0.6.0 - 2024-04-08
|
|
154
|
+
******************
|
|
155
|
+
|
|
156
|
+
Added
|
|
157
|
+
=====
|
|
158
|
+
|
|
159
|
+
* Allow to embed translated Superset Dashboards.
|
|
160
|
+
|
|
153
161
|
0.5.0 - 2024-04-01
|
|
154
162
|
******************
|
|
155
163
|
|
|
@@ -158,7 +166,6 @@ Added
|
|
|
158
166
|
|
|
159
167
|
* Load testing and test monitoring scripts.
|
|
160
168
|
|
|
161
|
-
|
|
162
169
|
0.4.0 - 2024-03-18
|
|
163
170
|
******************
|
|
164
171
|
|
|
@@ -177,6 +184,7 @@ Added
|
|
|
177
184
|
|
|
178
185
|
0.3.0 – 2024-03-10
|
|
179
186
|
******************
|
|
187
|
+
|
|
180
188
|
Added
|
|
181
189
|
=====
|
|
182
190
|
|
|
@@ -184,6 +192,7 @@ Added
|
|
|
184
192
|
|
|
185
193
|
0.2.0 – 2024-03-05
|
|
186
194
|
******************
|
|
195
|
+
|
|
187
196
|
Added
|
|
188
197
|
=====
|
|
189
198
|
|
|
@@ -13,6 +13,6 @@ redis
|
|
|
13
13
|
requests # HTTP request library
|
|
14
14
|
edx-django-utils # Django utilities, we use caching and monitoring
|
|
15
15
|
edx-opaque-keys # Parsing library for course and usage keys
|
|
16
|
-
|
|
16
|
+
djangorestframework # REST API framework
|
|
17
17
|
edx-toggles
|
|
18
18
|
XBlock
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/apps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/signals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/waffle.py
RENAMED
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/platform_plugin_aspects/xblock.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform-plugin-aspects-0.5.0 → platform-plugin-aspects-0.6.0}/requirements/constraints.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|