From 86a3a32a656b5cdaec033d27e9114cd20e9d7160 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Thu, 21 Nov 2024 17:32:03 -0500 Subject: [PATCH] update filter to be more readable based on #27355 Signed-off-by: Stephen Glass --- plugins/catalog-react/src/filters.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/catalog-react/src/filters.ts b/plugins/catalog-react/src/filters.ts index 1bab65ce9a..6c68dad9aa 100644 --- a/plugins/catalog-react/src/filters.ts +++ b/plugins/catalog-react/src/filters.ts @@ -94,13 +94,7 @@ export class EntityTextFilter implements EntityFilter { const partialMatch = this.toUpperArray([ entity.metadata.name, entity.metadata.title, - ...(typeof entity.spec?.profile === 'object' && - entity.spec?.profile !== null && - !Array.isArray(entity.spec.profile) && - 'displayName' in entity.spec.profile && - typeof entity.spec.profile.displayName === 'string' - ? [entity.spec.profile.displayName] - : []), + (entity.spec?.profile as { displayName?: string })?.displayName, ]); for (const word of words) {