Skip to content

Commit

Permalink
frontend: filterSlice: removed search by status array
Browse files Browse the repository at this point in the history
Signed-off-by: Lisa Alexander <[email protected]>
  • Loading branch information
lalexander07 committed Mar 7, 2024
1 parent 4530389 commit 232bd49
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions frontend/src/redux/filterSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ export function filterResource(
return false;
}

let status: string = '';
let phase: string = '';
if (isKubeCRD(item)) {
const kubeCRD: KubeCRD = item as KubeCRD;
status = kubeCRD?.status ? kubeCRD?.status : '';
phase = kubeCRD?.status?.phase ? kubeCRD?.status?.phase : '';;
if ((status.length > 0 || phase.length > 0) && filter.statuses.size > 0) {
matches = filter.statuses.has(status) || filter.statuses.has(phase);
if (phase.length > 0 && filter.statuses.size > 0) {
matches = filter.statuses.has(phase);
}
}

Expand All @@ -67,7 +65,6 @@ export function filterResource(
item.metadata.name.toLowerCase(),
...Object.keys(item.metadata.labels || {}).map(item => item.toLowerCase()),
...Object.values(item.metadata.labels || {}).map(item => item.toLowerCase()),
status.toLowerCase(),
phase.toLowerCase(),
];

Expand Down

0 comments on commit 232bd49

Please sign in to comment.