Merge pull request #32024 from open-craft/chris/FAL-3383-new-video-editor-flow

[FAL-3383] feat: New waffleflag to enable or disable new video editor flow
This commit is contained in:
kenclary
2023-05-18 09:56:06 -04:00
committed by GitHub
7 changed files with 40 additions and 5 deletions

View File

@@ -122,6 +122,24 @@ def use_new_video_editor():
return ENABLE_NEW_VIDEO_EDITOR_FLAG.is_enabled()
# .. toggle_name: new_core_editors.use_video_gallery_flow
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use the video selection gallery on the flow of the new core video xblock editor
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2023-04-03
# .. toggle_target_removal_date: 2023-6-01
# .. toggle_warning: You need to activate the `new_core_editors.use_new_video_editor` flag to use this new flow.
ENABLE_VIDEO_GALLERY_FLOW_FLAG = WaffleFlag('new_core_editors.use_video_gallery_flow', __name__)
def use_video_gallery_flow():
"""
Returns a boolean = true if the video gallery flow is enabled
"""
return ENABLE_VIDEO_GALLERY_FLOW_FLAG.is_enabled()
# .. toggle_name: new_core_editors.use_new_problem_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False

View File

@@ -365,6 +365,7 @@ class VideosHandlerTestCase(
'course_video_image_url',
'transcripts',
'transcription_status',
'transcript_urls',
'error_description'
}
)
@@ -381,7 +382,7 @@ class VideosHandlerTestCase(
[
'edx_video_id', 'client_video_id', 'created', 'duration',
'status', 'course_video_image_url', 'transcripts', 'transcription_status',
'error_description'
'transcript_urls', 'error_description'
],
[
{
@@ -398,7 +399,7 @@ class VideosHandlerTestCase(
[
'edx_video_id', 'client_video_id', 'created', 'duration',
'status', 'course_video_image_url', 'transcripts', 'transcription_status',
'error_description'
'transcript_urls', 'error_description'
],
[
{

View File

@@ -29,6 +29,7 @@ from edxval.api import (
create_video,
get_3rd_party_transcription_plans,
get_available_transcript_languages,
get_video_transcript_url,
get_transcript_credentials_state_for_org,
get_transcript_preferences,
get_videos_for_course,
@@ -574,6 +575,12 @@ def _get_videos(course, pagination_conf=None):
video['transcription_status'] = (
StatusDisplayStrings.get(video['status']) if is_video_encodes_ready else ''
)
video['transcript_urls'] = {}
for language_code in video['transcripts']:
video['transcript_urls'][language_code] = get_video_transcript_url(
video_id=video['edx_video_id'],
language_code=language_code,
)
# Convert the video status.
video['status'] = convert_video_status(video, is_video_encodes_ready)
@@ -595,7 +602,7 @@ def _get_index_videos(course, pagination_conf=None):
attrs = [
'edx_video_id', 'client_video_id', 'created', 'duration',
'status', 'courses', 'transcripts', 'transcription_status',
'error_description'
'transcript_urls', 'error_description'
]
def _get_values(video):