-
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: replaced the LMS endpoint for navigating the course unit page
fix: [AXIMST-424] Course unit - Fixed network connection behavior (#138) * fix: [AXIMST-424] fixed network connetcion behavior * fix: added placeholder for unsuccessful loading for the page * refactor: code refactoring
- Loading branch information
1 parent
17b1360
commit e396b1c
Showing
10 changed files
with
31 additions
and
391 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
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,9 @@ | ||
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); | ||
}, | ||
); | ||
export const getCourseId = (state) => state.courseDetail.courseId; | ||
export const getSequenceId = (state) => state.courseUnit.sequenceId; | ||
export const getCourseVerticalChildren = (state) => state.courseUnit.courseVerticalChildren; |
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.