mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 17:28:18 +00:00
Feat: Show overwritten value in secret overview and allow for edits
This commit is contained in:
+17
-2
@@ -10,24 +10,33 @@ import { IconButton, Tooltip } from "@app/components/v2";
|
|||||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
|
import { SecretType } from "@app/hooks/api/types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
defaultValue?: string | null;
|
defaultValue?: string | null;
|
||||||
secretName: string;
|
secretName: string;
|
||||||
secretId?: string;
|
secretId?: string;
|
||||||
|
isOverride?: boolean;
|
||||||
isCreatable?: boolean;
|
isCreatable?: boolean;
|
||||||
isVisible?: boolean;
|
isVisible?: boolean;
|
||||||
isImportedSecret: boolean;
|
isImportedSecret: boolean;
|
||||||
environment: string;
|
environment: string;
|
||||||
secretPath: string;
|
secretPath: string;
|
||||||
onSecretCreate: (env: string, key: string, value: string) => Promise<void>;
|
onSecretCreate: (env: string, key: string, value: string) => Promise<void>;
|
||||||
onSecretUpdate: (env: string, key: string, value: string, secretId?: string) => Promise<void>;
|
onSecretUpdate: (
|
||||||
|
env: string,
|
||||||
|
key: string,
|
||||||
|
value: string,
|
||||||
|
type?: SecretType,
|
||||||
|
secretId?: string
|
||||||
|
) => Promise<void>;
|
||||||
onSecretDelete: (env: string, key: string, secretId?: string) => Promise<void>;
|
onSecretDelete: (env: string, key: string, secretId?: string) => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SecretEditRow = ({
|
export const SecretEditRow = ({
|
||||||
defaultValue,
|
defaultValue,
|
||||||
isCreatable,
|
isCreatable,
|
||||||
|
isOverride,
|
||||||
isImportedSecret,
|
isImportedSecret,
|
||||||
onSecretUpdate,
|
onSecretUpdate,
|
||||||
secretName,
|
secretName,
|
||||||
@@ -73,7 +82,13 @@ export const SecretEditRow = ({
|
|||||||
if (isCreatable) {
|
if (isCreatable) {
|
||||||
await onSecretCreate(environment, secretName, value);
|
await onSecretCreate(environment, secretName, value);
|
||||||
} else {
|
} else {
|
||||||
await onSecretUpdate(environment, secretName, value, secretId);
|
await onSecretUpdate(
|
||||||
|
environment,
|
||||||
|
secretName,
|
||||||
|
value,
|
||||||
|
isOverride ? SecretType.Personal : SecretType.Shared,
|
||||||
|
secretId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reset({ value });
|
reset({ value });
|
||||||
|
|||||||
Reference in New Issue
Block a user