diff --git a/ui/src/app/applications/components/applications-list/applications-list.tsx b/ui/src/app/applications/components/applications-list/applications-list.tsx index 7b18fab436151..608bbad6b8494 100644 --- a/ui/src/app/applications/components/applications-list/applications-list.tsx +++ b/ui/src/app/applications/components/applications-list/applications-list.tsx @@ -548,6 +548,7 @@ export const ApplicationsList = (props: RouteComponentProps<{}>) => { showHeader={healthBarPrefs.showHealthStatusBar} preferencesKey='applications-list' page={pref.page} + defaultPageSize={5} emptyState={() => (

No matching applications found

diff --git a/ui/src/app/shared/components/paginate/paginate.tsx b/ui/src/app/shared/components/paginate/paginate.tsx index e81c8b7e4014a..102da17121055 100644 --- a/ui/src/app/shared/components/paginate/paginate.tsx +++ b/ui/src/app/shared/components/paginate/paginate.tsx @@ -22,15 +22,16 @@ export interface PaginateProps { header?: React.ReactNode; showHeader?: boolean; sortOptions?: SortOption[]; + defaultPageSize?: number; } -export function Paginate({page, onPageChange, children, data, emptyState, preferencesKey, header, showHeader, sortOptions, total}: PaginateProps) { +export function Paginate({page, onPageChange, children, data, emptyState, preferencesKey, header, showHeader, sortOptions, total, defaultPageSize}: PaginateProps) { const totalItems = total || data.length; return ( services.viewPreferences.getPreferences()}> {pref => { preferencesKey = preferencesKey || 'default'; - const pageSize = pref.pageSizes[preferencesKey] || 10; + const pageSize = pref.pageSizes[preferencesKey] || defaultPageSize || 10; const sortOption = sortOptions ? (pref.sortOptions && pref.sortOptions[preferencesKey]) || sortOptions[0].title : ''; const pageCount = pageSize === -1 ? 1 : Math.ceil(totalItems / pageSize); if (pageCount <= page) {