From e211a1b1f693f20b04d9474b57fa2e62a22105c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Tereshchenko Date: Tue, 17 Dec 2024 16:10:13 +0200 Subject: [PATCH] Page size of theses table in department overview to be 100 --- .../DepartmentOverview/DepartmentOverview.tsx | 1 + src/client/components/ThesisPage/ThesesPage.tsx | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/components/DepartmentOverview/DepartmentOverview.tsx b/src/client/components/DepartmentOverview/DepartmentOverview.tsx index 8aeea00..578f187 100644 --- a/src/client/components/DepartmentOverview/DepartmentOverview.tsx +++ b/src/client/components/DepartmentOverview/DepartmentOverview.tsx @@ -92,6 +92,7 @@ const DepartmentOverview = () => { noOwnThesesSwitch noAddThesisButton showExportOptions + pageSize={100} /> diff --git a/src/client/components/ThesisPage/ThesesPage.tsx b/src/client/components/ThesisPage/ThesesPage.tsx index e72ceac..2409cf0 100644 --- a/src/client/components/ThesisPage/ThesesPage.tsx +++ b/src/client/components/ThesisPage/ThesesPage.tsx @@ -45,7 +45,7 @@ import DeleteConfirmation from '../Common/DeleteConfirmation' import { StatusLocale } from '../../types' import { useDebounce } from '../../hooks/useDebounce' -const PAGE_SIZE = 25 +const DEFAULT_PAGE_SIZE = 25 interface Props { filteringProgramId?: string @@ -53,6 +53,7 @@ interface Props { noOwnThesesSwitch?: boolean noAddThesisButton?: boolean showExportOptions?: boolean + pageSize?: number } const ThesesPage = ({ filteringProgramId, @@ -60,7 +61,10 @@ const ThesesPage = ({ noOwnThesesSwitch, noAddThesisButton, showExportOptions, + pageSize, }: Props) => { + pageSize = pageSize ?? DEFAULT_PAGE_SIZE + const apiRef = useGridApiRef() const footerRef = useRef(null) const { t, i18n } = useTranslation() @@ -70,7 +74,7 @@ const ThesesPage = ({ const [paginationModel, setPaginationModel] = useState({ page: 0, - pageSize: PAGE_SIZE, + pageSize, }) const [rowSelectionModel, setRowSelectionModel] = @@ -373,7 +377,7 @@ const ThesesPage = ({ sortingMode="server" onSortModelChange={handleSortModelChange} hideFooterSelectedRowCount - pageSizeOptions={[PAGE_SIZE]} + pageSizeOptions={[pageSize]} paginationMode="server" paginationModel={paginationModel} onPaginationModelChange={(newModel) => setPaginationModel(newModel)}