Merge pull request #2610 from scott-ray-wilson/group-tables-fixes/improvements

Fix: Group Tables/Pagination Fixes and Improvements
This commit is contained in:
Scott Wilson
2024-10-21 09:39:00 -07:00
committed by GitHub
18 changed files with 247 additions and 81 deletions
@@ -55,7 +55,7 @@ import {
useProjectPermission,
useWorkspace
} from "@app/context";
import { useDebounce, usePagination, usePopUp } from "@app/hooks";
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
import {
useCreateFolder,
useCreateSecretV3,
@@ -213,10 +213,11 @@ export const SecretOverviewPage = () => {
totalCount = 0
} = overview ?? {};
useEffect(() => {
// reset page if no longer valid
if (totalCount <= offset) setPage(1);
}, [totalCount]);
useResetPageHelper({
totalCount,
offset,
setPage
});
const { folderNames, getFolderByNameAndEnv, isFolderPresentInEnv } = useFolderOverview(folders);