Skip to content

Commit 28ab2ce

Browse files
committed
fix: Drop other references to studiofrontend.
Drop tooling to load studio-frontend components into mako templates and XSS testing features related to it.
1 parent 1ebe64d commit 28ab2ce

File tree

10 files changed

+1
-151
lines changed

10 files changed

+1
-151
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ pull_translations: clean_translations ## pull translations via atlas
5858
make pull_plugin_translations
5959
atlas pull $(ATLAS_OPTIONS) \
6060
translations/edx-platform/conf/locale:conf/locale \
61-
translations/studio-frontend/src/i18n/messages:conf/plugins-locale/studio-frontend
6261
python manage.py lms compilemessages
6362
python manage.py lms compilejsi18n
6463
python manage.py cms compilejsi18n

cms/envs/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,6 @@
14231423
XBLOCK_FS_STORAGE_BUCKET = None
14241424
XBLOCK_FS_STORAGE_PREFIX = None
14251425

1426-
STUDIO_FRONTEND_CONTAINER_URL = None
1427-
14281426
############################ Global Database Configuration #####################
14291427

14301428
DATABASE_ROUTERS = [

cms/templates/container.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
<%static:include path="common/templates/image-modal.underscore" />
3737
</script>
3838
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/timepicker/jquery.timepicker.css')}" />
39-
% if not settings.STUDIO_FRONTEND_CONTAINER_URL:
40-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/common.min.css')}" />
41-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/editImageModal.min.css')}" />
42-
% endif
4339
</%block>
4440

4541
<%block name="page_bundle">

cms/templates/container_chromeless.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@
9898
<%static:include path="common/templates/image-modal.underscore" />
9999
</script>
100100
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/timepicker/jquery.timepicker.css')}" />
101-
## The following stylesheets are included for studio-frontend debugging.
102-
## Remove this as part of studio frontend deprecation.
103-
## https://github.com/openedx/studio-frontend/issues/381
104-
% if not settings.STUDIO_FRONTEND_CONTAINER_URL:
105-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/common.min.css')}" />
106-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/editImageModal.min.css')}" />
107-
% endif
108101
</head>
109102

110103
<body class="${static.dir_rtl()} is-signedin course container view-container lang_${LANGUAGE_CODE}">

cms/templates/container_editor.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@
7777
<%static:include path="common/templates/image-modal.underscore" />
7878
</script>
7979

80-
% if not settings.STUDIO_FRONTEND_CONTAINER_URL:
81-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/common.min.css')}" />
82-
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/editImageModal.min.css')}" />
83-
% endif
8480
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/timepicker/jquery.timepicker.css')}" />
8581
% for _, resource in resources:
8682
% if resource['kind'] == 'url' and resource['mimetype'] == 'text/css':

common/djangoapps/pipeline_mako/helpers/studiofrontend.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

common/djangoapps/pipeline_mako/templates/static_content.html

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import json
55
from django.contrib.staticfiles.storage import staticfiles_storage
66
from common.djangoapps.pipeline_mako import compressed_css, compressed_js
7-
from common.djangoapps.pipeline_mako.helpers.studiofrontend import load_sfe_i18n_messages
87
from django.utils.translation import get_language_bidi
98
from mako.exceptions import TemplateLookupException
109
from common.djangoapps.edxmako.shortcuts import marketing_link
@@ -108,37 +107,6 @@
108107

109108
%>${source | n, decode.utf8}</%def>
110109

111-
<%def name="studiofrontend(entry)">
112-
<%doc>
113-
Loads a studio-frontend page, with the necessary context. Context is expected
114-
as a dictionary in the body of this tag.
115-
</%doc>
116-
<%
117-
body = capture(caller.body)
118-
body_dict = json.loads(body)
119-
locale = body_dict['lang']
120-
121-
messages = load_sfe_i18n_messages(locale)
122-
%>
123-
<script type="application/json" id="SFE_i18n_data">
124-
{
125-
"locale": "${ locale | n, decode.utf8}",
126-
"messages": ${ messages | n, decode.utf8}
127-
}
128-
</script>
129-
<script type="application/javascript" id='courseContext'>
130-
var studioContext = ${ body | n, decode.utf8};
131-
</script>
132-
<div id="root" class="SFE"></div>
133-
% if settings.STUDIO_FRONTEND_CONTAINER_URL:
134-
<script type="text/javascript" src="${settings.STUDIO_FRONTEND_CONTAINER_URL}/${entry}.js"></script>
135-
% else:
136-
<script type="text/javascript" src="${url('common/js/vendor/runtime.min.js')}"></script>
137-
<script type="text/javascript" src="${url('common/js/vendor/common.min.js')}"></script>
138-
<script type="text/javascript" src="${url('common/js/vendor/{}.min.js'.format(entry))}"></script>
139-
% endif
140-
</%def>
141-
142110
<%def name="webpack(entry, extension=None, config='DEFAULT', attrs='')">
143111
<%doc>
144112
Loads Javascript onto your page from a Webpack-generated bundle.

common/djangoapps/pipeline_mako/tests/test_studio_frontend.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

scripts/xsslint/tests/test_linters.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,22 +1244,16 @@ def test_check_mako_expressions_in_mixed_contexts(self):
12441244
${x | h}
12451245
</%static:require_module>
12461246
${x | h}
1247-
<%static:studiofrontend page="${x}">
1248-
${x | h}
1249-
</%static:studiofrontend>
1250-
${x | h}
12511247
""")
12521248

12531249
linter._check_mako_file_is_safe(mako_template, results)
12541250

1255-
assert len(results.violations) == 7
1251+
assert len(results.violations) == 5
12561252
assert results.violations[0].rule == MAKO_LINTER_RULESET.mako_unwanted_html_filter
12571253
assert results.violations[1].rule == MAKO_LINTER_RULESET.mako_invalid_js_filter
12581254
assert results.violations[2].rule == MAKO_LINTER_RULESET.mako_unwanted_html_filter
12591255
assert results.violations[3].rule == MAKO_LINTER_RULESET.mako_invalid_js_filter
12601256
assert results.violations[4].rule == MAKO_LINTER_RULESET.mako_unwanted_html_filter
1261-
assert results.violations[5].rule == MAKO_LINTER_RULESET.mako_invalid_js_filter
1262-
assert results.violations[6].rule == MAKO_LINTER_RULESET.mako_unwanted_html_filter
12631257

12641258
def test_check_mako_expressions_javascript_strings(self):
12651259
"""

scripts/xsslint/xsslint/linters.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,8 +1359,6 @@ def _get_contexts(self, mako_template):
13591359
</%static:require_module(_async)?> | # require js script tag end (optionally the _async version)
13601360
<%static:webpack.*(?<!/)> | # webpack script tag start
13611361
</%static:webpack> | # webpack script tag end
1362-
<%static:studiofrontend.*?(?<!/)> | # studiofrontend script tag start
1363-
</%static:studiofrontend> | # studiofrontend script tag end
13641362
<%block[ ]*name=['"]requirejs['"]\w*(?<!/)> | # require js tag start
13651363
</%block> # require js tag end
13661364
""",

0 commit comments

Comments
 (0)