Skip to content

Commit 3718ed8

Browse files
fix: set correct instructor dashboard tab URL when MFE is enabled (#38451)
1 parent 356dbd2 commit 3718ed8

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

lms/djangoapps/instructor/views/instructor_dashboard.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ class InstructorDashboardTab(CourseTab):
7676
is_dynamic = True # The "Instructor" tab is instead dynamically added when it is enabled
7777
priority = 300
7878

79+
def __init__(self, tab_dict):
80+
# Customize link function to support both legacy dashboard and new MFE tab response based on feature flag
81+
def link_func(course, reverse_func):
82+
if not legacy_instructor_dashboard():
83+
return get_instructor_dashboard_url(course.id)
84+
else:
85+
return reverse_func(self.view_name, args=[str(course.id)])
86+
87+
tab_dict['link_func'] = link_func
88+
super().__init__(tab_dict)
89+
7990
@classmethod
8091
def is_enabled(cls, course, user=None):
8192
"""
@@ -832,4 +843,4 @@ def get_instructor_dashboard_url(course_key: CourseKey) -> str:
832843
Gets instructor microfrontend URL for the current course locator.
833844
"""
834845
mfe_base_url = settings.INSTRUCTOR_MICROFRONTEND_URL
835-
return f'{mfe_base_url}/{course_key}/course_info'
846+
return f'{mfe_base_url}/{course_key}'

0 commit comments

Comments
 (0)