From 986f52faabc42407ab606b35954697fef3ee5dee Mon Sep 17 00:00:00 2001 From: Thomas Tracy Date: Fri, 2 Jul 2021 10:20:28 -0400 Subject: [PATCH] [feat] Add has_scheduled_content to outline API The outline API that the learning MFE needs to know if a course has upcomming content for a new alert. --- lms/djangoapps/course_home_api/outline/v1/serializers.py | 1 + lms/djangoapps/course_home_api/outline/v1/views.py | 1 + openedx/features/course_experience/utils.py | 1 + 3 files changed, 3 insertions(+) diff --git a/lms/djangoapps/course_home_api/outline/v1/serializers.py b/lms/djangoapps/course_home_api/outline/v1/serializers.py index 1f16d83566..09db58ca87 100644 --- a/lms/djangoapps/course_home_api/outline/v1/serializers.py +++ b/lms/djangoapps/course_home_api/outline/v1/serializers.py @@ -54,6 +54,7 @@ class CourseBlockSerializer(serializers.Serializer): 'legacy_web_url': block['legacy_web_url'] if enable_links else None, 'resume_block': block.get('resume_block', False), 'type': block_type, + 'has_scheduled_content': block.get('has_scheduled_content'), }, } for child in children: diff --git a/lms/djangoapps/course_home_api/outline/v1/views.py b/lms/djangoapps/course_home_api/outline/v1/views.py index d35d5e4f02..fcae5dc135 100644 --- a/lms/djangoapps/course_home_api/outline/v1/views.py +++ b/lms/djangoapps/course_home_api/outline/v1/views.py @@ -102,6 +102,7 @@ class OutlineTabView(RetrieveAPIView): children: (list) If the block has child blocks, a list of IDs of the child blocks. resume_block: (bool) Whether the block is the resume block + has_scheduled_content: (bool) Whether the block has more content scheduled for the future course_goals: goal_options: (list) A list of goals where each goal is represented as a tuple (goal_key, goal_string) selected_goal: diff --git a/openedx/features/course_experience/utils.py b/openedx/features/course_experience/utils.py index d696a3ed0f..b3dbbfae20 100644 --- a/openedx/features/course_experience/utils.py +++ b/openedx/features/course_experience/utils.py @@ -105,6 +105,7 @@ def get_course_outline_block_tree(request, course_id, user=None, allow_start_dat 'effort_time', 'format', 'graded', + 'has_scheduled_content', 'has_score', 'show_gated_sections', 'special_exam_info',