Skip to content

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

adjust style based on DESIGN.md

Matheus Nogueira6c29a4dc511f
diff --git a/frontend/src/pages/secret-scanning/SecretScanningDataSourceByIdPage/SecretScanningDataSourceByIdPage.tsx b/frontend/src/pages/secret-scanning/SecretScanningDataSourceByIdPage/SecretScanningDataSourceByIdPage.tsx
index cbd9febf44..1795577f2b 100644
--- a/frontend/src/pages/secret-scanning/SecretScanningDataSourceByIdPage/SecretScanningDataSourceByIdPage.tsx
+++ b/frontend/src/pages/secret-scanning/SecretScanningDataSourceByIdPage/SecretScanningDataSourceByIdPage.tsx
@@ -5,13 +5,7 @@ import { useNavigate, useParams } from "@tanstack/react-router";
import { ProjectPermissionCan } from "@app/components/permissions";
import { Button, ContentLoader, EmptyState } from "@app/components/v2";
-import {
- CardDescription,
- CardHeader,
- CardTitle,
- DocumentationLinkBadge,
- ProviderIcon
-} from "@app/components/v3";
+import { ProviderIcon } from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { ProjectPermissionSub } from "@app/context";
import {
@@ -33,7 +27,7 @@ import {
const PageContent = () => {
const navigate = useNavigate();
- const { type, dataSourceId, orgId } = useParams({
+ const { type, dataSourceId, projectId, orgId } = useParams({
from: ROUTE_PATHS.SecretScanning.DataSourceByIdPage.id,
select: (params) => ({
...params,
@@ -74,8 +68,11 @@ const PageContent = () => {
leftIcon={<FontAwesomeIcon icon={faChevronLeft} />}
onClick={() => {
navigate({
- to: "/organizations/$orgId/secret-scanning/data-sources",
- params: { orgId }
+ to: "/organizations/$orgId/projects/secret-scanning/$projectId/data-sources",
+ params: {
+ orgId,
+ projectId
+ }
});
}}
>
@@ -104,15 +101,7 @@ const PageContent = () => {
>
<SecretScanningFindingsTable
dataSource={dataSource}
- cardHeader={
- <CardHeader>
- <CardTitle>
- Findings
- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/findings" />
- </CardTitle>
- <CardDescription>Secrets detected in this data source.</CardDescription>
- </CardHeader>
- }
+ description="Secrets detected in this data source."
/>
</ProjectPermissionCan>
<SecretScanningResourceSection dataSource={dataSource} />
diff --git a/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/SecretScanningFindingsPage.tsx b/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/SecretScanningFindingsPage.tsx
index 3e1c17923f..5fbdef1e61 100644
--- a/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/SecretScanningFindingsPage.tsx
+++ b/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/SecretScanningFindingsPage.tsx
@@ -36,6 +36,7 @@ export const SecretScanningFindingsPage = () => {
description="Secrets detected across every data source."
/>
<SecretScanningFindingsTable
+ description="Review and triage leaked secrets."
initialStatus={status}
initialDataSourceId={dataSourceId}
initialResourceId={resourceId}
diff --git a/frontend/src/pages/secret-scanning/components/findings/FindingDetailSheet.tsx b/frontend/src/pages/secret-scanning/components/findings/FindingDetailSheet.tsx
index 212c6beb21..b66f32e373 100644
--- a/frontend/src/pages/secret-scanning/components/findings/FindingDetailSheet.tsx
+++ b/frontend/src/pages/secret-scanning/components/findings/FindingDetailSheet.tsx
@@ -1,7 +1,6 @@
import { format } from "date-fns";
-import { ChevronDownIcon, ChevronUpIcon, CopyIcon, ExternalLinkIcon } from "lucide-react";
+import { ChevronDownIcon, ChevronUpIcon, ExternalLinkIcon } from "lucide-react";
-import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
Button,
@@ -56,11 +55,6 @@ export const FindingDetailSheet = ({
onChangeStatus,
isReopening
}: Props) => {
- const handleCopyFindingId = (id: string) => {
- navigator.clipboard.writeText(id);
- createNotification({ type: "info", text: "Finding ID copied to clipboard" });
- };
-
return (
<Sheet open={Boolean(finding)} onOpenChange={(open) => !open && onClose()}>
<SheetContent size="form" onOpenAutoFocus={(event) => event.preventDefault()}>
@@ -181,11 +175,7 @@ export const FindingDetailSheet = ({
)}
</div>
- <SheetFooter className="justify-between border-t">
- <Button variant="outline" size="sm" onClick={() => handleCopyFindingId(finding.id)}>
- <CopyIcon />
- Copy Finding ID
- </Button>
+ <SheetFooter>
<ProjectPermissionCan
I={ProjectPermissionSecretScanningFindingActions.Update}
a={ProjectPermissionSub.SecretScanningFindings}
diff --git a/frontend/src/pages/secret-scanning/components/findings/SecretScanningFindingsTable.tsx b/frontend/src/pages/secret-scanning/components/findings/SecretScanningFindingsTable.tsx
index 1488af9a89..f40697acc8 100644
--- a/frontend/src/pages/secret-scanning/components/findings/SecretScanningFindingsTable.tsx
+++ b/frontend/src/pages/secret-scanning/components/findings/SecretScanningFindingsTable.tsx
@@ -1,4 +1,4 @@
-import { ReactNode, useState } from "react";
+import { useState } from "react";
import { formatDistanceToNowStrict } from "date-fns";
import { ChevronDownIcon, FilterIcon, ShieldCheckIcon } from "lucide-react";
import { twMerge } from "tailwind-merge";
@@ -9,7 +9,11 @@ import {
Button,
Card,
CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
Checkbox,
+ DocumentationLinkBadge,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -96,7 +100,7 @@ const ResourceFilter = ({ dataSource, value, onChange }: ResourceFilterProps) =>
<ChevronDownIcon />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="max-h-80 thin-scrollbar min-w-64 overflow-y-auto">
+ <DropdownMenuContent align="end">
<DropdownMenuRadioGroup
value={value ?? ALL_OPTION}
onValueChange={(next) => onChange(next === ALL_OPTION ? null : next)}
@@ -119,7 +123,7 @@ type Props = {
initialStatus?: FindingsStatusFilter;
initialDataSourceId?: string;
initialResourceId?: string;
- cardHeader?: ReactNode;
+ description: string;
};
export const SecretScanningFindingsTable = ({
@@ -127,7 +131,7 @@ export const SecretScanningFindingsTable = ({
initialStatus = SecretScanningFindingStatus.Unresolved,
initialDataSourceId,
initialResourceId,
- cardHeader
+ description
}: Props) => {
const { currentProject } = useProject();
const isScoped = Boolean(dataSource);
@@ -326,180 +330,185 @@ export const SecretScanningFindingsTable = ({
return (
<>
<Card>
- {cardHeader}
- <CardContent className="flex flex-wrap items-center gap-2">
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="outline">
- <FilterIcon />
- Status:{" "}
- {statusFilter === "all"
- ? "All"
- : SECRET_SCANNING_FINDING_STATUS_MAP[statusFilter].name}
- <ChevronDownIcon />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="min-w-48">
- <DropdownMenuRadioGroup
- value={statusFilter}
- onValueChange={(value) =>
- applyFilterChange(() => setStatusFilter(value as FindingsStatusFilter))
- }
- >
- {SECRET_SCANNING_FINDING_STATUS_ORDER.map((status) => {
- const { Icon, className, name } = SECRET_SCANNING_FINDING_STATUS_MAP[status];
- return (
- <DropdownMenuRadioItem key={status} value={status}>
- <Icon className={className} />
- {name}
- </DropdownMenuRadioItem>
- );
- })}
- <DropdownMenuSeparator />
- <DropdownMenuRadioItem value={ALL_OPTION}>All</DropdownMenuRadioItem>
- </DropdownMenuRadioGroup>
- </DropdownMenuContent>
- </DropdownMenu>
- {!isScoped && (
+ <CardHeader>
+ <CardTitle>
+ Findings
+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/usage#findings" />
+ </CardTitle>
+ <CardDescription>{description}</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <div className="mb-4 flex flex-wrap items-center gap-2">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline">
- Data Source: {selectedDataSource?.name ?? "All"}
+ <FilterIcon />
+ Status:{" "}
+ {statusFilter === "all"
+ ? "All"
+ : SECRET_SCANNING_FINDING_STATUS_MAP[statusFilter].name}
<ChevronDownIcon />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent
- align="end"
- className="max-h-80 thin-scrollbar min-w-64 overflow-y-auto"
- >
+ <DropdownMenuContent align="end">
<DropdownMenuRadioGroup
- value={dataSourceFilter ?? ALL_OPTION}
+ value={statusFilter}
onValueChange={(value) =>
- applyFilterChange(() => {
- setDataSourceFilter(value === ALL_OPTION ? null : value);
- setResourceFilter(null);
- })
+ applyFilterChange(() => setStatusFilter(value as FindingsStatusFilter))
}
>
- <DropdownMenuRadioItem value={ALL_OPTION}>All Data Sources</DropdownMenuRadioItem>
+ {SECRET_SCANNING_FINDING_STATUS_ORDER.map((status) => {
+ const { Icon, className, name } = SECRET_SCANNING_FINDING_STATUS_MAP[status];
+ return (
+ <DropdownMenuRadioItem key={status} value={status}>
+ <Icon className={className} />
+ {name}
+ </DropdownMenuRadioItem>
+ );
+ })}
<DropdownMenuSeparator />
- {dataSources.map((option) => (
- <DropdownMenuRadioItem key={option.id} value={option.id}>
- <ProviderIcon
- alt={`${SECRET_SCANNING_DATA_SOURCE_MAP[option.type].name} data source`}
- icon={SECRET_SCANNING_DATA_SOURCE_MAP[option.type].image}
- className="size-4"
- />
- <span className="truncate">{option.name}</span>
- </DropdownMenuRadioItem>
- ))}
+ <DropdownMenuRadioItem value={ALL_OPTION}>All</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
- )}
- {selectedDataSource && (
- <ResourceFilter
- dataSource={selectedDataSource}
- value={resourceFilter}
- onChange={(value) => applyFilterChange(() => setResourceFilter(value))}
- />
- )}
- </CardContent>
-
- {showEmpty ? (
- <CardContent>{renderEmpty()}</CardContent>
- ) : (
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead className="w-0">
- <Checkbox
- aria-label="Select all findings on this page"
- isChecked={isPageSelected}
- isDisabled={isPending || !pageIds.length}
- onCheckedChange={() => setSelectedIds(isPageSelected ? [] : pageIds)}
- />
- </TableHead>
- {renderSortableHead(SecretScanningFindingOrderBy.ResourceName, resourceLabel)}
- {renderSortableHead(SecretScanningFindingOrderBy.Rule, "Rule")}
- {renderSortableHead(SecretScanningFindingOrderBy.Author, "Author")}
- {renderSortableHead(SecretScanningFindingOrderBy.CreatedAt, "Detected", "w-36")}
- {renderSortableHead(SecretScanningFindingOrderBy.Status, "Status", "w-36")}
- </TableRow>
- </TableHeader>
- <TableBody>
- {isPending &&
- Array.from({ length: 8 }).map((_, i) => (
- <TableRow key={`finding-skeleton-${i + 1}`}>
- <TableCell>
- <Skeleton className="size-4" />
- </TableCell>
- {Array.from({ length: 5 }).map((__, j) => (
- <TableCell key={`finding-skeleton-cell-${j + 1}`}>
- <Skeleton className="h-4 w-full" />
- </TableCell>
- ))}
- </TableRow>
- ))}
- {!isPending &&
- findings.map((finding) => {
- const isSelected = selectedIds.includes(finding.id);
- const source = SECRET_SCANNING_DATA_SOURCE_MAP[finding.dataSourceType];
-
- return (
- <TableRow
- key={finding.id}
- data-state={isSelected ? "selected" : undefined}
- onClick={() => setOpenFinding(finding)}
- >
- <TableCell onClick={(e) => e.stopPropagation()}>
- <Checkbox
- aria-label={`Select finding ${finding.rule}`}
- isChecked={isSelected}
- onCheckedChange={() =>
- setSelectedIds((prev) =>
- isSelected
- ? prev.filter((id) => id !== finding.id)
- : [...prev, finding.id]
- )
- }
+ {!isScoped && (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline">
+ Data Source: {selectedDataSource?.name ?? "All"}
+ <ChevronDownIcon />
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuRadioGroup
+ value={dataSourceFilter ?? ALL_OPTION}
+ onValueChange={(value) =>
+ applyFilterChange(() => {
+ setDataSourceFilter(value === ALL_OPTION ? null : value);
+ setResourceFilter(null);
+ })
+ }
+ >
+ <DropdownMenuRadioItem value={ALL_OPTION}>
+ All Data Sources
+ </DropdownMenuRadioItem>
+ <DropdownMenuSeparator />
+ {dataSources.map((option) => (
+ <DropdownMenuRadioItem key={option.id} value={option.id}>
+ <ProviderIcon
+ alt={`${SECRET_SCANNING_DATA_SOURCE_MAP[option.type].name} data source`}
+ icon={SECRET_SCANNING_DATA_SOURCE_MAP[option.type].image}
+ className="size-4"
/>
- </TableCell>
- <TableCell isTruncatable>
- <p className="flex items-center gap-1.5 truncate">
- {!isScoped && (
- <ProviderIcon
- alt={`${source.name} data source ${finding.dataSourceName}`}
- title={finding.dataSourceName}
- icon={source.image}
- className="size-3.5"
- />
- )}
- {finding.resourceName}
- </p>
- <p className="truncate text-xs text-muted">
- {finding.details.file}:{finding.details.startLine}
- </p>
- </TableCell>
- <TableCell isTruncatable>{finding.rule}</TableCell>
- <TableCell isTruncatable>{finding.details.author}</TableCell>
- <TableCell>
- {formatDistanceToNowStrict(new Date(finding.createdAt), {
- addSuffix: true
- })}
- </TableCell>
+ <span className="truncate">{option.name}</span>
+ </DropdownMenuRadioItem>
+ ))}
+ </DropdownMenuRadioGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )}
+ {selectedDataSource && (
+ <ResourceFilter
+ dataSource={selectedDataSource}
+ value={resourceFilter}
+ onChange={(value) => applyFilterChange(() => setResourceFilter(value))}
+ />
+ )}
+ </div>
+
+ {showEmpty ? (
+ renderEmpty()
+ ) : (
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead className="w-0">
+ <Checkbox
+ aria-label="Select all findings on this page"
+ isChecked={isPageSelected}
+ isDisabled={isPending || !pageIds.length}
+ onCheckedChange={() => setSelectedIds(isPageSelected ? [] : pageIds)}
+ />
+ </TableHead>
+ {renderSortableHead(SecretScanningFindingOrderBy.ResourceName, resourceLabel)}
+ {renderSortableHead(SecretScanningFindingOrderBy.Rule, "Rule")}
+ {renderSortableHead(SecretScanningFindingOrderBy.Author, "Author")}
+ {renderSortableHead(SecretScanningFindingOrderBy.CreatedAt, "Detected", "w-36")}
+ {renderSortableHead(SecretScanningFindingOrderBy.Status, "Status", "w-36")}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {isPending &&
+ Array.from({ length: 8 }).map((_, i) => (
+ <TableRow key={`finding-skeleton-${i + 1}`}>
<TableCell>
- <FindingStatusBadge status={finding.status} />
+ <Skeleton className="size-4" />
</TableCell>
+ {Array.from({ length: 5 }).map((__, j) => (
+ <TableCell key={`finding-skeleton-cell-${j + 1}`}>
+ <Skeleton className="h-4 w-full" />
+ </TableCell>
+ ))}
</TableRow>
- );
- })}
- </TableBody>
- </Table>
- )}
+ ))}
+ {!isPending &&
+ findings.map((finding) => {
+ const isSelected = selectedIds.includes(finding.id);
+ const source = SECRET_SCANNING_DATA_SOURCE_MAP[finding.dataSourceType];
+
+ return (
+ <TableRow
+ key={finding.id}
+ data-state={isSelected ? "selected" : undefined}
+ onClick={() => setOpenFinding(finding)}
+ >
+ <TableCell onClick={(e) => e.stopPropagation()}>
+ <Checkbox
+ aria-label={`Select finding ${finding.rule}`}
+ isChecked={isSelected}
+ onCheckedChange={() =>
+ setSelectedIds((prev) =>
+ isSelected
+ ? prev.filter((id) => id !== finding.id)
+ : [...prev, finding.id]
+ )
+ }
+ />
+ </TableCell>
+ <TableCell isTruncatable>
+ <p className="flex items-center gap-1.5 truncate">
+ {!isScoped && (
+ <ProviderIcon
+ alt={`${source.name} data source ${finding.dataSourceName}`}
+ title={finding.dataSourceName}
+ icon={source.image}
+ className="size-3.5"
+ />
+ )}
+ {finding.resourceName}
+ </p>
+ <p className="truncate text-xs text-muted">
+ {finding.details.file}:{finding.details.startLine}
+ </p>
+ </TableCell>
+ <TableCell isTruncatable>{finding.rule}</TableCell>
+ <TableCell isTruncatable>{finding.details.author}</TableCell>
+ <TableCell>
+ {formatDistanceToNowStrict(new Date(finding.createdAt), {
+ addSuffix: true
+ })}
+ </TableCell>
+ <TableCell>
+ <FindingStatusBadge status={finding.status} />
+ </TableCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ )}
- {!isPending && totalCount > 0 && (
- <CardContent className="-mt-5 pt-0">
+ {!isPending && totalCount > 0 && (
<Pagination
count={totalCount}
page={page}
@@ -510,8 +519,8 @@ export const SecretScanningFindingsTable = ({
}}
onChangePerPage={(newPerPage) => applyFilterChange(() => setPerPage(newPerPage))}
/>
- </CardContent>
- )}
+ )}
+ </CardContent>
</Card>
<SelectedActionBar