Skip to content

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

fix lint issues

Matheus Nogueirafbaf4209a33f
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
index 7f0d9dc67a..82fa4d83a9 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/ConstraintCard.tsx
@@ -111,7 +111,9 @@ export const ConstraintCard = ({ index, onRemove }: Props) => {
<span className="text-sm text-foreground">
This secret&apos;s previous versions
</span>
- <span className="text-xs text-muted">Reject values this secret held before</span>
+ <span className="text-xs text-muted">
+ Reject values this secret held before
+ </span>
</div>
<Toggle
aria-label="Check the new value against this secret's previous versions"
@@ -178,7 +180,11 @@ export const ConstraintCard = ({ index, onRemove }: Props) => {
return (
<div className="flex flex-col gap-1">
<label className="text-xs font-medium text-muted">Applies to</label>
- <Input value="Generated Password" readOnly className="cursor-default opacity-60" />
+ <Input
+ value="Generated Password"
+ readOnly
+ className="cursor-default opacity-60"
+ />
</div>
);
}
@@ -233,7 +239,7 @@ export const ConstraintCard = ({ index, onRemove }: Props) => {
)}
/>
</div>
- </div>
+ </div>
)}
</div>
);
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts
index 2e64efcf1d..89423b1b47 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.utils.ts
@@ -319,24 +319,26 @@ const NUMERIC_CONSTRAINTS: ConstraintType[] = [ConstraintType.MinLength, Constra
export const groupConstraintsByTarget = (constraints: TConstraint[]) => {
const grouped: Partial<Record<ConstraintTarget, TValueConstraints>> = {};
- constraints.forEach(({ type, appliesTo, value, checkPreviousVersions, checkOtherSecretsInScope }) => {
- const current = grouped[appliesTo] ?? {};
-
- if (type === ConstraintType.PreventValueReuse) {
- grouped[appliesTo] = {
- ...current,
- reusePrevention: {
- ...(checkPreviousVersions && { previousVersions: Number(value) }),
- ...(checkOtherSecretsInScope && { otherSecretsInScope: true })
- }
- };
- } else {
- grouped[appliesTo] = {
- ...current,
- [CONSTRAINT_FIELDS[type]]: NUMERIC_CONSTRAINTS.includes(type) ? Number(value) : value
- };
+ constraints.forEach(
+ ({ type, appliesTo, value, checkPreviousVersions, checkOtherSecretsInScope }) => {
+ const current = grouped[appliesTo] ?? {};
+
+ if (type === ConstraintType.PreventValueReuse) {
+ grouped[appliesTo] = {
+ ...current,
+ reusePrevention: {
+ ...(checkPreviousVersions && { previousVersions: Number(value) }),
+ ...(checkOtherSecretsInScope && { otherSecretsInScope: true })
+ }
+ };
+ } else {
+ grouped[appliesTo] = {
+ ...current,
+ [CONSTRAINT_FIELDS[type]]: NUMERIC_CONSTRAINTS.includes(type) ? Number(value) : value
+ };
+ }
}
- });
+ );
return grouped;
};