Skip to content

Commit

Permalink
Page size of theses table in department overview to be 100
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksTeresh committed Dec 17, 2024
1 parent 033281b commit e211a1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const DepartmentOverview = () => {
noOwnThesesSwitch
noAddThesisButton
showExportOptions
pageSize={100}
/>
</Stack>
</>
Expand Down
10 changes: 7 additions & 3 deletions src/client/components/ThesisPage/ThesesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,26 @@ 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
filteringDepartmentId?: string
noOwnThesesSwitch?: boolean
noAddThesisButton?: boolean
showExportOptions?: boolean
pageSize?: number
}
const ThesesPage = ({
filteringProgramId,
filteringDepartmentId,
noOwnThesesSwitch,
noAddThesisButton,
showExportOptions,
pageSize,
}: Props) => {
pageSize = pageSize ?? DEFAULT_PAGE_SIZE

const apiRef = useGridApiRef()
const footerRef = useRef<HTMLDivElement>(null)
const { t, i18n } = useTranslation()
Expand All @@ -70,7 +74,7 @@ const ThesesPage = ({

const [paginationModel, setPaginationModel] = useState({
page: 0,
pageSize: PAGE_SIZE,
pageSize,
})

const [rowSelectionModel, setRowSelectionModel] =
Expand Down Expand Up @@ -373,7 +377,7 @@ const ThesesPage = ({
sortingMode="server"
onSortModelChange={handleSortModelChange}
hideFooterSelectedRowCount
pageSizeOptions={[PAGE_SIZE]}
pageSizeOptions={[pageSize]}
paginationMode="server"
paginationModel={paginationModel}
onPaginationModelChange={(newModel) => setPaginationModel(newModel)}
Expand Down

0 comments on commit e211a1b

Please sign in to comment.