platform-plugin-aspects 0.7.2__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.
Files changed (50) hide show
  1. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/CHANGELOG.rst +16 -0
  2. platform_plugin_aspects-0.7.4/LICENSE +201 -0
  3. {platform_plugin_aspects-0.7.2/platform_plugin_aspects.egg-info → platform_plugin_aspects-0.7.4}/PKG-INFO +21 -7
  4. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/README.rst +0 -3
  5. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/__init__.py +1 -1
  6. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/extensions/filters.py +6 -4
  7. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/common.py +1 -1
  8. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/html/superset.html +1 -1
  9. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/embed_dashboard.js +14 -3
  10. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/superset.js +5 -3
  11. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/utils.py +11 -2
  12. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/views.py +3 -8
  13. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/xblock.py +8 -4
  14. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4/platform_plugin_aspects.egg-info}/PKG-INFO +21 -7
  15. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/requirements/constraints.txt +2 -0
  16. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/setup.py +4 -3
  17. platform_plugin_aspects-0.7.2/LICENSE +0 -661
  18. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/MANIFEST.in +0 -0
  19. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/apps.py +0 -0
  20. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/extensions/__init__.py +0 -0
  21. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/__init__.py +0 -0
  22. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/__init__.py +0 -0
  23. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
  24. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
  25. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
  26. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/__init__.py +0 -0
  27. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/settings/production.py +0 -0
  28. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/signals.py +0 -0
  29. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/__init__.py +0 -0
  30. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/base_sink.py +0 -0
  31. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
  32. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
  33. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/serializers.py +0 -0
  34. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
  35. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
  36. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/css/superset.css +0 -0
  37. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/html/superset_student.html +0 -0
  38. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/static/js/install_required.js +0 -0
  39. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/tasks.py +0 -0
  40. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
  41. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/urls.py +0 -0
  42. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects/waffle.py +0 -0
  43. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
  44. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
  45. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
  46. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
  47. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/requires.txt +0 -0
  48. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
  49. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/requirements/base.in +0 -0
  50. {platform_plugin_aspects-0.7.2 → platform_plugin_aspects-0.7.4}/setup.cfg +0 -0
@@ -16,6 +16,22 @@ Unreleased
16
16
 
17
17
  *
18
18
 
19
+ 0.7.4 - 2024-04-30
20
+ ******************
21
+
22
+ Fixed
23
+ =====
24
+ * Fixed Superset XBlock and default filters.
25
+
26
+ 0.7.3 - 2024-04-30
27
+ ******************
28
+
29
+ Fixed
30
+ =====
31
+
32
+ * Fixed UUID generation for localized Superset assets, which caused embedded
33
+ dashboards to fail to load when localized.
34
+
19
35
  0.7.2 - 2024-04-19
20
36
  ******************
21
37
 
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,20 +1,21 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: platform-plugin-aspects
3
- Version: 0.7.2
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
7
7
  Author-email: oscm@openedx.org
8
- License: AGPL 3.0
8
+ License: Apache 2.0
9
9
  Keywords: Python edx
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
- Classifier: Framework :: Django :: 3.2
12
+ Classifier: Framework :: Django :: 4.2
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.11
18
19
  Requires-Python: >=3.8
19
20
  License-File: LICENSE
20
21
  Requires-Dist: Django
@@ -215,9 +216,6 @@ For more information about these options, see the `Getting Help <https://openedx
215
216
  License
216
217
  *******
217
218
 
218
- The code in this repository is licensed under the AGPL 3.0 unless
219
- otherwise noted.
220
-
221
219
  Please see `LICENSE.txt <LICENSE.txt>`_ for details.
222
220
 
223
221
  Contributing
@@ -280,6 +278,22 @@ Unreleased
280
278
 
281
279
  *
282
280
 
281
+ 0.7.4 - 2024-04-30
282
+ ******************
283
+
284
+ Fixed
285
+ =====
286
+ * Fixed Superset XBlock and default filters.
287
+
288
+ 0.7.3 - 2024-04-30
289
+ ******************
290
+
291
+ Fixed
292
+ =====
293
+
294
+ * Fixed UUID generation for localized Superset assets, which caused embedded
295
+ dashboards to fail to load when localized.
296
+
283
297
  0.7.2 - 2024-04-19
284
298
  ******************
285
299
 
@@ -181,9 +181,6 @@ For more information about these options, see the `Getting Help <https://openedx
181
181
  License
182
182
  *******
183
183
 
184
- The code in this repository is licensed under the AGPL 3.0 unless
185
- otherwise noted.
186
-
187
184
  Please see `LICENSE.txt <LICENSE.txt>`_ for details.
188
185
 
189
186
  Contributing
@@ -5,6 +5,6 @@ Aspects plugins for edx-platform.
5
5
  import os
6
6
  from pathlib import Path
7
7
 
8
- __version__ = "0.7.2"
8
+ __version__ = "0.7.4"
9
9
 
10
10
  ROOT_DIRECTORY = Path(os.path.dirname(os.path.abspath(__file__)))
@@ -34,11 +34,13 @@ class AddSupersetTab(PipelineStep):
34
34
  user = get_current_user()
35
35
 
36
36
  user_language = (
37
- get_model("user_preference").get_value(user, "pref-lang") or "en_US"
37
+ get_model("user_preference").get_value(user, "pref-lang") or "en"
38
38
  )
