platform-plugin-aspects 0.7.3__tar.gz → 0.7.4__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.7.3 → platform_plugin_aspects-0.7.4}/CHANGELOG.rst +7 -0
- {platform_plugin_aspects-0.7.3/platform_plugin_aspects.egg-info → platform_plugin_aspects-0.7.4}/PKG-INFO +8 -1
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/__init__.py +1 -1
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/html/superset.html +1 -1
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/embed_dashboard.js +14 -3
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/superset.js +5 -3
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/utils.py +9 -1
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/views.py +3 -8
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/xblock.py +8 -4
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4/platform_plugin_aspects.egg-info}/PKG-INFO +8 -1
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/LICENSE +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/MANIFEST.in +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/README.rst +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/apps.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/extensions/__init__.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/extensions/filters.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/__init__.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/__init__.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/__init__.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/common.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/production.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/signals.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/__init__.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/base_sink.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/serializers.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/css/superset.css +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/html/superset_student.html +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/install_required.js +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/tasks.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/urls.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/waffle.py +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/requires.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/requirements/base.in +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/requirements/constraints.txt +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/setup.cfg +0 -0
- {platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
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
|
|
@@ -278,6 +278,13 @@ Unreleased
|
|
|
278
278
|
|
|
279
279
|
*
|
|
280
280
|
|
|
281
|
+
0.7.4 - 2024-04-30
|
|
282
|
+
******************
|
|
283
|
+
|
|
284
|
+
Fixed
|
|
285
|
+
=====
|
|
286
|
+
* Fixed Superset XBlock and default filters.
|
|
287
|
+
|
|
281
288
|
0.7.3 - 2024-04-30
|
|
282
289
|
******************
|
|
283
290
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<p>{{exception}}</p>
|
|
11
11
|
{% elif not superset_dashboards %}
|
|
12
12
|
<p>Dashboard UUID is not set. Please set the dashboard UUID in the Studio.</p>
|
|
13
|
-
{% elif superset_url
|
|
13
|
+
{% elif superset_url %} {% if xblock_id %}
|
|
14
14
|
<div class="superset-embedded-container" id="superset-embedded-container-{{xblock_id}}"></div>
|
|
15
15
|
{% else %}
|
|
16
16
|
<div class="aspects-tabs">
|
|
@@ -15,11 +15,22 @@ function getCookie(name) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
async function fetchGuestToken() {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
let response;
|
|
19
|
+
if (window.from_xblock){
|
|
20
|
+
// XBlock handler requires a POST request and a JSON body
|
|
21
|
+
body = JSON.stringify({});
|
|
22
|
+
method = 'POST';
|
|
23
|
+
}else {
|
|
24
|
+
body = null;
|
|
25
|
+
method = 'GET';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
response = await fetch(window.superset_guest_token_url, {
|
|
29
|
+
method: method,
|
|
20
30
|
headers: {
|
|
21
31
|
"X-CSRFToken": getCookie("csrftoken"),
|
|
22
|
-
}
|
|
32
|
+
},
|
|
33
|
+
body: body,
|
|
23
34
|
});
|
|
24
35
|
|
|
25
36
|
if (!response.ok) {
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
function SupersetXBlock(runtime, element, context) {
|
|
3
3
|
const dashboard_uuid = context.dashboard_uuid;
|
|
4
4
|
const superset_url = context.superset_url;
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const xblock_id = context.xblock_id;
|
|
6
|
+
|
|
7
|
+
window.superset_guest_token_url = runtime.handlerUrl(element, 'get_superset_guest_token');
|
|
8
|
+
window.from_xblock = true;
|
|
7
9
|
|
|
8
10
|
function initSuperset(supersetEmbeddedSdk) {
|
|
9
|
-
embedDashboard(dashboard_uuid, superset_url,
|
|
11
|
+
embedDashboard(dashboard_uuid, superset_url, xblock_id);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
if (typeof require === "function") {
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/utils.py
RENAMED
|
@@ -31,6 +31,12 @@ def _(text):
|
|
|
31
31
|
return text
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
DEFAULT_FILTERS_FORMAT = [
|
|
35
|
+
"org = '{course_id.org}'",
|
|
36
|
+
"course_key = '{course_id}'",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
|
|
34
40
|
def generate_superset_context(
|
|
35
41
|
context,
|
|
36
42
|
dashboards,
|
|
@@ -106,7 +112,9 @@ def generate_guest_token(user, course, dashboards, filters) -> str:
|
|
|
106
112
|
superset_username = superset_config.get("username")
|
|
107
113
|
superset_password = superset_config.get("password")
|
|
108
114
|
|
|
109
|
-
formatted_filters = [
|
|
115
|
+
formatted_filters = [
|
|
116
|
+
filter.format(course_id=course, user=user) for filter in filters
|
|
117
|
+
]
|
|
110
118
|
|
|
111
119
|
resources = []
|
|
112
120
|
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/views.py
RENAMED
|
@@ -16,7 +16,7 @@ from rest_framework.exceptions import APIException, NotFound
|
|
|
16
16
|
from rest_framework.generics import GenericAPIView
|
|
17
17
|
from rest_framework.response import Response
|
|
18
18
|
|
|
19
|
-
from .utils import _, generate_guest_token, get_model
|
|
19
|
+
from .utils import DEFAULT_FILTERS_FORMAT, _, generate_guest_token, get_model
|
|
20
20
|
|
|
21
21
|
try:
|
|
22
22
|
from openedx.core.lib.api.permissions import (
|
|
@@ -102,7 +102,7 @@ class SupersetView(GenericAPIView):
|
|
|
102
102
|
# May raise a permission denied
|
|
103
103
|
self.check_object_permissions(self.request, course)
|
|
104
104
|
|
|
105
|
-
return
|
|
105
|
+
return course_key
|
|
106
106
|
|
|
107
107
|
@method_decorator(cache_page(60 * 5))
|
|
108
108
|
def get(self, request, *args, **kwargs):
|
|
@@ -111,11 +111,6 @@ class SupersetView(GenericAPIView):
|
|
|
111
111
|
"""
|
|
112
112
|
course = self.get_object()
|
|
113
113
|
|
|
114
|
-
built_in_filters = [
|
|
115
|
-
f"org = '{course.course_id.org}'",
|
|
116
|
-
f"course_name = '{course.display_name}'",
|
|
117
|
-
f"course_run = '{course.course_id.run}'",
|
|
118
|
-
]
|
|
119
114
|
dashboards = settings.ASPECTS_INSTRUCTOR_DASHBOARDS
|
|
120
115
|
extra_filters_format = settings.SUPERSET_EXTRA_FILTERS_FORMAT
|
|
121
116
|
|
|
@@ -124,7 +119,7 @@ class SupersetView(GenericAPIView):
|
|
|
124
119
|
user=request.user,
|
|
125
120
|
course=course,
|
|
126
121
|
dashboards=dashboards,
|
|
127
|
-
filters=
|
|
122
|
+
filters=DEFAULT_FILTERS_FORMAT + extra_filters_format,
|
|
128
123
|
)
|
|
129
124
|
except ImproperlyConfigured as exc:
|
|
130
125
|
raise APIException() from exc
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/xblock.py
RENAMED
|
@@ -16,7 +16,12 @@ from xblock.fields import List, Scope, String
|
|
|
16
16
|
from xblock.utils.resources import ResourceLoader
|
|
17
17
|
from xblock.utils.studio_editable import StudioEditableXBlockMixin
|
|
18
18
|
|
|
19
|
-
from .utils import
|
|
19
|
+
from .utils import (
|
|
20
|
+
DEFAULT_FILTERS_FORMAT,
|
|
21
|
+
_,
|
|
22
|
+
generate_guest_token,
|
|
23
|
+
generate_superset_context,
|
|
24
|
+
)
|
|
20
25
|
|
|
21
26
|
log = logging.getLogger(__name__)
|
|
22
27
|
loader = ResourceLoader(__name__)
|
|
@@ -142,7 +147,6 @@ class SupersetXBlock(StudioEditableXBlockMixin, XBlock):
|
|
|
142
147
|
json_args={
|
|
143
148
|
"dashboard_uuid": self.dashboard_uuid,
|
|
144
149
|
"superset_url": context.get("superset_url"),
|
|
145
|
-
"superset_token": context.get("superset_token"),
|
|
146
150
|
"xblock_id": context.get("xblock_id"),
|
|
147
151
|
},
|
|
148
152
|
)
|
|
@@ -198,9 +202,9 @@ class SupersetXBlock(StudioEditableXBlockMixin, XBlock):
|
|
|
198
202
|
try:
|
|
199
203
|
guest_token = generate_guest_token(
|
|
200
204
|
user=user,
|
|
201
|
-
course=self.
|
|
205
|
+
course=self.scope_ids.usage_id.context_key,
|
|
202
206
|
dashboards=self.dashboards(),
|
|
203
|
-
filters=self.filters,
|
|
207
|
+
filters=DEFAULT_FILTERS_FORMAT + self.filters,
|
|
204
208
|
)
|
|
205
209
|
except ImproperlyConfigured as exc:
|
|
206
210
|
raise JsonHandlerError(500, str(exc)) from exc
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
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
|
|
@@ -278,6 +278,13 @@ Unreleased
|
|
|
278
278
|
|
|
279
279
|
*
|
|
280
280
|
|
|
281
|
+
0.7.4 - 2024-04-30
|
|
282
|
+
******************
|
|
283
|
+
|
|
284
|
+
Fixed
|
|
285
|
+
=====
|
|
286
|
+
* Fixed Superset XBlock and default filters.
|
|
287
|
+
|
|
281
288
|
0.7.3 - 2024-04-30
|
|
282
289
|
******************
|
|
283
290
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/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
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/urls.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.7.3 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/waffle.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.7.3 → platform_plugin_aspects-0.7.4}/requirements/constraints.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|