Skip to content

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

wip

Scott Wilsonde05a186c3b5
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/ConstraintCard.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
similarity index 99%
rename from frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/ConstraintCard.tsx
rename to frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
index 79f083f901..b5423d4f19 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/ConstraintCard.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
@@ -23,7 +23,7 @@ import {
ConstraintType,
MAX_PREVENT_VALUE_REUSE_VERSIONS,
TRuleForm
-} from "./SecretValidationRulesTab.utils";
+} from "./SecretValidationRulesSection.utils";
type Props = {
index: number;
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/SecretValidationRulesTab.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
similarity index 95%
rename from frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/SecretValidationRulesTab.tsx
rename to frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
index 691ce71b7c..0d45244fa0 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/SecretValidationRulesTab.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
@@ -17,6 +17,12 @@ import {
AlertDialogTitle,
Badge,
Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -72,7 +78,7 @@ import {
ruleFormSchema,
RuleType,
TRuleForm
-} from "./SecretValidationRulesTab.utils";
+} from "./SecretValidationRulesSection.utils";
const RuleFormContent = ({
defaultValues,
@@ -353,7 +359,7 @@ type SheetState =
| { open: true; mode: "create" }
| { open: true; mode: "edit"; ruleId: string };
-export const SecretValidationRulesTab = () => {
+export const SecretValidationRulesSection = () => {
const { currentProject } = useProject();
const [sheetState, setSheetState] = useState<SheetState>({ open: false });
@@ -441,15 +447,13 @@ export const SecretValidationRulesTab = () => {
const isEditing = sheetState.open && sheetState.mode === "edit";
return (
- <div className="w-full">
- <div className="flex h-full w-full flex-1 flex-col rounded-lg border border-border bg-card py-4">
- <div className="mx-4 flex items-center justify-between border-b border-border pb-4">
- <div>
- <h3 className="text-lg font-medium text-foreground">Secret Validation Rules</h3>
- <p className="text-sm leading-3 text-muted">
- Define validation constraints for secret keys and values
- </p>
- </div>
+ <Card className="mb-6">
+ <CardHeader>
+ <CardTitle>Secret Validation Rules</CardTitle>
+ <CardDescription>
+ Define validation constraints for secret keys and values
+ </CardDescription>
+ <CardAction>
<ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Settings}>
{(isAllowed) => (
<Tooltip>
@@ -457,8 +461,8 @@ export const SecretValidationRulesTab = () => {
<span>
<Button
isDisabled={!isAllowed}
- variant="outline"
- size="xs"
+ variant="project"
+ size="sm"
onClick={() => setSheetState({ open: true, mode: "create" })}
>
<PlusIcon className="size-4" />
@@ -472,15 +476,15 @@ export const SecretValidationRulesTab = () => {
</Tooltip>
)}
</ProjectPermissionCan>
- </div>
- <div className="flex flex-1 flex-col overflow-hidden px-4">
- <div className="thin-scrollbar flex-1 overflow-y-scroll py-4">
- {isLoading && (
- <div className="flex items-center justify-center py-12">
- <p className="text-sm text-muted">Loading rules...</p>
- </div>
- )}
- {!isLoading && rules.length === 0 ? (
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ {isLoading && (
+ <div className="flex items-center justify-center py-12">
+ <p className="text-sm text-muted">Loading rules...</p>
+ </div>
+ )}
+ {!isLoading && rules.length === 0 ? (
<Empty className="border">
<EmptyHeader>
<EmptyTitle>No validation rules configured</EmptyTitle>
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/SecretValidationRulesTab.utils.ts b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts
similarity index 100%
rename from frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/SecretValidationRulesTab.utils.ts
rename to frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/index.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/index.tsx
new file mode 100644
index 0000000000..abb2dc9462
--- /dev/null
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/index.tsx
@@ -0,0 +1 @@
+export { SecretValidationRulesSection } from "./SecretValidationRulesSection";
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/index.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/index.tsx
deleted file mode 100644
index b8917bf55c..0000000000
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesTab/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { SecretValidationRulesTab } from "./SecretValidationRulesTab";