-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pagination studio home for courses (#825)
This PR adds pagination for the studio home view and makes minor changes to each course card. NOTE: This needs to be activated by the environment variable ENABLE_HOME_PAGE_COURSE_API_V2 otherwise, it will continue using the old course list enable this feature flag new_studio_mfe.use_new_home_page * feat: pagination studio home for courses * chore: addressing some comments * refactor: addressing pr comments * test: adding test for studio home slice * chore: deleting unnecessary blank line * feat: adding feature for pagination * refactor: change customParams to requestParams * fix: linter problems * fix: course home number of 0 courses * chore: update feature name for pagination * fix: pagination enabled request and test for tab section added again * chore: removing cms link in course card items * chore: addresing some comments * fix: array dependency for pagination
- Loading branch information
Showing
20 changed files
with
365 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,5 @@ HOTJAR_VERSION=6 | |
HOTJAR_DEBUG=true | ||
INVITE_STUDENTS_EMAIL_TO="[email protected]" | ||
AI_TRANSLATIONS_BASE_URL='http://localhost:18760' | ||
ENABLE_HOME_PAGE_COURSE_API_V2=true | ||
ENABLE_CHECKLIST_QUALITY=true |
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 |
---|---|---|
|
@@ -35,4 +35,5 @@ ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=true | |
ENABLE_TAGGING_TAXONOMY_PAGES=true | ||
BBB_LEARN_MORE_URL='' | ||
INVITE_STUDENTS_EMAIL_TO="[email protected]" | ||
ENABLE_HOME_PAGE_COURSE_API_V2=true | ||
ENABLE_CHECKLIST_QUALITY=true |
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
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,3 +1,4 @@ | ||
export const getStudioHomeData = state => state.studioHome.studioHomeData; | ||
export const getLoadingStatuses = (state) => state.studioHome.loadingStatuses; | ||
export const getSavingStatuses = (state) => state.studioHome.savingStatuses; | ||
export const getStudioHomeCoursesParams = (state) => state.studioHome.studioHomeCoursesRequestParams; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { reducer, updateStudioHomeCoursesCustomParams } from './slice'; // Assuming the file is named slice.js | ||
|
||
import { RequestStatus } from '../../data/constants'; | ||
|
||
describe('updateStudioHomeCoursesCustomParams action', () => { | ||
const initialState = { | ||
loadingStatuses: { | ||
studioHomeLoadingStatus: RequestStatus.IN_PROGRESS, | ||
courseNotificationLoadingStatus: RequestStatus.IN_PROGRESS, | ||
courseLoadingStatus: RequestStatus.IN_PROGRESS, | ||
libraryLoadingStatus: RequestStatus.IN_PROGRESS, | ||
}, | ||
savingStatuses: { | ||
courseCreatorSavingStatus: '', | ||
deleteNotificationSavingStatus: '', | ||
}, | ||
studioHomeData: {}, | ||
studioHomeCoursesRequestParams: { | ||
currentPage: 1, | ||
}, | ||
}; | ||
|
||
it('should return the initial state', () => { | ||
const result = reducer(undefined, { type: undefined }); | ||
expect(result).toEqual(initialState); | ||
}); | ||
|
||
it('should update the currentPage in studioHomeCoursesRequestParams', () => { | ||
const newState = { | ||
...initialState, | ||
studioHomeCoursesRequestParams: { | ||
currentPage: 2, | ||
}, | ||
}; | ||
const payload = { | ||
currentPage: 2, | ||
}; | ||
|
||
const result = reducer(initialState, updateStudioHomeCoursesCustomParams(payload)); | ||
expect(result).toEqual(newState); | ||
}); | ||
}); |
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.