Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: upgrade react-query to v5 and changed hooks to staletime inf for prev context based ones

=7042d734108b
diff --git a/frontend-v2/src/components/auth/EnterEmailStep.tsx b/frontend-v2/src/components/auth/EnterEmailStep.tsx
index 689dad2f86..a74e9611cc 100644
--- a/frontend-v2/src/components/auth/EnterEmailStep.tsx
+++ b/frontend-v2/src/components/auth/EnterEmailStep.tsx
@@ -27,7 +27,7 @@ export default function EnterEmailStep({
setEmail,
incrementStep
}: DownloadBackupPDFStepProps): JSX.Element {
- const { mutateAsync, isLoading } = useSendVerificationEmail();
+ const { mutateAsync, isPending } = useSendVerificationEmail();
const [emailError, setEmailError] = useState(false);
const { t } = useTranslation();
@@ -95,8 +95,8 @@ export default function EnterEmailStep({
className="h-14"
colorSchema="primary"
variant="outline_bg"
- isLoading={isLoading}
- isDisabled={isLoading}
+ isLoading={isPending}
+ isDisabled={isPending}
>
{" "}
{String(t("signup.step1-submit"))}{" "}
diff --git a/frontend-v2/src/components/license/UpgradePlanModal/UpgradePlanModal.tsx b/frontend-v2/src/components/license/UpgradePlanModal/UpgradePlanModal.tsx
index 09af0139cc..76ddd4dbb6 100644
--- a/frontend-v2/src/components/license/UpgradePlanModal/UpgradePlanModal.tsx
+++ b/frontend-v2/src/components/license/UpgradePlanModal/UpgradePlanModal.tsx
@@ -13,7 +13,7 @@ type Props = {
export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => {
const { subscription } = useSubscription();
const { currentOrg } = useOrganization();
- const { mutateAsync, isLoading } = useGetOrgTrialUrl();
+ const { mutateAsync, isPending } = useGetOrgTrialUrl();
const link =
subscription && subscription.slug !== null
? `/org/${currentOrg?.id}/billing`
@@ -50,7 +50,7 @@ export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Ele
</p>
<div className="mt-8 flex items-center">
<Button
- isLoading={isLoading}
+ isLoading={isPending}
colorSchema="primary"
onClick={handleUpgradeBtnClick}
className="mr-4"
diff --git a/frontend-v2/src/components/mfa/TotpRegistration.tsx b/frontend-v2/src/components/mfa/TotpRegistration.tsx
index d9d73748f9..b6e2ebe2ab 100644
--- a/frontend-v2/src/components/mfa/TotpRegistration.tsx
+++ b/frontend-v2/src/components/mfa/TotpRegistration.tsx
@@ -14,8 +14,8 @@ type Props = {
};
const TotpRegistration = ({ onComplete, shouldCenterQr }: Props) => {
- const { data: registration, isLoading } = useGetUserTotpRegistration();
- const { mutateAsync: verifyUserTotp, isLoading: isVerifyLoading } =
+ const { data: registration, isPending } = useGetUserTotpRegistration();
+ const { mutateAsync: verifyUserTotp, isPending: isVerifyLoading } =
useVerifyUserTotpRegistration();
const [qrCodeUrl, setQrCodeUrl] = useState("");
const [totp, setTotp] = useState("");
@@ -47,7 +47,7 @@ const TotpRegistration = ({ onComplete, shouldCenterQr }: Props) => {
generateQRCode();
}, [registration]);
- if (isLoading) {
+ if (isPending) {
return <ContentLoader />;
}
diff --git a/frontend-v2/src/components/navigation/NavHeader.tsx b/frontend-v2/src/components/navigation/NavHeader.tsx
index 5393442afc..0077c4bf32 100644
--- a/frontend-v2/src/components/navigation/NavHeader.tsx
+++ b/frontend-v2/src/components/navigation/NavHeader.tsx
@@ -128,16 +128,13 @@ export default function NavHeader({
<div className="flex items-center space-x-3">
<FontAwesomeIcon icon={faAngleRight} className="ml-3 mr-1.5 text-xs text-gray-400" />
<Link
- passHref
- legacyBehavior
- href={{
- pathname: "/project/[id]/secrets/[env]",
+ to={{
+ pathname: "/project/[id]/secrets/[env]" as const,
query: { id: navigate.query.id, env: navigate.query.env }
}}
+ className="text-sm font-semibold text-primary/80 hover:text-primary"
>
- <a className="text-sm font-semibold text-primary/80 hover:text-primary">
- {userAvailableEnvs?.find(({ slug }) => slug === currentEnv)?.name}
- </a>
+ {userAvailableEnvs?.find(({ slug }) => slug === currentEnv)?.name}
</Link>
</div>
)}
diff --git a/frontend-v2/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx b/frontend-v2/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx
deleted file mode 100644
index 19621a25d9..0000000000
--- a/frontend-v2/src/components/v2/UpgradePlanModal/UpgradePlanModal.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { useOrganization, useSubscription } from "@app/context";
-import { useGetOrgTrialUrl } from "@app/hooks/api";
-
-import { Button } from "../Button";
-import { Modal, ModalContent } from "../Modal";
-
-type Props = {
- isOpen?: boolean;
- onOpenChange?: (isOpen: boolean) => void;
- text: string;
-};
-
-export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => {
- const { subscription } = useSubscription();
- const { currentOrg } = useOrganization();
- const { mutateAsync, isLoading } = useGetOrgTrialUrl();
- const link =
- subscription && subscription.slug !== null
- ? `/org/${currentOrg?.id}/billing`
- : "https://infisical.com/scheduledemo";
-
- const handleUpgradeBtnClick = async () => {
- try {
- if (!subscription || !currentOrg) return;
-
- if (!subscription.has_used_trial) {
- // direct user to start pro trial
-
- const url = await mutateAsync({
- orgId: currentOrg.id,
- success_url: window.location.href
- });
-
- window.location.href = url;
- } else {
- // direct user to upgrade their plan
- window.location.href = link;
- }
- } catch (err) {
- console.error(err);
- }
- };
-
- return (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent title="Unleash Infisical's Full Power">
- <p className="mb-2 text-bunker-300">{text}</p>
- <p className="text-bunker-300">
- Upgrade and get access to this, as well as to other powerful enhancements.
- </p>
- <div className="mt-8 flex items-center">
- <Button
- isLoading={isLoading}
- colorSchema="primary"
- onClick={handleUpgradeBtnClick}
- className="mr-4"
- >
- {subscription && !subscription.has_used_trial ? "Start Pro Free Trial" : "Upgrade Plan"}
- </Button>
- <Button
- colorSchema="secondary"
- variant="plain"
- onClick={() => onOpenChange && onOpenChange(false)}
- >
- Cancel
- </Button>
- </div>
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend-v2/src/components/v2/UpgradePlanModal/index.tsx b/frontend-v2/src/components/v2/UpgradePlanModal/index.tsx
deleted file mode 100644
index 09a53d31cf..0000000000
--- a/frontend-v2/src/components/v2/UpgradePlanModal/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { UpgradePlanModal } from "./UpgradePlanModal";
diff --git a/frontend-v2/src/components/v2/index.tsx b/frontend-v2/src/components/v2/index.tsx
index f35d006e97..8e195102b3 100644
--- a/frontend-v2/src/components/v2/index.tsx
+++ b/frontend-v2/src/components/v2/index.tsx
@@ -34,4 +34,3 @@ export * from "./Tabs";
export * from "./Tag";
export * from "./TextArea";
export * from "./Tooltip";
-export * from "./UpgradePlanModal";
diff --git a/frontend-v2/src/context/OrgPermissionContext/OrgPermissionContext.tsx b/frontend-v2/src/context/OrgPermissionContext/OrgPermissionContext.tsx
index 1d399dedfe..15389d3f65 100644
--- a/frontend-v2/src/context/OrgPermissionContext/OrgPermissionContext.tsx
+++ b/frontend-v2/src/context/OrgPermissionContext/OrgPermissionContext.tsx
@@ -1,10 +1,32 @@
+import { createMongoAbility, MongoAbility, RawRuleOf } from "@casl/ability";
+import { unpackRules } from "@casl/ability/extra";
+import { useSuspenseQuery } from "@tanstack/react-query";
import { useRouteContext } from "@tanstack/react-router";
+import {
+ conditionsMatcher,
+ fetchUserOrgPermissions,
+ roleQueryKeys
+} from "@app/hooks/api/roles/queries";
+
+import { OrgPermissionSet } from "./types";
+
export const useOrgPermission = () => {
- const ctx = useRouteContext({
+ const organizationId = useRouteContext({
from: "/_authenticate/_org_details",
- select: (el) => el.orgPermission
+ select: (el) => el.organizationId
+ });
+
+ const { data } = useSuspenseQuery({
+ queryKey: roleQueryKeys.getUserOrgPermissions({ orgId: organizationId }),
+ queryFn: () => fetchUserOrgPermissions({ orgId: organizationId }),
+ select: (res) => {
+ const rule = unpackRules<RawRuleOf<MongoAbility<OrgPermissionSet>>>(res.permissions);
+ const ability = createMongoAbility<OrgPermissionSet>(rule, { conditionsMatcher });
+ return { permission: ability, membership: res.membership };
+ },
+ staleTime: Infinity
});
- return ctx;
+ return data;
};
diff --git a/frontend-v2/src/context/OrganizationContext/OrganizationContext.tsx b/frontend-v2/src/context/OrganizationContext/OrganizationContext.tsx
index 78c4717591..b1898d12ad 100644
--- a/frontend-v2/src/context/OrganizationContext/OrganizationContext.tsx
+++ b/frontend-v2/src/context/OrganizationContext/OrganizationContext.tsx
@@ -1,9 +1,18 @@
+import { useSuspenseQuery } from "@tanstack/react-query";
import { useRouteContext } from "@tanstack/react-router";
+import { fetchOrganizationById, organizationKeys } from "@app/hooks/api/organization/queries";
+
export const useOrganization = () => {
- const currentOrg = useRouteContext({
+ const organizationId = useRouteContext({
from: "/_authenticate/_org_details",
- select: (el) => el.organization
+ select: (el) => el.organizationId
+ });
+
+ const { data: currentOrg } = useSuspenseQuery({
+ queryKey: organizationKeys.getOrgById(organizationId),
+ queryFn: () => fetchOrganizationById(organizationId),
+ staleTime: Infinity
});
return { currentOrg };
diff --git a/frontend-v2/src/context/ServerConfigContext/ServerConfigContext.tsx b/frontend-v2/src/context/ServerConfigContext/ServerConfigContext.tsx
index 3af31dbb75..acc63118b9 100644
--- a/frontend-v2/src/context/ServerConfigContext/ServerConfigContext.tsx
+++ b/frontend-v2/src/context/ServerConfigContext/ServerConfigContext.tsx
@@ -1,10 +1,12 @@
-import { adminQueryKeys, fetchServerConfig } from "@app/hooks/api/admin/queries";
import { useSuspenseQuery } from "@tanstack/react-query";
+import { adminQueryKeys, fetchServerConfig } from "@app/hooks/api/admin/queries";
+
export const useServerConfig = () => {
const { data: config } = useSuspenseQuery({
queryKey: adminQueryKeys.serverConfig(),
- queryFn: fetchServerConfig
+ queryFn: fetchServerConfig,
+ staleTime: Infinity
});
return { config };
diff --git a/frontend-v2/src/context/SubscriptionContext/SubscriptionContext.tsx b/frontend-v2/src/context/SubscriptionContext/SubscriptionContext.tsx
index ac563b5f15..447ac948c0 100644
--- a/frontend-v2/src/context/SubscriptionContext/SubscriptionContext.tsx
+++ b/frontend-v2/src/context/SubscriptionContext/SubscriptionContext.tsx
@@ -1,9 +1,18 @@
+import { useSuspenseQuery } from "@tanstack/react-query";
import { useRouteContext } from "@tanstack/react-router";
+import { fetchOrgSubscription, subscriptionQueryKeys } from "@app/hooks/api/subscriptions/queries";
+
export const useSubscription = () => {
- const subscription = useRouteContext({
+ const organizationId = useRouteContext({
from: "/_authenticate/_org_details",
- select: (el) => el.subscription
+ select: (el) => el.organizationId
+ });
+
+ const { data: subscription } = useSuspenseQuery({
+ queryKey: subscriptionQueryKeys.getOrgSubsription(organizationId),
+ queryFn: () => fetchOrgSubscription(organizationId),
+ staleTime: Infinity
});
return { subscription };
diff --git a/frontend-v2/src/context/UserContext/UserContext.tsx b/frontend-v2/src/context/UserContext/UserContext.tsx
index 507e0aaea3..eafde94657 100644
--- a/frontend-v2/src/context/UserContext/UserContext.tsx
+++ b/frontend-v2/src/context/UserContext/UserContext.tsx
@@ -1,7 +1,14 @@
-import { useRouteContext } from "@tanstack/react-router";
+import { useSuspenseQuery } from "@tanstack/react-query";
+
+import { userKeys } from "@app/hooks/api";
+import { fetchUserDetails } from "@app/hooks/api/users/queries";
export const useUser = () => {
- const user = useRouteContext({ from: "/_authenticate", select: (el) => el.user })!;
+ const { data: user } = useSuspenseQuery({
+ queryKey: userKeys.getUser,
+ queryFn: fetchUserDetails,
+ staleTime: Infinity
+ });
return { user };
};
diff --git a/frontend-v2/src/hooks/api/accessApproval/mutation.tsx b/frontend-v2/src/hooks/api/accessApproval/mutation.tsx
index 32cc9c1785..115b731868 100644
--- a/frontend-v2/src/hooks/api/accessApproval/mutation.tsx
+++ b/frontend-v2/src/hooks/api/accessApproval/mutation.tsx
@@ -37,7 +37,9 @@ export const useCreateAccessApprovalPolicy = () => {
return data;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(accessApprovalKeys.getAccessApprovalPolicies(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalPolicies(projectSlug)
+ });
}
});
};
@@ -57,7 +59,9 @@ export const useUpdateAccessApprovalPolicy = () => {
return data;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(accessApprovalKeys.getAccessApprovalPolicies(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalPolicies(projectSlug)
+ });
}
});
};
@@ -71,7 +75,9 @@ export const useDeleteAccessApprovalPolicy = () => {
return data;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(accessApprovalKeys.getAccessApprovalPolicies(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalPolicies(projectSlug)
+ });
}
});
};
@@ -96,7 +102,9 @@ export const useCreateAccessRequest = () => {
return data;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(accessApprovalKeys.getAccessApprovalRequestCount(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalRequestCount(projectSlug)
+ });
}
});
};
@@ -124,10 +132,12 @@ export const useReviewAccessRequest = () => {
return data;
},
onSuccess: (_, { projectSlug, envSlug, requestedBy }) => {
- queryClient.invalidateQueries(
- accessApprovalKeys.getAccessApprovalRequests(projectSlug, envSlug, requestedBy)
- );
- queryClient.invalidateQueries(accessApprovalKeys.getAccessApprovalRequestCount(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalRequests(projectSlug, envSlug, requestedBy)
+ });
+ queryClient.invalidateQueries({
+ queryKey: accessApprovalKeys.getAccessApprovalRequestCount(projectSlug)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/accessApproval/queries.tsx b/frontend-v2/src/hooks/api/accessApproval/queries.tsx
index 599962e433..1aa40c588a 100644
--- a/frontend-v2/src/hooks/api/accessApproval/queries.tsx
+++ b/frontend-v2/src/hooks/api/accessApproval/queries.tsx
@@ -1,7 +1,8 @@
import { PackRule, unpackRules } from "@casl/ability/extra";
-import { useQuery, UseQueryOptions } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
+import { TReactQueryOptions } from "@app/types/reactQuery";
import { TProjectPermission } from "../roles/types";
import {
@@ -41,15 +42,9 @@ export const useGetAccessPolicyApprovalCount = ({
projectSlug,
envSlug,
options = {}
-}: TGetAccessPolicyApprovalCountDTO & {
- options?: UseQueryOptions<
- number,
- unknown,
- number,
- ReturnType<typeof accessApprovalKeys.getAccessApprovalPolicies>
- >;
-}) =>
+}: TGetAccessPolicyApprovalCountDTO & TReactQueryOptions) =>
useQuery({
+ queryKey: accessApprovalKeys.getAccessApprovalRequestCount(projectSlug),
queryFn: () => fetchPolicyApprovalCount({ projectSlug, envSlug }),
...options,
enabled: Boolean(projectSlug) && (options?.enabled ?? true)
@@ -99,14 +94,7 @@ const fetchAccessRequestsCount = async (projectSlug: string) => {
export const useGetAccessRequestsCount = ({
projectSlug,
options = {}
-}: TGetAccessApprovalRequestsDTO & {
- options?: UseQueryOptions<
- TAccessRequestCount,
- unknown,
- { pendingCount: number; finalizedCount: number },
- ReturnType<typeof accessApprovalKeys.getAccessApprovalRequestCount>
- >;
-}) =>
+}: TGetAccessApprovalRequestsDTO & TReactQueryOptions) =>
useQuery({
queryKey: accessApprovalKeys.getAccessApprovalRequestCount(projectSlug),
queryFn: () => fetchAccessRequestsCount(projectSlug),
@@ -119,14 +107,7 @@ export const useGetAccessApprovalPolicies = ({
envSlug,
authorProjectMembershipId,
options = {}
-}: TGetAccessApprovalRequestsDTO & {
- options?: UseQueryOptions<
- TAccessApprovalPolicy[],
- unknown,
- TAccessApprovalPolicy[],
- ReturnType<typeof accessApprovalKeys.getAccessApprovalPolicies>
- >;
-}) =>
+}: TGetAccessApprovalRequestsDTO & TReactQueryOptions) =>
useQuery({
queryKey: accessApprovalKeys.getAccessApprovalPolicies(projectSlug),
queryFn: () => fetchApprovalPolicies({ projectSlug, envSlug, authorProjectMembershipId }),
@@ -139,14 +120,7 @@ export const useGetAccessApprovalRequests = ({
envSlug,
authorProjectMembershipId,
options = {}
-}: TGetAccessApprovalRequestsDTO & {
- options?: UseQueryOptions<
- TAccessApprovalRequest[],
- unknown,
- TAccessApprovalRequest[],
- ReturnType<typeof accessApprovalKeys.getAccessApprovalRequests>
- >;
-}) =>
+}: TGetAccessApprovalRequestsDTO & TReactQueryOptions) =>
useQuery({
queryKey: accessApprovalKeys.getAccessApprovalRequests(
projectSlug,
diff --git a/frontend-v2/src/hooks/api/admin/mutation.ts b/frontend-v2/src/hooks/api/admin/mutation.ts
index 8c414910d9..c68760fa48 100644
--- a/frontend-v2/src/hooks/api/admin/mutation.ts
+++ b/frontend-v2/src/hooks/api/admin/mutation.ts
@@ -26,7 +26,7 @@ export const useCreateAdminUser = () => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(adminQueryKeys.serverConfig());
+ queryClient.invalidateQueries({ queryKey: adminQueryKeys.serverConfig() });
}
});
};
@@ -48,8 +48,8 @@ export const useUpdateServerConfig = () => {
},
onSuccess: (data) => {
queryClient.setQueryData(adminQueryKeys.serverConfig(), data);
- queryClient.invalidateQueries(adminQueryKeys.serverConfig());
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
+ queryClient.invalidateQueries({ queryKey: adminQueryKeys.serverConfig() });
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
}
});
};
@@ -82,7 +82,7 @@ export const useUpdateAdminSlackConfig = () => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(adminQueryKeys.getAdminSlackConfig());
+ queryClient.invalidateQueries({ queryKey: adminQueryKeys.getAdminSlackConfig() });
}
});
};
@@ -94,7 +94,7 @@ export const useUpdateServerEncryptionStrategy = () => {
await apiRequest.patch("/api/v1/admin/encryption-strategies", { strategy });
},
onSuccess: () => {
- queryClient.invalidateQueries(adminQueryKeys.getServerEncryptionStrategies());
+ queryClient.invalidateQueries({ queryKey: adminQueryKeys.getServerEncryptionStrategies() });
}
});
};
diff --git a/frontend-v2/src/hooks/api/admin/queries.ts b/frontend-v2/src/hooks/api/admin/queries.ts
index 215a47a9e4..12ae1cf646 100644
--- a/frontend-v2/src/hooks/api/admin/queries.ts
+++ b/frontend-v2/src/hooks/api/admin/queries.ts
@@ -48,6 +48,7 @@ export const useGetServerConfig = ({
export const useAdminGetUsers = (filters: AdminGetUsersFilters) => {
return useInfiniteQuery({
+ initialPageParam: 0,
queryKey: adminQueryKeys.getUsers(filters),
queryFn: async ({ pageParam }) => {
const { data } = await apiRequest.get<{ users: User[] }>(
diff --git a/frontend-v2/src/hooks/api/apiKeys/queries.tsx b/frontend-v2/src/hooks/api/apiKeys/queries.tsx
index c913b797c2..22997ec15b 100644
--- a/frontend-v2/src/hooks/api/apiKeys/queries.tsx
+++ b/frontend-v2/src/hooks/api/apiKeys/queries.tsx
@@ -22,7 +22,7 @@ export const useCreateAPIKeyV2 = () => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.myAPIKeysV2);
+ queryClient.invalidateQueries({ queryKey: userKeys.myAPIKeysV2 });
}
});
};
@@ -39,7 +39,7 @@ export const useUpdateAPIKeyV2 = () => {
return apiKeyData;
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.myAPIKeysV2);
+ queryClient.invalidateQueries({ queryKey: userKeys.myAPIKeysV2 });
}
});
};
@@ -54,7 +54,7 @@ export const useDeleteAPIKeyV2 = () => {
return apiKeyData;
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.myAPIKeysV2);
+ queryClient.invalidateQueries({ queryKey: userKeys.myAPIKeysV2 });
}
});
};
diff --git a/frontend-v2/src/hooks/api/auditLogStreams/mutations.tsx b/frontend-v2/src/hooks/api/auditLogStreams/mutations.tsx
index 88094ad6b7..1ed93f95b9 100644
--- a/frontend-v2/src/hooks/api/auditLogStreams/mutations.tsx
+++ b/frontend-v2/src/hooks/api/auditLogStreams/mutations.tsx
@@ -22,7 +22,7 @@ export const useCreateAuditLogStream = () => {
return data;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(auditLogStreamKeys.list(orgId));
+ queryClient.invalidateQueries({ queryKey: auditLogStreamKeys.list(orgId) });
}
});
};
@@ -39,7 +39,7 @@ export const useUpdateAuditLogStream = () => {
return data;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(auditLogStreamKeys.list(orgId));
+ queryClient.invalidateQueries({ queryKey: auditLogStreamKeys.list(orgId) });
}
});
};
@@ -55,7 +55,7 @@ export const useDeleteAuditLogStream = () => {
return data;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(auditLogStreamKeys.list(orgId));
+ queryClient.invalidateQueries({ queryKey: auditLogStreamKeys.list(orgId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/auditLogs/queries.tsx b/frontend-v2/src/hooks/api/auditLogs/queries.tsx
index 5ec69b0e72..3b851f1cb9 100644
--- a/frontend-v2/src/hooks/api/auditLogs/queries.tsx
+++ b/frontend-v2/src/hooks/api/auditLogs/queries.tsx
@@ -1,8 +1,9 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions, useQuery } from "@tanstack/react-query";
+import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
import { AxiosError } from "axios";
import { createNotification } from "@app/components/notifications";
import { apiRequest } from "@app/config/request";
+import { TReactQueryOptions } from "@app/types/reactQuery";
import { Actor, AuditLog, TGetAuditLogsFilter } from "./types";
@@ -16,18 +17,10 @@ export const auditLogKeys = {
export const useGetAuditLogs = (
filters: TGetAuditLogsFilter,
projectId: string | null,
- options: Omit<
- UseInfiniteQueryOptions<
- AuditLog[],
- unknown,
- AuditLog[],
- AuditLog[],
- ReturnType<typeof auditLogKeys.getAuditLogs>
- >,
- "queryFn" | "queryKey" | "getNextPageParam"
- > = {}
+ options: TReactQueryOptions["options"] = {}
) => {
return useInfiniteQuery({
+ initialPageParam: 0,
queryKey: auditLogKeys.getAuditLogs(projectId, filters),
queryFn: async ({ pageParam }) => {
try {
diff --git a/frontend-v2/src/hooks/api/auth/queries.tsx b/frontend-v2/src/hooks/api/auth/queries.tsx
index 23c7fc70e1..07baf011ea 100644
--- a/frontend-v2/src/hooks/api/auth/queries.tsx
+++ b/frontend-v2/src/hooks/api/auth/queries.tsx
@@ -304,13 +304,14 @@ export const fetchAuthToken = async () => {
const { data } = await apiRequest.post<GetAuthTokenAPI>("/api/v1/auth/token", undefined, {
withCredentials: true
});
-
+ setAuthToken(data.token);
return data;
};
export const useGetAuthToken = () =>
- useQuery(authKeys.getAuthToken, fetchAuthToken, {
- onSuccess: (data) => setAuthToken(data.token),
+ useQuery({
+ queryKey: authKeys.getAuthToken,
+ queryFn: fetchAuthToken,
retry: 0
});
diff --git a/frontend-v2/src/hooks/api/bots/queries.tsx b/frontend-v2/src/hooks/api/bots/queries.tsx
index 3c9915791f..8b2aedcddd 100644
--- a/frontend-v2/src/hooks/api/bots/queries.tsx
+++ b/frontend-v2/src/hooks/api/bots/queries.tsx
@@ -31,7 +31,7 @@ export const useUpdateBotActiveStatus = () => {
});
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getBot(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getBot(workspaceId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/ca/mutations.tsx b/frontend-v2/src/hooks/api/ca/mutations.tsx
index 7fd09f3466..93ac4e6f0a 100644
--- a/frontend-v2/src/hooks/api/ca/mutations.tsx
+++ b/frontend-v2/src/hooks/api/ca/mutations.tsx
@@ -29,7 +29,7 @@ export const useCreateCa = () => {
return ca;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCas({ projectSlug }));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
}
});
};
@@ -44,8 +44,8 @@ export const useUpdateCa = () => {
return ca;
},
onSuccess: ({ id }, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCas({ projectSlug }));
- queryClient.invalidateQueries(caKeys.getCaById(id));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaById(id) });
}
});
};
@@ -60,7 +60,7 @@ export const useDeleteCa = () => {
return ca;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCas({ projectSlug }));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
}
});
};
@@ -89,9 +89,9 @@ export const useImportCaCertificate = () => {
return data;
},
onSuccess: (_, { caId, projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCas({ projectSlug }));
- queryClient.invalidateQueries(caKeys.getCaCerts(caId));
- queryClient.invalidateQueries(caKeys.getCaCert(caId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCerts(caId) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCert(caId) });
}
});
};
@@ -108,7 +108,9 @@ export const useCreateCertificate = () => {
return data;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.forWorkspaceCertificates(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.forWorkspaceCertificates(projectSlug)
+ });
}
});
};
@@ -124,12 +126,12 @@ export const useRenewCa = () => {
return data;
},
onSuccess: (_, { caId, projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCas({ projectSlug }));
- queryClient.invalidateQueries(caKeys.getCaById(caId));
- queryClient.invalidateQueries(caKeys.getCaCert(caId));
- queryClient.invalidateQueries(caKeys.getCaCerts(caId));
- queryClient.invalidateQueries(caKeys.getCaCsr(caId));
- queryClient.invalidateQueries(caKeys.getCaCrl(caId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaById(caId) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCert(caId) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCerts(caId) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCsr(caId) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCrl(caId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/certificateTemplates/mutations.tsx b/frontend-v2/src/hooks/api/certificateTemplates/mutations.tsx
index f535439616..55bbcd4177 100644
--- a/frontend-v2/src/hooks/api/certificateTemplates/mutations.tsx
+++ b/frontend-v2/src/hooks/api/certificateTemplates/mutations.tsx
@@ -25,8 +25,10 @@ export const useCreateCertTemplate = () => {
return certificateTemplate;
},
onSuccess: ({ caId }, { projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCertificateTemplates(projectId));
- queryClient.invalidateQueries(caKeys.getCaCertTemplates(caId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceCertificateTemplates(projectId)
+ });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCertTemplates(caId) });
}
});
};
@@ -43,9 +45,11 @@ export const useUpdateCertTemplate = () => {
return certificateTemplate;
},
onSuccess: ({ caId }, { projectId, id }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCertificateTemplates(projectId));
- queryClient.invalidateQueries(certTemplateKeys.getCertTemplateById(id));
- queryClient.invalidateQueries(caKeys.getCaCertTemplates(caId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceCertificateTemplates(projectId)
+ });
+ queryClient.invalidateQueries({ queryKey: certTemplateKeys.getCertTemplateById(id) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCertTemplates(caId) });
}
});
};
@@ -60,9 +64,11 @@ export const useDeleteCertTemplate = () => {
return certificateTemplate;
},
onSuccess: ({ caId }, { projectId, id }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceCertificateTemplates(projectId));
- queryClient.invalidateQueries(certTemplateKeys.getCertTemplateById(id));
- queryClient.invalidateQueries(caKeys.getCaCertTemplates(caId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceCertificateTemplates(projectId)
+ });
+ queryClient.invalidateQueries({ queryKey: certTemplateKeys.getCertTemplateById(id) });
+ queryClient.invalidateQueries({ queryKey: caKeys.getCaCertTemplates(caId) });
}
});
};
@@ -78,7 +84,9 @@ export const useCreateEstConfig = () => {
return data;
},
onSuccess: (_, { certificateTemplateId }) => {
- queryClient.invalidateQueries(certTemplateKeys.getEstConfig(certificateTemplateId));
+ queryClient.invalidateQueries({
+ queryKey: certTemplateKeys.getEstConfig(certificateTemplateId)
+ });
}
});
};
@@ -94,7 +102,9 @@ export const useUpdateEstConfig = () => {
return data;
},
onSuccess: (_, { certificateTemplateId }) => {
- queryClient.invalidateQueries(certTemplateKeys.getEstConfig(certificateTemplateId));
+ queryClient.invalidateQueries({
+ queryKey: certTemplateKeys.getEstConfig(certificateTemplateId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/certificates/mutations.tsx b/frontend-v2/src/hooks/api/certificates/mutations.tsx
index 00747f114a..7e9cf4f91e 100644
--- a/frontend-v2/src/hooks/api/certificates/mutations.tsx
+++ b/frontend-v2/src/hooks/api/certificates/mutations.tsx
@@ -17,7 +17,9 @@ export const useDeleteCert = () => {
return certificate;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.forWorkspaceCertificates(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.forWorkspaceCertificates(projectSlug)
+ });
}
});
};
@@ -37,7 +39,9 @@ export const useRevokeCert = () => {
return certificate;
},
onSuccess: (_, { projectSlug }) => {
- queryClient.invalidateQueries(workspaceKeys.forWorkspaceCertificates(projectSlug));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.forWorkspaceCertificates(projectSlug)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/cmeks/mutations.tsx b/frontend-v2/src/hooks/api/cmeks/mutations.tsx
index f3a1e6eaeb..41e70c193c 100644
--- a/frontend-v2/src/hooks/api/cmeks/mutations.tsx
+++ b/frontend-v2/src/hooks/api/cmeks/mutations.tsx
@@ -22,7 +22,7 @@ export const useCreateCmek = () => {
return data;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(cmekKeys.getCmeksByProjectId({ projectId }));
+ queryClient.invalidateQueries({ queryKey: cmekKeys.getCmeksByProjectId({ projectId }) });
}
});
};
@@ -40,7 +40,7 @@ export const useUpdateCmek = () => {
return data;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(cmekKeys.getCmeksByProjectId({ projectId }));
+ queryClient.invalidateQueries({ queryKey: cmekKeys.getCmeksByProjectId({ projectId }) });
}
});
};
@@ -54,7 +54,7 @@ export const useDeleteCmek = () => {
return data;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(cmekKeys.getCmeksByProjectId({ projectId }));
+ queryClient.invalidateQueries({ queryKey: cmekKeys.getCmeksByProjectId({ projectId }) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/cmeks/queries.tsx b/frontend-v2/src/hooks/api/cmeks/queries.tsx
index 5c2dac8952..69eedfb429 100644
--- a/frontend-v2/src/hooks/api/cmeks/queries.tsx
+++ b/frontend-v2/src/hooks/api/cmeks/queries.tsx
@@ -47,7 +47,7 @@ export const useGetCmeksByProjectId = (
return data;
},
enabled: Boolean(projectId) && (options?.enabled ?? true),
- keepPreviousData: true,
+ placeholderData: (previousData) => previousData,
...options
});
};
diff --git a/frontend-v2/src/hooks/api/dashboard/queries.tsx b/frontend-v2/src/hooks/api/dashboard/queries.tsx
index 3aa5997168..4b63be9883 100644
--- a/frontend-v2/src/hooks/api/dashboard/queries.tsx
+++ b/frontend-v2/src/hooks/api/dashboard/queries.tsx
@@ -1,8 +1,6 @@
import { useCallback } from "react";
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
-import axios from "axios";
-import { createNotification } from "@app/components/notifications";
import { apiRequest } from "@app/config/request";
import {
DashboardProjectSecretsByKeys,
@@ -175,26 +173,6 @@ export const useGetProjectSecretsOverview = (
includeDynamicSecrets,
environments
}),
- onError: (error) => {
- if (axios.isAxiosError(error)) {
- const { message, requestId } = error.response?.data as {
- message: string;
- requestId: string;
- };
- createNotification({
- title: "Error fetching secret details",
- type: "error",
- text: message,
- copyActions: [
- {
- value: requestId,
- name: "Request ID",
- label: `Request ID: ${requestId}`
- }
- ]
- });
- }
- },
select: useCallback((data: Awaited<ReturnType<typeof fetchProjectSecretsOverview>>) => {
const { secrets, ...select } = data;
const uniqueSecrets = secrets ? unique(secrets, (i) => i.secretKey) : [];
@@ -213,7 +191,7 @@ export const useGetProjectSecretsOverview = (
totalUniqueFoldersInPage: uniqueFolders.length
};
}, []),
- keepPreviousData: true
+ placeholderData: (previousData) => previousData
});
};
@@ -278,26 +256,6 @@ export const useGetProjectSecretsDetails = (
includeDynamicSecrets,
tags
}),
- onError: (error) => {
- if (axios.isAxiosError(error)) {
- const { message, requestId } = error.response?.data as {
- message: string;
- requestId: string;
- };
- createNotification({
- title: "Error fetching secret details",
- type: "error",
- text: message,
- copyActions: [
- {
- value: requestId,
- name: "Request ID",
- label: `Request ID: ${requestId}`
- }
- ]
- });
- }
- },
select: useCallback(
(data: Awaited<ReturnType<typeof fetchProjectSecretsDetails>>) => ({
...data,
@@ -305,7 +263,7 @@ export const useGetProjectSecretsDetails = (
}),
[]
),
- keepPreviousData: true
+ placeholderData: (previousData) => previousData
});
};
@@ -373,26 +331,6 @@ export const useGetProjectSecretsQuickSearch = (
environments,
tags
}),
- onError: (error) => {
- if (axios.isAxiosError(error)) {
- const { message, requestId } = error.response?.data as {
- message: string;
- requestId: string;
- };
- createNotification({
- title: "Error fetching secrets deep search",
- type: "error",
- text: message,
- copyActions: [
- {
- value: requestId,
- name: "Request ID",
- label: `Request ID: ${requestId}`
- }
- ]
- });
- }
- },
select: useCallback((data: Awaited<ReturnType<typeof fetchProjectSecretsQuickSearch>>) => {
const { secrets, folders, dynamicSecrets } = data;
@@ -413,6 +351,6 @@ export const useGetProjectSecretsQuickSearch = (
dynamicSecrets: groupedDynamicSecrets
};
}, []),
- keepPreviousData: true
+ placeholderData: (previousData) => previousData
});
};
diff --git a/frontend-v2/src/hooks/api/dynamicSecret/mutation.ts b/frontend-v2/src/hooks/api/dynamicSecret/mutation.ts
index b630132d28..e347e44931 100644
--- a/frontend-v2/src/hooks/api/dynamicSecret/mutation.ts
+++ b/frontend-v2/src/hooks/api/dynamicSecret/mutation.ts
@@ -24,8 +24,10 @@ export const useCreateDynamicSecret = () => {
},
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
// TODO: optimize but we currently don't pass projectId
- queryClient.invalidateQueries(dashboardKeys.all());
- queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
+ queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
+ });
}
});
};
@@ -43,8 +45,10 @@ export const useUpdateDynamicSecret = () => {
},
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
// TODO: optimize but currently don't pass projectId
- queryClient.invalidateQueries(dashboardKeys.all());
- queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
+ queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
+ });
}
});
};
@@ -62,8 +66,10 @@ export const useDeleteDynamicSecret = () => {
},
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
// TODO: optimize but currently don't pass projectId
- queryClient.invalidateQueries(dashboardKeys.all());
- queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
+ queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/dynamicSecretLease/mutation.ts b/frontend-v2/src/hooks/api/dynamicSecretLease/mutation.ts
index d1c6149f7a..1a95a3ab0e 100644
--- a/frontend-v2/src/hooks/api/dynamicSecretLease/mutation.ts
+++ b/frontend-v2/src/hooks/api/dynamicSecretLease/mutation.ts
@@ -26,9 +26,14 @@ export const useCreateDynamicSecretLease = () => {
return data;
},
onSuccess: (_, { path, environmentSlug, projectSlug, dynamicSecretName }) => {
- queryClient.invalidateQueries(
- dynamicSecretLeaseKeys.list({ path, projectSlug, environmentSlug, dynamicSecretName })
- );
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretLeaseKeys.list({
+ path,
+ projectSlug,
+ environmentSlug,
+ dynamicSecretName
+ })
+ });
}
});
};
@@ -45,9 +50,14 @@ export const useRenewDynamicSecretLease = () => {
return data.lease;
},
onSuccess: (_, { path, environmentSlug, projectSlug, dynamicSecretName }) => {
- queryClient.invalidateQueries(
- dynamicSecretLeaseKeys.list({ path, projectSlug, environmentSlug, dynamicSecretName })
- );
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretLeaseKeys.list({
+ path,
+ projectSlug,
+ environmentSlug,
+ dynamicSecretName
+ })
+ });
}
});
};
@@ -64,9 +74,14 @@ export const useRevokeDynamicSecretLease = () => {
return data.lease;
},
onSuccess: (_, { path, environmentSlug, projectSlug, dynamicSecretName }) => {
- queryClient.invalidateQueries(
- dynamicSecretLeaseKeys.list({ path, projectSlug, environmentSlug, dynamicSecretName })
- );
+ queryClient.invalidateQueries({
+ queryKey: dynamicSecretLeaseKeys.list({
+ path,
+ projectSlug,
+ environmentSlug,
+ dynamicSecretName
+ })
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx b/frontend-v2/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
index aac46726a1..ccf4f567db 100644
--- a/frontend-v2/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
+++ b/frontend-v2/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
@@ -13,7 +13,7 @@ export const useUpdateExternalGroupOrgRoleMappings = () => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(externalGroupOrgRoleMappingKeys.list());
+ queryClient.invalidateQueries({ queryKey: externalGroupOrgRoleMappingKeys.list() });
}
});
};
diff --git a/frontend-v2/src/hooks/api/groups/mutations.tsx b/frontend-v2/src/hooks/api/groups/mutations.tsx
index 2f5c5984ce..d45971995f 100644
--- a/frontend-v2/src/hooks/api/groups/mutations.tsx
+++ b/frontend-v2/src/hooks/api/groups/mutations.tsx
@@ -29,7 +29,7 @@ export const useCreateGroup = () => {
return group;
},
onSuccess: (_, { organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgGroups(organizationId));
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getOrgGroups(organizationId) });
}
});
};
@@ -57,8 +57,8 @@ export const useUpdateGroup = () => {
return group;
},
onSuccess: ({ orgId, id: groupId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgGroups(orgId));
- queryClient.invalidateQueries(groupKeys.getGroupById(groupId));
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getOrgGroups(orgId) });
+ queryClient.invalidateQueries({ queryKey: groupKeys.getGroupById(groupId) });
}
});
};
@@ -72,8 +72,8 @@ export const useDeleteGroup = () => {
return group;
},
onSuccess: ({ orgId, id: groupId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgGroups(orgId));
- queryClient.invalidateQueries(groupKeys.getGroupById(groupId));
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getOrgGroups(orgId) });
+ queryClient.invalidateQueries({ queryKey: groupKeys.getGroupById(groupId) });
}
});
};
@@ -94,7 +94,7 @@ export const useAddUserToGroup = () => {
return data;
},
onSuccess: (_, { slug }) => {
- queryClient.invalidateQueries(groupKeys.forGroupUserMemberships(slug));
+ queryClient.invalidateQueries({ queryKey: groupKeys.forGroupUserMemberships(slug) });
}
});
};
@@ -117,8 +117,8 @@ export const useRemoveUserFromGroup = () => {
return data;
},
onSuccess: (_, { slug, username }) => {
- queryClient.invalidateQueries(groupKeys.forGroupUserMemberships(slug));
- queryClient.invalidateQueries(userKeys.listUserGroupMemberships(username));
+ queryClient.invalidateQueries({ queryKey: groupKeys.forGroupUserMemberships(slug) });
+ queryClient.invalidateQueries({ queryKey: userKeys.listUserGroupMemberships(username) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/groups/queries.tsx b/frontend-v2/src/hooks/api/groups/queries.tsx
index dc3791db79..eb10085bc7 100644
--- a/frontend-v2/src/hooks/api/groups/queries.tsx
+++ b/frontend-v2/src/hooks/api/groups/queries.tsx
@@ -60,7 +60,7 @@ export const useListGroupUsers = ({
filter
}),
enabled: Boolean(groupSlug),
- keepPreviousData: true,
+ placeholderData: (previousData) => previousData,
queryFn: async () => {
const params = new URLSearchParams({
offset: String(offset),
diff --git a/frontend-v2/src/hooks/api/identities/mutations.tsx b/frontend-v2/src/hooks/api/identities/mutations.tsx
index 5efc69cad8..42de92e71b 100644
--- a/frontend-v2/src/hooks/api/identities/mutations.tsx
+++ b/frontend-v2/src/hooks/api/identities/mutations.tsx
@@ -63,7 +63,9 @@ export const useCreateIdentity = () => {
return identity;
},
onSuccess: (_, { organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
}
});
};
@@ -83,8 +85,10 @@ export const useUpdateIdentity = () => {
return identity;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
}
});
};
@@ -99,7 +103,9 @@ export const useDeleteIdentity = () => {
return identity;
},
onSuccess: (_, { organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
}
});
};
@@ -129,9 +135,13 @@ export const useAddIdentityUniversalAuth = () => {
return identityUniversalAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityUniversalAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
+ });
}
});
};
@@ -159,9 +169,13 @@ export const useUpdateIdentityUniversalAuth = () => {
return identityUniversalAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityUniversalAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
+ });
}
});
};
@@ -176,9 +190,13 @@ export const useDeleteIdentityUniversalAuth = () => {
return identityUniversalAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityUniversalAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
+ });
}
});
};
@@ -202,9 +220,9 @@ export const useCreateIdentityUniversalAuthClientSecret = () => {
return data;
},
onSuccess: (_, { identityId }) => {
- queryClient.invalidateQueries(
- identitiesKeys.getIdentityUniversalAuthClientSecrets(identityId)
- );
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuthClientSecrets(identityId)
+ });
}
});
};
@@ -221,9 +239,9 @@ export const useRevokeIdentityUniversalAuthClientSecret = () => {
return clientSecretData;
},
onSuccess: (_, { identityId }) => {
- queryClient.invalidateQueries(
- identitiesKeys.getIdentityUniversalAuthClientSecrets(identityId)
- );
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuthClientSecrets(identityId)
+ });
}
});
};
@@ -261,9 +279,11 @@ export const useAddIdentityGcpAuth = () => {
return identityGcpAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityGcpAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityGcpAuth(identityId) });
}
});
};
@@ -301,9 +321,11 @@ export const useUpdateIdentityGcpAuth = () => {
return identityGcpAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityGcpAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityGcpAuth(identityId) });
}
});
};
@@ -318,9 +340,11 @@ export const useDeleteIdentityGcpAuth = () => {
return identityGcpAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityGcpAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityGcpAuth(identityId) });
}
});
};
@@ -356,9 +380,11 @@ export const useAddIdentityAwsAuth = () => {
return identityAwsAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAwsAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAwsAuth(identityId) });
}
});
};
@@ -394,9 +420,11 @@ export const useUpdateIdentityAwsAuth = () => {
return identityAwsAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAwsAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAwsAuth(identityId) });
}
});
};
@@ -411,9 +439,11 @@ export const useDeleteIdentityAwsAuth = () => {
return identityAwsAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAwsAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAwsAuth(identityId) });
}
});
};
@@ -455,9 +485,11 @@ export const useUpdateIdentityOidcAuth = () => {
return identityOidcAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityOidcAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOidcAuth(identityId) });
}
});
};
@@ -499,9 +531,11 @@ export const useAddIdentityOidcAuth = () => {
return identityOidcAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityOidcAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOidcAuth(identityId) });
}
});
};
@@ -516,9 +550,11 @@ export const useDeleteIdentityOidcAuth = () => {
return identityOidcAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityOidcAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOidcAuth(identityId) });
}
});
};
@@ -563,9 +599,11 @@ export const useUpdateIdentityJwtAuth = () => {
return identityJwtAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityJwtAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityJwtAuth(identityId) });
}
});
};
@@ -611,9 +649,11 @@ export const useAddIdentityJwtAuth = () => {
return identityJwtAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityJwtAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityJwtAuth(identityId) });
}
});
};
@@ -628,9 +668,11 @@ export const useDeleteIdentityJwtAuth = () => {
return identityJwtAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityJwtAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityJwtAuth(identityId) });
}
});
};
@@ -666,9 +708,13 @@ export const useAddIdentityAzureAuth = () => {
return identityAzureAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityKubernetesAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityKubernetesAuth(identityId)
+ });
}
});
};
@@ -710,9 +756,11 @@ export const useAddIdentityKubernetesAuth = () => {
return identityKubernetesAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAzureAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAzureAuth(identityId) });
}
});
};
@@ -748,9 +796,11 @@ export const useUpdateIdentityAzureAuth = () => {
return identityAzureAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAzureAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAzureAuth(identityId) });
}
});
};
@@ -765,9 +815,11 @@ export const useDeleteIdentityAzureAuth = () => {
return identityAzureAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityAzureAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityAzureAuth(identityId) });
}
});
};
@@ -809,9 +861,13 @@ export const useUpdateIdentityKubernetesAuth = () => {
return identityKubernetesAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityKubernetesAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityKubernetesAuth(identityId)
+ });
}
});
};
@@ -826,9 +882,13 @@ export const useDeleteIdentityKubernetesAuth = () => {
return identityKubernetesAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityKubernetesAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityKubernetesAuth(identityId)
+ });
}
});
};
@@ -858,9 +918,13 @@ export const useAddIdentityTokenAuth = () => {
return identityTokenAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityUniversalAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
+ });
}
});
};
@@ -890,9 +954,13 @@ export const useUpdateIdentityTokenAuth = () => {
return identityTokenAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityUniversalAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityUniversalAuth(identityId)
+ });
}
});
};
@@ -907,9 +975,11 @@ export const useDeleteIdentityTokenAuth = () => {
return identityTokenAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
- queryClient.invalidateQueries(organizationKeys.getOrgIdentityMemberships(organizationId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityById(identityId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityTokenAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
+ });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
+ queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityTokenAuth(identityId) });
}
});
};
@@ -928,7 +998,9 @@ export const useCreateTokenIdentityTokenAuth = () => {
return data;
},
onSuccess: (_, { identityId }) => {
- queryClient.invalidateQueries(identitiesKeys.getIdentityTokensTokenAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityTokensTokenAuth(identityId)
+ });
}
});
};
@@ -949,7 +1021,9 @@ export const useUpdateIdentityTokenAuthToken = () => {
return token;
},
onSuccess: (_, { identityId }) => {
- queryClient.invalidateQueries(identitiesKeys.getIdentityTokensTokenAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityTokensTokenAuth(identityId)
+ });
}
});
};
@@ -965,7 +1039,9 @@ export const useRevokeIdentityTokenAuthToken = () => {
return data;
},
onSuccess: (_, { identityId }) => {
- queryClient.invalidateQueries(identitiesKeys.getIdentityTokensTokenAuth(identityId));
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityTokensTokenAuth(identityId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/identities/queries.tsx b/frontend-v2/src/hooks/api/identities/queries.tsx
index 49136614eb..0058823591 100644
--- a/frontend-v2/src/hooks/api/identities/queries.tsx
+++ b/frontend-v2/src/hooks/api/identities/queries.tsx
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
+import { TReactQueryOptions } from "@app/types/reactQuery";
import {
ClientSecretData,
@@ -69,12 +70,7 @@ export const useGetIdentityProjectMemberships = (identityId: string) => {
export const useGetIdentityUniversalAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityUniversalAuth,
- unknown,
- IdentityUniversalAuth,
- ReturnType<typeof identitiesKeys.getIdentityUniversalAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityUniversalAuth(identityId),
@@ -86,7 +82,7 @@ export const useGetIdentityUniversalAuth = (
);
return identityUniversalAuth;
},
- cacheTime: 0,
+ gcTime: 0,
staleTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
@@ -110,12 +106,7 @@ export const useGetIdentityUniversalAuthClientSecrets = (identityId: string) =>
export const useGetIdentityGcpAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityGcpAuth,
- unknown,
- IdentityGcpAuth,
- ReturnType<typeof identitiesKeys.getIdentityGcpAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityGcpAuth(identityId),
@@ -128,7 +119,7 @@ export const useGetIdentityGcpAuth = (
return identityGcpAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -136,12 +127,7 @@ export const useGetIdentityGcpAuth = (
export const useGetIdentityAwsAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityAwsAuth,
- unknown,
- IdentityAwsAuth,
- ReturnType<typeof identitiesKeys.getIdentityAwsAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityAwsAuth(identityId),
@@ -154,7 +140,7 @@ export const useGetIdentityAwsAuth = (
return identityAwsAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -162,12 +148,7 @@ export const useGetIdentityAwsAuth = (
export const useGetIdentityAzureAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityAzureAuth,
- unknown,
- IdentityAzureAuth,
- ReturnType<typeof identitiesKeys.getIdentityAzureAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityAzureAuth(identityId),
@@ -180,7 +161,7 @@ export const useGetIdentityAzureAuth = (
return identityAzureAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -188,12 +169,7 @@ export const useGetIdentityAzureAuth = (
export const useGetIdentityKubernetesAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityKubernetesAuth,
- unknown,
- IdentityKubernetesAuth,
- ReturnType<typeof identitiesKeys.getIdentityKubernetesAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityKubernetesAuth(identityId),
@@ -206,7 +182,7 @@ export const useGetIdentityKubernetesAuth = (
return identityKubernetesAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -214,12 +190,7 @@ export const useGetIdentityKubernetesAuth = (
export const useGetIdentityTokenAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityTokenAuth,
- unknown,
- IdentityTokenAuth,
- ReturnType<typeof identitiesKeys.getIdentityTokenAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityTokenAuth(identityId),
@@ -232,7 +203,7 @@ export const useGetIdentityTokenAuth = (
return identityTokenAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -255,12 +226,7 @@ export const useGetIdentityTokensTokenAuth = (identityId: string) => {
export const useGetIdentityOidcAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityOidcAuth,
- unknown,
- IdentityOidcAuth,
- ReturnType<typeof identitiesKeys.getIdentityOidcAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityOidcAuth(identityId),
@@ -273,7 +239,7 @@ export const useGetIdentityOidcAuth = (
return identityOidcAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
@@ -281,12 +247,7 @@ export const useGetIdentityOidcAuth = (
export const useGetIdentityJwtAuth = (
identityId: string,
- options?: UseQueryOptions<
- IdentityJwtAuth,
- unknown,
- IdentityJwtAuth,
- ReturnType<typeof identitiesKeys.getIdentityJwtAuth>
- >
+ options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityJwtAuth(identityId),
@@ -300,7 +261,7 @@ export const useGetIdentityJwtAuth = (
return identityJwtAuth;
},
staleTime: 0,
- cacheTime: 0,
+ gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
diff --git a/frontend-v2/src/hooks/api/identityProjectAdditionalPrivilege/mutation.tsx b/frontend-v2/src/hooks/api/identityProjectAdditionalPrivilege/mutation.tsx
index 167eea73e3..96b0c420a0 100644
--- a/frontend-v2/src/hooks/api/identityProjectAdditionalPrivilege/mutation.tsx
+++ b/frontend-v2/src/hooks/api/identityProjectAdditionalPrivilege/mutation.tsx
@@ -19,7 +19,9 @@ export const useCreateIdentityProjectAdditionalPrivilege = () => {
return data.privilege;
},
onSuccess: (_, { projectId, identityId }) => {
- queryClient.invalidateQueries(identitiyProjectPrivilegeKeys.list({ projectId, identityId }));
+ queryClient.invalidateQueries({
+ queryKey: identitiyProjectPrivilegeKeys.list({ projectId, identityId })
+ });
}
});
};
@@ -43,7 +45,9 @@ export const useUpdateIdentityProjectAdditionalPrivilege = () => {
return res.privilege;
},
onSuccess: (_, { projectId, identityId }) => {
- queryClient.invalidateQueries(identitiyProjectPrivilegeKeys.list({ projectId, identityId }));
+ queryClient.invalidateQueries({
+ queryKey: identitiyProjectPrivilegeKeys.list({ projectId, identityId })
+ });
}
});
};
@@ -66,7 +70,9 @@ export const useDeleteIdentityProjectAdditionalPrivilege = () => {
return data.privilege;
},
onSuccess: (_, { projectId, identityId }) => {
- queryClient.invalidateQueries(identitiyProjectPrivilegeKeys.list({ projectId, identityId }));
+ queryClient.invalidateQueries({
+ queryKey: identitiyProjectPrivilegeKeys.list({ projectId, identityId })
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/incidentContacts/queries.tsx b/frontend-v2/src/hooks/api/incidentContacts/queries.tsx
index 04611879c2..d79117e535 100644
--- a/frontend-v2/src/hooks/api/incidentContacts/queries.tsx
+++ b/frontend-v2/src/hooks/api/incidentContacts/queries.tsx
@@ -33,7 +33,7 @@ export const useAddIncidentContact = () => {
return data;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(incidentContactKeys.getAllContact(orgId));
+ queryClient.invalidateQueries({ queryKey: incidentContactKeys.getAllContact(orgId) });
}
});
};
@@ -49,7 +49,7 @@ export const useDeleteIncidentContact = () => {
return data;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(incidentContactKeys.getAllContact(orgId));
+ queryClient.invalidateQueries({ queryKey: incidentContactKeys.getAllContact(orgId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/integrationAuth/queries.tsx b/frontend-v2/src/hooks/api/integrationAuth/queries.tsx
index e43f4cc68c..813fa4cb8f 100644
--- a/frontend-v2/src/hooks/api/integrationAuth/queries.tsx
+++ b/frontend-v2/src/hooks/api/integrationAuth/queries.tsx
@@ -914,7 +914,9 @@ export const useAuthorizeIntegration = () => {
return integrationAuth;
},
onSuccess: (res) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceAuthorization(res.workspace));
+ queryClient.invalidateQueries({
+ queryKey: { queryKey: workspaceKeys.getWorkspaceAuthorization(res.workspace) }
+ });
}
});
};
@@ -958,7 +960,9 @@ export const useSaveIntegrationAccessToken = () => {
return integrationAuth;
},
onSuccess: (res) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceAuthorization(res.workspace));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceAuthorization(res.workspace)
+ });
}
});
};
@@ -975,8 +979,12 @@ export const useDeleteIntegrationAuths = () => {
})}`
),
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceAuthorization(workspaceId));
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIntegrations(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceAuthorization(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIntegrations(workspaceId)
+ });
}
});
};
@@ -988,8 +996,12 @@ export const useDeleteIntegrationAuth = () => {
return useMutation<object, object, { id: string; workspaceId: string }>({
mutationFn: ({ id }) => apiRequest.delete(`/api/v1/integration-auth/${id}`),
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceAuthorization(workspaceId));
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIntegrations(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceAuthorization(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIntegrations(workspaceId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/integrations/queries.tsx b/frontend-v2/src/hooks/api/integrations/queries.tsx
index 414cf691c8..2b90d5e9a3 100644
--- a/frontend-v2/src/hooks/api/integrations/queries.tsx
+++ b/frontend-v2/src/hooks/api/integrations/queries.tsx
@@ -114,7 +114,9 @@ export const useCreateIntegration = () => {
return integration;
},
onSuccess: (res) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIntegrations(res.workspace));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIntegrations(res.workspace)
+ });
}
});
};
@@ -132,8 +134,12 @@ export const useDeleteIntegration = () => {
`/api/v1/integration/${id}?shouldDeleteIntegrationSecrets=${shouldDeleteIntegrationSecrets}`
),
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIntegrations(workspaceId));
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceAuthorization(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIntegrations(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceAuthorization(workspaceId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/kms/mutations.tsx b/frontend-v2/src/hooks/api/kms/mutations.tsx
index b87c495c93..2bf27bf6a0 100644
--- a/frontend-v2/src/hooks/api/kms/mutations.tsx
+++ b/frontend-v2/src/hooks/api/kms/mutations.tsx
@@ -24,7 +24,7 @@ export const useAddExternalKms = (orgId: string) => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(kmsKeys.getExternalKmsList(orgId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getExternalKmsList(orgId) });
}
});
};
@@ -49,8 +49,8 @@ export const useUpdateExternalKms = (orgId: string) => {
return data;
},
onSuccess: (_, { kmsId }) => {
- queryClient.invalidateQueries(kmsKeys.getExternalKmsList(orgId));
- queryClient.invalidateQueries(kmsKeys.getExternalKmsById(kmsId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getExternalKmsList(orgId) });
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getExternalKmsById(kmsId) });
}
});
};
@@ -64,7 +64,7 @@ export const useRemoveExternalKms = (orgId: string) => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(kmsKeys.getExternalKmsList(orgId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getExternalKmsList(orgId) });
}
});
};
@@ -82,7 +82,7 @@ export const useUpdateProjectKms = (projectId: string) => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(kmsKeys.getActiveProjectKms(projectId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getActiveProjectKms(projectId) });
}
});
};
@@ -98,7 +98,7 @@ export const useLoadProjectKmsBackup = (projectId: string) => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(kmsKeys.getActiveProjectKms(projectId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getActiveProjectKms(projectId) });
}
});
};
@@ -139,7 +139,7 @@ export const useExternalKmsFetchGcpKeys = (orgId: string) => {
return data;
},
onSuccess: () => {
- queryClient.invalidateQueries(kmsKeys.getExternalKmsList(orgId));
+ queryClient.invalidateQueries({ queryKey: kmsKeys.getExternalKmsList(orgId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/ldapConfig/mutations.tsx b/frontend-v2/src/hooks/api/ldapConfig/mutations.tsx
index 2014f52bd0..6bab003cba 100644
--- a/frontend-v2/src/hooks/api/ldapConfig/mutations.tsx
+++ b/frontend-v2/src/hooks/api/ldapConfig/mutations.tsx
@@ -49,7 +49,7 @@ export const useCreateLDAPConfig = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(ldapConfigKeys.getLDAPConfig(dto.organizationId));
+ queryClient.invalidateQueries({ queryKey: ldapConfigKeys.getLDAPConfig(dto.organizationId) });
}
});
};
@@ -99,7 +99,7 @@ export const useUpdateLDAPConfig = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(ldapConfigKeys.getLDAPConfig(dto.organizationId));
+ queryClient.invalidateQueries({ queryKey: ldapConfigKeys.getLDAPConfig(dto.organizationId) });
}
});
};
@@ -123,7 +123,7 @@ export const useCreateLDAPGroupMapping = () => {
return data;
},
onSuccess(_, { ldapConfigId }) {
- queryClient.invalidateQueries(ldapConfigKeys.getLDAPGroupMaps(ldapConfigId));
+ queryClient.invalidateQueries({ queryKey: ldapConfigKeys.getLDAPGroupMaps(ldapConfigId) });
}
});
};
@@ -144,7 +144,7 @@ export const useDeleteLDAPGroupMapping = () => {
return data;
},
onSuccess(_, { ldapConfigId }) {
- queryClient.invalidateQueries(ldapConfigKeys.getLDAPGroupMaps(ldapConfigId));
+ queryClient.invalidateQueries({ queryKey: ldapConfigKeys.getLDAPGroupMaps(ldapConfigId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/migration/mutations.tsx b/frontend-v2/src/hooks/api/migration/mutations.tsx
index f40fbb05f5..c2b903f8a6 100644
--- a/frontend-v2/src/hooks/api/migration/mutations.tsx
+++ b/frontend-v2/src/hooks/api/migration/mutations.tsx
@@ -34,7 +34,9 @@ export const useImportEnvKey = () => {
}
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/oidcConfig/mutations.tsx b/frontend-v2/src/hooks/api/oidcConfig/mutations.tsx
index 9f57c0332b..b29ebd333f 100644
--- a/frontend-v2/src/hooks/api/oidcConfig/mutations.tsx
+++ b/frontend-v2/src/hooks/api/oidcConfig/mutations.tsx
@@ -53,8 +53,8 @@ export const useUpdateOIDCConfig = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(oidcConfigKeys.getOIDCConfig(dto.orgSlug));
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
+ queryClient.invalidateQueries({ queryKey: oidcConfigKeys.getOIDCConfig(dto.orgSlug) });
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
}
});
};
@@ -107,7 +107,7 @@ export const useCreateOIDCConfig = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(oidcConfigKeys.getOIDCConfig(dto.orgSlug));
+ queryClient.invalidateQueries({ queryKey: oidcConfigKeys.getOIDCConfig(dto.orgSlug) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/organization/queries.tsx b/frontend-v2/src/hooks/api/organization/queries.tsx
index a99be251f3..2eddda50a8 100644
--- a/frontend-v2/src/hooks/api/organization/queries.tsx
+++ b/frontend-v2/src/hooks/api/organization/queries.tsx
@@ -92,7 +92,7 @@ export const useCreateOrg = (options: { invalidate: boolean } = { invalidate: tr
},
onSuccess: () => {
if (options?.invalidate) {
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
}
}
});
@@ -122,7 +122,7 @@ export const useUpdateOrg = () => {
});
},
onSuccess: () => {
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
}
});
};
@@ -226,7 +226,9 @@ export const useUpdateOrgBillingDetails = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getOrgBillingDetails(dto.organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgBillingDetails(dto.organizationId)
+ });
}
});
};
@@ -271,7 +273,9 @@ export const useAddOrgPmtMethod = () => {
return url;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getOrgPmtMethods(dto.organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPmtMethods(dto.organizationId)
+ });
}
});
};
@@ -294,7 +298,9 @@ export const useDeleteOrgPmtMethod = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getOrgPmtMethods(dto.organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPmtMethods(dto.organizationId)
+ });
}
});
};
@@ -337,7 +343,9 @@ export const useAddOrgTaxId = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getOrgTaxIds(dto.organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgTaxIds(dto.organizationId)
+ });
}
});
};
@@ -354,7 +362,9 @@ export const useDeleteOrgTaxId = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getOrgTaxIds(dto.organizationId));
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgTaxIds(dto.organizationId)
+ });
}
});
};
@@ -461,20 +471,34 @@ export const useDeleteOrgById = () => {
return organization;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
- queryClient.invalidateQueries(organizationKeys.getOrgPlanBillingInfo(dto.organizationId));
- queryClient.invalidateQueries(organizationKeys.getOrgPlanTable(dto.organizationId));
- queryClient.invalidateQueries(
- organizationKeys.getOrgPlansTable(dto.organizationId, "monthly")
- ); // You might need to invalidate for 'yearly' as well.
- queryClient.invalidateQueries(
- organizationKeys.getOrgPlansTable(dto.organizationId, "yearly")
- );
- queryClient.invalidateQueries(organizationKeys.getOrgBillingDetails(dto.organizationId));
- queryClient.invalidateQueries(organizationKeys.getOrgPmtMethods(dto.organizationId));
- queryClient.invalidateQueries(organizationKeys.getOrgTaxIds(dto.organizationId));
- queryClient.invalidateQueries(organizationKeys.getOrgInvoices(dto.organizationId));
- queryClient.invalidateQueries(organizationKeys.getOrgLicenses(dto.organizationId));
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPlanBillingInfo(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPlanTable(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPlansTable(dto.organizationId, "monthly")
+ }); // You might need to invalidate for 'yearly' as well.
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPlansTable(dto.organizationId, "yearly")
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgBillingDetails(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgPmtMethods(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgTaxIds(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgInvoices(dto.organizationId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: organizationKeys.getOrgLicenses(dto.organizationId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/pkiAlerts/mutations.tsx b/frontend-v2/src/hooks/api/pkiAlerts/mutations.tsx
index 1a5159df76..34397c1412 100644
--- a/frontend-v2/src/hooks/api/pkiAlerts/mutations.tsx
+++ b/frontend-v2/src/hooks/api/pkiAlerts/mutations.tsx
@@ -14,7 +14,7 @@ export const useCreatePkiAlert = () => {
return alert;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiAlerts(projectId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspacePkiAlerts(projectId) });
}
});
};
@@ -30,8 +30,8 @@ export const useUpdatePkiAlert = () => {
return alert;
},
onSuccess: (_, { projectId, alertId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiAlerts(projectId));
- queryClient.invalidateQueries(pkiAlertKeys.getPkiAlertById(alertId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspacePkiAlerts(projectId) });
+ queryClient.invalidateQueries({ queryKey: pkiAlertKeys.getPkiAlertById(alertId) });
}
});
};
@@ -44,8 +44,8 @@ export const useDeletePkiAlert = () => {
return alert;
},
onSuccess: (_, { projectId, alertId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiAlerts(projectId));
- queryClient.invalidateQueries(pkiAlertKeys.getPkiAlertById(alertId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspacePkiAlerts(projectId) });
+ queryClient.invalidateQueries({ queryKey: pkiAlertKeys.getPkiAlertById(alertId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/pkiCollections/mutations.tsx b/frontend-v2/src/hooks/api/pkiCollections/mutations.tsx
index 8451befcf4..af1f0af185 100644
--- a/frontend-v2/src/hooks/api/pkiCollections/mutations.tsx
+++ b/frontend-v2/src/hooks/api/pkiCollections/mutations.tsx
@@ -25,7 +25,9 @@ export const useCreatePkiCollection = () => {
return pkiCollection;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiCollections(projectId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspacePkiCollections(projectId)
+ });
}
});
};
@@ -41,8 +43,12 @@ export const useUpdatePkiCollection = () => {
return pkiCollection;
},
onSuccess: (_, { projectId, collectionId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiCollections(projectId));
- queryClient.invalidateQueries(pkiCollectionKeys.getPkiCollectionById(collectionId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspacePkiCollections(projectId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: pkiCollectionKeys.getPkiCollectionById(collectionId)
+ });
}
});
};
@@ -57,8 +63,12 @@ export const useDeletePkiCollection = () => {
return pkiCollection;
},
onSuccess: (_, { projectId, collectionId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspacePkiCollections(projectId));
- queryClient.invalidateQueries(pkiCollectionKeys.getPkiCollectionById(collectionId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspacePkiCollections(projectId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: pkiCollectionKeys.getPkiCollectionById(collectionId)
+ });
}
});
};
@@ -77,7 +87,9 @@ export const useAddItemToPkiCollection = () => {
return pkiCollectionItem;
},
onSuccess: (_, { collectionId }) => {
- queryClient.invalidateQueries(pkiCollectionKeys.getPkiCollectionItems(collectionId));
+ queryClient.invalidateQueries({
+ queryKey: pkiCollectionKeys.getPkiCollectionItems(collectionId)
+ });
}
});
};
@@ -92,7 +104,9 @@ export const useRemoveItemFromPkiCollection = () => {
return pkiCollectionItem;
},
onSuccess: (_, { collectionId }) => {
- queryClient.invalidateQueries(pkiCollectionKeys.getPkiCollectionItems(collectionId));
+ queryClient.invalidateQueries({
+ queryKey: pkiCollectionKeys.getPkiCollectionItems(collectionId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/projectTemplates/mutations.tsx b/frontend-v2/src/hooks/api/projectTemplates/mutations.tsx
index 7056f738ed..fdffec1b7e 100644
--- a/frontend-v2/src/hooks/api/projectTemplates/mutations.tsx
+++ b/frontend-v2/src/hooks/api/projectTemplates/mutations.tsx
@@ -20,7 +20,7 @@ export const useCreateProjectTemplate = () => {
return data.projectTemplate;
},
- onSuccess: () => queryClient.invalidateQueries(projectTemplateKeys.list())
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: projectTemplateKeys.list() })
});
};
@@ -36,8 +36,8 @@ export const useUpdateProjectTemplate = () => {
return data.projectTemplate;
},
onSuccess: (_, { templateId }) => {
- queryClient.invalidateQueries(projectTemplateKeys.list());
- queryClient.invalidateQueries(projectTemplateKeys.byId(templateId));
+ queryClient.invalidateQueries({ queryKey: projectTemplateKeys.list() });
+ queryClient.invalidateQueries({ queryKey: projectTemplateKeys.byId(templateId) });
}
});
};
@@ -51,8 +51,8 @@ export const useDeleteProjectTemplate = () => {
return data;
},
onSuccess: (_, { templateId }) => {
- queryClient.invalidateQueries(projectTemplateKeys.list());
- queryClient.invalidateQueries(projectTemplateKeys.byId(templateId));
+ queryClient.invalidateQueries({ queryKey: projectTemplateKeys.list() });
+ queryClient.invalidateQueries({ queryKey: projectTemplateKeys.byId(templateId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/projectUserAdditionalPrivilege/mutation.tsx b/frontend-v2/src/hooks/api/projectUserAdditionalPrivilege/mutation.tsx
index 32ecc36d41..79d7d7f23d 100644
--- a/frontend-v2/src/hooks/api/projectUserAdditionalPrivilege/mutation.tsx
+++ b/frontend-v2/src/hooks/api/projectUserAdditionalPrivilege/mutation.tsx
@@ -19,7 +19,9 @@ export const useCreateProjectUserAdditionalPrivilege = () => {
return data.privilege;
},
onSuccess: (_, { projectMembershipId }) => {
- queryClient.invalidateQueries(projectUserPrivilegeKeys.list(projectMembershipId));
+ queryClient.invalidateQueries({
+ queryKey: projectUserPrivilegeKeys.list(projectMembershipId)
+ });
}
});
};
@@ -36,7 +38,9 @@ export const useUpdateProjectUserAdditionalPrivilege = () => {
return data.privilege;
},
onSuccess: (_, { projectMembershipId }) => {
- queryClient.invalidateQueries(projectUserPrivilegeKeys.list(projectMembershipId));
+ queryClient.invalidateQueries({
+ queryKey: projectUserPrivilegeKeys.list(projectMembershipId)
+ });
}
});
};
@@ -52,7 +56,9 @@ export const useDeleteProjectUserAdditionalPrivilege = () => {
return data.privilege;
},
onSuccess: (_, { projectMembershipId }) => {
- queryClient.invalidateQueries(projectUserPrivilegeKeys.list(projectMembershipId));
+ queryClient.invalidateQueries({
+ queryKey: projectUserPrivilegeKeys.list(projectMembershipId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/rateLimit/mutation.ts b/frontend-v2/src/hooks/api/rateLimit/mutation.ts
index 2bc79b81d6..d2aea631ba 100644
--- a/frontend-v2/src/hooks/api/rateLimit/mutation.ts
+++ b/frontend-v2/src/hooks/api/rateLimit/mutation.ts
@@ -15,7 +15,7 @@ export const useUpdateRateLimit = () => {
},
onSuccess: (data) => {
queryClient.setQueryData(rateLimitQueryKeys.rateLimit(), data);
- queryClient.invalidateQueries(rateLimitQueryKeys.rateLimit());
+ queryClient.invalidateQueries({ queryKey: rateLimitQueryKeys.rateLimit() });
}
});
};
diff --git a/frontend-v2/src/hooks/api/roles/mutation.tsx b/frontend-v2/src/hooks/api/roles/mutation.tsx
index 80921063da..8d662f993f 100644
--- a/frontend-v2/src/hooks/api/roles/mutation.tsx
+++ b/frontend-v2/src/hooks/api/roles/mutation.tsx
@@ -26,7 +26,7 @@ export const useCreateProjectRole = () => {
return role;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(roleQueryKeys.getProjectRoles(projectId));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getProjectRoles(projectId) });
}
});
};
@@ -42,9 +42,11 @@ export const useUpdateProjectRole = () => {
return role;
},
onSuccess: (_, { projectId, slug }) => {
- queryClient.invalidateQueries(roleQueryKeys.getProjectRoles(projectId));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getProjectRoles(projectId) });
if (slug) {
- queryClient.invalidateQueries(roleQueryKeys.getProjectRoleBySlug(projectId, slug));
+ queryClient.invalidateQueries({
+ queryKey: roleQueryKeys.getProjectRoleBySlug(projectId, slug)
+ });
}
}
});
@@ -60,7 +62,7 @@ export const useDeleteProjectRole = () => {
return role;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(roleQueryKeys.getProjectRoles(projectId));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getProjectRoles(projectId) });
}
});
};
@@ -80,7 +82,7 @@ export const useCreateOrgRole = () => {
return role;
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(roleQueryKeys.getOrgRoles(orgId));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getOrgRoles(orgId) });
}
});
};
@@ -100,8 +102,8 @@ export const useUpdateOrgRole = () => {
return role;
},
onSuccess: (_, { id, orgId }) => {
- queryClient.invalidateQueries(roleQueryKeys.getOrgRoles(orgId));
- queryClient.invalidateQueries(roleQueryKeys.getOrgRole(orgId, id));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getOrgRoles(orgId) });
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getOrgRole(orgId, id) });
}
});
};
@@ -120,8 +122,8 @@ export const useDeleteOrgRole = () => {
return role;
},
onSuccess: (_, { id, orgId }) => {
- queryClient.invalidateQueries(roleQueryKeys.getOrgRoles(orgId));
- queryClient.invalidateQueries(roleQueryKeys.getOrgRole(orgId, id));
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getOrgRoles(orgId) });
+ queryClient.invalidateQueries({ queryKey: roleQueryKeys.getOrgRole(orgId, id) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/scim/mutations.tsx b/frontend-v2/src/hooks/api/scim/mutations.tsx
index 259b140c14..341ad02024 100644
--- a/frontend-v2/src/hooks/api/scim/mutations.tsx
+++ b/frontend-v2/src/hooks/api/scim/mutations.tsx
@@ -18,7 +18,7 @@ export const useCreateScimToken = () => {
return data;
},
onSuccess: (_, { organizationId }) => {
- queryClient.invalidateQueries(scimKeys.getScimTokens(organizationId));
+ queryClient.invalidateQueries({ queryKey: scimKeys.getScimTokens(organizationId) });
}
});
};
@@ -31,7 +31,7 @@ export const useDeleteScimToken = () => {
return data;
},
onSuccess: (_, { organizationId }) => {
- queryClient.invalidateQueries(scimKeys.getScimTokens(organizationId));
+ queryClient.invalidateQueries({ queryKey: scimKeys.getScimTokens(organizationId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/secretApproval/mutation.tsx b/frontend-v2/src/hooks/api/secretApproval/mutation.tsx
index 75fdfff87c..f5ffad7b0e 100644
--- a/frontend-v2/src/hooks/api/secretApproval/mutation.tsx
+++ b/frontend-v2/src/hooks/api/secretApproval/mutation.tsx
@@ -30,7 +30,9 @@ export const useCreateSecretApprovalPolicy = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretApprovalKeys.getApprovalPolicies(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: secretApprovalKeys.getApprovalPolicies(workspaceId)
+ });
}
});
};
@@ -50,7 +52,9 @@ export const useUpdateSecretApprovalPolicy = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretApprovalKeys.getApprovalPolicies(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: secretApprovalKeys.getApprovalPolicies(workspaceId)
+ });
}
});
};
@@ -64,7 +68,9 @@ export const useDeleteSecretApprovalPolicy = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretApprovalKeys.getApprovalPolicies(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: secretApprovalKeys.getApprovalPolicies(workspaceId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/secretApproval/queries.tsx b/frontend-v2/src/hooks/api/secretApproval/queries.tsx
index ae90ff766d..52c3743fbf 100644
--- a/frontend-v2/src/hooks/api/secretApproval/queries.tsx
+++ b/frontend-v2/src/hooks/api/secretApproval/queries.tsx
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
+import { TReactQueryOptions } from "@app/types/reactQuery";
import {
TGetSecretApprovalPoliciesDTO,
@@ -28,14 +29,7 @@ const fetchApprovalPolicies = async (workspaceId: string) => {
export const useGetSecretApprovalPolicies = ({
workspaceId,
options = {}
-}: TGetSecretApprovalPoliciesDTO & {
- options?: UseQueryOptions<
- TSecretApprovalPolicy[],
- unknown,
- TSecretApprovalPolicy[],
- ReturnType<typeof secretApprovalKeys.getApprovalPolicies>
- >;
-}) =>
+}: TGetSecretApprovalPoliciesDTO & TReactQueryOptions) =>
useQuery({
queryKey: secretApprovalKeys.getApprovalPolicies(workspaceId),
queryFn: () => fetchApprovalPolicies(workspaceId),
@@ -60,14 +54,7 @@ export const useGetSecretApprovalPolicyOfABoard = ({
secretPath = "/",
environment,
options = {}
-}: TGetSecretApprovalPolicyOfBoardDTO & {
- options?: UseQueryOptions<
- TSecretApprovalPolicy,
- unknown,
- TSecretApprovalPolicy,
- ReturnType<typeof secretApprovalKeys.getApprovalPolicyOfABoard>
- >;
-}) =>
+}: TGetSecretApprovalPolicyOfBoardDTO & TReactQueryOptions) =>
useQuery({
queryKey: secretApprovalKeys.getApprovalPolicyOfABoard(workspaceId, environment, secretPath),
queryFn: () => fetchApprovalPolicyOfABoard(workspaceId, environment, secretPath),
diff --git a/frontend-v2/src/hooks/api/secretApprovalRequest/mutation.tsx b/frontend-v2/src/hooks/api/secretApprovalRequest/mutation.tsx
index 0366bf7cbd..ce584a85f6 100644
--- a/frontend-v2/src/hooks/api/secretApprovalRequest/mutation.tsx
+++ b/frontend-v2/src/hooks/api/secretApprovalRequest/mutation.tsx
@@ -20,7 +20,7 @@ export const useUpdateSecretApprovalReviewStatus = () => {
return data;
},
onSuccess: (_, { id }) => {
- queryClient.invalidateQueries(secretApprovalRequestKeys.detail({ id }));
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.detail({ id }) });
}
});
};
@@ -36,8 +36,8 @@ export const useUpdateSecretApprovalRequestStatus = () => {
return data;
},
onSuccess: (_, { id, workspaceId }) => {
- queryClient.invalidateQueries(secretApprovalRequestKeys.detail({ id }));
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.detail({ id }) });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
}
});
};
@@ -53,9 +53,9 @@ export const usePerformSecretApprovalRequestMerge = () => {
return data;
},
onSuccess: (_, { id, workspaceId }) => {
- queryClient.invalidateQueries(secretApprovalRequestKeys.detail({ id }));
- queryClient.invalidateQueries(secretApprovalRequestKeys.list({ workspaceId }));
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.detail({ id }) });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.list({ workspaceId }) });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/secretApprovalRequest/queries.tsx b/frontend-v2/src/hooks/api/secretApprovalRequest/queries.tsx
index a153160185..74acf744bd 100644
--- a/frontend-v2/src/hooks/api/secretApprovalRequest/queries.tsx
+++ b/frontend-v2/src/hooks/api/secretApprovalRequest/queries.tsx
@@ -1,16 +1,12 @@
/* eslint-disable no-param-reassign */
-import {
- useInfiniteQuery,
- UseInfiniteQueryOptions,
- useQuery,
- UseQueryOptions
-} from "@tanstack/react-query";
+import { useInfiniteQuery, useQuery, UseQueryOptions } from "@tanstack/react-query";
import {
decryptAssymmetric,
decryptSymmetric
} from "@app/components/utilities/cryptography/crypto";
import { apiRequest } from "@app/config/request";
+import { TReactQueryOptions } from "@app/types/reactQuery";
import { UserWsKeyPair } from "../keys/types";
import { EncryptedSecret, SecretType, SecretV3RawSanitized } from "../secrets/types";
@@ -147,18 +143,9 @@ export const useGetSecretApprovalRequests = ({
status,
limit = 20,
committer
-}: TGetSecretApprovalRequestList & {
- options?: Omit<
- UseInfiniteQueryOptions<
- TSecretApprovalRequest[],
- unknown,
- TSecretApprovalRequest[],
- ReturnType<typeof secretApprovalRequestKeys.list>
- >,
- "queryKey" | "queryFn"
- >;
-}) =>
+}: TGetSecretApprovalRequestList & TReactQueryOptions) =>
useInfiniteQuery({
+ initialPageParam: 0,
queryKey: secretApprovalRequestKeys.list({
workspaceId,
environment,
diff --git a/frontend-v2/src/hooks/api/secretFolders/queries.tsx b/frontend-v2/src/hooks/api/secretFolders/queries.tsx
index f3b1cb649a..b58dd3c053 100644
--- a/frontend-v2/src/hooks/api/secretFolders/queries.tsx
+++ b/frontend-v2/src/hooks/api/secretFolders/queries.tsx
@@ -125,21 +125,21 @@ export const useCreateFolder = () => {
return data;
},
onSuccess: (_, { projectId, environment, path }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({
projectId,
secretPath: path ?? "/"
})
- );
- queryClient.invalidateQueries(
- folderQueryKeys.getSecretFolders({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
- );
+ });
+ queryClient.invalidateQueries({
+ queryKey: folderQueryKeys.getSecretFolders({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
+ });
}
});
};
@@ -158,21 +158,21 @@ export const useUpdateFolder = () => {
return data;
},
onSuccess: (_, { projectId, environment, path }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({
projectId,
secretPath: path ?? "/"
})
- );
- queryClient.invalidateQueries(
- folderQueryKeys.getSecretFolders({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
- );
+ });
+ queryClient.invalidateQueries({
+ queryKey: folderQueryKeys.getSecretFolders({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
+ });
}
});
};
@@ -192,21 +192,21 @@ export const useDeleteFolder = () => {
return data;
},
onSuccess: (_, { path = "/", projectId, environment }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({
projectId,
secretPath: path
})
- );
- queryClient.invalidateQueries(
- folderQueryKeys.getSecretFolders({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
- );
+ });
+ queryClient.invalidateQueries({
+ queryKey: folderQueryKeys.getSecretFolders({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ workspaceId: projectId, environment, directory: path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ workspaceId: projectId, environment, directory: path })
+ });
}
});
};
@@ -225,33 +225,33 @@ export const useUpdateFolderBatch = () => {
},
onSuccess: (_, { projectId, folders }) => {
folders.forEach((folder) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({
projectId,
secretPath: folder.path ?? "/"
})
- );
- queryClient.invalidateQueries(
- folderQueryKeys.getSecretFolders({
+ });
+ queryClient.invalidateQueries({
+ queryKey: folderQueryKeys.getSecretFolders({
projectId,
environment: folder.environment,
path: folder.path
})
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({
workspaceId: projectId,
environment: folder.environment,
directory: folder.path
})
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({
workspaceId: projectId,
environment: folder.environment,
directory: folder.path
})
- );
+ });
});
}
});
diff --git a/frontend-v2/src/hooks/api/secretImports/mutation.tsx b/frontend-v2/src/hooks/api/secretImports/mutation.tsx
index 0f55333fd3..72254bae25 100644
--- a/frontend-v2/src/hooks/api/secretImports/mutation.tsx
+++ b/frontend-v2/src/hooks/api/secretImports/mutation.tsx
@@ -26,15 +26,15 @@ export const useCreateSecretImport = () => {
return data;
},
onSuccess: (_, { environment, projectId, path }) => {
- queryClient.invalidateQueries(
- secretImportKeys.getProjectSecretImports({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- secretImportKeys.getSecretImportSecrets({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
- );
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getProjectSecretImports({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getSecretImportSecrets({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
+ });
}
});
};
@@ -53,15 +53,15 @@ export const useUpdateSecretImport = () => {
return data;
},
onSuccess: (_, { environment, projectId, path }) => {
- queryClient.invalidateQueries(
- secretImportKeys.getProjectSecretImports({ projectId, path, environment })
- );
- queryClient.invalidateQueries(
- secretImportKeys.getSecretImportSecrets({ environment, path, projectId })
- );
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
- );
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getProjectSecretImports({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getSecretImportSecrets({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
+ });
}
});
};
@@ -94,15 +94,15 @@ export const useDeleteSecretImport = () => {
return data;
},
onSuccess: (_, { projectId, environment, path }) => {
- queryClient.invalidateQueries(
- secretImportKeys.getProjectSecretImports({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- secretImportKeys.getSecretImportSecrets({ projectId, environment, path })
- );
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
- );
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getProjectSecretImports({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretImportKeys.getSecretImportSecrets({ projectId, environment, path })
+ });
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId, secretPath: path ?? "/" })
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/secretRotation/mutation.tsx b/frontend-v2/src/hooks/api/secretRotation/mutation.tsx
index c62ea1eadb..6abb206b79 100644
--- a/frontend-v2/src/hooks/api/secretRotation/mutation.tsx
+++ b/frontend-v2/src/hooks/api/secretRotation/mutation.tsx
@@ -18,7 +18,7 @@ export const useCreateSecretRotation = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretRotationKeys.list({ workspaceId }));
+ queryClient.invalidateQueries({ queryKey: secretRotationKeys.list({ workspaceId }) });
}
});
};
@@ -32,7 +32,7 @@ export const useDeleteSecretRotation = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretRotationKeys.list({ workspaceId }));
+ queryClient.invalidateQueries({ queryKey: secretRotationKeys.list({ workspaceId }) });
}
});
};
@@ -46,7 +46,7 @@ export const useRestartSecretRotation = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(secretRotationKeys.list({ workspaceId }));
+ queryClient.invalidateQueries({ queryKey: secretRotationKeys.list({ workspaceId }) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/secretSharing/mutations.ts b/frontend-v2/src/hooks/api/secretSharing/mutations.ts
index e805abfd29..3f2a3c8ff8 100644
--- a/frontend-v2/src/hooks/api/secretSharing/mutations.ts
+++ b/frontend-v2/src/hooks/api/secretSharing/mutations.ts
@@ -20,7 +20,8 @@ export const useCreateSharedSecret = () => {
);
return data;
},
- onSuccess: () => queryClient.invalidateQueries(secretSharingKeys.allSharedSecrets())
+ onSuccess: () =>
+ queryClient.invalidateQueries({ queryKey: secretSharingKeys.allSharedSecrets() })
});
};
@@ -34,7 +35,8 @@ export const useCreatePublicSharedSecret = () => {
);
return data;
},
- onSuccess: () => queryClient.invalidateQueries(secretSharingKeys.allSharedSecrets())
+ onSuccess: () =>
+ queryClient.invalidateQueries({ queryKey: secretSharingKeys.allSharedSecrets() })
});
};
@@ -47,6 +49,7 @@ export const useDeleteSharedSecret = () => {
);
return data;
},
- onSuccess: () => queryClient.invalidateQueries(secretSharingKeys.allSharedSecrets())
+ onSuccess: () =>
+ queryClient.invalidateQueries({ queryKey: secretSharingKeys.allSharedSecrets() })
});
};
diff --git a/frontend-v2/src/hooks/api/secretSharing/queries.ts b/frontend-v2/src/hooks/api/secretSharing/queries.ts
index c267adabf4..84ada6c6fe 100644
--- a/frontend-v2/src/hooks/api/secretSharing/queries.ts
+++ b/frontend-v2/src/hooks/api/secretSharing/queries.ts
@@ -51,7 +51,6 @@ export const useGetActiveSharedSecretById = ({
}) => {
return useQuery({
queryKey: secretSharingKeys.getSecretById({ id: sharedSecretId, hashedHex, password }),
-
queryFn: async () => {
const { data } = await apiRequest.post<TViewSharedSecretResponse>(
`/api/v1/secret-sharing/public/${sharedSecretId}`,
@@ -62,8 +61,7 @@ export const useGetActiveSharedSecretById = ({
);
return data;
- }
- }, {
+ },
enabled: Boolean(sharedSecretId)
});
};
diff --git a/frontend-v2/src/hooks/api/secretSnapshots/queries.tsx b/frontend-v2/src/hooks/api/secretSnapshots/queries.tsx
index b9be2878d5..8a16b41806 100644
--- a/frontend-v2/src/hooks/api/secretSnapshots/queries.tsx
+++ b/frontend-v2/src/hooks/api/secretSnapshots/queries.tsx
@@ -47,6 +47,7 @@ const fetchWorkspaceSnaphots = async ({
export const useGetWorkspaceSnapshotList = (dto: TGetSecretSnapshotsDTO & { isPaused?: boolean }) =>
useInfiniteQuery({
+ initialPageParam: 0,
enabled: Boolean(dto.workspaceId && dto.environment) && !dto.isPaused,
queryKey: secretSnapshotKeys.list({ ...dto }),
queryFn: ({ pageParam }) => fetchWorkspaceSnaphots({ ...dto, offset: pageParam }),
@@ -149,23 +150,17 @@ export const usePerformSecretRollback = () => {
},
onSuccess: (_, { workspaceId, environment, directory }) => {
queryClient.invalidateQueries({
- queryKey: [
- { workspaceId, environment, secretPath: directory },
- "secrets"
- ]
+ queryKey: [{ workspaceId, environment, secretPath: directory }, "secrets"]
});
queryClient.invalidateQueries({
- queryKey: [
- "secret-folders",
- { projectId: workspaceId, environment, path: directory }
- ]
+ queryKey: ["secret-folders", { projectId: workspaceId, environment, path: directory }]
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ workspaceId, environment, directory })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ workspaceId, environment, directory })
});
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ workspaceId, environment, directory })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ workspaceId, environment, directory })
- );
}
});
};
diff --git a/frontend-v2/src/hooks/api/secrets/mutations.tsx b/frontend-v2/src/hooks/api/secrets/mutations.tsx
index 4dc52de587..efdb866cb9 100644
--- a/frontend-v2/src/hooks/api/secrets/mutations.tsx
+++ b/frontend-v2/src/hooks/api/secrets/mutations.tsx
@@ -47,19 +47,19 @@ export const useCreateSecretV3 = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -102,19 +102,19 @@ export const useUpdateSecretV3 = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -148,19 +148,19 @@ export const useDeleteSecretV3 = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -184,19 +184,19 @@ export const useCreateSecretBatch = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -220,19 +220,19 @@ export const useUpdateSecretBatch = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -258,19 +258,19 @@ export const useDeleteSecretBatch = ({
return data;
},
onSuccess: (_, { workspaceId, environment, secretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({ projectId: workspaceId, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({ environment, workspaceId, directory: secretPath })
+ });
+ queryClient.invalidateQueries({ queryKey: secretApprovalRequestKeys.count({ workspaceId }) });
},
...options
});
@@ -316,34 +316,36 @@ export const useMoveSecrets = ({
return data;
},
onSuccess: (_, { projectId, sourceEnvironment, sourceSecretPath }) => {
- queryClient.invalidateQueries(
- dashboardKeys.getDashboardSecrets({
+ queryClient.invalidateQueries({
+ queryKey: dashboardKeys.getDashboardSecrets({
projectId,
secretPath: sourceSecretPath
})
- );
- queryClient.invalidateQueries(
- secretKeys.getProjectSecret({
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretKeys.getProjectSecret({
workspaceId: projectId,
environment: sourceEnvironment,
secretPath: sourceSecretPath
})
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.list({
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.list({
environment: sourceEnvironment,
workspaceId: projectId,
directory: sourceSecretPath
})
- );
- queryClient.invalidateQueries(
- secretSnapshotKeys.count({
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretSnapshotKeys.count({
environment: sourceEnvironment,
workspaceId: projectId,
directory: sourceSecretPath
})
- );
- queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId: projectId }));
+ });
+ queryClient.invalidateQueries({
+ queryKey: secretApprovalRequestKeys.count({ workspaceId: projectId })
+ });
},
...options
});
diff --git a/frontend-v2/src/hooks/api/secrets/queries.tsx b/frontend-v2/src/hooks/api/secrets/queries.tsx
index a803ff50bb..4b95579c21 100644
--- a/frontend-v2/src/hooks/api/secrets/queries.tsx
+++ b/frontend-v2/src/hooks/api/secrets/queries.tsx
@@ -115,26 +115,6 @@ export const useGetProjectSecrets = ({
enabled: Boolean(workspaceId && environment) && (options?.enabled ?? true),
queryKey: secretKeys.getProjectSecret({ workspaceId, environment, secretPath }),
queryFn: () => fetchProjectSecrets({ workspaceId, environment, secretPath }),
- onError: (error) => {
- if (axios.isAxiosError(error)) {
- const { message, requestId } = error.response?.data as {
- message: string;
- requestId: string;
- };
- createNotification({
- title: "Error fetching secrets",
- type: "error",
- text: message,
- copyActions: [
- {
- value: requestId,
- name: "Request ID",
- label: `Request ID: ${requestId}`
- }
- ]
- });
- }
- },
select: useCallback(
(data: Awaited<ReturnType<typeof fetchProjectSecrets>>) => mergePersonalSecrets(data.secrets),
[]
diff --git a/frontend-v2/src/hooks/api/serviceTokens/queries.tsx b/frontend-v2/src/hooks/api/serviceTokens/queries.tsx
index 7911f95b8f..06b9b09c6f 100644
--- a/frontend-v2/src/hooks/api/serviceTokens/queries.tsx
+++ b/frontend-v2/src/hooks/api/serviceTokens/queries.tsx
@@ -43,7 +43,9 @@ export const useCreateServiceToken = () => {
return data;
},
onSuccess: ({ serviceTokenData: { projectId } }) => {
- queryClient.invalidateQueries(serviceTokenKeys.getAllWorkspaceServiceToken(projectId));
+ queryClient.invalidateQueries({
+ queryKey: serviceTokenKeys.getAllWorkspaceServiceToken(projectId)
+ });
}
});
};
@@ -57,7 +59,9 @@ export const useDeleteServiceToken = () => {
return data;
},
onSuccess: ({ serviceTokenData: { projectId } }) => {
- queryClient.invalidateQueries(serviceTokenKeys.getAllWorkspaceServiceToken(projectId));
+ queryClient.invalidateQueries({
+ queryKey: serviceTokenKeys.getAllWorkspaceServiceToken(projectId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/ssoConfig/queries.tsx b/frontend-v2/src/hooks/api/ssoConfig/queries.tsx
index 69abd4f846..17dda5c1de 100644
--- a/frontend-v2/src/hooks/api/ssoConfig/queries.tsx
+++ b/frontend-v2/src/hooks/api/ssoConfig/queries.tsx
@@ -55,7 +55,7 @@ export const useCreateSSOConfig = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(ssoConfigKeys.getSSOConfig(dto.organizationId));
+ queryClient.invalidateQueries({ queryKey: ssoConfigKeys.getSSOConfig(dto.organizationId) });
}
});
};
@@ -91,10 +91,10 @@ export const useUpdateSSOConfig = () => {
},
onSuccess(_, { organizationId, isActive }) {
if (isActive === false) {
- queryClient.invalidateQueries(organizationKeys.getUserOrganizations);
+ queryClient.invalidateQueries({ queryKey: organizationKeys.getUserOrganizations });
}
- queryClient.invalidateQueries(ssoConfigKeys.getSSOConfig(organizationId));
+ queryClient.invalidateQueries({ queryKey: ssoConfigKeys.getSSOConfig(organizationId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/tags/queries.tsx b/frontend-v2/src/hooks/api/tags/queries.tsx
index fa59751450..bdbb9659d8 100644
--- a/frontend-v2/src/hooks/api/tags/queries.tsx
+++ b/frontend-v2/src/hooks/api/tags/queries.tsx
@@ -39,7 +39,7 @@ export const useCreateWsTag = () => {
return data.workspaceTag;
},
onSuccess: (tagData) => {
- queryClient.invalidateQueries(workspaceTags.getWsTags(tagData?.projectId));
+ queryClient.invalidateQueries({ queryKey: workspaceTags.getWsTags(tagData?.projectId) });
}
});
};
@@ -55,7 +55,7 @@ export const useDeleteWsTag = () => {
return data.workspaceTag;
},
onSuccess: (tagData) => {
- queryClient.invalidateQueries(workspaceTags.getWsTags(tagData?.projectId));
+ queryClient.invalidateQueries({ queryKey: workspaceTags.getWsTags(tagData?.projectId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/trustedIps/queries.ts b/frontend-v2/src/hooks/api/trustedIps/queries.ts
index c8b4f922b1..57a5d58445 100644
--- a/frontend-v2/src/hooks/api/trustedIps/queries.ts
+++ b/frontend-v2/src/hooks/api/trustedIps/queries.ts
@@ -44,7 +44,7 @@ export const useAddTrustedIp = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(trustedIps.getTrustedIps(dto.workspaceId));
+ queryClient.invalidateQueries({ queryKey: trustedIps.getTrustedIps(dto.workspaceId) });
}
});
};
@@ -77,7 +77,7 @@ export const useUpdateTrustedIp = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(trustedIps.getTrustedIps(dto.workspaceId));
+ queryClient.invalidateQueries({ queryKey: trustedIps.getTrustedIps(dto.workspaceId) });
}
});
};
@@ -99,7 +99,7 @@ export const useDeleteTrustedIp = () => {
return data;
},
onSuccess(_, dto) {
- queryClient.invalidateQueries(trustedIps.getTrustedIps(dto.workspaceId));
+ queryClient.invalidateQueries({ queryKey: trustedIps.getTrustedIps(dto.workspaceId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/users/mutation.tsx b/frontend-v2/src/hooks/api/users/mutation.tsx
index 5cc50e845e..3e181d7138 100644
--- a/frontend-v2/src/hooks/api/users/mutation.tsx
+++ b/frontend-v2/src/hooks/api/users/mutation.tsx
@@ -42,7 +42,7 @@ export const useAddUserToWsE2EE = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceUsers(workspaceId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceUsers(workspaceId) });
}
});
};
@@ -59,8 +59,10 @@ export const useAddUserToWsNonE2EE = () => {
return data;
},
onSuccess: (_, { orgId, projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceUsers(projectId));
- queryClient.invalidateQueries(userKeys.allOrgMembershipProjectMemberships(orgId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceUsers(projectId) });
+ queryClient.invalidateQueries({
+ queryKey: userKeys.allOrgMembershipProjectMemberships(orgId)
+ });
}
});
};
@@ -110,7 +112,7 @@ export const useUpdateUserProjectFavorites = () => {
return {};
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(userKeys.userProjectFavorites(orgId));
+ queryClient.invalidateQueries({ queryKey: userKeys.userProjectFavorites(orgId) });
}
});
};
@@ -136,7 +138,7 @@ export const useDeleteUserTotpConfiguration = () => {
return {};
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.totpConfiguration);
+ queryClient.invalidateQueries({ queryKey: userKeys.totpConfiguration });
}
});
};
@@ -150,7 +152,7 @@ export const useCreateNewTotpRecoveryCodes = () => {
return {};
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.totpConfiguration);
+ queryClient.invalidateQueries({ queryKey: userKeys.totpConfiguration });
}
});
};
diff --git a/frontend-v2/src/hooks/api/users/queries.tsx b/frontend-v2/src/hooks/api/users/queries.tsx
index 730dba8c30..78b57d0dab 100644
--- a/frontend-v2/src/hooks/api/users/queries.tsx
+++ b/frontend-v2/src/hooks/api/users/queries.tsx
@@ -31,7 +31,11 @@ export const fetchUserDetails = async () => {
return data.user;
};
-export const useGetUser = () => useQuery(userKeys.getUser, fetchUserDetails);
+export const useGetUser = () =>
+ useQuery({
+ queryKey: userKeys.getUser,
+ queryFn: fetchUserDetails
+ });
export const useDeleteMe = () => {
const queryClient = useQueryClient();
@@ -87,7 +91,7 @@ export const useRenameUser = () => {
lastName: newName?.split(" ").slice(1).join(" ")
}),
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.getUser);
+ queryClient.invalidateQueries({ queryKey: userKeys.getUser });
}
});
};
@@ -106,7 +110,7 @@ export const useUpdateUserAuthMethods = () => {
return user;
},
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.getUser);
+ queryClient.invalidateQueries({ queryKey: userKeys.getUser });
}
});
};
@@ -157,13 +161,15 @@ export const useAddUsersToOrg = () => {
return apiRequest.post("/api/v1/invite-org/signup", dto);
},
onSuccess: (_, { organizationId, projects }) => {
- queryClient.invalidateQueries(userKeys.getOrgUsers(organizationId));
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgUsers(organizationId) });
projects?.forEach((project) => {
if (project.slug) {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceGroupMemberships(project.slug));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceGroupMemberships(project.slug)
+ });
}
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceUsers(project.id));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceUsers(project.id) });
});
}
});
@@ -212,7 +218,7 @@ export const useDeleteOrgMembership = () => {
return apiRequest.delete(`/api/v2/organizations/${orgId}/memberships/${membershipId}`);
},
onSuccess: (_, { orgId }) => {
- queryClient.invalidateQueries(userKeys.getOrgUsers(orgId));
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgUsers(orgId) });
}
});
};
@@ -227,8 +233,8 @@ export const useDeactivateOrgMembership = () => {
);
},
onSuccess: (_, { orgId, membershipId }) => {
- queryClient.invalidateQueries(userKeys.getOrgUsers(orgId));
- queryClient.invalidateQueries(userKeys.getOrgMembership(orgId, membershipId));
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgUsers(orgId) });
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgMembership(orgId, membershipId) });
}
});
};
@@ -248,13 +254,17 @@ export const useUpdateOrgMembership = () => {
);
},
onSuccess: (_, { organizationId, membershipId }) => {
- queryClient.invalidateQueries(userKeys.getOrgUsers(organizationId));
- queryClient.invalidateQueries(userKeys.getOrgMembership(organizationId, membershipId));
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgUsers(organizationId) });
+ queryClient.invalidateQueries({
+ queryKey: userKeys.getOrgMembership(organizationId, membershipId)
+ });
},
// to remove old states
onError: (_, { organizationId, membershipId }) => {
- queryClient.invalidateQueries(userKeys.getOrgUsers(organizationId));
- queryClient.invalidateQueries(userKeys.getOrgMembership(organizationId, membershipId));
+ queryClient.invalidateQueries({ queryKey: userKeys.getOrgUsers(organizationId) });
+ queryClient.invalidateQueries({
+ queryKey: userKeys.getOrgMembership(organizationId, membershipId)
+ });
}
});
};
@@ -264,7 +274,7 @@ export const useRegisterUserAction = () => {
return useMutation<object, object, string>({
mutationFn: (action) => apiRequest.post("/api/v1/user-action", { action }),
onSuccess: () => {
- queryClient.invalidateQueries(userKeys.userAction);
+ queryClient.invalidateQueries({ queryKey: userKeys.userAction });
}
});
};
@@ -346,7 +356,7 @@ export const useCreateAPIKey = () => {
return data;
},
onSuccess() {
- queryClient.invalidateQueries(userKeys.myAPIKeys);
+ queryClient.invalidateQueries({ queryKey: userKeys.myAPIKeys });
}
});
};
@@ -361,7 +371,7 @@ export const useDeleteAPIKey = () => {
return data;
},
onSuccess() {
- queryClient.invalidateQueries(userKeys.myAPIKeys);
+ queryClient.invalidateQueries({ queryKey: userKeys.myAPIKeys });
}
});
};
@@ -387,7 +397,7 @@ export const useRevokeMySessions = () => {
return data;
},
onSuccess() {
- queryClient.invalidateQueries(userKeys.mySessions);
+ queryClient.invalidateQueries({ queryKey: userKeys.mySessions });
}
});
};
@@ -412,7 +422,7 @@ export const useUpdateUserMfa = () => {
return user;
},
onSuccess() {
- queryClient.invalidateQueries(userKeys.getUser);
+ queryClient.invalidateQueries({ queryKey: userKeys.getUser });
}
});
};
diff --git a/frontend-v2/src/hooks/api/webhooks/mutation.tsx b/frontend-v2/src/hooks/api/webhooks/mutation.tsx
index 46f20a6faa..10d5e472e3 100644
--- a/frontend-v2/src/hooks/api/webhooks/mutation.tsx
+++ b/frontend-v2/src/hooks/api/webhooks/mutation.tsx
@@ -14,7 +14,7 @@ export const useCreateWebhook = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getWebhooks(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getWebhooks(workspaceId) });
}
});
};
@@ -28,10 +28,10 @@ export const useTestWebhook = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getWebhooks(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getWebhooks(workspaceId) });
},
onError: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getWebhooks(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getWebhooks(workspaceId) });
}
});
};
@@ -47,7 +47,7 @@ export const useUpdateWebhook = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getWebhooks(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getWebhooks(workspaceId) });
}
});
};
@@ -61,7 +61,7 @@ export const useDeleteWebhook = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(queryKeys.getWebhooks(workspaceId));
+ queryClient.invalidateQueries({ queryKey: queryKeys.getWebhooks(workspaceId) });
}
});
};
diff --git a/frontend-v2/src/hooks/api/workflowIntegrations/mutation.tsx b/frontend-v2/src/hooks/api/workflowIntegrations/mutation.tsx
index eea7bc92d0..e87b0dd6b5 100644
--- a/frontend-v2/src/hooks/api/workflowIntegrations/mutation.tsx
+++ b/frontend-v2/src/hooks/api/workflowIntegrations/mutation.tsx
@@ -20,8 +20,10 @@ export const useUpdateSlackIntegration = () => {
return data;
},
onSuccess: (_, { orgId, id }) => {
- queryClient.invalidateQueries(workflowIntegrationKeys.getSlackIntegration(id));
- queryClient.invalidateQueries(workflowIntegrationKeys.getSlackIntegrations(orgId));
+ queryClient.invalidateQueries({ queryKey: workflowIntegrationKeys.getSlackIntegration(id) });
+ queryClient.invalidateQueries({
+ queryKey: workflowIntegrationKeys.getSlackIntegrations(orgId)
+ });
}
});
};
@@ -36,8 +38,8 @@ export const useDeleteSlackIntegration = () => {
return data;
},
onSuccess: (_, { orgId, id }) => {
- queryClient.invalidateQueries(workflowIntegrationKeys.getSlackIntegration(id));
- queryClient.invalidateQueries(workflowIntegrationKeys.getIntegrations(orgId));
+ queryClient.invalidateQueries({ queryKey: workflowIntegrationKeys.getSlackIntegration(id) });
+ queryClient.invalidateQueries({ queryKey: workflowIntegrationKeys.getIntegrations(orgId) });
}
});
};
@@ -54,7 +56,9 @@ export const useUpdateProjectSlackConfig = () => {
return data;
},
onSuccess: (_, { workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceSlackConfig(workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceSlackConfig(workspaceId)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/workspace/mutations.tsx b/frontend-v2/src/hooks/api/workspace/mutations.tsx
index 4de00d2dec..a531518402 100644
--- a/frontend-v2/src/hooks/api/workspace/mutations.tsx
+++ b/frontend-v2/src/hooks/api/workspace/mutations.tsx
@@ -27,7 +27,9 @@ export const useAddGroupToWorkspace = () => {
return groupMembership;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceGroupMemberships(projectId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceGroupMemberships(projectId)
+ });
}
});
};
@@ -45,7 +47,9 @@ export const useUpdateGroupWorkspaceRole = () => {
return groupMembership;
},
onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceGroupMemberships(projectId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceGroupMemberships(projectId)
+ });
}
});
};
@@ -67,10 +71,12 @@ export const useDeleteGroupFromWorkspace = () => {
return groupMembership;
},
onSuccess: (_, { projectId, username }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceGroupMemberships(projectId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceGroupMemberships(projectId)
+ });
if (username) {
- queryClient.invalidateQueries(userKeys.listUserGroupMemberships(username));
+ queryClient.invalidateQueries({ queryKey: userKeys.listUserGroupMemberships(username) });
}
}
});
@@ -83,7 +89,7 @@ export const useLeaveProject = () => {
return apiRequest.delete(`/api/v1/workspace/${workspaceId}/leave`);
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace());
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace() });
}
});
};
@@ -95,7 +101,9 @@ export const useMigrateProjectToV3 = () => {
return apiRequest.post(`/api/v1/workspace/${workspaceId}/migrate-v3`);
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
diff --git a/frontend-v2/src/hooks/api/workspace/queries.tsx b/frontend-v2/src/hooks/api/workspace/queries.tsx
index 909d5a8956..0c86a3e473 100644
--- a/frontend-v2/src/hooks/api/workspace/queries.tsx
+++ b/frontend-v2/src/hooks/api/workspace/queries.tsx
@@ -83,14 +83,15 @@ export const useUpgradeProject = () => {
});
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
export const useGetUpgradeProjectStatus = ({
projectId,
- onSuccess,
enabled,
refetchInterval
}: TGetUpgradeProjectStatusDTO) => {
@@ -98,7 +99,6 @@ export const useGetUpgradeProjectStatus = ({
queryKey: workspaceKeys.getProjectUpgradeStatus(projectId),
queryFn: () => fetchProjectUpgradeStatus(projectId),
enabled,
- onSuccess,
refetchInterval
});
};
@@ -151,8 +151,7 @@ export const useGetUserWorkspaces = ({
useQuery({
queryKey: workspaceKeys.getAllUserWorkspace(type || ""),
- queryFn: () =>
- fetchUserWorkspaces(includeRoles, type)
+ queryFn: () => fetchUserWorkspaces(includeRoles, type)
});
const fetchUserWorkspaceMemberships = async (orgId: string) => {
@@ -180,7 +179,9 @@ export const useNameWorkspaceSecrets = () => {
secretsToUpdate
}),
onSuccess: (_, variables) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIndexStatus(variables.workspaceId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIndexStatus(variables.workspaceId)
+ });
}
});
};
@@ -238,7 +239,9 @@ export const useCreateWorkspace = () => {
type
}),
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.data.project.type));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(dto.data.project.type)
+ });
}
});
};
@@ -258,7 +261,7 @@ export const useUpdateProject = () => {
return data.workspace;
},
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.type));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
}
});
};
@@ -277,7 +280,7 @@ export const useToggleAutoCapitalization = () => {
return data.workspace;
},
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.type));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
}
});
};
@@ -293,7 +296,7 @@ export const useUpdateWorkspaceVersionLimit = () => {
return data.workspace;
},
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.type));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
}
});
};
@@ -312,7 +315,7 @@ export const useUpdateWorkspaceAuditLogsRetention = () => {
return data.workspace;
},
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.type));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
}
});
};
@@ -326,7 +329,7 @@ export const useDeleteWorkspace = () => {
return data.workspace;
},
onSuccess: (dto) => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(dto.type));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getAllUserWorkspace(dto.type) });
queryClient.invalidateQueries({
queryKey: ["org-admin-projects"]
});
@@ -345,7 +348,9 @@ export const useCreateWsEnvironment = () => {
});
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
@@ -362,7 +367,9 @@ export const useUpdateWsEnvironment = () => {
});
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
@@ -375,7 +382,9 @@ export const useDeleteWsEnvironment = () => {
return apiRequest.delete(`/api/v1/workspace/${workspaceId}/environments/${id}`);
},
onSuccess: () => {
- queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getAllUserWorkspace(ProjectType.SecretManager)
+ });
}
});
};
@@ -435,8 +444,10 @@ export const useDeleteUserFromWorkspace = () => {
return deletedMembership;
},
onSuccess: (_, { orgId, workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceUsers(workspaceId));
- queryClient.invalidateQueries(userKeys.allOrgMembershipProjectMemberships(orgId));
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceUsers(workspaceId) });
+ queryClient.invalidateQueries({
+ queryKey: userKeys.allOrgMembershipProjectMemberships(orgId)
+ });
}
});
};
@@ -456,10 +467,10 @@ export const useUpdateUserWorkspaceRole = () => {
return membership;
},
onSuccess: (_, { workspaceId, membershipId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceUsers(workspaceId));
- queryClient.invalidateQueries(
- workspaceKeys.getWorkspaceUserDetails(workspaceId, membershipId)
- );
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceUsers(workspaceId) });
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceUserDetails(workspaceId, membershipId)
+ });
}
});
};
@@ -488,8 +499,12 @@ export const useAddIdentityToWorkspace = () => {
return identityMembership;
},
onSuccess: (_, { identityId, workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIdentityMemberships(workspaceId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityProjectMemberships(identityId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIdentityMemberships(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityProjectMemberships(identityId)
+ });
}
});
};
@@ -510,11 +525,15 @@ export const useUpdateIdentityWorkspaceRole = () => {
return identityMembership;
},
onSuccess: (_, { identityId, workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIdentityMemberships(workspaceId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityProjectMemberships(identityId));
- queryClient.invalidateQueries(
- workspaceKeys.getWorkspaceIdentityMembershipDetails(workspaceId, identityId)
- );
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIdentityMemberships(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityProjectMemberships(identityId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIdentityMembershipDetails(workspaceId, identityId)
+ });
}
});
};
@@ -537,8 +556,12 @@ export const useDeleteIdentityFromWorkspace = () => {
return identityMembership;
},
onSuccess: (_, { identityId, workspaceId }) => {
- queryClient.invalidateQueries(workspaceKeys.getWorkspaceIdentityMemberships(workspaceId));
- queryClient.invalidateQueries(identitiesKeys.getIdentityProjectMemberships(identityId));
+ queryClient.invalidateQueries({
+ queryKey: workspaceKeys.getWorkspaceIdentityMemberships(workspaceId)
+ });
+ queryClient.invalidateQueries({
+ queryKey: identitiesKeys.getIdentityProjectMemberships(identityId)
+ });
}
});
};
diff --git a/frontend-v2/src/routes/_authenticate.tsx b/frontend-v2/src/routes/_authenticate.tsx
index b164077212..cb70c4c6f2 100644
--- a/frontend-v2/src/routes/_authenticate.tsx
+++ b/frontend-v2/src/routes/_authenticate.tsx
@@ -3,13 +3,12 @@ import { createFileRoute, redirect } from "@tanstack/react-router";
import { createNotification } from "@app/components/notifications";
import { userKeys } from "@app/hooks/api";
import { authKeys, fetchAuthToken } from "@app/hooks/api/auth/queries";
-import { setAuthToken } from "@app/hooks/api/reactQuery";
import { fetchUserDetails } from "@app/hooks/api/users/queries";
export const Route = createFileRoute("/_authenticate")({
beforeLoad: async ({ context }) => {
const data = await context.queryClient
- .fetchQuery({
+ .ensureQueryData({
queryKey: authKeys.getAuthToken,
queryFn: fetchAuthToken
})
@@ -24,12 +23,11 @@ export const Route = createFileRoute("/_authenticate")({
});
});
- setAuthToken(data.token);
if (!data.organizationId) {
throw redirect({ to: "/login/select-organization" });
}
- const user = await context.queryClient.fetchQuery({
+ const user = await context.queryClient.ensureQueryData({
queryKey: userKeys.getUser,
queryFn: fetchUserDetails
});
diff --git a/frontend-v2/src/routes/_authenticate/_org_details.tsx b/frontend-v2/src/routes/_authenticate/_org_details.tsx
index 8c4f0601b8..0fa3795020 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details.tsx
@@ -1,41 +1,26 @@
-import { createMongoAbility, MongoAbility, RawRuleOf } from "@casl/ability";
-import { unpackRules } from "@casl/ability/extra";
import { createFileRoute } from "@tanstack/react-router";
-import { OrgPermissionSet } from "@app/context/OrgPermissionContext/types";
import { fetchOrganizationById, organizationKeys } from "@app/hooks/api/organization/queries";
-import {
- conditionsMatcher,
- fetchUserOrgPermissions,
- roleQueryKeys
-} from "@app/hooks/api/roles/queries";
+import { fetchUserOrgPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
import { fetchOrgSubscription, subscriptionQueryKeys } from "@app/hooks/api/subscriptions/queries";
export const Route = createFileRoute("/_authenticate/_org_details")({
beforeLoad: async ({ context }) => {
const organizationId = context.organizationId!;
- const orgDetails = await context.queryClient.fetchQuery({
+ await context.queryClient.ensureQueryData({
queryKey: organizationKeys.getOrgById(organizationId),
queryFn: () => fetchOrganizationById(organizationId)
});
- const subscription = await context.queryClient.fetchQuery({
+ await context.queryClient.ensureQueryData({
queryKey: subscriptionQueryKeys.getOrgSubsription(organizationId),
queryFn: () => fetchOrgSubscription(organizationId)
});
- const orgPermission = await context.queryClient.fetchQuery({
+ await context.queryClient.ensureQueryData({
queryKey: roleQueryKeys.getUserOrgPermissions({ orgId: organizationId }),
queryFn: () => fetchUserOrgPermissions({ orgId: organizationId })
});
-
- const rule = unpackRules<RawRuleOf<MongoAbility<OrgPermissionSet>>>(orgPermission.permissions);
- const ability = createMongoAbility<OrgPermissionSet>(rule, { conditionsMatcher });
-
- return {
- organization: orgDetails,
- subscription,
- orgPermission: { permission: ability, membership: orgPermission.membership }
- };
+ return { organizationId };
}
});
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/admin/-components/OrgAdminProjects/OrgAdminProjects.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/admin/-components/OrgAdminProjects/OrgAdminProjects.tsx
index adba6d9a98..1d2fc1ffb3 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/admin/-components/OrgAdminProjects/OrgAdminProjects.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/admin/-components/OrgAdminProjects/OrgAdminProjects.tsx
@@ -43,7 +43,7 @@ export const OrgAdminProjects = withPermission(
const navigate = useNavigate();
const orgAdminAccessProject = useOrgAdminAccessProject();
- const { data, isLoading: isProjectsLoading } = useOrgAdminGetProjects({
+ const { data, isPending: isProjectsLoading } = useOrgAdminGetProjects({
offset: (page - 1) * perPage,
limit: perPage,
search: debouncedSearch || undefined
@@ -130,12 +130,12 @@ export const OrgAdminProjects = withPermission(
icon={<FontAwesomeIcon icon={faSignIn} />}
disabled={
orgAdminAccessProject.variables?.projectId === id &&
- orgAdminAccessProject.isLoading
+ orgAdminAccessProject.isPending
}
>
Access{" "}
{orgAdminAccessProject.variables?.projectId === id &&
- orgAdminAccessProject.isLoading && <Spinner size="xs" />}
+ orgAdminAccessProject.isPending && <Spinner size="xs" />}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsFilter.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsFilter.tsx
index 1c644b8217..ba7457128c 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsFilter.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsFilter.tsx
@@ -61,7 +61,7 @@ export const LogsFilter = ({
const workspacesInOrg = workspaces.filter((ws) => ws.orgId === currentOrg?.id);
- const { data, isLoading } = useGetAuditLogActorFilterOpts(workspaces?.[0]?.id ?? "");
+ const { data, isPending } = useGetAuditLogActorFilterOpts(workspaces?.[0]?.id ?? "");
useEffect(() => {
if (workspacesInOrg.length) {
@@ -205,7 +205,7 @@ export const LogsFilter = ({
)}
/>
- {!isLoading && data && data.length > 0 && !presets?.actorId && (
+ {!isPending && data && data.length > 0 && !presets?.actorId && (
<Controller
control={control}
name="actor"
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsSection.tsx
index 4ee8956490..5a64a83f81 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsSection.tsx
@@ -2,7 +2,7 @@ import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
-import { UpgradePlanModal } from "@app/components/v2";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { OrgPermissionActions, OrgPermissionSubjects, useSubscription } from "@app/context";
import { withPermission } from "@app/hoc";
import { ActorType, EventType, UserAgentType } from "@app/hooks/api/auditLogs/enums";
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsTable.tsx
index 350b477dd4..998055e2a6 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/audit-logs/-components/LogsTable.tsx
@@ -44,7 +44,7 @@ export const LogsTable = ({
// Use the projectId from the filter if it exists
filter?.projectId || null;
- const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage } = useGetAuditLogs(
+ const { data, isPending, isFetchingNextPage, hasNextPage, fetchNextPage } = useGetAuditLogs(
{
...filter,
limit: AUDIT_LOG_LIMIT
@@ -55,7 +55,7 @@ export const LogsTable = ({
}
);
- const isEmpty = !isLoading && !data?.pages?.[0].length;
+ const isEmpty = !isPending && !data?.pages?.[0].length;
return (
<div>
@@ -78,7 +78,7 @@ export const LogsTable = ({
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data?.pages?.map((group, i) => (
<Fragment key={`audit-log-fragment-${i + 1}`}>
{group.map((auditLog) => (
@@ -91,7 +91,7 @@ export const LogsTable = ({
))}
</Fragment>
))}
- {isLoading && <TableSkeleton innerKey="logs-table" columns={5} key="logs" />}
+ {isPending && <TableSkeleton innerKey="logs-table" columns={5} key="logs" />}
{isEmpty && (
<Tr>
<Td colSpan={5}>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/CurrentPlanSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/CurrentPlanSection.tsx
index a3135d85f0..1b7e84f2c9 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/CurrentPlanSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/CurrentPlanSection.tsx
@@ -17,7 +17,7 @@ import { useGetOrgPlanTable } from "@app/hooks/api";
export const CurrentPlanSection = () => {
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetOrgPlanTable(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgPlanTable(currentOrg?.id ?? "");
const displayCell = (value: null | number | string | boolean) => {
if (value === null) return "-";
@@ -44,7 +44,7 @@ export const CurrentPlanSection = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data &&
data?.rows?.length > 0 &&
data.rows.map(({ name, allowed, used }) => {
@@ -56,8 +56,8 @@ export const CurrentPlanSection = () => {
</Tr>
);
})}
- {isLoading && <TableSkeleton columns={5} innerKey="invoices" />}
- {!isLoading && data && data?.rows?.length === 0 && (
+ {isPending && <TableSkeleton columns={5} innerKey="invoices" />}
+ {!isPending && data && data?.rows?.length === 0 && (
<Tr>
<Td colSpan={3}>
<EmptyState title="No plan details found" icon={faFileInvoice} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/ManagePlansTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/ManagePlansTable.tsx
index b37c220123..29b0326c4e 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/ManagePlansTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/ManagePlansTable.tsx
@@ -23,7 +23,7 @@ type Props = {
export const ManagePlansTable = ({ billingCycle }: Props) => {
const { currentOrg } = useOrganization();
const { subscription } = useSubscription();
- const { data: tableData, isLoading: isTableDataLoading } = useGetOrgPlansTable({
+ const { data: tableData, isPending: isTableDataLoading } = useGetOrgPlansTable({
organizationId: currentOrg?.id ?? "",
billingCycle
});
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/PreviewSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/PreviewSection.tsx
index a7c4cb4431..ab160e4c57 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/PreviewSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingCloudTab/PreviewSection.tsx
@@ -21,7 +21,7 @@ import { ManagePlansModal } from "./ManagePlansModal";
export const PreviewSection = () => {
const { currentOrg } = useOrganization();
const { subscription } = useSubscription();
- const { data, isLoading } = useGetOrgPlanBillingInfo(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgPlanBillingInfo(currentOrg?.id ?? "");
const getOrgTrialUrl = useGetOrgTrialUrl();
const createCustomerPortalSession = useCreateCustomerPortalSession();
@@ -124,7 +124,7 @@ export const PreviewSection = () => {
</div>
</div>
)}
- {!isLoading && subscription && data && (
+ {!isPending && subscription && data && (
<div className="mb-6 flex">
<div className="mr-4 flex-1 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<p className="mb-2 text-gray-400">Current plan</p>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/CompanyNameSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/CompanyNameSection.tsx
index 10df8e43ac..c78017acca 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/CompanyNameSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/CompanyNameSection.tsx
@@ -24,7 +24,7 @@ export const CompanyNameSection = () => {
resolver: zodResolver(schema)
});
const { data } = useGetOrgBillingDetails(currentOrg?.id ?? "");
- const { mutateAsync, isLoading } = useUpdateOrgBillingDetails();
+ const { mutateAsync, isPending } = useUpdateOrgBillingDetails();
useEffect(() => {
if (data) {
@@ -79,8 +79,8 @@ export const CompanyNameSection = () => {
<Button
type="submit"
colorSchema="secondary"
- isLoading={isLoading}
- isDisabled={isLoading || !isAllowed}
+ isLoading={isPending}
+ isDisabled={isPending || !isAllowed}
>
Save
</Button>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/InvoiceEmailSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/InvoiceEmailSection.tsx
index 951c2bc33e..ac192b3127 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/InvoiceEmailSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/InvoiceEmailSection.tsx
@@ -24,7 +24,7 @@ export const InvoiceEmailSection = () => {
resolver: yupResolver(schema)
});
const { data } = useGetOrgBillingDetails(currentOrg?.id ?? "");
- const { mutateAsync, isLoading } = useUpdateOrgBillingDetails();
+ const { mutateAsync, isPending } = useUpdateOrgBillingDetails();
useEffect(() => {
if (data) {
@@ -80,8 +80,8 @@ export const InvoiceEmailSection = () => {
<Button
type="submit"
colorSchema="secondary"
- isLoading={isLoading}
- isDisabled={isLoading || !isAllowed}
+ isLoading={isPending}
+ isDisabled={isPending || !isAllowed}
>
Save
</Button>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsSection.tsx
index 266e529995..9d90bf50b6 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsSection.tsx
@@ -10,7 +10,7 @@ import { PmtMethodsTable } from "./PmtMethodsTable";
export const PmtMethodsSection = () => {
const { currentOrg } = useOrganization();
- const { mutateAsync, isLoading } = useAddOrgPmtMethod();
+ const { mutateAsync, isPending } = useAddOrgPmtMethod();
const handleAddPmtMethodBtnClick = async () => {
if (!currentOrg?.id) return;
@@ -32,7 +32,7 @@ export const PmtMethodsSection = () => {
<Button
onClick={handleAddPmtMethodBtnClick}
colorSchema="secondary"
- isLoading={isLoading}
+ isLoading={isPending}
leftIcon={<FontAwesomeIcon icon={faPlus} />}
isDisabled={!isAllowed}
>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsTable.tsx
index 8dfe7e6056..f703489db1 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/PmtMethodsTable.tsx
@@ -22,7 +22,7 @@ import { useDeleteOrgPmtMethod, useGetOrgPmtMethods } from "@app/hooks/api";
export const PmtMethodsTable = () => {
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetOrgPmtMethods(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgPmtMethods(currentOrg?.id ?? "");
const deleteOrgPmtMethod = useDeleteOrgPmtMethod();
const { handlePopUpOpen, handlePopUpClose, handlePopUpToggle, popUp } = usePopUp([
"removeCard"
@@ -64,7 +64,7 @@ export const PmtMethodsTable = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data &&
data?.length > 0 &&
data.map(({ _id: id, brand, exp_month, exp_year, funding, last4 }) => (
@@ -94,8 +94,8 @@ export const PmtMethodsTable = () => {
</Td>
</Tr>
))}
- {isLoading && <TableSkeleton columns={5} innerKey="pmt-methods" />}
- {!isLoading && data && data?.length === 0 && (
+ {isPending && <TableSkeleton columns={5} innerKey="pmt-methods" />}
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState title="No payment methods on file" icon={faCreditCard} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/TaxIDTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/TaxIDTable.tsx
index 7a6362da2d..c79fe2a1ac 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/TaxIDTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingDetailsTab/TaxIDTable.tsx
@@ -72,7 +72,7 @@ const taxIDTypeLabelMap: { [key: string]: string } = {
export const TaxIDTable = () => {
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetOrgTaxIds(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgTaxIds(currentOrg?.id ?? "");
const deleteOrgTaxId = useDeleteOrgTaxId();
const handleDeleteTaxIdBtnClick = async (taxId: string) => {
@@ -94,7 +94,7 @@ export const TaxIDTable = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data &&
data?.length > 0 &&
data.map(({ id, type, value }) => (
@@ -124,8 +124,8 @@ export const TaxIDTable = () => {
</Td>
</Tr>
))}
- {isLoading && <TableSkeleton columns={3} innerKey="tax-ids" />}
- {!isLoading && data && data?.length === 0 && (
+ {isPending && <TableSkeleton columns={3} innerKey="tax-ids" />}
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState title="No Tax IDs on file" icon={faFileInvoice} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingReceiptsTab/InvoicesTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingReceiptsTab/InvoicesTable.tsx
index bc6032a676..1f67a5cdda 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingReceiptsTab/InvoicesTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingReceiptsTab/InvoicesTable.tsx
@@ -18,7 +18,7 @@ import { useGetOrgInvoices } from "@app/hooks/api";
export const InvoicesTable = () => {
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetOrgInvoices(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgInvoices(currentOrg?.id ?? "");
return (
<TableContainer className="mt-8">
<Table>
@@ -32,7 +32,7 @@ export const InvoicesTable = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data &&
data?.length > 0 &&
data.map(({ id, created, paid, number, total, invoice_pdf }) => {
@@ -65,8 +65,8 @@ export const InvoicesTable = () => {
</Tr>
);
})}
- {isLoading && <TableSkeleton columns={5} innerKey="invoices" />}
- {!isLoading && data && data?.length === 0 && (
+ {isPending && <TableSkeleton columns={5} innerKey="invoices" />}
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState title="No invoices on file" icon={faFileInvoice} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingSelfHostedTab/LicensesSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingSelfHostedTab/LicensesSection.tsx
index 919d8eabbe..160a02f604 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingSelfHostedTab/LicensesSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/billing/-components/BillingSelfHostedTab/LicensesSection.tsx
@@ -16,7 +16,7 @@ import { useGetOrgLicenses } from "@app/hooks/api";
export const LicensesSection = () => {
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetOrgLicenses(currentOrg?.id ?? "");
+ const { data, isPending } = useGetOrgLicenses(currentOrg?.id ?? "");
return (
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
@@ -32,7 +32,7 @@ export const LicensesSection = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
data &&
data?.length > 0 &&
data.map(({ id, licenseKey, isActivated, createdAt, expiresAt }) => {
@@ -47,8 +47,8 @@ export const LicensesSection = () => {
</Tr>
);
})}
- {isLoading && <TableSkeleton columns={4} innerKey="licenses" />}
- {!isLoading && data && data?.length === 0 && (
+ {isPending && <TableSkeleton columns={4} innerKey="licenses" />}
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={4}>
<EmptyState title="No enterprise licenses on file" icon={faFileContract} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/AddGroupMemberModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/AddGroupMemberModal.tsx
index 38cf33c2de..bcebea5c75 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/AddGroupMemberModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/AddGroupMemberModal.tsx
@@ -43,7 +43,7 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
};
const offset = (page - 1) * perPage;
- const { data, isLoading } = useListGroupUsers({
+ const { data, isPending } = useListGroupUsers({
id: popUpData?.groupId,
groupSlug: popUpData?.slug,
offset,
@@ -113,8 +113,8 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={2} innerKey="group-users" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={2} innerKey="group-users" />}
+ {!isPending &&
data?.users?.map(({ id, firstName, lastName, username }) => {
return (
<Tr className="items-center" key={`group-user-${id}`}>
@@ -130,7 +130,7 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
{(isAllowed) => {
return (
<Button
- isLoading={isLoading}
+ isLoading={isPending}
isDisabled={!isAllowed}
colorSchema="primary"
variant="outline_bg"
@@ -148,7 +148,7 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
})}
</TBody>
</Table>
- {!isLoading && totalCount > 0 && (
+ {!isPending && totalCount > 0 && (
<Pagination
count={totalCount}
page={page}
@@ -157,7 +157,7 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
/>
)}
- {!isLoading && !data?.users?.length && (
+ {!isPending && !data?.users?.length && (
<EmptyState
title={
debouncedSearch ? "No users match search" : "All users are already in the group"
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupCreateUpdateModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupCreateUpdateModal.tsx
index 42f2c73aaa..e4364e8742 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupCreateUpdateModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupCreateUpdateModal.tsx
@@ -40,8 +40,8 @@ type Props = {
export const GroupCreateUpdateModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
const { currentOrg } = useOrganization();
const { data: roles } = useGetOrgRoles(currentOrg?.id || "");
- const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateGroup();
- const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateGroup();
+ const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateGroup();
+ const { mutateAsync: updateMutateAsync, isPending: updateIsLoading } = useUpdateGroup();
const { control, handleSubmit, reset } = useForm<TGroupFormData>({
resolver: zodResolver(GroupFormSchema)
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupDetailsSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupDetailsSection.tsx
index 2b46740078..a2010f43d3 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupDetailsSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupDetailsSection.tsx
@@ -14,9 +14,9 @@ type Props = {
};
export const GroupDetailsSection = ({ groupId, handlePopUpOpen }: Props) => {
- const { data, isLoading } = useGetGroupById(groupId);
+ const { data, isPending } = useGetGroupById(groupId);
- if (isLoading) return <Spinner size="sm" className="ml-2 mt-2" />;
+ if (isPending) return <Spinner size="sm" className="ml-2 mt-2" />;
return data ? (
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupMembersSection/GroupMembersTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupMembersSection/GroupMembersTable.tsx
index 8c3268dab8..b0f2bf273c 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupMembersSection/GroupMembersTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/-components/GroupMembersSection/GroupMembersTable.tsx
@@ -58,7 +58,7 @@ export const GroupMembersTable = ({ groupId, groupSlug, handlePopUpOpen }: Props
toggleOrderDirection
} = usePagination(GroupMembersOrderBy.Name, { initPerPage: 10 });
- const { data: groupMemberships, isLoading } = useListGroupUsers({
+ const { data: groupMemberships, isPending } = useListGroupUsers({
id: groupId,
groupSlug,
offset,
@@ -138,8 +138,8 @@ export const GroupMembersTable = ({ groupId, groupSlug, handlePopUpOpen }: Props
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="group-user-memberships" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="group-user-memberships" />}
+ {!isPending &&
filteredGroupMemberships.slice(offset, perPage * page).map((userGroupMembership) => {
return (
<GroupMembershipRow
@@ -160,7 +160,7 @@ export const GroupMembersTable = ({ groupId, groupSlug, handlePopUpOpen }: Props
onChangePerPage={setPerPage}
/>
)}
- {!isLoading && !filteredGroupMemberships?.length && (
+ {!isPending && !filteredGroupMemberships?.length && (
<EmptyState
title={
groupMemberships?.users.length
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/index.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/index.tsx
index a1c265405b..6473baf9e0 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/index.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/groups/$groupId/index.tsx
@@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createFileRoute, useNavigate, useParams } from "@tanstack/react-router";
import { twMerge } from "tailwind-merge";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -15,8 +16,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
Spinner,
- Tooltip,
- UpgradePlanModal
+ Tooltip
} from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { withPermission } from "@app/hoc";
@@ -44,7 +44,7 @@ const GroupPage = withPermission(
const groupId = params.groupId as string;
const { currentOrg } = useOrganization();
- const { data, isLoading } = useGetGroupById(groupId);
+ const { data, isPending } = useGetGroupById(groupId);
const { mutateAsync: deleteMutateAsync } = useDeleteGroup();
@@ -83,7 +83,7 @@ const GroupPage = withPermission(
handlePopUpClose("deleteGroup");
};
- if (isLoading) return <Spinner size="sm" className="ml-2 mt-2" />;
+ if (isPending) return <Spinner size="sm" className="ml-2 mt-2" />;
return (
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityAddToProjectModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityAddToProjectModal.tsx
index c6597a5eb7..aa6247f1f5 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityAddToProjectModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityAddToProjectModal.tsx
@@ -58,8 +58,8 @@ const Content = ({ identityId, handlePopUpToggle }: Omit<Props, "popUp">) => {
const projectId = watch("project")?.id;
const { data: projectMemberships } = useGetIdentityProjectMemberships(identityId);
- const { data: project, isLoading: isProjectLoading } = useGetWorkspaceById(projectId);
- const { data: roles, isLoading: isRolesLoading } = useGetProjectRoles(project?.id ?? "");
+ const { data: project, isPending: isProjectLoading } = useGetWorkspaceById(projectId);
+ const { data: roles, isPending: isRolesLoading } = useGetProjectRoles(project?.id ?? "");
const filteredWorkspaces = useMemo(() => {
const wsWorkspaceIds = new Map();
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityProjectsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityProjectsTable.tsx
index 4f9191f3ae..680bb80358 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityProjectsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityProjectsSection/IdentityProjectsTable.tsx
@@ -41,7 +41,7 @@ enum IdentityProjectsOrderBy {
}
export const IdentityProjectsTable = ({ identityId, handlePopUpOpen }: Props) => {
- const { data: projectMemberships = [], isLoading } = useGetIdentityProjectMemberships(identityId);
+ const { data: projectMemberships = [], isPending } = useGetIdentityProjectMemberships(identityId);
const {
search,
@@ -113,8 +113,8 @@ export const IdentityProjectsTable = ({ identityId, handlePopUpOpen }: Props) =>
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="identity-project-memberships" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="identity-project-memberships" />}
+ {!isPending &&
filteredProjectMemberships.slice(offset, perPage * page).map((membership) => {
return (
<IdentityProjectRow
@@ -135,7 +135,7 @@ export const IdentityProjectsTable = ({ identityId, handlePopUpOpen }: Props) =>
onChangePerPage={setPerPage}
/>
)}
- {!isLoading && !filteredProjectMemberships?.length && (
+ {!isPending && !filteredProjectMemberships?.length && (
<EmptyState
title={
projectMemberships.length
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityTokenListModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityTokenListModal.tsx
index f0336061b8..fcb9065f70 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityTokenListModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/-components/IdentityTokenListModal.tsx
@@ -61,7 +61,7 @@ export const IdentityTokenListModal = ({ popUp, handlePopUpOpen, handlePopUpTogg
};
const { data: tokens } = useGetIdentityTokensTokenAuth(popUpData?.identityId ?? "");
- const { data, isLoading } = useGetIdentityUniversalAuthClientSecrets(popUpData?.identityId ?? "");
+ const { data, isPending } = useGetIdentityUniversalAuthClientSecrets(popUpData?.identityId ?? "");
const { mutateAsync: createToken } = useCreateTokenIdentityTokenAuth();
@@ -202,8 +202,8 @@ export const IdentityTokenListModal = ({ popUp, handlePopUpOpen, handlePopUpTogg
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={5} innerKey="identities-tokens" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={5} innerKey="identities-tokens" />}
+ {!isPending &&
tokens?.map(
({
id,
@@ -251,7 +251,7 @@ export const IdentityTokenListModal = ({ popUp, handlePopUpOpen, handlePopUpTogg
);
}
)}
- {!isLoading && data && data?.length === 0 && (
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/index.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/index.tsx
index 0421015c9b..2b486d560c 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/index.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/identities/$identityId/index.tsx
@@ -7,6 +7,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createFileRoute, useNavigate, useParams } from "@tanstack/react-router";
import { twMerge } from "tailwind-merge";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -16,8 +17,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip,
- UpgradePlanModal
+ Tooltip
} from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { withPermission } from "@app/hoc";
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
index aaec0a5956..908be4935b 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
@@ -37,8 +37,8 @@ type Props = {
export const OrgGroupModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
const { currentOrg } = useOrganization();
const { data: roles } = useGetOrgRoles(currentOrg?.id || "");
- const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateGroup();
- const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateGroup();
+ const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateGroup();
+ const { mutateAsync: updateMutateAsync, isPending: updateIsLoading } = useUpdateGroup();
const { control, handleSubmit, reset } = useForm<TGroupFormData>({
resolver: zodResolver(GroupFormSchema)
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsSection.tsx
index 9c39491505..ec3ef159c7 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsSection.tsx
@@ -1,9 +1,10 @@
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
+import { Button, DeleteActionModal } from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects, useSubscription } from "@app/context";
import { useDeleteGroup } from "@app/hooks/api";
import { usePopUp } from "@app/hooks/usePopUp";
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsTable.tsx
index 0e0506559e..24b0b7a3f6 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupsTable.tsx
@@ -65,7 +65,7 @@ export const OrgGroupsTable = ({ handlePopUpOpen }: Props) => {
const navigate = useNavigate();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
- const { isLoading, data: groups = [] } = useGetOrganizationGroups(orgId);
+ const { isPending, data: groups = [] } = useGetOrganizationGroups(orgId);
const { mutateAsync: updateMutateAsync } = useUpdateGroup();
const { data: roles } = useGetOrgRoles(orgId);
@@ -219,8 +219,8 @@ export const OrgGroupsTable = ({ handlePopUpOpen }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="org-groups" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="org-groups" />}
+ {!isPending &&
filteredGroups
.slice(offset, perPage * page)
.map(({ id, name, slug, role, customRole }) => {
@@ -381,7 +381,7 @@ export const OrgGroupsTable = ({ handlePopUpOpen }: Props) => {
onChangePerPage={setPerPage}
/>
)}
- {!isLoading && !filteredGroups?.length && (
+ {!isPending && !filteredGroups?.length && (
<EmptyState
title={
groups.length
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModalContent.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModalContent.tsx
index 1df1294860..859b218834 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModalContent.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityAuthMethodModalContent.tsx
@@ -3,6 +3,7 @@ import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import {
Badge,
@@ -10,8 +11,7 @@ import {
FormControl,
Select,
SelectItem,
- Tooltip,
- UpgradePlanModal
+ Tooltip
} from "@app/components/v2";
import { useOrganization } from "@app/context";
import {
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx
index 63ca7d7170..de569c38cf 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx
@@ -1,9 +1,10 @@
import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
+import { Button, DeleteActionModal } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
index b13889945d..34817174bd 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx
@@ -73,7 +73,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
const { mutateAsync: updateMutateAsync } = useUpdateIdentity();
- const { data, isLoading, isFetching } = useGetIdentityMembershipOrgs(
+ const { data, isPending, isFetching } = useGetIdentityMembershipOrgs(
{
organizationId,
offset,
@@ -82,7 +82,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
orderBy,
search: debouncedSearch
},
- { keepPreviousData: true }
+ { placeholderData: (prevData) => prevData }
);
const { totalCount = 0 } = data ?? {};
@@ -188,8 +188,8 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={3} innerKey="org-identities" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={3} innerKey="org-identities" />}
+ {!isPending &&
data?.identityMemberships.map(({ identity: { id, name }, role, customRole }) => {
return (
<Tr
@@ -300,7 +300,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
})}
</TBody>
</Table>
- {!isLoading && data && totalCount > 0 && (
+ {!isPending && data && totalCount > 0 && (
<Pagination
count={totalCount}
page={page}
@@ -309,7 +309,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
/>
)}
- {!isLoading && data && data?.identityMemberships.length === 0 && (
+ {!isPending && data && data?.identityMemberships.length === 0 && (
<EmptyState
title={
debouncedSearch.trim().length > 0
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthClientSecretModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthClientSecretModal.tsx
index 668882b9d6..356c80f0a4 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthClientSecretModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthClientSecretModal.tsx
@@ -75,7 +75,7 @@ export const IdentityUniversalAuthClientSecretModal = ({
name?: string;
};
- const { data, isLoading } = useGetIdentityUniversalAuthClientSecrets(popUpData?.identityId ?? "");
+ const { data, isPending } = useGetIdentityUniversalAuthClientSecrets(popUpData?.identityId ?? "");
const { data: identityUniversalAuth } = useGetIdentityUniversalAuth(popUpData?.identityId ?? "");
const { mutateAsync: createClientSecretMutateAsync } =
@@ -278,8 +278,8 @@ export const IdentityUniversalAuthClientSecretModal = ({
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={5} innerKey="org-identities-client-secrets" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={5} innerKey="org-identities-client-secrets" />}
+ {!isPending &&
data &&
data.length > 0 &&
data.map(
@@ -325,7 +325,7 @@ export const IdentityUniversalAuthClientSecretModal = ({
);
}
)}
- {!isLoading && data && data?.length === 0 && (
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
index 15b2cdce13..f516d43fec 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
@@ -71,7 +71,7 @@ export const AddOrgMemberModal = ({
const { data: organizationRoles } = useGetOrgRoles(currentOrg?.id ?? "");
const { data: serverDetails } = useFetchServerStatus();
const { mutateAsync: addUsersMutateAsync } = useAddUsersToOrg();
- const { data: projects, isLoading: isProjectsLoading } = useGetUserWorkspaces({
+ const { data: projects, isPending: isProjectsLoading } = useGetUserWorkspaces({
includeRoles: true
});
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx
index 340295c93f..be203705d3 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx
@@ -2,14 +2,10 @@ import { useState } from "react";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import {
- Button,
- DeleteActionModal,
- EmailServiceSetupModal,
- UpgradePlanModal
-} from "@app/components/v2";
+import { Button, DeleteActionModal, EmailServiceSetupModal } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersTable.tsx
index 0a54826eed..5fbf752030 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgMembersTab/components/OrgMembersSection/OrgMembersTable.tsx
@@ -78,10 +78,10 @@ export const OrgMembersTable = ({ handlePopUpOpen, setCompleteInviteLinks }: Pro
const userId = user?.id || "";
const orgId = currentOrg?.id || "";
- const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(orgId);
+ const { data: roles, isPending: isRolesLoading } = useGetOrgRoles(orgId);
const { data: serverDetails } = useFetchServerStatus();
- const { data: members = [], isLoading: isMembersLoading } = useGetOrgUsers(orgId);
+ const { data: members = [], isPending: isMembersLoading } = useGetOrgUsers(orgId);
const { mutateAsync: addUsersMutateAsync } = useAddUsersToOrg();
const { mutateAsync: updateOrgMembership } = useUpdateOrgMembership();
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgRoleTabSection/OrgRoleTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgRoleTabSection/OrgRoleTable.tsx
index f3d4288b4b..83b08ffeab 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgRoleTabSection/OrgRoleTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/-components/OrgRoleTabSection/OrgRoleTable.tsx
@@ -3,6 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
import { twMerge } from "tailwind-merge";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -21,8 +22,7 @@ import {
Th,
THead,
Tooltip,
- Tr,
- UpgradePlanModal
+ Tr
} from "@app/components/v2";
import {
OrgPermissionActions,
@@ -48,7 +48,7 @@ export const OrgRoleTable = () => {
"upgradePlan"
] as const);
- const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(orgId);
+ const { data: roles, isPending: isRolesLoading } = useGetOrgRoles(orgId);
const { mutateAsync: deleteRole } = useDeleteOrgRole();
const { mutateAsync: updateOrg } = useUpdateOrg();
const { subscription } = useSubscription();
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/index.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/index.tsx
index cca86e32f9..27b2036e79 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/index.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/members/index.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
-import { useEffect, useState } from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { createFileRoute, useNavigate, useSearch } from "@tanstack/react-router";
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserDetailsSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserDetailsSection.tsx
index b719b8dc44..223340ea4f 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserDetailsSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserDetailsSection.tsx
@@ -45,7 +45,7 @@ export const UserDetailsSection = ({ membershipId, handlePopUpOpen }: Props) =>
const { data: roles } = useGetOrgRoles(orgId);
const { data: serverDetails } = useFetchServerStatus();
const { data: membership } = useGetOrgMembership(orgId, membershipId);
- const { mutateAsync: inviteUsers, isLoading } = useAddUsersToOrg();
+ const { mutateAsync: inviteUsers, isPending } = useAddUsersToOrg();
const onResendInvite = async (email: string) => {
try {
@@ -209,7 +209,7 @@ export const UserDetailsSection = ({ membershipId, handlePopUpOpen }: Props) =>
className="mt-4 w-full"
colorSchema="primary"
type="submit"
- isLoading={isLoading}
+ isLoading={isPending}
onClick={() => {
onResendInvite(membership.user.email as string);
}}
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserGroupsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserGroupsTable.tsx
index 7263fb5a7d..b22b1377f2 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserGroupsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserGroupsTable.tsx
@@ -38,7 +38,7 @@ enum UserGroupsOrderBy {
}
export const UserGroupsTable = ({ handlePopUpOpen, orgMembership }: Props) => {
- const { data: groupMemberships = [], isLoading } = useListUserGroupMemberships(
+ const { data: groupMemberships = [], isPending } = useListUserGroupMemberships(
orgMembership.user.username
);
@@ -122,7 +122,7 @@ export const UserGroupsTable = ({ handlePopUpOpen, orgMembership }: Props) => {
onChangePerPage={setPerPage}
/>
)}
- {!isLoading && !filteredGroupMemberships?.length && (
+ {!isPending && !filteredGroupMemberships?.length && (
<EmptyState
title={
groupMemberships.length
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserProjectsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserProjectsTable.tsx
index 16c0a03b3f..ff9ed9bbcd 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserProjectsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/-components/UserProjectsSection/UserProjectsTable.tsx
@@ -56,7 +56,7 @@ export const UserProjectsTable = ({ membershipId, handlePopUpOpen }: Props) => {
toggleOrderDirection
} = usePagination(UserProjectsOrderBy.Name, { initPerPage: 10 });
- const { data: projectMemberships = [], isLoading } = useGetOrgMembershipProjectMemberships(
+ const { data: projectMemberships = [], isPending } = useGetOrgMembershipProjectMemberships(
orgId,
membershipId
);
@@ -117,8 +117,8 @@ export const UserProjectsTable = ({ membershipId, handlePopUpOpen }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={3} innerKey="user-project-memberships" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={3} innerKey="user-project-memberships" />}
+ {!isPending &&
filteredProjectMemberships.slice(offset, perPage * page).map((membership) => {
return (
<UserProjectRow
@@ -139,7 +139,7 @@ export const UserProjectsTable = ({ membershipId, handlePopUpOpen }: Props) => {
onChangePerPage={setPerPage}
/>
)}
- {!isLoading && !filteredProjectMemberships?.length && (
+ {!isPending && !filteredProjectMemberships?.length && (
<EmptyState
title={
projectMemberships.length
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/index.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/index.tsx
index 93ab8ccad5..6b9be3e725 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/index.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/memberships/$membershipId/index.tsx
@@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createFileRoute, useNavigate, useParams } from "@tanstack/react-router";
import { twMerge } from "tailwind-merge";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -14,8 +15,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip,
- UpgradePlanModal
+ Tooltip
} from "@app/components/v2";
import {
OrgPermissionActions,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-manager/overview.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-manager/overview.tsx
index 2e98fe1b9b..6413828842 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-manager/overview.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-manager/overview.tsx
@@ -19,18 +19,11 @@ import {
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createFileRoute, useNavigate } from "@tanstack/react-router";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import { NewProjectModal } from "@app/components/projects";
-import {
- Button,
- IconButton,
- Input,
- Pagination,
- Skeleton,
- Tooltip,
- UpgradePlanModal
-} from "@app/components/v2";
+import { Button, IconButton, Input, Pagination, Skeleton, Tooltip } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -82,10 +75,10 @@ export const ProductOverview = ({ type }: Props) => {
const navigate = useNavigate();
- const { data: workspaces, isLoading: isWorkspaceLoading } = useGetUserWorkspaces({ type });
+ const { data: workspaces, isPending: isWorkspaceLoading } = useGetUserWorkspaces({ type });
const { currentOrg } = useOrganization();
const orgWorkspaces = workspaces || [];
- const { data: projectFavorites, isLoading: isProjectFavoritesLoading } =
+ const { data: projectFavorites, isPending: isProjectFavoritesLoading } =
useGetUserProjectFavorites(currentOrg?.id);
const { mutateAsync: updateUserProjectFavorites } = useUpdateUserProjectFavorites();
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/-components/SecretScanningLogsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/-components/SecretScanningLogsTable.tsx
index 30b2171ab9..8ee387b771 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/-components/SecretScanningLogsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/-components/SecretScanningLogsTable.tsx
@@ -20,7 +20,7 @@ import { RiskStatusSelection } from "./RiskStatusSelection";
export const SecretScanningLogsTable = () => {
const { currentOrg } = useOrganization();
const organizationId = currentOrg.id;
- const { isLoading, data: gitRisks } = useGetSecretScanningRisks(organizationId);
+ const { isPending, data: gitRisks } = useGetSecretScanningRisks(organizationId);
return (
<TableContainer className="mt-8">
@@ -37,7 +37,7 @@ export const SecretScanningLogsTable = () => {
</Tr>
</THead>
<TBody>
- {!isLoading &&
+ {!isPending &&
gitRisks &&
gitRisks?.map((risk) => {
return (
@@ -76,8 +76,8 @@ export const SecretScanningLogsTable = () => {
</Tr>
);
})}
- {isLoading && <TableSkeleton columns={7} innerKey="gitRisks" />}
- {!isLoading && gitRisks && gitRisks?.length === 0 && (
+ {isPending && <TableSkeleton columns={7} innerKey="gitRisks" />}
+ {!isPending && gitRisks && gitRisks?.length === 0 && (
<Tr>
<Td colSpan={7}>
<EmptyState title="No risks detected." icon={faCheck} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/index.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/index.tsx
index 5ea324ad95..2f8da1a428 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/index.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-scanning/index.tsx
@@ -33,7 +33,7 @@ const SecretScanning = withPermission(
const { mutateAsync: linkGitAppInstallationWithOrganization } =
useLinkGitAppInstallationWithOrg();
const { mutateAsync: createNewIntegrationSession } = useCreateNewInstallationSession();
- const { data: installationStatus, isLoading: isSecretScanningInstatllationStatusLoading } =
+ const { data: installationStatus, isPending: isSecretScanningInstatllationStatusLoading } =
useGetSecretScanningInstallationStatus(organizationId);
const integrationEnabled =
!isSecretScanningInstatllationStatusLoading && installationStatus?.appInstallationCompleted;
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-sharing/-components/ShareSecretsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-sharing/-components/ShareSecretsTable.tsx
index bdb2b2ffa1..5176c91626 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-sharing/-components/ShareSecretsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/secret-sharing/-components/ShareSecretsTable.tsx
@@ -33,7 +33,7 @@ type Props = {
export const ShareSecretsTable = ({ handlePopUpOpen }: Props) => {
const [page, setPage] = useState(1);
const [perPage, setPerPage] = useState(10);
- const { isLoading, data } = useGetSharedSecrets({
+ const { isPending, data } = useGetSharedSecrets({
offset: (page - 1) * perPage,
limit: perPage
});
@@ -52,14 +52,14 @@ export const ShareSecretsTable = ({ handlePopUpOpen }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={7} innerKey="shared-secrets" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={7} innerKey="shared-secrets" />}
+ {!isPending &&
data?.secrets?.map((row) => (
<ShareSecretsRow key={row.id} row={row} handlePopUpOpen={handlePopUpOpen} />
))}
</TBody>
</Table>
- {!isLoading &&
+ {!isPending &&
data?.secrets &&
data?.totalCount >= perPage &&
data?.totalCount !== undefined && (
@@ -71,7 +71,7 @@ export const ShareSecretsTable = ({ handlePopUpOpen }: Props) => {
onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
/>
)}
- {!isLoading && !data?.secrets?.length && (
+ {!isPending && !data?.secrets?.length && (
<EmptyState title="No secrets shared yet" icon={faKey} />
)}
</TableContainer>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamForm.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamForm.tsx
index d4bc35ac9f..c022610df1 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamForm.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamForm.tsx
@@ -108,7 +108,7 @@ export const AuditLogStreamForm = ({ id = "", onClose }: Props) => {
}
};
- if (isEdit && auditLogStream.isLoading) {
+ if (isEdit && auditLogStream.isPending) {
return (
<div className="flex items-center justify-center p-8">
<Spinner size="lg" />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamTab.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamTab.tsx
index ddbcc79599..beb0f63dbf 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamTab.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/AuditLogStreamTab/AuditLogStreamTab.tsx
@@ -1,6 +1,7 @@
import { faPlug, faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -15,8 +16,7 @@ import {
TBody,
Td,
THead,
- Tr,
- UpgradePlanModal
+ Tr
} from "@app/components/v2";
import {
OrgPermissionActions,
@@ -41,7 +41,7 @@ export const AuditLogStreamsTab = withPermission(
] as const);
const { subscription } = useSubscription();
- const { data: auditLogStreams, isLoading: isAuditLogStreamsLoading } =
+ const { data: auditLogStreams, isPending: isAuditLogStreamsLoading } =
useGetAuditLogStreams(orgId);
// mutation
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ExternalGroupOrgRoleMappings.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ExternalGroupOrgRoleMappings.tsx
index 4972d8d6d8..6109bf65b9 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ExternalGroupOrgRoleMappings.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ExternalGroupOrgRoleMappings.tsx
@@ -43,7 +43,7 @@ type TForm = z.infer<typeof formSchema>;
export const ExternalGroupOrgRoleMappings = () => {
const { currentOrg } = useOrganization();
- const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(currentOrg.id);
+ const { data: roles, isPending: isRolesLoading } = useGetOrgRoles(currentOrg.id);
const { data: mappings } = useGetExternalGroupOrgRoleMappings();
const updateMappings = useUpdateExternalGroupOrgRoleMappings();
const { permission } = useOrgPermission();
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPGroupMapModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPGroupMapModal.tsx
index 2aa4d22c78..b68c76d77a 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPGroupMapModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPGroupMapModal.tsx
@@ -64,8 +64,8 @@ export const LDAPGroupMapModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }:
const { data: ldapConfig } = useGetLDAPConfig(currentOrg?.id ?? "");
const { data: groups } = useGetOrganizationGroups(currentOrg?.id ?? "");
- const { data: groupMaps, isLoading } = useGetLDAPGroupMaps(ldapConfig?.id ?? "");
- const { mutateAsync: createLDAPGroupMapping, isLoading: createIsLoading } =
+ const { data: groupMaps, isPending } = useGetLDAPGroupMaps(ldapConfig?.id ?? "");
+ const { mutateAsync: createLDAPGroupMapping, isPending: createIsLoading } =
useCreateLDAPGroupMapping();
const { mutateAsync: deleteLDAPGroupMapping } = useDeleteLDAPGroupMapping();
const navigate = useNavigate();
@@ -215,8 +215,8 @@ export const LDAPGroupMapModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }:
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={3} innerKey="ldap-group-maps" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={3} innerKey="ldap-group-maps" />}
+ {!isPending &&
groupMaps?.map(({ id, ldapGroupCN, group }) => {
return (
<Tr className="h-10 items-center" key={`ldap-group-map-${id}`}>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPModal.tsx
index 136141bae6..da75a769b8 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/LDAPModal.tsx
@@ -47,8 +47,8 @@ type Props = {
export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
- const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateLDAPConfig();
- const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateLDAPConfig();
+ const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateLDAPConfig();
+ const { mutateAsync: updateMutateAsync, isPending: updateIsLoading } = useUpdateLDAPConfig();
const { mutateAsync: testLDAPConnection } = useTestLDAPConnection();
const { data } = useGetLDAPConfig(currentOrg?.id ?? "");
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OIDCModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OIDCModal.tsx
index 6df9a118f1..30807bda9f 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OIDCModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OIDCModal.tsx
@@ -99,8 +99,8 @@ export type OIDCFormData = z.infer<typeof schema>;
export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
- const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateOIDCConfig();
- const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateOIDCConfig();
+ const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateOIDCConfig();
+ const { mutateAsync: updateMutateAsync, isPending: updateIsLoading } = useUpdateOIDCConfig();
const [isDeletePopupOpen, setIsDeletePopupOpen] = useToggle(false);
const { data } = useGetOIDCConfig(currentOrg?.slug ?? "");
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgAuthTab.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgAuthTab.tsx
index c0ff17ae6d..cc6358e3c7 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgAuthTab.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgAuthTab.tsx
@@ -1,6 +1,7 @@
import { twMerge } from "tailwind-merge";
-import { Button, ContentLoader, UpgradePlanModal } from "@app/components/v2";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
+import { Button, ContentLoader } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -38,13 +39,13 @@ export const OrgAuthTab = withPermission(
const { subscription } = useSubscription();
- const { data: oidcConfig, isLoading: isLoadingOidcConfig } = useGetOIDCConfig(
+ const { data: oidcConfig, isPending: isLoadingOidcConfig } = useGetOIDCConfig(
currentOrg?.slug ?? ""
);
- const { data: samlConfig, isLoading: isLoadingSamlConfig } = useGetSSOConfig(
+ const { data: samlConfig, isPending: isLoadingSamlConfig } = useGetSSOConfig(
currentOrg?.id ?? ""
);
- const { data: ldapConfig, isLoading: isLoadingLdapConfig } = useGetLDAPConfig(
+ const { data: ldapConfig, isPending: isLoadingLdapConfig } = useGetLDAPConfig(
currentOrg?.id ?? ""
);
const areConfigsLoading = isLoadingOidcConfig || isLoadingSamlConfig || isLoadingLdapConfig;
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGeneralAuthSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGeneralAuthSection.tsx
index 778215f07b..5e04f173e0 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGeneralAuthSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGeneralAuthSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Switch, UpgradePlanModal } from "@app/components/v2";
+import { Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGenericAuthSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGenericAuthSection.tsx
index 9b9aa65532..7e2bd522b3 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGenericAuthSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgGenericAuthSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { FormControl, Select, SelectItem, Switch, UpgradePlanModal } from "@app/components/v2";
+import { FormControl, Select, SelectItem, Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgLDAPSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgLDAPSection.tsx
index 49e07f8617..9c72932100 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgLDAPSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgLDAPSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
+import { Button, Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgOIDCSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgOIDCSection.tsx
index c277e90f1b..2c0232d7ca 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgOIDCSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgOIDCSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
+import { Button, Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -17,7 +18,7 @@ export const OrgOIDCSection = (): JSX.Element => {
const { currentOrg } = useOrganization();
const { subscription } = useSubscription();
- const { data, isLoading } = useGetOIDCConfig(currentOrg?.slug ?? "");
+ const { data, isPending } = useGetOIDCConfig(currentOrg?.slug ?? "");
const { mutateAsync } = useUpdateOIDCConfig();
const { mutateAsync: updateOrg } = useUpdateOrg();
@@ -91,7 +92,7 @@ export const OrgOIDCSection = (): JSX.Element => {
<div className="py-4">
<div className="mb-2 flex items-center justify-between">
<h2 className="text-md text-mineshaft-100">OIDC</h2>
- {!isLoading && (
+ {!isPending && (
<OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Sso}>
{(isAllowed) => (
<Button
@@ -111,7 +112,7 @@ export const OrgOIDCSection = (): JSX.Element => {
<div className="py-4">
<div className="mb-2 flex items-center justify-between">
<h2 className="text-md text-mineshaft-100">Enable OIDC</h2>
- {!isLoading && (
+ {!isPending && (
<OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Sso}>
{(isAllowed) => (
<Switch
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSCIMSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSCIMSection.tsx
index e20a5fe22e..a10b188a8f 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSCIMSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSCIMSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
+import { Button, Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSSOSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSSOSection.tsx
index 3e5d778422..3ffd8b3c27 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSSOSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/OrgSSOSection.tsx
@@ -1,6 +1,7 @@
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
+import { Button, Switch } from "@app/components/v2";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -16,7 +17,7 @@ export const OrgSSOSection = (): JSX.Element => {
const { currentOrg } = useOrganization();
const { subscription } = useSubscription();
- const { data, isLoading } = useGetSSOConfig(currentOrg?.id ?? "");
+ const { data, isPending } = useGetSSOConfig(currentOrg?.id ?? "");
const { mutateAsync } = useUpdateSSOConfig();
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
"upgradePlan",
@@ -83,7 +84,7 @@ export const OrgSSOSection = (): JSX.Element => {
<div className="py-4">
<div className="mb-2 flex items-center justify-between">
<h2 className="text-md text-mineshaft-100">SAML</h2>
- {!isLoading && (
+ {!isPending && (
<OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Sso}>
{(isAllowed) => (
<Button onClick={addSSOBtnClick} colorSchema="secondary" isDisabled={!isAllowed}>
@@ -98,7 +99,7 @@ export const OrgSSOSection = (): JSX.Element => {
<div className="py-4">
<div className="mb-2 flex items-center justify-between">
<h2 className="text-md text-mineshaft-100">Enable SAML</h2>
- {!isLoading && (
+ {!isPending && (
<OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Sso}>
{(isAllowed) => (
<Switch
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/SSOModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/SSOModal.tsx
index a39f1241f1..eab111c154 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/SSOModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/SSOModal.tsx
@@ -57,8 +57,8 @@ type Props = {
export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
- const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateSSOConfig();
- const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateSSOConfig();
+ const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateSSOConfig();
+ const { mutateAsync: updateMutateAsync, isPending: updateIsLoading } = useUpdateSSOConfig();
const [isDeletePopupOpen, setIsDeletePopupOpen] = useToggle();
const { data } = useGetSSOConfig(currentOrg?.id ?? "");
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ScimTokenModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ScimTokenModal.tsx
index 82a038e58b..cc44204c9a 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ScimTokenModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgAuthTab/ScimTokenModal.tsx
@@ -61,7 +61,7 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
const [isScimUrlCopied, setIsScimUrlCopied] = useToggle(false);
const [isScimTokenCopied, setIsScimTokenCopied] = useToggle(false);
- const { data, isLoading } = useGetScimTokens(currentOrg?.id ?? "");
+ const { data, isPending } = useGetScimTokens(currentOrg?.id ?? "");
const { mutateAsync: createScimTokenMutateAsync } = useCreateScimToken();
const { mutateAsync: deleteScimTokenMutateAsync } = useDeleteScimToken();
@@ -256,8 +256,8 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="org-scim-tokens" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="org-scim-tokens" />}
+ {!isPending &&
data &&
data.length > 0 &&
data.map(({ id, description, ttlDays, createdAt }) => {
@@ -289,7 +289,7 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
</Tr>
);
})}
- {!isLoading && data && data?.length === 0 && (
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={4}>
<EmptyState title="No SCIM tokens have been created yet" icon={faKey} />
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgDeleteSection/OrgDeleteSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgDeleteSection/OrgDeleteSection.tsx
index e28d0dcfba..e810a6a3ab 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgDeleteSection/OrgDeleteSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgDeleteSection/OrgDeleteSection.tsx
@@ -17,7 +17,7 @@ export const OrgDeleteSection = () => {
"deleteOrg"
] as const);
- const { mutateAsync, isLoading } = useDeleteOrgById();
+ const { mutateAsync, isPending } = useDeleteOrgById();
const handleDeleteOrgSubmit = async () => {
try {
@@ -50,7 +50,7 @@ export const OrgDeleteSection = () => {
<div className="py-4">
<p className="text-md mb-4 text-mineshaft-100">Danger Zone</p>
<Button
- isLoading={isLoading}
+ isLoading={isPending}
colorSchema="danger"
variant="outline_bg"
type="submit"
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/GcpKmsForm.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/GcpKmsForm.tsx
index b4476bcbc5..07711d3067 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/GcpKmsForm.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/GcpKmsForm.tsx
@@ -109,7 +109,7 @@ export const GcpKmsForm = ({ onCompleted, onCancel, kms }: Props) => {
const { currentOrg } = useOrganization();
const { mutateAsync: addGcpExternalKms } = useAddExternalKms(currentOrg.id);
const { mutateAsync: updateGcpExternalKms } = useUpdateExternalKms(currentOrg.id);
- const { mutateAsync: fetchGcpKeys, isLoading: isFetchGcpKeysLoading } =
+ const { mutateAsync: fetchGcpKeys, isPending: isFetchGcpKeysLoading } =
useExternalKmsFetchGcpKeys(currentOrg?.id);
// transforms the credential file into a JSON object
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/OrgEncryptionTab.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/OrgEncryptionTab.tsx
index d2d676bdf2..dc25b40af0 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/OrgEncryptionTab.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/OrgEncryptionTab.tsx
@@ -3,6 +3,7 @@ import { faEllipsis, faLock, faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { twMerge } from "tailwind-merge";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
@@ -19,8 +20,7 @@ import {
TBody,
Td,
THead,
- Tr,
- UpgradePlanModal
+ Tr
} from "@app/components/v2";
import {
OrgPermissionActions,
@@ -47,7 +47,7 @@ export const OrgEncryptionTab = withPermission(
"editExternalKms",
"removeExternalKms"
] as const);
- const { data: externalKmsList, isLoading: isExternalKmsListLoading } =
+ const { data: externalKmsList, isPending: isExternalKmsListLoading } =
useGetExternalKmsList(orgId);
const { mutateAsync: removeExternalKms } = useRemoveExternalKms(currentOrg.id);
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/UpdateExternalKmsForm.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/UpdateExternalKmsForm.tsx
index bc2e85558f..2b37a49ddd 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/UpdateExternalKmsForm.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgEncryptionTab/UpdateExternalKmsForm.tsx
@@ -12,11 +12,11 @@ type Props = {
};
export const UpdateExternalKmsForm = ({ isOpen, kmsId, onOpenChange }: Props) => {
- const { data: externalKms, isLoading } = useGetExternalKmsById(kmsId);
+ const { data: externalKms, isPending } = useGetExternalKmsById(kmsId);
return (
<Modal isOpen={isOpen} onOpenChange={onOpenChange}>
<ModalContent title="Edit configuration" bodyClassName="overflow-visible">
- {isLoading && <ContentLoader />}
+ {isPending && <ContentLoader />}
{externalKms?.external?.provider === ExternalKmsProvider.Aws && (
<AwsKmsForm
kms={externalKms}
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/AddOrgIncidentContactModal.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/AddOrgIncidentContactModal.tsx
index 1748682cd3..84bb083ec7 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/AddOrgIncidentContactModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/AddOrgIncidentContactModal.tsx
@@ -32,7 +32,7 @@ export const AddOrgIncidentContactModal = ({
resolver: zodResolver(addContactFormSchema)
});
- const { mutateAsync, isLoading } = useAddIncidentContact();
+ const { mutateAsync, isPending } = useAddIncidentContact();
const onFormSubmit = async ({ email }: TAddContactForm) => {
try {
@@ -86,7 +86,7 @@ export const AddOrgIncidentContactModal = ({
)}
/>
<div className="mt-8 flex items-center space-x-4">
- <Button size="sm" type="submit" isLoading={isLoading} isDisabled={isLoading}>
+ <Button size="sm" type="submit" isLoading={isPending} isDisabled={isPending}>
Add Incident Contact
</Button>
<Button
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/OrgIncidentContactsTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/OrgIncidentContactsTable.tsx
index 29d1e721bd..d0723fdaf6 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/OrgIncidentContactsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgIncidentContactsSection/OrgIncidentContactsTable.tsx
@@ -24,7 +24,7 @@ import { useDeleteIncidentContact, useGetOrgIncidentContact } from "@app/hooks/a
export const OrgIncidentContactsTable = () => {
const { currentOrg } = useOrganization();
- const { data: contacts, isLoading } = useGetOrgIncidentContact(currentOrg?.id ?? "");
+ const { data: contacts, isPending } = useGetOrgIncidentContact(currentOrg?.id ?? "");
const [searchContact, setSearchContact] = useState("");
const { handlePopUpToggle, popUp, handlePopUpOpen, handlePopUpClose } = usePopUp([
"removeContact",
@@ -78,7 +78,7 @@ export const OrgIncidentContactsTable = () => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={2} innerKey="incident-contact" />}
+ {isPending && <TableSkeleton columns={2} innerKey="incident-contact" />}
{filteredContacts?.map(({ email, id }) => (
<Tr key={email}>
<Td className="w-full">{email}</Td>
@@ -103,7 +103,7 @@ export const OrgIncidentContactsTable = () => {
))}
</TBody>
</Table>
- {filteredContacts?.length === 0 && !isLoading && (
+ {filteredContacts?.length === 0 && !isPending && (
<EmptyState title="No incident contacts found" icon={faContactBook} />
)}
</TableContainer>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgNameChangeSection/OrgNameChangeSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgNameChangeSection/OrgNameChangeSection.tsx
index 0fca370007..a64821fc27 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgNameChangeSection/OrgNameChangeSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/OrgNameChangeSection/OrgNameChangeSection.tsx
@@ -32,11 +32,11 @@ export const OrgNameChangeSection = (): JSX.Element => {
const { handleSubmit, control, reset } = useForm<FormData>({
resolver: zodResolver(formSchema)
});
- const { mutateAsync, isLoading } = useUpdateOrg();
+ const { mutateAsync, isPending } = useUpdateOrg();
const canReadOrgRoles = permission.can(OrgPermissionActions.Read, OrgPermissionSubjects.Role);
- const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(currentOrg.id, canReadOrgRoles);
+ const { data: roles, isPending: isRolesLoading } = useGetOrgRoles(currentOrg.id, canReadOrgRoles);
const [isFormInitialized, setIsFormInitialized] = useState(false);
useEffect(() => {
@@ -153,7 +153,7 @@ export const OrgNameChangeSection = (): JSX.Element => {
<OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
{(isAllowed) => (
<Button
- isLoading={isLoading}
+ isLoading={isPending}
isDisabled={!isAllowed}
colorSchema="primary"
variant="outline_bg"
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/EditProjectTemplateSection/EditProjectTemplateSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/EditProjectTemplateSection/EditProjectTemplateSection.tsx
index 0923a9bb45..60ca359bb1 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/EditProjectTemplateSection/EditProjectTemplateSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/EditProjectTemplateSection/EditProjectTemplateSection.tsx
@@ -20,7 +20,7 @@ export const EditProjectTemplateSection = ({ template, onBack }: Props) => {
template.name as InfisicalProjectTemplate
);
- const { data: projectTemplate, isLoading } = useGetProjectTemplateById(template.id, {
+ const { data: projectTemplate, isPending } = useGetProjectTemplateById(template.id, {
initialData: template,
enabled: !isInfisicalTemplate
});
@@ -37,7 +37,7 @@ export const EditProjectTemplateSection = ({ template, onBack }: Props) => {
Back to Templates
</Button>
{/* eslint-disable-next-line no-nested-ternary */}
- {isLoading ? (
+ {isPending ? (
<div className="flex h-[60vh] w-full items-center justify-center p-24">
<Spinner />
</div>
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesSection.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesSection.tsx
index 151ee9f5df..d4a0769308 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesSection.tsx
@@ -3,8 +3,9 @@ import { faArrowUpRightFromSquare, faBookOpen, faPlus } from "@fortawesome/free-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { AnimatePresence, motion } from "framer-motion";
+import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, UpgradePlanModal } from "@app/components/v2";
+import { Button } from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects, useSubscription } from "@app/context";
import { TProjectTemplate } from "@app/hooks/api/projectTemplates";
import { usePopUp } from "@app/hooks/usePopUp";
diff --git a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
index b3e2d9ba33..b8dc00ab22 100644
--- a/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/_org_details/organization/$organizationId/settings/-components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
@@ -35,7 +35,7 @@ type Props = {
export const ProjectTemplatesTable = ({ onEdit }: Props) => {
const { subscription } = useSubscription();
- const { isLoading, data: projectTemplates = [] } = useListProjectTemplates({
+ const { isPending, data: projectTemplates = [] } = useListProjectTemplates({
enabled: subscription?.projectTemplates
});
const [search, setSearch] = useState("");
@@ -69,7 +69,7 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
</Tr>
</THead>
<TBody>
- {isLoading && (
+ {isPending && (
<TableSkeleton
innerKey="project-templates-table"
columns={4}
@@ -164,7 +164,7 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
</Tr>
);
})}
- {!isLoading && filteredTemplates?.length === 0 && (
+ {!isPending && filteredTemplates?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/APIKeyTable.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/APIKeyTable.tsx
index 07531dbc08..6fe6afd43a 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/APIKeyTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/APIKeyTable.tsx
@@ -18,7 +18,7 @@ import {
import { useDeleteAPIKey, useGetMyAPIKeys } from "@app/hooks/api";
export const APIKeyTable = () => {
- const { data, isLoading } = useGetMyAPIKeys();
+ const { data, isPending } = useGetMyAPIKeys();
const { mutateAsync } = useDeleteAPIKey();
const handleDeleteAPIKeyDataClick = async (apiKeyDataId: string) => {
@@ -50,8 +50,8 @@ export const APIKeyTable = () => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="api-keys" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="api-keys" />}
+ {!isPending &&
data &&
data.length > 0 &&
data.map(({ id, name, createdAt, expiresAt, lastUsed }) => {
@@ -77,7 +77,7 @@ export const APIKeyTable = () => {
</Tr>
);
})}
- {!isLoading && data && data?.length === 0 && (
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={5}>
<EmptyState title="No API Keys on file" icon={faKey} />
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/AddAPIKeyModal.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/AddAPIKeyModal.tsx
index 595da20f2d..ce901112e5 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/AddAPIKeyModal.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/APIKeySection/AddAPIKeyModal.tsx
@@ -54,7 +54,7 @@ export const AddAPIKeyModal = ({ popUp, handlePopUpToggle }: Props) => {
const [newAPIKey, setNewAPIKey] = useState("");
const [isAPIKeyCopied, setIsAPIKeyCopied] = useToggle(false);
- const { mutateAsync, isLoading } = useCreateAPIKey();
+ const { mutateAsync, isPending } = useCreateAPIKey();
const { control, handleSubmit, reset } = useForm<FormData>({
resolver: zodResolver(schema)
@@ -149,8 +149,8 @@ export const AddAPIKeyModal = ({ popUp, handlePopUpToggle }: Props) => {
className="mr-4"
size="sm"
type="submit"
- isLoading={isLoading}
- isDisabled={isLoading}
+ isLoading={isPending}
+ isDisabled={isPending}
>
Add
</Button>
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/DeleteAccountSection/DeleteAccountSection.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/DeleteAccountSection/DeleteAccountSection.tsx
index 74e2f83fef..f69c7aab12 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/DeleteAccountSection/DeleteAccountSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/DeleteAccountSection/DeleteAccountSection.tsx
@@ -12,7 +12,7 @@ export const DeleteAccountSection = () => {
"deleteAccount"
] as const);
- const { mutateAsync: deleteUserMutateAsync, isLoading } = useDeleteMe();
+ const { mutateAsync: deleteUserMutateAsync, isPending } = useDeleteMe();
const handleDeleteAccountSubmit = async () => {
try {
@@ -38,7 +38,7 @@ export const DeleteAccountSection = () => {
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<p className="mb-4 text-xl font-semibold text-mineshaft-100">Danger Zone</p>
<Button
- isLoading={isLoading}
+ isLoading={isPending}
colorSchema="danger"
variant="outline_bg"
type="submit"
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/SecuritySection/MFASection.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/SecuritySection/MFASection.tsx
index f27bf65dd1..7f8988fa58 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/SecuritySection/MFASection.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/SecuritySection/MFASection.tsx
@@ -33,7 +33,7 @@ export const MFASection = () => {
"deleteTotpConfig"
] as const);
const [shouldShowRecoveryCodes, setShouldShowRecoveryCodes] = useToggle();
- const { data: totpConfiguration, isLoading: isTotpConfigurationLoading } =
+ const { data: totpConfiguration, isPending: isTotpConfigurationLoading } =
useGetUserTotpConfiguration();
const { mutateAsync: deleteTotpConfiguration } = useDeleteUserTotpConfiguration();
const { mutateAsync: createTotpRecoveryCodes } = useCreateNewTotpRecoveryCodes();
@@ -206,7 +206,7 @@ export const MFASection = () => {
<div className="ml-6 mt-6 flex min-w-full">
<TotpRegistration
onComplete={async () => {
- await queryClient.invalidateQueries(userKeys.totpConfiguration);
+ await queryClient.invalidateQueries({ queryKey: userKeys.totpConfiguration });
}}
/>
</div>
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/SessionsSection/SessionsTable.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/SessionsSection/SessionsTable.tsx
index dfb6576401..9a24b1e270 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/SessionsSection/SessionsTable.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/SessionsSection/SessionsTable.tsx
@@ -14,7 +14,7 @@ import {
import { useGetMySessions } from "@app/hooks/api";
export const SessionsTable = () => {
- const { data, isLoading } = useGetMySessions();
+ const { data, isPending } = useGetMySessions();
const formatDate = (dateToFormat: string) => {
const date = new Date(dateToFormat);
@@ -39,8 +39,8 @@ export const SessionsTable = () => {
</Tr>
</THead>
<TBody>
- {isLoading && <TableSkeleton columns={4} innerKey="sesssions" />}
- {!isLoading &&
+ {isPending && <TableSkeleton columns={4} innerKey="sesssions" />}
+ {!isPending &&
data &&
data.length > 0 &&
data.map(({ id, createdAt, lastUsed, ip, userAgent }) => {
@@ -53,7 +53,7 @@ export const SessionsTable = () => {
</Tr>
);
})}
- {!isLoading && data && data?.length === 0 && (
+ {!isPending && data && data?.length === 0 && (
<Tr>
<Td colSpan={4}>
<EmptyState title="No sessions on file" icon={faServer} />
diff --git a/frontend-v2/src/routes/_authenticate/personal-settings/-components/UserNameSection/UserNameSection.tsx b/frontend-v2/src/routes/_authenticate/personal-settings/-components/UserNameSection/UserNameSection.tsx
index d9653fa2a2..00d32c1fbc 100644
--- a/frontend-v2/src/routes/_authenticate/personal-settings/-components/UserNameSection/UserNameSection.tsx
+++ b/frontend-v2/src/routes/_authenticate/personal-settings/-components/UserNameSection/UserNameSection.tsx
@@ -18,7 +18,7 @@ export const UserNameSection = (): JSX.Element => {
const { user } = useUser();
const { handleSubmit, control, reset } = useForm<FormData>({ resolver: zodResolver(formSchema) });
- const { mutateAsync, isLoading } = useRenameUser();
+ const { mutateAsync, isPending } = useRenameUser();
useEffect(() => {
if (user) {
@@ -63,7 +63,7 @@ export const UserNameSection = (): JSX.Element => {
name="name"
/>
</div>
- <Button isLoading={isLoading} colorSchema="primary" variant="outline_bg" type="submit">
+ <Button isLoading={isPending} colorSchema="primary" variant="outline_bg" type="submit">
Save
</Button>
</form>
diff --git a/frontend-v2/src/routes/_restrict_login_signup/login/-components/Login.utils.tsx b/frontend-v2/src/routes/_restrict_login_signup/login/-components/Login.utils.tsx
index 963f860780..46f60858ab 100644
--- a/frontend-v2/src/routes/_restrict_login_signup/login/-components/Login.utils.tsx
+++ b/frontend-v2/src/routes/_restrict_login_signup/login/-components/Login.utils.tsx
@@ -37,7 +37,7 @@ export const useNavigateToSelectOrganization = () => {
if (config.defaultAuthOrgId) {
redirectTo += `org_id=${config.defaultAuthOrgId}&`;
} else {
- queryClient.invalidateQueries(userKeys.getUser);
+ queryClient.invalidateQueries({ queryKey: userKeys.getUser });
}
if (cliCallbackPort) {
diff --git a/frontend-v2/src/routes/_restrict_login_signup/login/provider/success.tsx b/frontend-v2/src/routes/_restrict_login_signup/login/provider/success.tsx
index d5906a2ec9..8a0e4b62f8 100644
--- a/frontend-v2/src/routes/_restrict_login_signup/login/provider/success.tsx
+++ b/frontend-v2/src/routes/_restrict_login_signup/login/provider/success.tsx
@@ -1,9 +1,9 @@
import { useEffect } from "react";
import { createFileRoute, useSearch } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import SecurityClient from "@app/components/utilities/SecurityClient";
-import { z } from "zod";
-import { zodValidator } from "@tanstack/zod-adapter";
const LoginProviderSuccess = () => {
const search = useSearch({ from: "/_restrict_login_signup/login/provider/success" });
diff --git a/frontend-v2/src/routes/_restrict_login_signup/login/select-organization/index.tsx b/frontend-v2/src/routes/_restrict_login_signup/login/select-organization/index.tsx
index f4682026b6..63df0b1c5a 100644
--- a/frontend-v2/src/routes/_restrict_login_signup/login/select-organization/index.tsx
+++ b/frontend-v2/src/routes/_restrict_login_signup/login/select-organization/index.tsx
@@ -43,7 +43,7 @@ const SelectOrganizationPage = () => {
const organizations = useGetOrganizations();
const selectOrg = useSelectOrganization();
- const { data: user, isLoading: userLoading } = useGetUser();
+ const { data: user, isPending: userLoading } = useGetUser();
const [shouldShowMfa, toggleShowMfa] = useToggle(false);
const [requiredMfaMethod, setRequiredMfaMethod] = useState(MfaMethod.EMAIL);
const [isInitialOrgCheckLoading, setIsInitialOrgCheckLoading] = useState(true);
@@ -175,7 +175,7 @@ const SelectOrganizationPage = () => {
}, [navigate]);
useEffect(() => {
- if (organizations.isLoading || !organizations.data) return;
+ if (organizations.isPending || !organizations.data) return;
// Case: User has no organizations.
// This can happen if the user was previously a member, but the organization was deleted or the user was removed.
@@ -191,7 +191,7 @@ const SelectOrganizationPage = () => {
} else {
setIsInitialOrgCheckLoading(false);
}
- }, [organizations.isLoading, organizations.data]);
+ }, [organizations.isPending, organizations.data]);
useEffect(() => {
if (defaultSelectedOrg) {
@@ -248,7 +248,7 @@ const SelectOrganizationPage = () => {
</div>
</div>
<div className="mt-2 w-1/4 min-w-[21.2rem] space-y-4 rounded-md text-center md:min-w-[25.1rem] lg:w-1/4">
- {organizations.isLoading ? (
+ {organizations.isPending ? (
<Spinner />
) : (
organizations.data?.map((org) => (
diff --git a/frontend-v2/src/routes/_restrict_login_signup/password-reset.tsx b/frontend-v2/src/routes/_restrict_login_signup/password-reset.tsx
index 19c602c6de..86dfe2b3ae 100644
--- a/frontend-v2/src/routes/_restrict_login_signup/password-reset.tsx
+++ b/frontend-v2/src/routes/_restrict_login_signup/password-reset.tsx
@@ -41,7 +41,7 @@ const PasswordResetPage = () => {
const {
mutateAsync: verifyPasswordResetCodeMutateAsync,
- isLoading: isVerifyPasswordResetLoading
+ isPending: isVerifyPasswordResetLoading
} = useVerifyPasswordResetCode();
const { mutateAsync: resetPasswordMutateAsync } = useResetPassword();
diff --git a/frontend-v2/src/types/reactQuery.ts b/frontend-v2/src/types/reactQuery.ts
new file mode 100644
index 0000000000..18ef404dd9
--- /dev/null
+++ b/frontend-v2/src/types/reactQuery.ts
@@ -0,0 +1,6 @@
+export type TReactQueryOptions = {
+ options?: {
+ enabled?: boolean;
+ refetchInterval?: number;
+ };
+};