Skip to content

Commit e39a117

Browse files
committed
Final dev updat
1 parent c996642 commit e39a117

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

app/charts/route-trace.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ const RouteLocations = (props) => {
99

1010
if(communicationsData.length>0 && communicationsData[0]["_id"]){
1111
//Sort the communication array from latest to earliest document
12-
communicationsData.sort((a,b)=>{ new Date(a.timeSent) - new Date(b.timeSent)})
12+
// communicationsData.sort((a,b)=>{ new Date(a.timeSent) - new Date(b.timeSent)})
13+
communicationsData.sort((a,b)=>{
14+
if(new Date(a.timeSent) > new Date(b.timeSent)) return 1;
15+
if(new Date(a.timeSent) < new Date(b.timeSent)) return -1;
16+
return 0;
17+
});
18+
19+
1320

1421
//Iterate over sorted communicationsData array from the end to the beginning
15-
for (let i = communicationsData.length-1; i >= 0; i--) {
22+
for (let i = 0; i < communicationsData.length; i+=1) {
1623
//declare a constant element and initialize it as the object at index i of the communicationsData array
1724
const element = communicationsData[i];
1825
//Pushes the microservice name into the object
@@ -34,9 +41,10 @@ const RouteLocations = (props) => {
3441

3542
//use object values to destructure locations
3643
const tracePoints = Object.values(resObj);
37-
let position = tracePoints.length-1;
44+
let position = communicationsData[0].correlatingid ? 0 : tracePoints.length-1;
3845

3946
const resArray = [];
47+
4048
for (let i = 0; i < tracePoints[position].length; i+=1) {
4149
resArray.push(
4250
<div className="RouteCircle" key={i}>
@@ -53,3 +61,4 @@ const RouteLocations = (props) => {
5361
};
5462

5563
export default RouteLocations;
64+

user/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"setupRequired":false,"services":[["Database1","MongoDB","mongodb+srv://chronos:jenae@cluster0-gw2vt.mongodb.net/test?retryWrites=true&w=majority"]]}
1+
{"setupRequired":true, "services":["hard","coded","in"]}

0 commit comments

Comments
 (0)