Skip to content

Commit 8dd99de

Browse files
authored
chore: optimize/correct the VideoBlock code (#38012)
- Change the `i18n` service declaration from `wants` to `needs`, since the runtime must provide it for the block to function correctly. - Update the `public_view` webpack JS reference from `VideoBlockMain` to `VideoBlockDisplay`, as all VideoBlock JS files are bundled into `VideoBlockDisplay` and `VideoBlockMain` is not referring to anything or no longer exists in the repository.
1 parent a55c1dd commit 8dd99de

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

xmodule/video_block/video_block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
EXPORT_IMPORT_STATIC_DIR = 'static'
106106

107107

108-
@XBlock.wants('settings', 'completion', 'i18n', 'request_cache', 'video_config')
109-
@XBlock.needs('mako', 'user')
108+
@XBlock.wants('settings', 'completion', 'request_cache', 'video_config')
109+
@XBlock.needs('mako', 'user', 'i18n')
110110
class _BuiltInVideoBlock(
111111
VideoFields, VideoTranscriptsMixin, VideoStudioViewHandlers, VideoStudentViewHandlers,
112112
EmptyDataRawMixin, XmlMixin, EditingMixin, XModuleToXBlockMixin,
@@ -265,7 +265,7 @@ def public_view(self, context):
265265

266266
fragment = Fragment(self.get_html(view=PUBLIC_VIEW, context=context))
267267
add_css_to_fragment(fragment, 'VideoBlockDisplay.css')
268-
add_webpack_js_to_fragment(fragment, 'VideoBlockMain')
268+
add_webpack_js_to_fragment(fragment, 'VideoBlockDisplay')
269269
fragment.initialize_js('Video')
270270
return fragment
271271

0 commit comments

Comments
 (0)