-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [AXIMST-416] replaced the LMS endpoint for navigating the course…
… unit page (#137)
- Loading branch information
1 parent
17b1360
commit cdd3118
Showing
9 changed files
with
14 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
import { createSelector } from '@reduxjs/toolkit'; | ||
|
||
import { RequestStatus } from '../../data/constants'; | ||
|
||
export const getCourseUnitData = (state) => state.courseUnit.unit; | ||
export const getCourseUnit = (state) => state.courseUnit; | ||
export const getSavingStatus = (state) => state.courseUnit.savingStatus; | ||
export const getLoadingStatus = (state) => state.courseUnit.loadingStatus; | ||
export const getSequenceStatus = (state) => state.courseUnit.sequenceStatus; | ||
export const getSequenceIds = (state) => state.courseUnit.courseSectionVertical.courseSequenceIds; | ||
export const getCourseSectionVertical = (state) => state.courseUnit.courseSectionVertical; | ||
export const getCourseUnitComponentTemplates = (state) => state.courseUnit.courseSectionVertical.componentTemplates; | ||
export const getCourseSectionVerticalLoadingStatus = (state) => state | ||
.courseUnit.loadingStatus.courseSectionVerticalLoadingStatus; | ||
export const getCourseStatus = state => state.courseUnit.courseStatus; | ||
export const getCoursewareMeta = state => state.models.coursewareMeta; | ||
export const getSections = state => state.models.sections; | ||
export const getCourseId = state => state.courseDetail.courseId; | ||
export const getSequenceId = state => state.courseUnit.sequenceId; | ||
export const getCourseVerticalChildren = state => state.courseUnit.courseVerticalChildren; | ||
export const sequenceIdsSelector = createSelector( | ||
[getCourseStatus, getCoursewareMeta, getSections, getCourseId], | ||
(courseStatus, coursewareMeta, sections, courseId) => { | ||
if (courseStatus !== RequestStatus.SUCCESSFUL) { | ||
return []; | ||
} | ||
|
||
const sectionIds = coursewareMeta[courseId].sectionIds || []; | ||
return sectionIds.flatMap(sectionId => sections[sectionId].sequenceIds); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.