Skip to content

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

fix: support filtering imported secrets in singl env view

Scott Wilsond2e6743f224d
diff --git a/backend/src/server/routes/v1/dashboard-router.ts b/backend/src/server/routes/v1/dashboard-router.ts
index dae18c23e0..c466be0874 100644
--- a/backend/src/server/routes/v1/dashboard-router.ts
+++ b/backend/src/server/routes/v1/dashboard-router.ts
@@ -732,8 +732,8 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
actorOrgId: req.permission.orgId,
projectId,
environment,
- path: secretPath,
- search
+ path: secretPath
+ // search scott: removing for now because this prevents searching imported secrets which are fetched separately client side
});
if (remainingLimit > 0 && totalImportCount > adjustedOffset) {
@@ -745,7 +745,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
projectId,
environment,
path: secretPath,
- search,
+ // search scott: removing for now because this prevents searching imported secrets which are fetched separately client side
limit: remainingLimit,
offset: adjustedOffset
});
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretImportListView/SecretImportItem.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretImportListView/SecretImportItem.tsx
index 9b8a3c0cec..2be935b33f 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretImportListView/SecretImportItem.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretImportListView/SecretImportItem.tsx
@@ -9,6 +9,7 @@ import {
faInfoCircle,
faKey,
faRotate,
+ faSearch,
faUpDown,
faWarning,
faXmark
@@ -140,6 +141,10 @@ export const SecretImportItem = ({
}
};
+ const filteredImportedSecrets = importedSecrets.filter((secret) =>
+ secret.key.toUpperCase().includes(searchTerm.toUpperCase())
+ );
+
return (
<>
<div
@@ -305,21 +310,26 @@ export const SecretImportItem = ({
</td>
</tr>
)}
- {importedSecrets
- .filter((secret) => secret.key.toUpperCase().includes(searchTerm.toUpperCase()))
- .map(({ key, value }, index) => (
- <tr key={`${id}-${key}-${index + 1}`}>
- <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
- {key}
- </td>
- <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
- <SecretInput value={value} isReadOnly />
- </td>
- {/* <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
+ {filteredImportedSecrets.length === 0 && importedSecrets?.length !== 0 && (
+ <tr>
+ <td colSpan={3}>
+ <EmptyState title="No secrets match search" icon={faSearch} />
+ </td>
+ </tr>
+ )}
+ {filteredImportedSecrets.map(({ key, value }, index) => (
+ <tr key={`${id}-${key}-${index + 1}`}>
+ <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
+ {key}
+ </td>
+ <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
+ <SecretInput value={value} isReadOnly />
+ </td>
+ {/* <td className="h-10" style={{ padding: "0.25rem 1rem" }}>
<EnvFolderIcon env={overriden?.env} secretPath={overriden?.secretPath} />
</td> */}
- </tr>
- ))}
+ </tr>
+ ))}
</tbody>
</table>
</TableContainer>