+
+ {intl.formatMessage(messages.coursesPaginationInfo, {
+ length: coursesDataItems.length,
+ total: coursesCount,
+ })}
+
+
+ )}
+ {hasCourses ? (
+ <>
+ {sortAlphabeticallyArray(coursesDataItems).map(
+ ({
+ courseKey,
+ displayName,
+ lmsLink,
+ org,
+ rerunLink,
+ number,
+ run,
+ url,
+ cmsLink,
+ }) => (
+
+ ),
+ )}
+
+ {numPages > 1 && isEnabledPagination && (
+
- ),
- )
+ )}
+ >
) : (!optimizationEnabled && (
{
const TABS_LIST = {
courses: 'courses',
@@ -25,6 +30,7 @@ const TabsSection = ({
libraryAuthoringMfeUrl,
redirectToLibraryAuthoringMfe,
courses, librariesEnabled, libraries, archivedCourses,
+ numPages, coursesCount,
} = useSelector(getStudioHomeData);
const {
courseLoadingStatus,
@@ -52,6 +58,10 @@ const TabsSection = ({
isShowProcessing={isShowProcessing}
isLoading={isLoadingCourses}
isFailed={isFailedCoursesPage}
+ dispatch={dispatch}
+ numPages={numPages}
+ coursesCount={coursesCount}
+ isEnabledPagination={isPaginationCoursesEnabled}
/>
,
);
@@ -114,12 +124,17 @@ const TabsSection = ({
);
};
+TabsSection.defaultProps = {
+ isPaginationCoursesEnabled: false,
+};
+
TabsSection.propTypes = {
intl: intlShape.isRequired,
showNewCourseContainer: PropTypes.bool.isRequired,
onClickNewCourse: PropTypes.func.isRequired,
isShowProcessing: PropTypes.bool.isRequired,
dispatch: PropTypes.func.isRequired,
+ isPaginationCoursesEnabled: PropTypes.bool,
};
export default injectIntl(TabsSection);
diff --git a/src/studio-home/tabs-section/messages.js b/src/studio-home/tabs-section/messages.js
index 75e945cef..05e8d0fce 100644
--- a/src/studio-home/tabs-section/messages.js
+++ b/src/studio-home/tabs-section/messages.js
@@ -9,6 +9,10 @@ const messages = defineMessages({
id: 'course-authoring.studio-home.courses.tab.error.message',
defaultMessage: 'Failed to fetch courses. Please try again later.',
},
+ coursesPaginationInfo: {
+ id: 'course-authoring.studio-home.courses.pagination.info',
+ defaultMessage: 'Showing {length} of {total}',
+ },
librariesTabErrorMessage: {
id: 'course-authoring.studio-home.libraries.tab.error.message',
defaultMessage: 'Failed to fetch libraries. Please try again later.',