diff --git a/plugins/main/public/components/common/wazuh-discover/wz-discover.tsx b/plugins/main/public/components/common/wazuh-discover/wz-discover.tsx index 378c19cc53..af14c9f6cc 100644 --- a/plugins/main/public/components/common/wazuh-discover/wz-discover.tsx +++ b/plugins/main/public/components/common/wazuh-discover/wz-discover.tsx @@ -142,7 +142,7 @@ const WazuhDiscoverComponent = (props: WazuhDiscoverProps) => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -198,15 +198,15 @@ const WazuhDiscoverComponent = (props: WazuhDiscoverProps) => { {isDataSourceLoading ? ( ) : ( - - )} + + )} {!isDataSourceLoading && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx b/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx index 2248e65f6f..0113dcc34f 100644 --- a/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx +++ b/plugins/main/public/components/common/wazuh-discover/wz-flyout-discover.tsx @@ -152,7 +152,7 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => { .catch((error: HttpError) => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching discover data', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); diff --git a/plugins/main/public/components/management/cluster/dashboard/dashboard.tsx b/plugins/main/public/components/management/cluster/dashboard/dashboard.tsx index 978f7e2439..22a79d5f32 100644 --- a/plugins/main/public/components/management/cluster/dashboard/dashboard.tsx +++ b/plugins/main/public/components/management/cluster/dashboard/dashboard.tsx @@ -91,7 +91,7 @@ const DashboardCT: React.FC = ({ statusRunning }) => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -168,26 +168,26 @@ const DashboardCT: React.FC = ({ statusRunning }) => { ) : null} {!isDataSourceLoading && - dataSource && - !state.showConfig && - !state.showNodes ? ( - - ) : null} + dataSource && + !state.showConfig && + !state.showNodes ? ( + + ) : null} {state.showConfig ? ( { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,15 +102,15 @@ const DashboardGDPRComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/github/dashboards/dashboard.tsx b/plugins/main/public/components/overview/github/dashboards/dashboard.tsx index 67c5190f1a..403bf03141 100644 --- a/plugins/main/public/components/overview/github/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/github/dashboards/dashboard.tsx @@ -84,7 +84,7 @@ const DashboardGitHubComponent: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,22 +102,23 @@ const DashboardGitHubComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} {dataSource && results?.hits?.total > 0 ? (
0 ? '' : 'wz-no-display' - }`} + className={`github-dashboard-responsive ${ + dataSource && results?.hits?.total > 0 ? '' : 'wz-no-display' + }`} > ([]); - const [pagination, setPagination] = useState({ - pageIndex: 0, - pageSize: 15, - pageSizeOptions: [15, 25, 50, 100], - }) - const [sorting, setSorting] = useState([]); + const [results, setResults] = useState([]); + const [pagination, setPagination] = useState({ + pageIndex: 0, + pageSize: 15, + pageSizeOptions: [15, 25, 50, 100], + }); + const [sorting, setSorting] = useState([]); - const { - fetchData, - searchBarProps, - indexPattern, - fetchFilters, - defaultTableColumns, - } = props; + const { + fetchData, + searchBarProps, + indexPattern, + fetchFilters, + defaultTableColumns, + } = props; - useEffect(() => { - if (!indexPattern) { - return; - } - fetchData({ - query: searchBarProps.query, - filters: fetchFilters, - pagination, - sorting, - dateRange: { - from: searchBarProps.dateRangeFrom || '', - to: searchBarProps.dateRangeTo || '', - }, - }) - .then(results => { - setResults(results); - }) - .catch(error => { - const searchError = ErrorFactory.create(HttpError, { - error, - message: 'Error fetching actions', - }); - ErrorHandler.handleError(searchError); - }); - }, [ - JSON.stringify(fetchFilters), - JSON.stringify(searchBarProps.query), - JSON.stringify(pagination), - JSON.stringify(sorting), - searchBarProps.dateRangeFrom, - searchBarProps.dateRangeTo, - ]) + useEffect(() => { + if (!indexPattern) { + return; + } + fetchData({ + query: searchBarProps.query, + filters: fetchFilters, + pagination, + sorting, + dateRange: { + from: searchBarProps.dateRangeFrom || '', + to: searchBarProps.dateRangeTo || '', + }, + }) + .then(results => { + setResults(results); + }) + .catch(error => { + const searchError = ErrorFactory.create(HttpError, { + error, + message: 'Error fetching data', + }); + ErrorHandler.handleError(searchError); + }); + }, [ + JSON.stringify(fetchFilters), + JSON.stringify(searchBarProps.query), + JSON.stringify(pagination), + JSON.stringify(sorting), + searchBarProps.dateRangeFrom, + searchBarProps.dateRangeTo, + ]); - return ( - - setPagination(pagination)} - onChangeSorting={(sorting) => { - setSorting(sorting); - }} - /> - ); + return ( + + setPagination(pagination)} + onChangeSorting={sorting => { + setSorting(sorting); + }} + /> + + ); } diff --git a/plugins/main/public/components/overview/google-cloud/dashboards/dashboard.tsx b/plugins/main/public/components/overview/google-cloud/dashboards/dashboard.tsx index ffacf1a130..d859ff03b1 100644 --- a/plugins/main/public/components/overview/google-cloud/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/google-cloud/dashboards/dashboard.tsx @@ -82,7 +82,7 @@ const DashboardGoogleCloudComponent: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -100,16 +100,16 @@ const DashboardGoogleCloudComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/hipaa/dashboards/dashboard.tsx b/plugins/main/public/components/overview/hipaa/dashboards/dashboard.tsx index 6f8de3d020..1646d7b636 100644 --- a/plugins/main/public/components/overview/hipaa/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/hipaa/dashboards/dashboard.tsx @@ -84,7 +84,7 @@ const DashboardHIPAAComponent: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,15 +102,15 @@ const DashboardHIPAAComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/mitre/dashboard/dashboard.tsx b/plugins/main/public/components/overview/mitre/dashboard/dashboard.tsx index 8a02ac2810..da5cfb265e 100644 --- a/plugins/main/public/components/overview/mitre/dashboard/dashboard.tsx +++ b/plugins/main/public/components/overview/mitre/dashboard/dashboard.tsx @@ -78,7 +78,7 @@ export const DashboardMITRE: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -96,21 +96,22 @@ export const DashboardMITRE: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null}
0 ? '' : 'wz-no-display' - }`} + className={`mitre-dashboard-responsive ${ + dataSource && results?.hits?.total > 0 ? '' : 'wz-no-display' + }`} >
diff --git a/plugins/main/public/components/overview/nist/dashboards/dashboard.tsx b/plugins/main/public/components/overview/nist/dashboards/dashboard.tsx index 6b9e7da7a8..6f023c5186 100644 --- a/plugins/main/public/components/overview/nist/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/nist/dashboards/dashboard.tsx @@ -84,7 +84,7 @@ const DashboardNIST80053Component: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,15 +102,15 @@ const DashboardNIST80053Component: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/office/dashboard/dashboard.tsx b/plugins/main/public/components/overview/office/dashboard/dashboard.tsx index 60e7860dae..9bc072c977 100644 --- a/plugins/main/public/components/overview/office/dashboard/dashboard.tsx +++ b/plugins/main/public/components/overview/office/dashboard/dashboard.tsx @@ -83,7 +83,7 @@ const DashboardOffice365Component: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -101,23 +101,24 @@ const DashboardOffice365Component: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null}
0 ? '' : 'wz-no-display' - }`} + className={`office-365-dashboard-responsive ${ + dataSource && results?.hits?.total > 0 ? '' : 'wz-no-display' + }`} > { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -103,15 +103,15 @@ const DashboardPCIDSSComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/server-management-statistics/dashboards/dashboardTabsPanels.tsx b/plugins/main/public/components/overview/server-management-statistics/dashboards/dashboardTabsPanels.tsx index 4624d2a6e4..5077d7747c 100644 --- a/plugins/main/public/components/overview/server-management-statistics/dashboards/dashboardTabsPanels.tsx +++ b/plugins/main/public/components/overview/server-management-statistics/dashboards/dashboardTabsPanels.tsx @@ -97,7 +97,7 @@ export const DashboardTabsPanels = ({ .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching statistics', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); diff --git a/plugins/main/public/components/overview/threat-hunting/dashboard/dashboard.tsx b/plugins/main/public/components/overview/threat-hunting/dashboard/dashboard.tsx index 136efb1062..2e31c0fc10 100644 --- a/plugins/main/public/components/overview/threat-hunting/dashboard/dashboard.tsx +++ b/plugins/main/public/components/overview/threat-hunting/dashboard/dashboard.tsx @@ -169,7 +169,7 @@ const DashboardTH: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching threat hunting', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -228,10 +228,11 @@ const DashboardTH: React.FC = () => { ) : null}
0 - ? '' - : 'wz-no-display' - }`} + className={`th-container ${ + !isDataSourceLoading && dataSource && results?.hits?.total > 0 + ? '' + : 'wz-no-display' + }`} >
@@ -292,20 +293,20 @@ const DashboardTH: React.FC = () => { { }} + onResetQuery={() => {}} tooltip={ results?.hits?.total && - results?.hits?.total > MAX_ENTRIES_PER_QUERY + results?.hits?.total > MAX_ENTRIES_PER_QUERY ? { - ariaLabel: 'Warning', - content: `The query results has exceeded the limit of ${formatNumWithCommas( - MAX_ENTRIES_PER_QUERY, - )} hits. To provide a better experience the table only shows the first ${formatNumWithCommas( - MAX_ENTRIES_PER_QUERY, - )} hits.`, - iconType: 'alert', - position: 'top', - } + ariaLabel: 'Warning', + content: `The query results has exceeded the limit of ${formatNumWithCommas( + MAX_ENTRIES_PER_QUERY, + )} hits. To provide a better experience the table only shows the first ${formatNumWithCommas( + MAX_ENTRIES_PER_QUERY, + )} hits.`, + iconType: 'alert', + position: 'top', + } : undefined } /> diff --git a/plugins/main/public/components/overview/tsc/dashboards/dashboard.tsx b/plugins/main/public/components/overview/tsc/dashboards/dashboard.tsx index 95b8f6ad6a..80066a138e 100644 --- a/plugins/main/public/components/overview/tsc/dashboards/dashboard.tsx +++ b/plugins/main/public/components/overview/tsc/dashboards/dashboard.tsx @@ -84,7 +84,7 @@ const DashboardTSCComponent: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,15 +102,15 @@ const DashboardTSCComponent: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null} diff --git a/plugins/main/public/components/overview/virustotal/dashboard/dashboard.tsx b/plugins/main/public/components/overview/virustotal/dashboard/dashboard.tsx index fbce45b29f..30b1f7455c 100644 --- a/plugins/main/public/components/overview/virustotal/dashboard/dashboard.tsx +++ b/plugins/main/public/components/overview/virustotal/dashboard/dashboard.tsx @@ -84,7 +84,7 @@ const DashboardVT: React.FC = () => { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching alerts', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -102,16 +102,16 @@ const DashboardVT: React.FC = () => { {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {!isDataSourceLoading && dataSource && results?.hits?.total > 0 ? ( ) : null} @@ -119,10 +119,11 @@ const DashboardVT: React.FC = () => { ) : null}
0 - ? '' - : 'wz-no-display' - }`} + className={`virustotal-dashboard-responsive ${ + !isDataSourceLoading && dataSource && results?.hits?.total > 0 + ? '' + : 'wz-no-display' + }`} > { .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -214,17 +214,17 @@ const InventoryVulsComponent = () => { showResetButton={false} tooltip={ results?.hits?.total && - results?.hits?.total > MAX_ENTRIES_PER_QUERY + results?.hits?.total > MAX_ENTRIES_PER_QUERY ? { - ariaLabel: 'Warning', - content: `The query results has exceeded the limit of ${formatNumWithCommas( - MAX_ENTRIES_PER_QUERY, - )} hits. To provide a better experience the table only shows the first ${formatNumWithCommas( - MAX_ENTRIES_PER_QUERY, - )} hits.`, - iconType: 'alert', - position: 'top', - } + ariaLabel: 'Warning', + content: `The query results has exceeded the limit of ${formatNumWithCommas( + MAX_ENTRIES_PER_QUERY, + )} hits. To provide a better experience the table only shows the first ${formatNumWithCommas( + MAX_ENTRIES_PER_QUERY, + )} hits.`, + iconType: 'alert', + position: 'top', + } : undefined } /> diff --git a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx index f173e127e9..74ec75a6c2 100644 --- a/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx +++ b/plugins/main/public/components/overview/vulnerabilities/dashboards/overview/dashboard.tsx @@ -77,7 +77,7 @@ const DashboardVulsComponent: React.FC = ({ .catch(error => { const searchError = ErrorFactory.create(HttpError, { error, - message: 'Error fetching vulnerabilities', + message: 'Error fetching data', }); ErrorHandler.handleError(searchError); }); @@ -91,22 +91,23 @@ const DashboardVulsComponent: React.FC = ({ {isDataSourceLoading && !dataSource ? ( ) : ( - - )} + + )} {dataSource && results?.hits?.total === 0 ? ( ) : null}
0 ? '' : 'wz-no-display' - }`} + className={`vulnerability-dashboard-responsive ${ + dataSource && results?.hits?.total > 0 ? '' : 'wz-no-display' + }`} >