From 6c3588e8abc3f24bec6887ce69a6c4566ae93358 Mon Sep 17 00:00:00 2001 From: Georgii Karataev Date: Fri, 5 Aug 2022 11:16:09 +0200 Subject: [PATCH] fix(Tables): set data-ouia-safe to true even when there is an error requesting API --- src/Components/AffectedClustersTable/AffectedClustersTable.js | 2 +- src/Components/ClusterRules/ClusterRules.js | 2 +- src/Components/ClustersListTable/ClustersListTable.js | 2 +- src/Components/RecsListTable/RecsListTable.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/AffectedClustersTable/AffectedClustersTable.js b/src/Components/AffectedClustersTable/AffectedClustersTable.js index 2109234a..7b87a002 100644 --- a/src/Components/AffectedClustersTable/AffectedClustersTable.js +++ b/src/Components/AffectedClustersTable/AffectedClustersTable.js @@ -278,7 +278,7 @@ const AffectedClustersTable = ({ query, rule, afterDisableFn }) => { const newDisplayedRows = buildDisplayedRows(newFilteredRows); setFilteredRows(newFilteredRows); setDisplayedRows(newDisplayedRows); - if (isSuccess) { + if (isSuccess || isError) { setRowsFiltered(true); } }, [query, filters]); diff --git a/src/Components/ClusterRules/ClusterRules.js b/src/Components/ClusterRules/ClusterRules.js index b7fb64b7..bc511222 100644 --- a/src/Components/ClusterRules/ClusterRules.js +++ b/src/Components/ClusterRules/ClusterRules.js @@ -106,7 +106,7 @@ const ClusterRules = ({ cluster }) => { useEffect(() => { setFilteredRows(buildFilteredRows(reports, filters)); - if (isSuccess) { + if (isSuccess || isError) { setRowsFiltered(true); } }, [data, filters]); diff --git a/src/Components/ClustersListTable/ClustersListTable.js b/src/Components/ClustersListTable/ClustersListTable.js index f00b42da..1823a6f3 100644 --- a/src/Components/ClustersListTable/ClustersListTable.js +++ b/src/Components/ClustersListTable/ClustersListTable.js @@ -88,7 +88,7 @@ const ClustersListTable = ({ useEffect(() => { setFilteredRows(buildFilteredRows(clusters)); - if (isSuccess) { + if (isSuccess || isError) { setRowsFiltered(true); } }, [data, filters]); diff --git a/src/Components/RecsListTable/RecsListTable.js b/src/Components/RecsListTable/RecsListTable.js index 1ebb4cc1..062ff7d3 100644 --- a/src/Components/RecsListTable/RecsListTable.js +++ b/src/Components/RecsListTable/RecsListTable.js @@ -101,7 +101,7 @@ const RecsListTable = ({ query }) => { setDisplayedRows( buildDisplayedRows(filteredRows, filters.sortIndex, filters.sortDirection) ); - if (isSuccess) { + if (isSuccess || isError) { setRowsFiltered(true); } }, [