remove sub from editable metadata fields

This commit is contained in:
Qubad786
2018-03-25 11:04:59 +05:00
committed by muhammad-ammar
parent d850fb2078
commit 7afd3b6c21
5 changed files with 6 additions and 12 deletions

View File

@@ -362,7 +362,6 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
'saveStateUrl': self.system.ajax_url + '/save_user_state',
'autoplay': settings.FEATURES.get('AUTOPLAY_VIDEOS', False),
'streams': self.youtube_streams,
'sub': self.sub,
'sources': sources,
'poster': poster,
'duration': video_duration,
@@ -606,6 +605,10 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
else:
editable_fields.pop('source')
# Default Timed Transcript a.k.a `sub` has been deprecated and end users shall
# not be able to modify it.
editable_fields.pop('sub')
languages = [{'label': label, 'code': lang} for lang, label in settings.ALL_LANGUAGES]
languages.sort(key=lambda l: l['label'])
editable_fields['transcripts']['languages'] = languages

View File

@@ -104,6 +104,8 @@ class VideoFields(object):
scope=Scope.settings,
default=False
)
# `sub` is deprecated field and should not be used in future. Now, transcripts are primarily handled in VAL and
# backward compatibility for the video modules already using this field has been ensured.
sub = String(
help=_("The default transcript for the video, from the Default Timed Transcript field on the Basic tab. This transcript should be in English. You don't have to change this setting."), # pylint: disable=line-too-long
display_name=_("Default Timed Transcript"),

View File

@@ -64,7 +64,6 @@ DEFAULT_SETTINGS = [
# advanced
[DISPLAY_NAME, 'Video', False],
['Default Timed Transcript', '', False],
['Download Transcript Allowed', 'False', False],
['Downloadable Transcript URL', '', False],
['Show Transcript', 'True', False],

View File

@@ -153,15 +153,12 @@ class VideoTranscriptTest(CMSVideoBaseTest):
And I enter a "t_not_exist.mp4" source to field number 1
Then I see status message "No Timed Transcript"
And I see value "" in the field "Default Timed Transcript"
"""
self._create_video_component()
self.edit_component()
self.video.set_url_field('t_not_exist.mp4', 1)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.open_advanced_tab()
self.assertTrue(self.video.verify_field_value('Default Timed Transcript', ''))
def test_set_youtube_id_wo_local(self):
"""
@@ -761,7 +758,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
After i enter a "/gizmo.webm" source to field number 1 Then I see status message "No Timed Transcript"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
And I see value "gizmo" in the field "Default Timed Transcript"
After saving the changes video captions should be visible
After I edit the component I should see status message "Timed Transcript Found"
"""

View File

@@ -92,7 +92,6 @@ class TestVideoYouTube(TestVideo):
'saveStateUrl': self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state',
'autoplay': False,
'streams': '0.75:jNCf2gIqpeE,1.00:ZwkTiUPN0mg,1.25:rsq9auxASqI,1.50:kMyNdzVHHgg',
'sub': 'a_sub_file.srt.sjson',
'sources': sources,
'duration': None,
'poster': None,
@@ -174,7 +173,6 @@ class TestVideoNonYouTube(TestVideo):
'saveStateUrl': self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state',
'autoplay': False,
'streams': '1.00:3_yD_cEKoCk',
'sub': 'a_sub_file.srt.sjson',
'sources': sources,
'duration': None,
'poster': None,
@@ -232,7 +230,6 @@ class TestGetHtmlMethod(BaseTestXmodule):
'saveStateUrl': '',
'autoplay': settings.FEATURES.get('AUTOPLAY_VIDEOS', True),
'streams': '1.00:3_yD_cEKoCk',
'sub': 'a_sub_file.srt.sjson',
'sources': '[]',
'duration': 111.0,
'poster': None,
@@ -363,7 +360,6 @@ class TestGetHtmlMethod(BaseTestXmodule):
'transcriptAvailableTranslationsUrl': self.get_handler_url('transcript', 'available_translations'),
'publishCompletionUrl': self.get_handler_url('publish_completion', ''),
'saveStateUrl': self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state',
'sub': data['sub'],
})
expected_context.update({
'transcript_download_format': (
@@ -2059,7 +2055,6 @@ class TestVideoWithBumper(TestVideo):
'saveStateUrl': self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state',
'autoplay': False,
'streams': '0.75:jNCf2gIqpeE,1.00:ZwkTiUPN0mg,1.25:rsq9auxASqI,1.50:kMyNdzVHHgg',
'sub': 'a_sub_file.srt.sjson',
'sources': sources,
'poster': None,
'duration': None,
@@ -2131,7 +2126,6 @@ class TestAutoAdvanceVideo(TestVideo):
'saveStateUrl': self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state',
'autoplay': False,
'streams': '0.75:jNCf2gIqpeE,1.00:ZwkTiUPN0mg,1.25:rsq9auxASqI,1.50:kMyNdzVHHgg',
'sub': 'a_sub_file.srt.sjson',
'sources': [u'example.mp4', u'example.webm'],
'duration': None,
'poster': None,