Skip to content
Snippets Groups Projects
Commit 8133ae5c authored by Carla Duarte's avatar Carla Duarte
Browse files

AA-357: Add DatesBannerSerializerMixin to MFE Outline Tab API

parent 09c24be3
Branches
Tags
No related merge requests found
......@@ -43,5 +43,6 @@ class DatesTabSerializer(DatesBannerSerializerMixin, serializers.Serializer):
Serializer for the Dates Tab
"""
course_date_blocks = DateSummarySerializer(many=True)
has_ended = serializers.BooleanField()
learner_is_full_access = serializers.BooleanField()
user_timezone = serializers.CharField()
......@@ -48,11 +48,14 @@ class DatesTabView(RetrieveAPIView):
link: (str) An absolute link to content related to the date event
(ex. verified link or link to assignment)
title: (str) The title of the date event
missed_deadlines: (bool) Indicates whether the user missed any graded content deadlines
missed_gated_content: (bool) Indicates whether the user missed gated content
dates_banner_info: (obj)
content_type_gating_enabled: (bool) Whether content type gating is enabled for this enrollment.
missed_deadlines: (bool) Indicates whether the user missed any graded content deadlines
missed_gated_content: (bool) Indicates whether the user missed gated content
verified_upgrade_link: (str) The link for upgrading to the Verified track in a course
has_ended: (bool) Indicates whether course has ended
learner_is_full_access: (bool) Indicates if the user is verified in the course
user_timezone: (str) The user's preferred timezone
verified_upgrade_link: (str) The link for upgrading to the Verified track in a course
**Returns**
......
......@@ -6,6 +6,7 @@ from django.utils.translation import ngettext
from rest_framework import serializers
from lms.djangoapps.course_home_api.dates.v1.serializers import DateSummarySerializer
from lms.djangoapps.course_home_api.mixins import DatesBannerSerializerMixin
class CourseBlockSerializer(serializers.Serializer):
......@@ -104,7 +105,7 @@ class ResumeCourseSerializer(serializers.Serializer):
url = serializers.URLField()
class OutlineTabSerializer(serializers.Serializer):
class OutlineTabSerializer(DatesBannerSerializerMixin, serializers.Serializer):
"""
Serializer for the Outline Tab
"""
......@@ -115,6 +116,7 @@ class OutlineTabSerializer(serializers.Serializer):
dates_widget = DatesWidgetSerializer()
enroll_alert = EnrollAlertSerializer()
handouts_html = serializers.CharField()
has_ended = serializers.BooleanField()
offer_html = serializers.CharField()
resume_course = ResumeCourseSerializer()
welcome_message_html = serializers.CharField()
......@@ -91,6 +91,11 @@ class OutlineTabView(RetrieveAPIView):
analytics_id: (str) The unique id given to the tool.
title: (str) The display title of the tool.
url: (str) The link to access the tool.
dates_banner_info: (obj)
content_type_gating_enabled: (bool) Whether content type gating is enabled for this enrollment.
missed_deadlines: (bool) Whether the user has missed any graded content deadlines for the given course.
missed_gated_content: (bool) Whether the user has missed any gated content for the given course.
verified_upgrade_link: (str) The URL to ecommerce IDA for purchasing the verified upgrade.
dates_widget:
course_date_blocks: List of serialized Course Dates objects. Each serialization has the following fields:
complete: (bool) Meant to only be used by assignments. Indicates completeness for an
......@@ -108,6 +113,7 @@ class OutlineTabView(RetrieveAPIView):
can_enroll: (bool) Whether the user can enroll in the given course
extra_text: (str)
handouts_html: (str) Raw HTML for the handouts section of the course info
has_ended: (bool) Indicates whether course has ended
resume_course:
has_visited_course: (bool) Whether the user has ever visited the course
url: (str) The display name of the course block to resume
......@@ -249,6 +255,7 @@ class OutlineTabView(RetrieveAPIView):
'dates_widget': dates_widget,
'enroll_alert': enroll_alert,
'handouts_html': handouts_html or None,
'has_ended': course.has_ended(),
'offer_html': offer_html or None,
'resume_course': resume_course,
'welcome_message_html': welcome_message_html or None,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment