@@ -25,7 +25,7 @@ import { Helmet } from 'react-helmet';
2525import { IncidentsTable } from './IncidentsTable' ;
2626import {
2727 getIncidentsTimeRanges ,
28- processIncidents ,
28+ convertToIncidents ,
2929 processIncidentsForAlerts ,
3030} from './processIncidents' ;
3131import {
@@ -37,7 +37,7 @@ import {
3737 parseUrlParams ,
3838 updateBrowserUrl ,
3939} from './utils' ;
40- import { groupAlertsForTable , processAlerts } from './processAlerts' ;
40+ import { groupAlertsForTable , convertToAlerts } from './processAlerts' ;
4141import { CompressArrowsAltIcon , CompressIcon , FilterIcon } from '@patternfly/react-icons' ;
4242import { useDispatch , useSelector } from 'react-redux' ;
4343import {
@@ -251,10 +251,10 @@ const IncidentsPage = () => {
251251 } ) ,
252252 )
253253 . then ( ( results ) => {
254- const aggregatedData = results . flat ( ) ;
254+ const prometheusResults = results . flat ( ) ;
255255 dispatch (
256256 setAlertsData ( {
257- alertsData : processAlerts ( aggregatedData , incidentForAlertProcessing ) ,
257+ alertsData : convertToAlerts ( prometheusResults , incidentForAlertProcessing ) ,
258258 } ) ,
259259 ) ;
260260 if ( ! isEmpty ( filteredData ) ) {
@@ -304,23 +304,23 @@ const IncidentsPage = () => {
304304 } ) ,
305305 )
306306 . then ( ( results ) => {
307- const aggregatedData = results . flat ( ) ;
308- const processedIncidents = processIncidents ( aggregatedData ) ;
307+ const prometheusResults = results . flat ( ) ;
308+ const incidents = convertToIncidents ( prometheusResults ) ;
309309
310310 // Update the raw, unfiltered incidents state
311- dispatch ( setIncidents ( { incidents : processedIncidents } ) ) ;
311+ dispatch ( setIncidents ( { incidents } ) ) ;
312312
313- // Now, dispatch the filtered data based on the full incidents list
313+ // Filter the incidents and dispatch
314314 dispatch (
315315 setFilteredIncidentsData ( {
316- filteredIncidentsData : filterIncident ( incidentsActiveFilters , processedIncidents ) ,
316+ filteredIncidentsData : filterIncident ( incidentsActiveFilters , incidents ) ,
317317 } ) ,
318318 ) ;
319319
320320 setIncidentsAreLoading ( false ) ;
321321
322322 if ( isGroupSelected ) {
323- setIncidentForAlertProcessing ( processIncidentsForAlerts ( aggregatedData ) ) ;
323+ setIncidentForAlertProcessing ( processIncidentsForAlerts ( prometheusResults ) ) ;
324324 // Only set loading if we don't already have data to show
325325 if ( isEmpty ( alertsData ) ) {
326326 dispatch ( setAlertsAreLoading ( { alertsAreLoading : true } ) ) ;
0 commit comments