Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404 page when wrong filtered catalog is being used in execution results page #1414

Merged
merged 2 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/js/components/ExecutionResults/ExecutionResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import HealthIcon from '@components/Health';
import Modal from '@components/Modal';
import PremiumPill from '@components/PremiumPill';
import Table from '@components/Table';
import LoadingBox from '@components/LoadingBox';
import {
getCatalogCategoryList,
getCheckResults,
Expand Down Expand Up @@ -117,6 +118,10 @@ function ExecutionResults({
}
};

if (catalogLoading) {
return <LoadingBox text="Loading checks catalog" />;
}

EMaksy marked this conversation as resolved.
Show resolved Hide resolved
const checksResults = getCheckResults(executionData);
const catalogCategoryList = getCatalogCategoryList(catalog, checksResults);
const tableData = checksResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
REQUESTED_EXECUTION_STATE,
RUNNING_STATES,
} from '@state/lastExecutions';
import LoadingBox from '@components/LoadingBox';
import ExecutionResults from './ExecutionResults';

function ExecutionResultsPage() {
Expand Down Expand Up @@ -40,7 +41,7 @@ function ExecutionResultsPage() {
}, [cloudProvider]);

if (!cluster) {
return <div>Loading...</div>;
return <LoadingBox text="Loading ..." />;
}

return (
Expand Down
7 changes: 4 additions & 3 deletions assets/js/components/ExecutionResults/checksUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export const getCatalogCategoryList = (catalog, checksResults = []) => {
}
return [
...new Set(
checksResults.map(
({ check_id }) => catalog.find((check) => check.id === check_id).group
)
checksResults.map(({ check_id }) => {
const result = catalog.find((check) => check.id === check_id);
return !result ? '' : result.group;
})
),
].sort();
};
Expand Down