Repository navigation
Description
Description
In the Learning MFE, the Instructor Dashboard tab links to the Instructor Dashboard MFE, which always lands on the /course_info tab. Users who do not have permission to view that tab end up on a page they cannot use, even when they have access to other tabs. The landing page should depend on the tabs available to the user.
Current Behavior
Clicking the Instructor Dashboard tab in the Learning MFE opens <INSTRUCTOR_MICROFRONTEND_URL>/<course_key>, which always redirects to /course_info. This happens regardless of the user's permissions. If the user lacks courses.view_course_info, they see a page they are not allowed to use instead of a tab they can access.
Expected Behavior
Opening the Instructor Dashboard redirects the user to the first tab, in the dashboard's tab order, that the user has permission to access. /course_info is used only when it is the first accessible tab.
Steps to reproduce
- Log in as a user who has access to the Instructor Dashboard but lacks the
courses.view_course_infopermission for a course. - Open the course in the Learning MFE.
- Click the Instructor Dashboard tab.
- Observe that the browser lands on
/instructor-dashboard/<course_key>/course_infoinstead of the first tab the user can access.
Acceptance Criteria
- Opening the Instructor Dashboard from the Learning MFE redirects to the first tab accessible to the user, following the displayed tab order.
- A user with access to
course_infostill lands on/course_info. - A user without access to
course_infolands on the first tab they can access, not on/course_info. - A user with no accessible tabs sees a clear no-access state instead of a redirect loop or a blank page.
- Direct access to a tab the user cannot view remains restricted.
- Unit tests cover the redirect for users with different sets of permissions.
Technical Notes
- The redirect is defined in the Instructor Dashboard MFE, not in the Learning MFE.
DefaultTabRedirectinsrc/routes.tsxnavigates to the staticdefaultLandingTabId. defaultLandingTabIdis hardcoded as'course_info'insrc/dashboardConfig/configs.tsx.- The Learning MFE link comes from
get_instructor_dashboard_url()inopenedx-platform/lms/djangoapps/instructor/views/instructor_dashboard.py, which buildsf'{INSTRUCTOR_MICROFRONTEND_URL}/{course_key}'with no tab information. - Permission constants live in
src/permissions/constants.ts(for exampleVIEW_COURSE_INFO).CourseInfoPagealready gates its content oncourses.view_course_info. - The fix should reuse the same tab list and permission checks that the instructor navigation uses (
src/instructorNav/), so the landing tab always matches the visible tabs.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity