Skip to content

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

improvement(ui): move PAM data explorer and Secret Scanning config off V2 components (#8836)

Andrew Huangc2bc27a4482a
diff --git a/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx b/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx
index 6cdafb86b8..df26aaf188 100644
--- a/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx
+++ b/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx
@@ -12,8 +12,8 @@ import {
} from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { Spinner } from "@app/components/v2";
import { Button } from "@app/components/v3/generic/Button";
+import { Spinner } from "@app/components/v3/generic/Spinner";
import { cn } from "@app/components/v3/utils";
import { PamAccountType, useGetPamAccountById } from "@app/hooks/api/pam";
@@ -302,7 +302,7 @@ export const PamDataExplorerPage = ({ reason, mfaSessionId }: Props = {}) => {
if (isConnecting && !isConnected) {
return (
<div className="flex h-screen w-screen flex-col items-center justify-center gap-4 bg-background">
- <Spinner className="h-8 w-8" />
+ <Spinner label="Connecting to database" />
<p className="text-sm text-muted">Connecting to database...</p>
</div>
);
@@ -317,7 +317,7 @@ export const PamDataExplorerPage = ({ reason, mfaSessionId }: Props = {}) => {
>
{mfaState.verifying ? (
<div className="flex items-center justify-center gap-2 text-xs text-muted">
- <Spinner className="h-4 w-4" />
+ <Spinner size="xs" label="Waiting for MFA verification" />
Waiting for verification...
</div>
) : (
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx
index b4f37f9026..458fc0131f 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx
@@ -1,7 +1,10 @@
-import { faBan } from "@fortawesome/free-solid-svg-icons";
-
-import { ContentLoader, EmptyState } from "@app/components/v2";
-import { AccessRestrictedNotice } from "@app/components/v3";
+import {
+ AccessRestrictedNotice,
+ Empty,
+ EmptyHeader,
+ EmptyTitle,
+ PageLoader
+} from "@app/components/v3";
import { useProject, useSubscription } from "@app/context";
import { useGetSecretScanningConfig } from "@app/hooks/api/secretScanningV2";
@@ -26,21 +29,19 @@ export const ProjectScanningConfigTab = () => {
if (isConfigPending) {
return (
- <div className="flex h-full w-full items-center justify-center">
- <ContentLoader />
+ <div className="h-32">
+ <PageLoader lottieClassName="w-16" />
</div>
);
}
if (!config) {
return (
- <div className="flex h-full w-full items-center justify-center px-20">
- <EmptyState
- className="max-w-2xl rounded-md text-center"
- icon={faBan}
- title="Could not find Secret Scanning configuration"
- />
- </div>
+ <Empty>
+ <EmptyHeader>
+ <EmptyTitle>Could not find Secret Scanning configuration</EmptyTitle>
+ </EmptyHeader>
+ </Empty>
);
}
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
index 48020dda74..1b3ba2b153 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
@@ -4,8 +4,19 @@ import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { Button, FormControl, TextArea } from "@app/components/v2";
-import { DocumentationLinkBadge } from "@app/components/v3";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ TextArea
+} from "@app/components/v3";
import { ProjectPermissionSub } from "@app/context";
import { ProjectPermissionSecretScanningConfigActions } from "@app/context/ProjectPermissionContext/types";
import {
@@ -50,16 +61,16 @@ export const SecretScanningConfigForm = ({ config }: Props) => {
};
return (
- <div className="rounded-lg border border-border-control bg-surface-base p-4">
- <div className="mb-4">
- <div className="flex items-center gap-2">
- <h2 className="text-xl font-normal text-foreground">Scanning Configuration</h2>
- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/configuration" />
- </div>
- <p className="leading-5 text-muted">Configure rules and exceptions to customize scanning</p>
- </div>
- <div>
- <form onSubmit={handleSubmit(onSubmit)} className="flex w-full flex-col">
+ <form onSubmit={handleSubmit(onSubmit)}>
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ Scanning Configuration
+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/configuration" />
+ </CardTitle>
+ <CardDescription>Configure rules and exceptions to customize scanning</CardDescription>
+ </CardHeader>
+ <CardContent>
<ProjectPermissionCan
I={ProjectPermissionSecretScanningConfigActions.Update}
a={ProjectPermissionSub.SecretScanningConfigs}
@@ -68,41 +79,45 @@ export const SecretScanningConfigForm = ({ config }: Props) => {
<Controller
defaultValue=""
render={({ field, fieldState: { error } }) => (
- <FormControl isError={Boolean(error)} errorText={error?.message}>
+ <Field data-invalid={Boolean(error)}>
<TextArea
+ aria-label="Scanning configuration"
placeholder={
"[extend]\n\nuseDefault = true\n\n# See docs for configuration guide"
}
{...field}
rows={3}
- className="min-h-144 thin-scrollbar w-full resize-none! resize-y!"
- isDisabled={!isAllowed}
+ className="min-h-144 resize-y"
+ isError={Boolean(error)}
+ disabled={!isAllowed}
/>
- </FormControl>
+ <FieldError errors={[error]} />
+ </Field>
)}
control={control}
name="content"
/>
)}
</ProjectPermissionCan>
+ </CardContent>
+ <CardFooter className="justify-end">
<ProjectPermissionCan
I={ProjectPermissionSecretScanningConfigActions.Update}
a={ProjectPermissionSub.SecretScanningConfigs}
>
{(isAllowed) => (
<Button
- colorSchema="secondary"
+ variant="ss"
type="submit"
- className="w-min"
- isLoading={updateConfig.isPending}
+ isPending={updateConfig.isPending}
isDisabled={updateConfig.isPending || !isAllowed || !isDirty}
>
Save
</Button>
)}
</ProjectPermissionCan>
- </form>
- </div>
- </div>
+ </CardFooter>
+ </Card>
+ </form>
);
};