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
@@ -16,7 +16,7 @@ import {
useProjectPermission,
useWorkspace
} from "@app/context";
import { useDebounce, usePagination, usePopUp } from "@app/hooks";
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
import {
useGetImportedSecretsSingleEnv,
useGetSecretApprovalPolicyOfABoard,
@@ -164,10 +164,11 @@ const SecretMainPageContent = () => {
totalCount = 0
} = data ?? {};
useEffect(() => {
// reset page if no longer valid
if (totalCount <= offset) setPage(1);
}, [totalCount]);
useResetPageHelper({
totalCount,
offset,
setPage
});
// fetch imported secrets to show user the overriden ones
const { data: importedSecrets } = useGetImportedSecretsSingleEnv({