Skip to content

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

refactor: remove console logs and enhance tooltip information in CreateSecretForm

Victor Santos10aace268e7e
diff --git a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx
index 39c56c281e..3b6d68112d 100644
--- a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx
+++ b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx
@@ -344,11 +344,6 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
}
);
- console.log("canReadSecretValue", canReadSecretValue);
- console.log("propEnvironment", propEnvironment);
- console.log("propSecretPath", propSecretPath);
- console.log("segment", segment);
-
if (!canReadSecretValue) {
createNotification({
text: "You do not have permission to access this secret",
@@ -405,11 +400,6 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
}
);
- console.log("canReadSecretValue", canReadSecretValue);
- console.log("environmentSlug", environmentSlug);
- console.log("secretPath", secretPath);
- console.log("secretName", secretName);
-
if (!canReadSecretValue) {
createNotification({
text: "You do not have permission to access this secret",
@@ -432,7 +422,7 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
})
});
},
- [navigate, projectId]
+ [navigate, projectId, permission, propEnvironment, propSecretPath]
);
return (
diff --git a/frontend/src/components/v2/SecretInput/SecretInput.tsx b/frontend/src/components/v2/SecretInput/SecretInput.tsx
index 758d1a225a..1745a84ec2 100644
--- a/frontend/src/components/v2/SecretInput/SecretInput.tsx
+++ b/frontend/src/components/v2/SecretInput/SecretInput.tsx
@@ -153,12 +153,18 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
}
};
+ const handleBlur = () => {
+ setIsCmdOrCtrlPressed(false);
+ };
+
window.addEventListener("keydown", handleKeyDown);
window.addEventListener("keyup", handleKeyUp);
+ window.addEventListener("blur", handleBlur);
return () => {
window.removeEventListener("keydown", handleKeyDown);
window.removeEventListener("keyup", handleKeyUp);
+ window.removeEventListener("blur", handleBlur);
};
}, []);
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
index 9779433301..3a7639cda9 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
@@ -249,6 +249,19 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
name="value"
render={({ field }) => (
<FormControl
+ tooltipText={
+ <div>
+ You can add references to other secrets using the format{" "}
+ <code>
+ &#36;{"{"}secret_name{"}"}
+ </code>
+ .
+ <br />
+ <br /> You can go to the referenced secret by holding the <code>Cmd</code> (Mac) or{" "}
+ <code>Ctrl</code> (Windows/Linux) key and clicking on the secret name.
+ </div>
+ }
+ tooltipClassName="max-w-md"
label="Value"
isError={Boolean(errors?.value)}
errorText={errors?.value?.message}
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
index 1bc06de4d0..d525cea306 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
@@ -602,7 +602,7 @@ const Page = () => {
tags: updatedTags,
include: includeFilter
}));
- setDebouncedSearchFilter(routerQueryParams.search as string);
+ setDebouncedSearchFilter((routerQueryParams.search as string) ?? "");
}, [routerQueryParams.search, routerQueryParams.tags, routerQueryParams.filterBy]);
const selectedSecrets = useSelectedSecrets();