mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 01:27:31 +00:00
fix: resolved secret and approval count triggered for other project types
This commit is contained in:
@@ -46,8 +46,19 @@ export const ProjectLayout = () => {
|
|||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
const projectSlug = currentWorkspace?.slug || "";
|
const projectSlug = currentWorkspace?.slug || "";
|
||||||
|
|
||||||
const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({ workspaceId });
|
const isSecretManager = currentWorkspace?.type === ProjectType.SecretManager;
|
||||||
const { data: accessApprovalRequestCount } = useGetAccessRequestsCount({ projectSlug });
|
const isCertManager = currentWorkspace?.type === ProjectType.CertificateManager;
|
||||||
|
const isCmek = currentWorkspace?.type === ProjectType.KMS;
|
||||||
|
const isSSH = currentWorkspace?.type === ProjectType.SSH;
|
||||||
|
|
||||||
|
const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({
|
||||||
|
workspaceId,
|
||||||
|
options: { enabled: isSecretManager }
|
||||||
|
});
|
||||||
|
const { data: accessApprovalRequestCount } = useGetAccessRequestsCount({
|
||||||
|
projectSlug,
|
||||||
|
options: { enabled: isSecretManager }
|
||||||
|
});
|
||||||
|
|
||||||
const pendingRequestsCount =
|
const pendingRequestsCount =
|
||||||
(secretApprovalReqCount?.open || 0) + (accessApprovalRequestCount?.pendingCount || 0);
|
(secretApprovalReqCount?.open || 0) + (accessApprovalRequestCount?.pendingCount || 0);
|
||||||
@@ -86,11 +97,6 @@ export const ProjectLayout = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSecretManager = currentWorkspace?.type === ProjectType.SecretManager;
|
|
||||||
const isCertManager = currentWorkspace?.type === ProjectType.CertificateManager;
|
|
||||||
const isCmek = currentWorkspace?.type === ProjectType.KMS;
|
|
||||||
const isSSH = currentWorkspace?.type === ProjectType.SSH;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="dark hidden h-screen w-full flex-col overflow-x-hidden md:flex">
|
<div className="dark hidden h-screen w-full flex-col overflow-x-hidden md:flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user