feat: created API to get program discussion iframe (#29205)

fix: py lint issues fixed

feat: added test cases for API

fix: py lint issues fixed and added tests

fix: updated tests and refactored

fix: fixed return type in the function

fix: conflicts resolved and linter issue

refactor: updated code to accommodate backward compatibility

refactor: updated classes for code clean up

feat: added test for ProgramDetailFragment

feat: added a new flag for masters discussion

refactor: updated flag names and other refactors
This commit is contained in:
Ahtisham Shahid
2021-11-22 11:27:45 +05:00
committed by GitHub
parent e8e8f4acbe
commit 987c641d82
8 changed files with 381 additions and 101 deletions

View File

@@ -2,10 +2,9 @@
The utility methods and functions to help the djangoapp logic
"""
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.learner_dashboard.config.waffle import ENABLE_PROGRAM_DISCUSSIONS
from lms.djangoapps.learner_dashboard.config.waffle import ENABLE_PROGRAM_TAB_VIEW, ENABLE_MASTERS_PROGRAM_TAB_VIEW
FAKE_COURSE_KEY = CourseKey.from_string('course-v1:fake+course+run')
@@ -19,8 +18,15 @@ def strip_course_id(path):
return path.split(course_id)[0]
def program_discussions_is_enabled():
def program_tab_view_is_enabled() -> bool:
"""
check if program discussion is enabled.
"""
return ENABLE_PROGRAM_DISCUSSIONS.is_enabled()
return ENABLE_PROGRAM_TAB_VIEW.is_enabled()
def masters_program_tab_view_is_enabled() -> bool:
"""
check if masters program discussion is enabled.
"""
return ENABLE_MASTERS_PROGRAM_TAB_VIEW.is_enabled()