From 7f3f5c9b91ae88b32b2f8339f6d916c630b01ce8 Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Mon, 28 Jun 2021 18:24:24 +0100 Subject: [PATCH] Add accessor method to retrieve array filter value from EntityTypeFilter Co-authored-by: Tim Hansen Co-authored-by: Chase Rutherford-Jenkins Co-authored-by: Himanshu Mishra Co-authored-by: Joe Porpeglia Signed-off-by: Mike Lewis --- plugins/catalog-react/src/filters.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-react/src/filters.ts b/plugins/catalog-react/src/filters.ts index 7a80eb6d31..418afeab92 100644 --- a/plugins/catalog-react/src/filters.ts +++ b/plugins/catalog-react/src/filters.ts @@ -32,10 +32,14 @@ export class EntityKindFilter implements EntityFilter { } export class EntityTypeFilter implements EntityFilter { - constructor(readonly value: string) {} + constructor(readonly value: string | string[]) {} + + getTypes() { + return Array.isArray(this.value) ? this.value : [this.value]; + } getCatalogFilters(): Record { - return { 'spec.type': this.value }; + return { 'spec.type': this.getTypes() }; } }