refactor: move overview resource env determination logic to the client side to preserve ordering of resources

This commit is contained in:
Scott Wilson
2024-09-19 16:36:11 -07:00
parent d0656358a2
commit bc74c44f97
13 changed files with 80 additions and 137 deletions
@@ -277,7 +277,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
})}
</TBody>
</Table>
{!isLoading && data && data.totalCount > INIT_PER_PAGE && (
{!isLoading && data && (
<Pagination
count={data.totalCount}
page={page}
@@ -369,7 +369,7 @@ export const IdentityTab = withProjectPermission(
})}
</TBody>
</Table>
{!isLoading && data && data.totalCount > INIT_PER_PAGE && (
{!isLoading && data && (
<Pagination
count={data.totalCount}
page={page}
@@ -358,7 +358,7 @@ export const SecretMainPage = () => {
{!canReadSecret && folders?.length === 0 && <PermissionDeniedBanner />}
</div>
</div>
{!isDetailsLoading && totalCount > INIT_PER_PAGE && (
{!isDetailsLoading && (
<Pagination
startAdornment={
<SecretTableResourceCount
@@ -242,20 +242,12 @@ export const SecretOverviewPage = () => {
totalDynamicSecretCount
} = overview ?? {};
const { folderNames, getFolderByNameAndEnv, isFolderPresentInEnv } = useFolderOverview(
folders,
orderDirection
);
const { folderNames, getFolderByNameAndEnv, isFolderPresentInEnv } = useFolderOverview(folders);
const { dynamicSecretNames, isDynamicSecretPresentInEnv } = useDynamicSecretOverview(
dynamicSecrets,
orderDirection
);
const { dynamicSecretNames, isDynamicSecretPresentInEnv } =
useDynamicSecretOverview(dynamicSecrets);
const { secKeys, getSecretByKey, getEnvSecretKeyCount } = useSecretOverview(
secrets,
orderDirection
);
const { secKeys, getSecretByKey, getEnvSecretKeyCount } = useSecretOverview(secrets);
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
const { mutateAsync: updateSecretV3 } = useUpdateSecretV3();
@@ -961,7 +953,7 @@ export const SecretOverviewPage = () => {
</Tr>
</TFoot>
</Table>
{!isOverviewLoading && totalCount > INIT_PER_PAGE && (
{!isOverviewLoading && (
<Pagination
startAdornment={
<SecretTableResourceCount