Skip to content

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

remove metadata results in case the secrets type is not selected

adilson3f78b473c08b
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/components/QuickSearchModal.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/components/QuickSearchModal.tsx
index a97e8ba56c..f48110c21f 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/components/QuickSearchModal.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretSearchInput/components/QuickSearchModal.tsx
@@ -264,11 +264,25 @@ const Content = ({
setFilterTags({});
};
+ // metadata search only supports secrets, so fully reset it (conditions, builder, match)
+ // whenever it should no longer apply
+ const resetMetadataSearch = () => {
+ setMetadataConditions([]);
+ setIsBuilderOpen(false);
+ setMetadataMatch("all");
+ };
+
const handleToggleShowType = (type: string) => {
setShowFilter((prev) => {
const newValue = !prev[type as ResourceType];
if (type === RowType.Secret && !newValue) {
+ // Secrets turned off: tags and metadata search are secrets-only
setFilterTags({});
+ resetMetadataSearch();
+ }
+ if (type !== RowType.Secret && newValue) {
+ // switched to a non-secret resource type: metadata search only supports secrets
+ resetMetadataSearch();
}
return {
...prev,
@@ -305,8 +319,7 @@ const Content = ({
// closing the builder discards the conditions so a metadata filter never stays active while hidden
const handleCloseBuilder = () => {
- setIsBuilderOpen(false);
- setMetadataConditions([]);
+ resetMetadataSearch();
};
const hasActiveFilters =