diff --git a/frontend/src/views/DashboardPage/DashboardPage.tsx b/frontend/src/views/DashboardPage/DashboardPage.tsx index acb0f59ff..b83cb839d 100644 --- a/frontend/src/views/DashboardPage/DashboardPage.tsx +++ b/frontend/src/views/DashboardPage/DashboardPage.tsx @@ -950,6 +950,7 @@ export const DashboardPage = () => { secrets={secrets?.secrets} importedSecrets={importedSecrets} items={items} + searchTerm={searchFilter} /> { const [isExpanded, setIsExpanded] = useToggle(); const { attributes, listeners, transform, transition, setNodeRef, isDragging } = useSortable({ @@ -46,6 +48,17 @@ export const SecretImportItem = ({ const { currentWorkspace } = useWorkspace(); const rowEnv = currentWorkspace?.environments?.find(({ slug }) => slug === importedEnv); + useEffect(() => { + const filteredSecrets = importedSecrets.filter(secret => secret.key.toUpperCase().includes(searchTerm.toUpperCase())) + + if (filteredSecrets.length > 0 && searchTerm) { + setIsExpanded.on(); + } else { + setIsExpanded.off(); + } + }, [searchTerm]); + + useEffect(() => { if (isDragging) { setIsExpanded.off(); @@ -65,8 +78,10 @@ export const SecretImportItem = ({ className="group flex cursor-default flex-row items-center hover:bg-mineshaft-700" onClick={() => setIsExpanded.toggle()} > - - + + + + {isExpanded && !isDragging && ( - -
-
Secrets Imported
+ +
@@ -132,7 +146,7 @@ export const SecretImportItem = ({ )} - {importedSecrets.map(({ key, value, overriden }, index) => ( + {importedSecrets.filter(secret => secret.key.toUpperCase().includes(searchTerm.toUpperCase())).map(({ key, value, overriden }, index) => ( + diff --git a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx index 86f2a2071..df88d8138 100644 --- a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx +++ b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx @@ -288,8 +288,14 @@ export const SecretOverviewPage = () => { className="min-table-row min-w-[11rem] border-b-0 p-0 text-center" key={`secret-overview-${name}-${index + 1}`} > -
- {name} +
+ {missingKeyCount > 0 && ( { const { t } = useTranslation(); return ( -
+
{key} diff --git a/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportSection.tsx b/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportSection.tsx index c685a6dec..9d796d079 100644 --- a/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportSection.tsx +++ b/frontend/src/views/DashboardPage/components/SecretImportSection/SecretImportSection.tsx @@ -61,10 +61,11 @@ type Props = { importedSecrets?: TImportedSecrets; onSecretImportDelete: (env: string, secPath: string) => void; items: { id: string; environment: string; secretPath: string }[]; + searchTerm: string; }; export const SecretImportSection = memo( - ({ secrets = [], importedSecrets = [], onSecretImportDelete, items = [] }: Props) => { + ({ secrets = [], importedSecrets = [], onSecretImportDelete, items = [], searchTerm = "" }: Props) => { const { currentWorkspace } = useWorkspace(); const environments = currentWorkspace?.environments || []; @@ -83,6 +84,7 @@ export const SecretImportSection = memo( )} onDelete={onSecretImportDelete} importedSecPath={impSecPath} + searchTerm={searchTerm} /> ))} diff --git a/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx b/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx index 780a36225..a7ccec3b4 100644 --- a/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx +++ b/frontend/src/views/DashboardPage/components/SecretInputRow/SecretInputRow.tsx @@ -219,7 +219,7 @@ export const SecretInputRow = memo( } return ( -
{index + 1}