mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 22:29:15 +00:00
feat(frontend): Persisnt "perPage" for tables
This commit is contained in:
+10
-2
@@ -30,6 +30,7 @@ import {
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
|
||||
import { getUserTablePreference, setUserTablePreference } from "@app/helpers/userTablePreferences";
|
||||
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
|
||||
import { TAppConnection, useListAppConnections } from "@app/hooks/api/appConnections";
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
@@ -76,7 +77,14 @@ export const AppConnectionsTable = () => {
|
||||
orderBy,
|
||||
setOrderDirection,
|
||||
setOrderBy
|
||||
} = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, { initPerPage: 20 });
|
||||
} = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, {
|
||||
initPerPage: getUserTablePreference("appConnectionsTable", "perPage", 20)
|
||||
});
|
||||
|
||||
const handlePerPageChange = (newPerPage: number) => {
|
||||
setPerPage(newPerPage);
|
||||
setUserTablePreference("appConnectionsTable", "perPage", newPerPage);
|
||||
};
|
||||
|
||||
const filteredAppConnections = useMemo(
|
||||
() =>
|
||||
@@ -282,7 +290,7 @@ export const AppConnectionsTable = () => {
|
||||
page={page}
|
||||
perPage={perPage}
|
||||
onChangePage={setPage}
|
||||
onChangePerPage={setPerPage}
|
||||
onChangePerPage={handlePerPageChange}
|
||||
/>
|
||||
)}
|
||||
{!isPending && !filteredAppConnections?.length && (
|
||||
|
||||
Reference in New Issue
Block a user