Skip to content

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

improvements: resolve more commit state issues form value reveal change

Scott Wilson999ce3fec60e
diff --git a/frontend/src/hooks/api/secrets/queries.tsx b/frontend/src/hooks/api/secrets/queries.tsx
index e3cbf7f0ef..4eb2ba22fb 100644
--- a/frontend/src/hooks/api/secrets/queries.tsx
+++ b/frontend/src/hooks/api/secrets/queries.tsx
@@ -272,13 +272,7 @@ export const useGetSecretVersion = (dto: GetSecretVersionsDTO) =>
export const fetchSecretVersionValue = async (secretId: string, version: number) => {
const { data } = await apiRequest.get<TSecretVersionValue>(
- `/api/v1/dashboard/secret-versions/${secretId}/value/${version}`,
- {
- params: {
- secretId,
- version
- }
- }
+ `/api/v1/dashboard/secret-versions/${secretId}/value/${version}`
);
return data.value;
};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewSecretRotationRow/SecretOverviewRotationSecretRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewSecretRotationRow/SecretOverviewRotationSecretRow.tsx
index e8df569b9e..f8efdf17ef 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewSecretRotationRow/SecretOverviewRotationSecretRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewSecretRotationRow/SecretOverviewRotationSecretRow.tsx
@@ -29,7 +29,7 @@ export const SecretOverviewRotationSecretRow = ({
const { data: secretValueData, isError } = useGetSecretValue(
{
- secretKey: secret!.key,
+ secretKey: secret?.key ?? "",
environment,
secretPath,
projectId: currentProject.id
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
index be914024e7..9046f2ea7c 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
@@ -117,7 +117,7 @@ export const SecretEditRow = ({
? {
environment: importedSecret.environment,
secretPath: importedSecret.secretPath,
- secretKey: importedSecret.secret!.key,
+ secretKey: importedSecret.secret?.key ?? "",
projectId: currentProject.id
}
: {
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
index ac72adf439..59cceb9bbf 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CommitForm/CommitForm.tsx
@@ -143,7 +143,7 @@ const RenderSecretChanges = ({ onDiscard, change }: RenderResourceProps) => {
{
version: 1, // placeholder, not used
secretKey,
- secretValue
+ secretValue: secretValue || undefined
}
]
}}
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem.tsx
index 7b3ac9738b..e933d1b5e2 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem.tsx
@@ -126,7 +126,10 @@ export const SecretItem = memo(
const [isFieldFocused, setIsFieldFocused] = useToggle();
const queryClient = useQueryClient();
- const canFetchSecretValue = !originalSecret.secretValueHidden && !originalSecret.isEmpty;
+ const canFetchSecretValue =
+ !originalSecret.secretValueHidden &&
+ !originalSecret.isEmpty &&
+ pendingAction !== PendingAction.Create;
const fetchSecretValueParams = {
environment,
@@ -508,13 +511,15 @@ export const SecretItem = memo(
control={control}
render={({ field }) => (
<SecretInput
- isLoadingValue={isLoadingSecretValue}
+ isLoadingValue={isLoadingSecretValue && Boolean(secret.idOverride)}
isErrorLoadingValue={isErrorFetchingSecretValue}
key="value-overriden"
isVisible={isVisible}
isReadOnly={isReadOnly}
{...field}
- onFocus={() => setIsFieldFocused.on()}
+ onFocus={() => {
+ if (secret.idOverride) setIsFieldFocused.on();
+ }}
onBlur={() => {
setIsFieldFocused.off();
field.onBlur();
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretRotationListView/SecretRotationSecretRow.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretRotationListView/SecretRotationSecretRow.tsx
index cf89c3296b..e8b7788afb 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretRotationListView/SecretRotationSecretRow.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretRotationListView/SecretRotationSecretRow.tsx
@@ -27,7 +27,7 @@ export const SecretRotationSecretRow = ({
{
environment,
secretPath,
- secretKey: secret!.key,
+ secretKey: secret?.key ?? "",
projectId: currentProject.id
},
{