Skip to content

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

improvement(secret-manager): migrate S08 Secret Manager core, integration management and rotation UI to V3 (#8599)

Andrew Huang5d204c7b49b6
diff --git a/frontend/src/components/secret-rotations-v2/SecretRotationV2StatusBadge.tsx b/frontend/src/components/secret-rotations-v2/SecretRotationV2StatusBadge.tsx
index e09d345dca..777fef50d0 100644
--- a/frontend/src/components/secret-rotations-v2/SecretRotationV2StatusBadge.tsx
+++ b/frontend/src/components/secret-rotations-v2/SecretRotationV2StatusBadge.tsx
@@ -3,8 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { format, formatDistanceToNow } from "date-fns";
import { BanIcon, RefreshCwIcon, XIcon } from "lucide-react";
-import { Tooltip } from "@app/components/v2";
-import { Badge } from "@app/components/v3";
+import { Badge, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
import { SecretRotationStatus, TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
type Props = {
@@ -26,10 +25,14 @@ export const SecretRotationV2StatusBadge = ({ secretRotation }: Props) => {
}
return (
- <Tooltip
- position="left"
- className="max-w-sm select-text"
- content={
+ <Tooltip hoverable selectable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <Badge variant="danger">
+ <XIcon />
+ Rotation Failed
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent side="left" className="max-w-sm">
<div className="flex flex-col gap-2 py-1 whitespace-normal">
<div>
<div className="mb-2 flex self-start text-danger">
@@ -47,12 +50,7 @@ export const SecretRotationV2StatusBadge = ({ secretRotation }: Props) => {
</span>
)}
</div>
- }
- >
- <Badge variant="danger">
- <XIcon />
- Rotation Failed
- </Badge>
+ </TooltipContent>
</Tooltip>
);
}
@@ -70,24 +68,21 @@ export const SecretRotationV2StatusBadge = ({ secretRotation }: Props) => {
(new Date(nextRotationAt).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24);
return (
- <Tooltip
- className="max-w-lg"
- content={
- <>
- <span>
- Rotates on {format(nextRotationAt, "MM/dd/yyyy")} at {format(nextRotationAt, "h:mm aa")}
- </span>{" "}
- <span className="text-label">(Local Time)</span>
- </>
- }
- asChild
- >
- <Badge variant={daysToRotation >= 7 ? "info" : "warning"} className="capitalize">
- <RefreshCwIcon />
- {daysToRotation < 0
- ? "Rotating"
- : `Rotates ${formatDistanceToNow(nextRotationAt, { addSuffix: true })}`}
- </Badge>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <Badge variant={daysToRotation >= 7 ? "info" : "warning"} className="capitalize">
+ <RefreshCwIcon />
+ {daysToRotation < 0
+ ? "Rotating"
+ : `Rotates ${formatDistanceToNow(nextRotationAt, { addSuffix: true })}`}
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-lg">
+ <span>
+ Rotates on {format(nextRotationAt, "MM/dd/yyyy")} at {format(nextRotationAt, "h:mm aa")}
+ </span>{" "}
+ <span className="text-label">(Local Time)</span>
+ </TooltipContent>
</Tooltip>
);
};
diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx
index 1bac2befe7..d6081b8383 100644
--- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx
+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx
@@ -2,7 +2,15 @@ import { useReducer } from "react";
import { faCheck, faCopy, faEyeSlash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { GenericFieldLabel, IconButton, Tooltip } from "@app/components/v2";
+import {
+ Detail,
+ DetailLabel,
+ DetailValue,
+ IconButton,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { useTimedReset } from "@app/hooks";
type Props = {
@@ -19,43 +27,52 @@ export const CredentialDisplay = ({ children, label, isSensitive }: Props) => {
});
return (
- <GenericFieldLabel label={label}>
+ <Detail className="min-w-0">
+ <DetailLabel>{label}</DetailLabel>
{children ? (
- <div className="flex w-full min-w-0 items-center gap-1 text-foreground">
+ <DetailValue className="flex w-full min-w-0 items-center gap-1">
<span className="min-w-0 flex-1 truncate" title={showCredential ? children : undefined}>
{showCredential ? children : "****************************"}
</span>
<span className="flex-shrink-0">
- <Tooltip content={`Copy ${label}`}>
- <IconButton
- onClick={() => {
- setCopyCredential(children);
- navigator.clipboard.writeText(children);
- }}
- ariaLabel="Copy credential"
- variant="plain"
- size="xs"
- >
- <FontAwesomeIcon icon={isCopyingCredential ? faCheck : faCopy} />
- </IconButton>
- </Tooltip>
- </span>
- {isSensitive && (
- <span className="flex-shrink-0">
- <Tooltip content={`Show ${label}`}>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
<IconButton
- variant="plain"
+ onClick={() => {
+ setCopyCredential(children);
+ navigator.clipboard.writeText(children);
+ }}
+ aria-label="Copy credential"
+ variant="ghost"
size="xs"
- onClick={toggleShowCredential}
- ariaLabel={`${showCredential ? "Hide" : "Show"} credential`}
>
- <FontAwesomeIcon icon={faEyeSlash} />
+ <FontAwesomeIcon icon={isCopyingCredential ? faCheck : faCopy} />
</IconButton>
+ </TooltipTrigger>
+ <TooltipContent>{`Copy ${label}`}</TooltipContent>
+ </Tooltip>
+ </span>
+ {isSensitive && (
+ <span className="flex-shrink-0">
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <IconButton
+ variant="ghost"
+ size="xs"
+ onClick={toggleShowCredential}
+ aria-label={`${showCredential ? "Hide" : "Show"} credential`}
+ >
+ <FontAwesomeIcon icon={faEyeSlash} />
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent>{`Show ${label}`}</TooltipContent>
</Tooltip>
</span>
)}
- </div>
- ) : null}
- </GenericFieldLabel>
+ </DetailValue>
+ ) : (
+ <DetailValue className="text-muted italic">None</DetailValue>
+ )}
+ </Detail>
);
};
diff --git a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/IntegrationConnectionSection.tsx b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/IntegrationConnectionSection.tsx
index 1b0079020b..f4acc55d10 100644
--- a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/IntegrationConnectionSection.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/IntegrationConnectionSection.tsx
@@ -1,4 +1,4 @@
-import { FormLabel } from "@app/components/v2";
+import { Detail, DetailLabel } from "@app/components/v3";
import { CircleCiScope } from "@app/hooks/api/integrationAuth/types";
import { IntegrationMappingBehavior, TIntegrationWithEnv } from "@app/hooks/api/integrations/types";
@@ -14,18 +14,18 @@ export const IntegrationConnectionSection = ({ integration }: Props) => {
return (
<div className="flex flex-row">
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Organization" />
+ <Detail>
+ <DetailLabel>Organization</DetailLabel>
<div className="text-sm text-label">{integration?.owner || "-"}</div>
- </div>
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Project" />
+ </Detail>
+ <Detail>
+ <DetailLabel>Project</DetailLabel>
<div className="text-sm text-label">{integration?.targetService || "-"}</div>
- </div>
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Target Environment" />
+ </Detail>
+ <Detail>
+ <DetailLabel>Target Environment</DetailLabel>
<div className="text-sm text-label">{integration?.targetEnvironment || "-"}</div>
- </div>
+ </Detail>
</div>
);
};
@@ -90,31 +90,31 @@ export const IntegrationConnectionSection = ({ integration }: Props) => {
};
return (
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label={formLabel()} />
+ <Detail>
+ <DetailLabel>{formLabel()}</DetailLabel>
<div className="text-sm text-label">{contents()}</div>
- </div>
+ </Detail>
);
};
const targetEnvironmentDetails = () => {
if (integration.integration === "bitbucket") {
return (
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Workspace" />
+ <Detail>
+ <DetailLabel>Workspace</DetailLabel>
<div className="text-sm text-label">
{integration.targetEnvironment || integration.targetEnvironmentId}
</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "octopus-deploy") {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Space" />
+ <Detail>
+ <DetailLabel>Space</DetailLabel>
<div className="text-sm text-label">{integration.targetEnvironment}</div>
- </div>
+ </Detail>
);
}
@@ -123,12 +123,12 @@ export const IntegrationConnectionSection = ({ integration }: Props) => {
(integration.integration === "github" && integration.scope === "github-env")
) {
return (
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Target Environment" />
+ <Detail>
+ <DetailLabel>Target Environment</DetailLabel>
<div className="text-sm text-label">
{integration.targetEnvironment || integration.targetEnvironmentId}
</div>
- </div>
+ </Detail>
);
}
@@ -138,55 +138,55 @@ export const IntegrationConnectionSection = ({ integration }: Props) => {
const generalIntegrationSpecificDetails = () => {
if (integration.integration === "checkly" && integration.targetService) {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Group" />
+ <Detail>
+ <DetailLabel>Group</DetailLabel>
<div className="text-sm text-label">{integration.targetService}</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "circleci" && integration.owner) {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Organization" />
+ <Detail>
+ <DetailLabel>Organization</DetailLabel>
<div className="text-sm text-label">{integration.owner}</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "terraform-cloud" && integration.targetService) {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Category" />
+ <Detail>
+ <DetailLabel>Category</DetailLabel>
<div className="text-sm text-label">{integration.targetService}</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "checkly" || integration.integration === "github") {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Secret Suffix" />
+ <Detail>
+ <DetailLabel>Secret Suffix</DetailLabel>
<div className="text-sm text-label">{integration?.metadata?.secretSuffix || "-"}</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "bitbucket" && integration.targetServiceId) {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Deployment Environment" />
+ <Detail>
+ <DetailLabel>Deployment Environment</DetailLabel>
<div className="text-sm text-label">{integration.targetService}</div>
- </div>
+ </Detail>
);
}
if (integration.integration === "windmill" && integration.url) {
return (
- <div>
- <FormLabel className="text-sm font-medium text-label" label="Instance URL" />
+ <Detail>
+ <DetailLabel>Instance URL</DetailLabel>
<div className="text-sm text-label">{integration.url}</div>
- </div>
+ </Detail>
);
}
@@ -200,25 +200,27 @@ export const IntegrationConnectionSection = ({ integration }: Props) => {
</div>
<div className="mt-4">
- <FormLabel className="my-2" label="Source" />
+ <DetailLabel className="my-2">Source</DetailLabel>
<div className="space-y-2 rounded-lg border border-border-subtle bg-surface-raised p-2">
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Environment" />
+ <Detail>
+ <DetailLabel>Environment</DetailLabel>
<div className="text-sm text-label">{integration.environment.name}</div>
- </div>
- <div className="flex flex-col">
- <FormLabel className="text-sm font-medium text-label" label="Secret Path" />
+ </Detail>
+ <Detail>
+ <DetailLabel>Secret Path</DetailLabel>
<div className="text-sm text-label">{integration.secretPath}</div>
- </div>
+ </Detail>
</div>
- <FormLabel className="my-2" label="Destination" />
+ <DetailLabel className="my-2">Destination</DetailLabel>
<div className="space-y-2 rounded-lg border border-border-subtle bg-surface-raised p-2">
- <FormLabel className="text-sm font-medium text-label" label="Platform" />
- <div className="text-sm text-label">
- {integrationSlugNameMapping?.[integration.integration]}
- </div>
+ <Detail>
+ <DetailLabel>Platform</DetailLabel>
+ <div className="text-sm text-label">
+ {integrationSlugNameMapping?.[integration.integration]}
+ </div>
+ </Detail>
{specifcQoveryDetails()}
{isNotAwsManagerOneToOneDetails()}
diff --git a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/OctopusDeployScopeValues.tsx b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/OctopusDeployScopeValues.tsx
index db326cf90e..f5271ddeb7 100644
--- a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/OctopusDeployScopeValues.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/components/OctopusDeployScopeValues.tsx
@@ -1,5 +1,4 @@
-import { FormLabel } from "@app/components/v2";
-import { Spinner } from "@app/components/v3";
+import { Detail, DetailLabel, Spinner } from "@app/components/v3";
import { useGetIntegrationAuthOctopusDeployScopeValues } from "@app/hooks/api/integrationAuth/queries";
import {
OctopusDeployScope,
@@ -73,11 +72,8 @@ export const OctopusDeployScopeValues = ({ integration }: OctopusDeployScopeValu
};
return (
- <div className="mt-4" key={key}>
- <FormLabel
- className="text-sm font-medium text-foreground-secondary"
- label={getLabel(key)}
- />
+ <Detail className="mt-4" key={key}>
+ <DetailLabel>{getLabel(key)}</DetailLabel>
<div className="text-sm text-label">
{values
@@ -86,7 +82,7 @@ export const OctopusDeployScopeValues = ({ integration }: OctopusDeployScopeValu
<p key={name}>{name}</p>
))}
</div>
- </div>
+ </Detail>
);
})}
</>
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationDetails.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationDetails.tsx
index 48437ace72..95edc74353 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationDetails.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationDetails.tsx
@@ -1,4 +1,4 @@
-import { FormLabel } from "@app/components/v2";
+import { Detail, DetailLabel } from "@app/components/v3";
import { CircleCiScope } from "@app/hooks/api/integrationAuth/types";
import { IntegrationMappingBehavior, TIntegration } from "@app/hooks/api/integrations/types";
@@ -22,37 +22,36 @@ export const IntegrationDetails = ({ integration }: Props) => {
return (
<div className="flex flex-col gap-2 p-2">
{integration.integration === "octopus-deploy" && (
- <div>
- <FormLabel label="Space" />
+ <Detail>
+ <DetailLabel>Space</DetailLabel>
<div className={FIELD_CLASSNAME}>
{integration.targetEnvironment || integration.targetEnvironmentId}
</div>
- </div>
+ </Detail>
)}
{integration.integration === "qovery" && (
<>
- <div>
- <FormLabel label="Org" />
+ <Detail>
+ <DetailLabel>Org</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration?.owner || "-"}</div>
- </div>
- <div>
- <FormLabel label="Project" />
+ </Detail>
+ <Detail>
+ <DetailLabel>Project</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration?.targetService || "-"}</div>
- </div>
- <div>
- <FormLabel label="Env" />
+ </Detail>
+ <Detail>
+ <DetailLabel>Env</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration?.targetEnvironment || "-"}</div>
- </div>
+ </Detail>
</>
)}
{!(
integration.integration === "aws-secret-manager" &&
integration.metadata?.mappingBehavior === IntegrationMappingBehavior.ONE_TO_ONE
) && (
- <div>
- <FormLabel
- label={
- (integration.integration === "qovery" && integration?.scope) ||
+ <Detail>
+ <DetailLabel>
+ {(integration.integration === "qovery" && integration?.scope) ||
(integration.integration === "circleci" &&
(integration.scope === CircleCiScope.Context ? "Context" : "Project")) ||
(integration.integration === "bitbucket" && "Repository") ||
@@ -63,11 +62,10 @@ export const IntegrationDetails = ({ integration }: Props) => {
(integration?.scope === "github-org" && "Organization") ||
(["github-repo", "github-env"].includes(integration?.scope as string) &&
"Repository") ||
- "App"
- }
- />
+ "App"}
+ </DetailLabel>
<div className={FIELD_CLASSNAME}>{getIntegrationDestination(integration)}</div>
- </div>
+ </Detail>
)}
{(integration.integration === "vercel" ||
integration.integration === "netlify" ||
@@ -75,55 +73,55 @@ export const IntegrationDetails = ({ integration }: Props) => {
integration.integration === "gitlab" ||
integration.integration === "teamcity" ||
(integration.integration === "github" && integration.scope === "github-env")) && (
- <div>
- <FormLabel label="Target Environment" />
+ <Detail>
+ <DetailLabel>Target Environment</DetailLabel>
<div className={FIELD_CLASSNAME}>
{integration.targetEnvironment || integration.targetEnvironmentId}
</div>
- </div>
+ </Detail>
)}
{integration.integration === "bitbucket" && (
<>
{integration.targetServiceId && (
- <div>
- <FormLabel label="Environment" />
+ <Detail>
+ <DetailLabel>Environment</DetailLabel>
<div className={FIELD_CLASSNAME}>
{integration.targetService || integration.targetServiceId}
</div>
- </div>
+ </Detail>
)}
- <div>
- <FormLabel label="Workspace" />
+ <Detail>
+ <DetailLabel>Workspace</DetailLabel>
<div className={FIELD_CLASSNAME}>
{integration.targetEnvironment || integration.targetEnvironmentId}
</div>
- </div>
+ </Detail>
</>
)}
{integration.integration === "checkly" && integration.targetService && (
- <div>
- <FormLabel label="Group" />
+ <Detail>
+ <DetailLabel>Group</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration.targetService}</div>
- </div>
+ </Detail>
)}
{integration.integration === "circleci" && integration.owner && (
- <div>
- <FormLabel label="Organization" />
+ <Detail>
+ <DetailLabel>Organization</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration.owner}</div>
- </div>
+ </Detail>
)}
{integration.integration === "terraform-cloud" && integration.targetService && (
- <div>
- <FormLabel label="Category" />
+ <Detail>
+ <DetailLabel>Category</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration.targetService}</div>
- </div>
+ </Detail>
)}
{(integration.integration === "checkly" || integration.integration === "github") &&
integration?.metadata?.secretSuffix && (
- <div>
- <FormLabel label="Secret Suffix" />
+ <Detail>
+ <DetailLabel>Secret Suffix</DetailLabel>
<div className={FIELD_CLASSNAME}>{integration.metadata.secretSuffix}</div>
- </div>
+ </Detail>
)}
{integration.integration === "github" && integration.metadata?.githubVisibility ? (
<div className="mt-2 text-xs text-foreground-secondary">
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationRow.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationRow.tsx
index b8028fc488..c2ab1db772 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationRow.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationRow.tsx
@@ -14,8 +14,16 @@ import { format } from "date-fns";
import { twMerge } from "tailwind-merge";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { IconButton, Td, Tooltip, Tr } from "@app/components/v2";
-import { Badge, ProviderIcon } from "@app/components/v3";
+import {
+ Badge,
+ IconButton,
+ ProviderIcon,
+ TableCell,
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import {
ProjectPermissionActions,
ProjectPermissionSub,
@@ -63,7 +71,7 @@ export const IntegrationRow = ({
}, [isSynced, syncMessage]);
return (
- <Tr
+ <TableRow
onClick={() =>
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId",
@@ -74,13 +82,10 @@ export const IntegrationRow = ({
}
})
}
- className={twMerge(
- "group h-10 cursor-pointer transition-colors duration-100 hover:bg-surface-hover",
- isSynced === false && "bg-danger/5 hover:bg-danger/10"
- )}
+ className={twMerge(isSynced === false && "bg-danger/5 hover:bg-danger/10")}
key={`integration-${id}`}
>
- <Td>
+ <TableCell>
<div className="flex items-center gap-2">
<ProviderIcon
alt={`${cloudIntegration?.name} integration`}
@@ -89,36 +94,51 @@ export const IntegrationRow = ({
/>
<span className="hidden lg:inline">{cloudIntegration?.name}</span>
</div>
- </Td>
- <Td className="max-w-0 min-w-32!">
- <Tooltip side="top" className="max-w-2xl break-words" content={secretPath}>
- <p className="truncate">{secretPath}</p>
- </Tooltip>{" "}
- </Td>
- <Td>{environment?.name ?? "-"}</Td>
- <Td className="max-w-0 min-w-20!">
+ </TableCell>
+ <TableCell isTruncatable className="min-w-32">
+ {secretPath && (
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <p className="truncate">{secretPath}</p>
+ </TooltipTrigger>
+ <TooltipContent side="top" className="max-w-2xl break-words">
+ {secretPath}
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </TableCell>
+ <TableCell>{environment?.name ?? "-"}</TableCell>
+ <TableCell isTruncatable className="min-w-20">
<div className="flex items-center gap-2">
<p className="truncate">{getIntegrationDestination(integration)}</p>
- <Tooltip
- position="left"
- className="max-w-lg min-w-[20rem]"
- content={<IntegrationDetails integration={integration} />}
- >
- <FontAwesomeIcon icon={faInfoCircle} className="text-muted" />
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <FontAwesomeIcon icon={faInfoCircle} className="text-muted" />
+ </TooltipTrigger>
+ <TooltipContent side="left" className="max-w-lg min-w-[20rem]">
+ <IntegrationDetails integration={integration} />
+ </TooltipContent>
</Tooltip>
</div>
- </Td>
- <Td>
- {" "}
+ </TableCell>
+ <TableCell>
{typeof integration.isSynced !== "boolean" ? (
<Badge variant="info" key={integration.id}>
Pending Sync
</Badge>
) : (
- <Tooltip
- position="left"
- className="max-w-sm"
- content={
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <div className="w-min whitespace-nowrap">
+ <Badge variant={integration.isSynced ? "success" : "danger"} key={integration.id}>
+ <div className="flex items-center space-x-1">
+ <FontAwesomeIcon icon={integration.isSynced ? faCheck : faWarning} />
+ <div>{integration.isSynced ? "Synced" : "Not Synced"}</div>
+ </div>
+ </Badge>
+ </div>
+ </TooltipTrigger>
+ <TooltipContent side="left" className="max-w-sm">
<div className="flex flex-col gap-2 py-1">
{integration.lastUsed && (
<div>
@@ -146,57 +166,54 @@ export const IntegrationRow = ({
</div>
)}
</div>
- }
- >
- <div className="w-min whitespace-nowrap">
- <Badge variant={integration.isSynced ? "success" : "danger"} key={integration.id}>
- <div className="flex items-center space-x-1">
- <FontAwesomeIcon icon={integration.isSynced ? faCheck : faWarning} />
- <div>{integration.isSynced ? "Synced" : "Not Synced"}</div>
- </div>
- </Badge>
- </div>
+ </TooltipContent>
</Tooltip>
)}
- </Td>
- <Td>
+ </TableCell>
+ <TableCell onClick={(e) => e.stopPropagation()}>
<div className="flex gap-2 whitespace-nowrap">
- <Tooltip className="max-w-sm text-center" content="Manually Sync">
- <IconButton
- onClick={(e) => {
- e.stopPropagation();
- onManualSyncIntegration();
- }}
- ariaLabel="sync"
- colorSchema="secondary"
- variant="plain"
- >
- <FontAwesomeIcon icon={faRefresh} />
- </IconButton>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <IconButton
+ onClick={(e) => {
+ e.stopPropagation();
+ onManualSyncIntegration();
+ }}
+ aria-label="sync"
+ variant="ghost"
+ >
+ <FontAwesomeIcon icon={faRefresh} />
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm text-center">Manually Sync</TooltipContent>
</Tooltip>
<ProjectPermissionCan
I={ProjectPermissionActions.Delete}
a={ProjectPermissionSub.Integrations}
>
{(isAllowed: boolean) => (
- <Tooltip content="Remove Integration">
- <IconButton
- onClick={(e) => {
- e.stopPropagation();
- onRemoveIntegration();
- }}
- ariaLabel="delete"
- isDisabled={!isAllowed}
- colorSchema="danger"
- variant="plain"
- >
- <FontAwesomeIcon icon={faTrash} className="px-1" />
- </IconButton>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <span>
+ <IconButton
+ onClick={(e) => {
+ e.stopPropagation();
+ onRemoveIntegration();
+ }}
+ aria-label="delete"
+ isDisabled={!isAllowed}
+ variant="danger"
+ >
+ <FontAwesomeIcon icon={faTrash} className="px-1" />
+ </IconButton>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent>Remove Integration</TooltipContent>
</Tooltip>
)}
</ProjectPermissionCan>
</div>
- </Td>
- </Tr>
+ </TableCell>
+ </TableRow>
);
};
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationsTable.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationsTable.tsx
index 81ec6ae157..f05f6e02fa 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationsTable.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/IntegrationsTable.tsx
@@ -7,12 +7,10 @@ import {
faClock,
faFilter,
faMagnifyingGlass,
- faRotate,
- faSearch,
faWarning
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
+import { RefreshCwIcon, SearchIcon } from "lucide-react";
import {
DropdownMenu,
@@ -20,19 +18,26 @@ import {
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuTrigger,
- EmptyState,
+ Empty,
+ EmptyHeader,
+ EmptyMedia,
+ EmptyTitle,
IconButton,
- Input,
+ InputGroup,
+ InputGroupAddon,
+ InputGroupInput,
Pagination,
+ ProviderIcon,
Table,
- TableContainer,
- TBody,
- Th,
- THead,
+ TableBody,
+ TableHead,
+ TableHeader,
+ TableRow,
+ type TableSortDirection,
Tooltip,
- Tr
-} from "@app/components/v2";
-import { ProviderIcon } from "@app/components/v3";
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import {
getUserTablePreference,
PreferenceKey,
@@ -232,8 +237,12 @@ export const IntegrationsTable = ({
setOrderDirection(OrderByDirection.ASC);
};
- const getClassName = (col: IntegrationsOrderBy) =>
- twMerge("ml-2", orderBy === col ? "" : "opacity-30");
+ const getClassName = (col: IntegrationsOrderBy) => (orderBy === col ? "" : "opacity-30");
+
+ const getSortDirection = (col: IntegrationsOrderBy): TableSortDirection => {
+ if (orderBy !== col) return "none";
+ return orderDirection === OrderByDirection.ASC ? "ascending" : "descending";
+ };
const getColSortIcon = (col: IntegrationsOrderBy) =>
orderDirection === OrderByDirection.DESC && orderBy === col ? faArrowUp : faArrowDown;
@@ -244,29 +253,30 @@ export const IntegrationsTable = ({
return (
<div>
<div className="flex gap-2">
- <Input
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}
- placeholder="Search integrations..."
- className="flex-1"
- />
+ <InputGroup className="flex-1">
+ <InputGroupAddon>
+ <FontAwesomeIcon icon={faMagnifyingGlass} />
+ </InputGroupAddon>
+ <InputGroupInput
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ placeholder="Search integrations..."
+ />
+ </InputGroup>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton
- ariaLabel="Environments"
- variant="plain"
- size="sm"
- className={twMerge(
- "flex h-10 w-11 items-center justify-center overflow-hidden border border-border-control bg-surface-raised p-0 transition-all hover:border-project/60 hover:bg-project/10",
- isTableFiltered && "border-project/50 text-project"
- )}
- >
- <Tooltip content="Filter Integrations" className="mb-2">
- <FontAwesomeIcon icon={faFilter} />
- </Tooltip>
- </IconButton>
- </DropdownMenuTrigger>
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <DropdownMenuTrigger asChild>
+ <IconButton
+ aria-label="Environments"
+ variant={isTableFiltered ? "project" : "outline"}
+ >
+ <FontAwesomeIcon icon={faFilter} />
+ </IconButton>
+ </DropdownMenuTrigger>
+ </TooltipTrigger>
+ <TooltipContent>Filter Integrations</TooltipContent>
+ </Tooltip>
<DropdownMenuContent className="max-h-[70vh] thin-scrollbar overflow-y-auto" align="end">
<DropdownMenuLabel>Status</DropdownMenuLabel>
{Object.values(IntegrationStatus).map((status) => (
@@ -281,12 +291,6 @@ export const IntegrationsTable = ({
}));
}}
key={status}
- icon={
- filters.status.includes(status) && (
- <FontAwesomeIcon className="text-project" icon={faCheckCircle} />
- )
- }
- iconPos="right"
>
<div className="flex items-center gap-2">
<FontAwesomeIcon
@@ -295,6 +299,9 @@ export const IntegrationsTable = ({
/>
<span className="capitalize">{status.replace("-", " ")}</span>
</div>
+ {filters.status.includes(status) && (
+ <FontAwesomeIcon className="ml-auto text-project" icon={faCheckCircle} />
+ )}
</DropdownMenuItem>
))}
<DropdownMenuLabel>Integration</DropdownMenuLabel>
@@ -310,12 +317,6 @@ export const IntegrationsTable = ({
}));
}}
key={integration}
- icon={
- filters.integrations.includes(integration) && (
- <FontAwesomeIcon className="text-project" icon={faCheckCircle} />
- )
- }
- iconPos="right"
>
<div className="flex items-center gap-2">
<ProviderIcon
@@ -325,6 +326,9 @@ export const IntegrationsTable = ({
/>
<span className="capitalize">{cloudIntegrationMap.get(integration)!.name}</span>
</div>
+ {filters.integrations.includes(integration) && (
+ <FontAwesomeIcon className="ml-auto text-project" icon={faCheckCircle} />
+ )}
</DropdownMenuItem>
))}
<DropdownMenuLabel>Environment</DropdownMenuLabel>
@@ -340,130 +344,122 @@ export const IntegrationsTable = ({
}));
}}
key={env.id}
- icon={
- filters.environmentIds.includes(env.id) && (
- <FontAwesomeIcon className="text-project" icon={faCheckCircle} />
- )
- }
- iconPos="right"
>
<span className="capitalize">{env.name}</span>
+ {filters.environmentIds.includes(env.id) && (
+ <FontAwesomeIcon className="ml-auto text-project" icon={faCheckCircle} />
+ )}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
</div>
- <TableContainer className="mt-4">
- <Table>
- <THead>
- <Tr>
- <Th className="w-[25%]">
- <div className="flex items-center">
+ {!isLoading && !filteredIntegrations?.length ? (
+ <Empty className="mt-4 border">
+ <EmptyHeader>
+ <EmptyMedia variant="icon">
+ {integrations.length ? <SearchIcon /> : <RefreshCwIcon />}
+ </EmptyMedia>
+ <EmptyTitle>
+ {integrations.length
+ ? "No integrations match search..."
+ : "This project has no integrations configured"}
+ </EmptyTitle>
+ </EmptyHeader>
+ </Empty>
+ ) : (
+ <>
+ <Table containerClassName="mt-4">
+ <TableHeader>
+ <TableRow>
+ <TableHead
+ className="w-[25%]"
+ sortDirection={getSortDirection(IntegrationsOrderBy.App)}
+ onSortChange={() => handleSort(IntegrationsOrderBy.App)}
+ >
Integration
- <IconButton
- variant="plain"
+ <FontAwesomeIcon
+ icon={getColSortIcon(IntegrationsOrderBy.App)}
className={getClassName(IntegrationsOrderBy.App)}
- ariaLabel="sort"
- onClick={() => handleSort(IntegrationsOrderBy.App)}
- >
- <FontAwesomeIcon icon={getColSortIcon(IntegrationsOrderBy.App)} />
- </IconButton>
- </div>
- </Th>
- <Th className="w-1/5">
- <div className="flex items-center">
+ />
+ </TableHead>
+ <TableHead
+ className="w-1/5"
+ sortDirection={getSortDirection(IntegrationsOrderBy.SecretPath)}
+ onSortChange={() => handleSort(IntegrationsOrderBy.SecretPath)}
+ >
Source Path
- <IconButton
- variant="plain"
+ <FontAwesomeIcon
+ icon={getColSortIcon(IntegrationsOrderBy.SecretPath)}
className={getClassName(IntegrationsOrderBy.SecretPath)}
- ariaLabel="sort"
- onClick={() => handleSort(IntegrationsOrderBy.SecretPath)}
- >
- <FontAwesomeIcon icon={getColSortIcon(IntegrationsOrderBy.SecretPath)} />
- </IconButton>
- </div>
- </Th>
- <Th className="w-1/5">
- <div className="flex items-center">
+ />
+ </TableHead>
+ <TableHead
+ className="w-1/5"
+ sortDirection={getSortDirection(IntegrationsOrderBy.Environment)}
+ onSortChange={() => handleSort(IntegrationsOrderBy.Environment)}
+ >
Source Environment
- <IconButton
- variant="plain"
+ <FontAwesomeIcon
+ icon={getColSortIcon(IntegrationsOrderBy.Environment)}
className={getClassName(IntegrationsOrderBy.Environment)}
- ariaLabel="sort"
- onClick={() => handleSort(IntegrationsOrderBy.Environment)}
- >
- <FontAwesomeIcon icon={getColSortIcon(IntegrationsOrderBy.Environment)} />
- </IconButton>
- </div>
- </Th>
- <Th className="w-1/5">
- <div className="flex items-center">
+ />
+ </TableHead>
+ <TableHead
+ className="w-1/5"
+ sortDirection={getSortDirection(IntegrationsOrderBy.Destination)}
+ onSortChange={() => handleSort(IntegrationsOrderBy.Destination)}
+ >
Destination
- <IconButton
- variant="plain"
+ <FontAwesomeIcon
+ icon={getColSortIcon(IntegrationsOrderBy.Destination)}
className={getClassName(IntegrationsOrderBy.Destination)}
- ariaLabel="sort"
- onClick={() => handleSort(IntegrationsOrderBy.Destination)}
- >
- <FontAwesomeIcon icon={getColSortIcon(IntegrationsOrderBy.Destination)} />
- </IconButton>
- </div>
- </Th>
- <Th className="w-1/5">
- <div className="flex items-center">
+ />
+ </TableHead>
+ <TableHead
+ className="w-1/5"
+ sortDirection={getSortDirection(IntegrationsOrderBy.Status)}
+ onSortChange={() => handleSort(IntegrationsOrderBy.Status)}
+ >
Status
- <IconButton
- variant="plain"
+ <FontAwesomeIcon
+ icon={getColSortIcon(IntegrationsOrderBy.Status)}
className={getClassName(IntegrationsOrderBy.Status)}
- ariaLabel="sort"
- onClick={() => handleSort(IntegrationsOrderBy.Status)}
- >
- <FontAwesomeIcon icon={getColSortIcon(IntegrationsOrderBy.Status)} />
- </IconButton>
- </div>
- </Th>
- <Th className="w-5" />
- </Tr>
- </THead>
- <TBody>
- {filteredIntegrations.slice(offset, perPage * page).map((integration) => (
- <IntegrationRow
- cloudIntegration={cloudIntegrationMap.get(integration.integration)!}
- key={`integration-${integration.id}`}
- onManualSyncIntegration={() => {
- syncIntegration({
- workspaceId,
- id: integration.id,
- lastUsed: integration.lastUsed as string
- });
- }}
- onRemoveIntegration={() => onDeleteIntegration(integration)}
- integration={integration}
- environment={environmentMap.get(integration.envId)}
- />
- ))}
- </TBody>
- </Table>
- {Boolean(filteredIntegrations.length) && (
- <Pagination
- count={filteredIntegrations.length}
- page={page}
- perPage={perPage}
- onChangePage={setPage}
- onChangePerPage={handlePerPageChange}
- />
- )}
- {!isLoading && !filteredIntegrations?.length && (
- <EmptyState
- title={
- integrations.length
- ? "No integrations match search..."
- : "This project has no integrations configured"
- }
- icon={integrations.length ? faSearch : faRotate}
- />
- )}
- </TableContainer>
+ />
+ </TableHead>
+ <TableHead className="w-5" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {filteredIntegrations.slice(offset, perPage * page).map((integration) => (
+ <IntegrationRow
+ cloudIntegration={cloudIntegrationMap.get(integration.integration)!}
+ key={`integration-${integration.id}`}
+ onManualSyncIntegration={() => {
+ syncIntegration({
+ workspaceId,
+ id: integration.id,
+ lastUsed: integration.lastUsed as string
+ });
+ }}
+ onRemoveIntegration={() => onDeleteIntegration(integration)}
+ integration={integration}
+ environment={environmentMap.get(integration.envId)}
+ />
+ ))}
+ </TableBody>
+ </Table>
+ {Boolean(filteredIntegrations.length) && (
+ <Pagination
+ count={filteredIntegrations.length}
+ page={page}
+ perPage={perPage}
+ onChangePage={setPage}
+ onChangePerPage={handlePerPageChange}
+ />
+ )}
+ </>
+ )}
</div>
);
};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/SecretTableResourceCount.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/SecretTableResourceCount.tsx
deleted file mode 100644
index dbd42780e8..0000000000
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/SecretTableResourceCount.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import {
- faFileImport,
- faFingerprint,
- faFolder,
- faKey,
- faRotate
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-
-import { Tooltip } from "@app/components/v2";
-
-type Props = {
- folderCount?: number;
- importCount?: number;
- secretCount?: number;
- dynamicSecretCount?: number;
- secretRotationCount?: number;
-};
-
-export const SecretTableResourceCount = ({
- folderCount = 0,
- dynamicSecretCount = 0,
- secretCount = 0,
- importCount = 0,
- secretRotationCount = 0
-}: Props) => {
- return (
- <div className="flex items-center divide-x divide-border text-sm text-muted [&>*]:pr-2">
- {importCount > 0 && (
- <Tooltip
- className="max-w-sm"
- content={
- <p className="text-center whitespace-nowrap">
- Total import count <span className="text-center text-muted">(matching filters)</span>
- </p>
- }
- >
- <div className="flex items-center gap-2">
- <FontAwesomeIcon icon={faFileImport} className="text-import" />
- <span>{importCount}</span>
- </div>
- </Tooltip>
- )}
- {folderCount > 0 && (
- <Tooltip
- className="max-w-sm"
- content={
- <p className="text-center whitespace-nowrap">
- Total folder count <span className="text-center text-muted">(matching filters)</span>
- </p>
- }
- >
- <div className="flex items-center gap-2 pl-2">
- <FontAwesomeIcon icon={faFolder} className="text-folder" />
- <span>{folderCount}</span>
- </div>
- </Tooltip>
- )}
- {dynamicSecretCount > 0 && (
- <Tooltip
- className="max-w-sm"
- content={
- <p className="text-center whitespace-nowrap">
- Total dynamic secret count{" "}
- <span className="text-center text-muted">(matching filters)</span>
- </p>
- }
- >
- <div className="flex items-center gap-2 pl-2">
- <FontAwesomeIcon icon={faFingerprint} className="text-dynamic-secret" />
- <span>{dynamicSecretCount}</span>
- </div>
- </Tooltip>
- )}
- {secretRotationCount > 0 && (
- <Tooltip
- className="max-w-sm"
- content={
- <p className="text-center whitespace-nowrap">
- Total secret rotation count{" "}
- <span className="text-center text-muted">(matching filters)</span>
- </p>
- }
- >
- <div className="flex items-center gap-2 pl-2">
- <FontAwesomeIcon icon={faRotate} className="text-secret-rotation" />
- <span>{secretRotationCount}</span>
- </div>
- </Tooltip>
- )}
- {secretCount > 0 && (
- <Tooltip
- className="max-w-sm"
- content={
- <p className="text-center whitespace-nowrap">
- Total secret count <span className="text-center text-muted">(matching filters)</span>
- </p>
- }
- >
- <div className="flex items-center gap-2 pl-2">
- <FontAwesomeIcon icon={faKey} className="text-secret" />
- <span>{secretCount}</span>
- </div>
- </Tooltip>
- )}
- </div>
- );
-};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/index.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/index.tsx
deleted file mode 100644
index d2b5705fa4..0000000000
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableResourceCount/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { SecretTableResourceCount } from "./SecretTableResourceCount";
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
index 83522e473d..dbbbc89710 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
@@ -12,7 +12,6 @@ import {
import { createNotification } from "@app/components/notifications";
import { SecretVersionDiffView } from "@app/components/secrets/diff";
-import { Tooltip } from "@app/components/v2";
import {
Badge,
Button,
@@ -23,7 +22,10 @@ import {
SheetDescription,
SheetFooter,
SheetHeader,
- SheetTitle
+ SheetTitle,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
} from "@app/components/v3";
import { HIDDEN_SECRET_VALUE_API_MASK } from "@app/const/secrets";
import { dashboardKeys, fetchSecretValue } from "@app/hooks/api/dashboard/queries";
@@ -126,8 +128,13 @@ const RenderSecretChanges = ({
const showReferenceWarning = hasKeyChange && referenceCount && referenceCount > 0;
const referenceWarningElement = showReferenceWarning ? (
- <Tooltip
- content={
+ <Tooltip hoverable delayDuration={50}>
+ <TooltipTrigger asChild>
+ <Badge variant="warning" className="ml-2">
+ <TriangleAlertIcon className="size-3" /> References affected
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent>
<div className="max-w-xs">
<p className="font-medium">References will be updated</p>
<p className="mt-1 text-xs text-label">
@@ -136,11 +143,7 @@ const RenderSecretChanges = ({
syncs in the respective environments.
</p>
</div>
- }
- >
- <Badge variant="warning" className="ml-2">
- <TriangleAlertIcon className="size-3" /> References affected
- </Badge>
+ </TooltipContent>
</Tooltip>
) : undefined;