39
- formatted_language = user_language.replace("-", "_")
40
- if formatted_language not in settings.SUPERSET_DASHBOARD_LOCALES:
41
- formatted_language = "en_US"
39
+ formatted_language = user_language.lower().replace("-", "_")
40
+ if formatted_language not in [
41
+ loc.lower().replace("-", "_") for loc in settings.SUPERSET_DASHBOARD_LOCALES
42
+ ]:
43
+ formatted_language = "en"
42
44
 
43
45
  context["course_id"] = course.id
44
46
  context = generate_superset_context(
@@ -29,7 +29,7 @@ def plugin_settings(settings):
29
29
  },
30
30
  ]
31
31
  settings.SUPERSET_EXTRA_FILTERS_FORMAT = []
32
- settings.SUPERSET_DASHBOARD_LOCALES = ["en_US"]
32
+ settings.SUPERSET_DASHBOARD_LOCALES = ["en"]
33
33
  settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = {
34
34
  # URL to a running ClickHouse server's HTTP interface. ex: https://foo.openedx.org:8443/ or
35
35
  # http://foo.openedx.org:8123/ . Note that we only support the ClickHouse HTTP interface
@@ -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 and superset_guest_token_url %} {% if xblock_id %}
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
- const response = await fetch(superset_guest_token_url, {
19
- method: 'GET',
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 superset_guest_token_url = runtime.handlerUrl(element, 'get_superset_guest_token');
6
- const xblock_id = context.xblock_id
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, superset_guest_token_url, xblock_id);
11
+ embedDashboard(dashboard_uuid, superset_url, xblock_id);
10
12
  }
11
13
 
12
14
  if (typeof require === "function") {
@@ -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 = [filter.format(course=course, user=user) for filter in filters]
115
+ formatted_filters = [
116
+ filter.format(course_id=course, user=user) for filter in filters
117
+ ]
110
118
 
111
119
  resources = []
112
120
 
@@ -268,4 +276,5 @@ def get_localized_uuid(base_uuid, language):
268
276
  """
269
277
  base_uuid = uuid.UUID(base_uuid)
270
278
  base_namespace = uuid.uuid5(base_uuid, "superset")
271
- return str(uuid.uuid5(base_namespace, language))
279
+ normalized_language = language.lower().replace("-", "_")
280
+ return str(uuid.uuid5(base_namespace, normalized_language))
@@ -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 course
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=built_in_filters + extra_filters_format,
122
+ filters=DEFAULT_FILTERS_FORMAT + extra_filters_format,
128
123
  )
129
124
  except ImproperlyConfigured as exc:
130
125
  raise APIException() from exc
@@ -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 _, generate_guest_token, generate_superset_context
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.runtime.course_id,
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,20 +1,21 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: platform-plugin-aspects
3
- Version: 0.7.2
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
7
7
  Author-email: oscm@openedx.org
8
- License: AGPL 3.0
8
+ License: Apache 2.0
9
9
  Keywords: Python edx
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
- Classifier: Framework :: Django :: 3.2
12
+ Classifier: Framework :: Django :: 4.2
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.11
18
19
  Requires-Python: >=3.8
19
20
  License-File: LICENSE
20
21
  Requires-Dist: Django
@@ -215,9 +216,6 @@ For more information about these options, see the `Getting Help <https://openedx
215
216
  License
216
217
  *******
217
218
 
218
- The code in this repository is licensed under the AGPL 3.0 unless
219
- otherwise noted.
220
-
221
219
  Please see `LICENSE.txt <LICENSE.txt>`_ for details.
222
220
 
223
221
  Contributing
@@ -280,6 +278,22 @@ Unreleased
280
278
 
281
279
  *
282
280
 
281
+ 0.7.4 - 2024-04-30
282
+ ******************
283
+
284
+ Fixed
285
+ =====
286
+ * Fixed Superset XBlock and default filters.
287
+
288
+ 0.7.3 - 2024-04-30
289
+ ******************
290
+
291
+ Fixed
292
+ =====
293
+
294
+ * Fixed UUID generation for localized Superset assets, which caused embedded
295
+ dashboards to fail to load when localized.
296
+
283
297
  0.7.2 - 2024-04-19
284
298
  ******************
285
299
 
@@ -10,3 +10,5 @@
10
10
 
11
11
  # Common constraints for edx repos
12
12
  -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
13
+
14
+ backports.zoneinfo;python_version<"3.9"
@@ -161,18 +161,19 @@ setup(
161
161
  include_package_data=True,
162
162
  install_requires=load_requirements("requirements/base.in"),
163
163
  python_requires=">=3.8",
164
- license="AGPL 3.0",
164
+ license="Apache 2.0",
165
165
  zip_safe=False,
166
166
  keywords="Python edx",
167
167
  classifiers=[
168
168
  "Development Status :: 3 - Alpha",
169
169
  "Framework :: Django",
170
- "Framework :: Django :: 3.2",
170
+ "Framework :: Django :: 4.2",
171
171
  "Intended Audience :: Developers",
172
- "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
172
+ "License :: OSI Approved :: Apache Software License",
173
173
  "Natural Language :: English",
174
174
  "Programming Language :: Python :: 3",
175
175
  "Programming Language :: Python :: 3.8",
176
+ "Programming Language :: Python :: 3.11",
176
177
  ],
177
178
  entry_points={
178
179
  "lms.djangoapp": [