From 5474688084e73ba3b72bb844491ae07cdd22d97f Mon Sep 17 00:00:00 2001 From: Alessio Biancalana Date: Tue, 23 May 2023 18:23:15 +0200 Subject: [PATCH] fixup! Persist selected filters in checks results inside Redux --- assets/js/components/ExecutionResults/ChecksResultFilters.jsx | 4 +++- .../js/components/ExecutionResults/ExecutionResults.test.jsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/components/ExecutionResults/ChecksResultFilters.jsx b/assets/js/components/ExecutionResults/ChecksResultFilters.jsx index b146b92944..09940ee2fc 100644 --- a/assets/js/components/ExecutionResults/ChecksResultFilters.jsx +++ b/assets/js/components/ExecutionResults/ChecksResultFilters.jsx @@ -5,7 +5,9 @@ import Filter from '@components/Table/Filter'; export const RESULT_FILTER_FIELD = 'result'; const getFilters = (savedFilters, searchParams) => - savedFilters && savedFilters.length >= 0 && searchParams.getAll('health').length === 0 + savedFilters && + savedFilters.length >= 0 && + searchParams.getAll('health').length === 0 ? savedFilters : searchParams.getAll('health'); diff --git a/assets/js/components/ExecutionResults/ExecutionResults.test.jsx b/assets/js/components/ExecutionResults/ExecutionResults.test.jsx index cd6dd14a55..5a1fda975c 100644 --- a/assets/js/components/ExecutionResults/ExecutionResults.test.jsx +++ b/assets/js/components/ExecutionResults/ExecutionResults.test.jsx @@ -342,7 +342,7 @@ describe('ExecutionResults', () => { executionData={executionData} executionError={executionError} savedFilters={['passing']} - />, + /> ); expect(screen.getAllByText('test-cluster')).toHaveLength(2);