File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ import CommunicationsContext from '../context/OverviewContext';
55
66const RouteLocations = ( props ) => {
77 const communicationsData = useContext ( CommunicationsContext ) . overviewData ;
8-
8+ console . log ( 'commData (from overviewContxt):' , communicationsData ) ;
9+
910 // initialize an empty object resObj. This object will store the microservice names as values and its corresponding correlatingId or correlatingid as keys. The microservice names will be stored in array within the order it was to the database.
1011 const resObj = { } ;
1112
1213 if ( communicationsData . length > 0 && communicationsData [ 0 ] . _id ) {
1314 // Sort the communication array from latest to earliest document
1415 communicationsData . sort ( ( a , b ) => {
16+ // Note that a newer date obj IS GREATER THAN an older date obj.
17+ // The following lines sort the array from OLDEST to NEWEST.
1518 if ( new Date ( a . timeSent ) > new Date ( b . timeSent ) ) return 1 ;
1619 if ( new Date ( a . timeSent ) < new Date ( b . timeSent ) ) return - 1 ;
1720 return 0 ;
@@ -60,6 +63,8 @@ const RouteLocations = (props) => {
6063 // Each elem in tracePoints is an array of arrays, which contain objects (each of which is a data point).
6164 const tracePoints = Object . values ( resObj ) ;
6265 const position = communicationsData [ 0 ] . correlatingid ? 0 : tracePoints . length - 1 ;
66+ console . log ( 'tracePoints arr:' , tracePoints ) ;
67+ console . log ( 'position for tracePoints:' , position ) ;
6368
6469 const resArray = [ ] ;
6570
Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ const ServiceOverview = (props) => {
2626 // IPC listener responsible for retrieving infomation from asynchronous main process message.
2727 ipcRenderer . on ( 'overviewResponse' , ( event , data ) => {
2828 // Adds to state and context.
29- console . log ( JSON . parse ( data ) ) ;
29+ // console.log(JSON.parse(data));
3030 setOverviewState ( Object . values ( JSON . parse ( data ) ) ) ;
3131 serviceComponents . overviewData = JSON . parse ( data ) ;
3232 } ) ;
3333 } , [ ] ) ;
3434
35- console . log ( 'overviewstate: ' , overviewState ) ;
35+ // console.log('overviewstate: ', overviewState);
3636 // Add routes to the display
3737 // Hook used to toggle whether or not the Modal component renders
3838 const [ modalDisplay , toggleModalDisplay ] = useState ( false ) ;
You can’t perform that action at this time.
0 commit comments