You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old list was fetching all lines for an area and could easily implement order by topo image order index on client side. For the new implementation, this requires some clever queries that mimic the attached order function. Somehow the order by needs to order by an attributes of the first element in a relationship list.
/** * Sorts an array of lines by their primary topo image and the topo images order. Lines without topo images come * last. * @param lines Lines to sort. */constgetSortedLines=(lines: Line[]): Line[]=>{constsortedLines=lines.sort((l1,l2)=>{if(l1.topoImages.length===0&&l2.topoImages.length===0){return0;}if(l1.topoImages.length===0){return1;}if(l2.topoImages.length===0){return-1;}if(l1.topoImages[0].orderIndex>l2.topoImages[0].orderIndex){return1;}if(l1.topoImages[0].orderIndex<l2.topoImages[0].orderIndex){return-1;}if(l1.topoImages[0].linePaths[0].orderIndex>l2.topoImages[0].linePaths[0].orderIndex){return1;}if(l1.topoImages[0].linePaths[0].orderIndex<l2.topoImages[0].linePaths[0].orderIndex){return-1;}return0;});sortedLines.map((line,orderIndex)=>{line.blockOrderIndex=orderIndex})returnsortedLines;}
The text was updated successfully, but these errors were encountered:
The old list was fetching all lines for an area and could easily implement order by topo image order index on client side. For the new implementation, this requires some clever queries that mimic the attached order function. Somehow the order by needs to order by an attributes of the first element in a relationship list.
The text was updated successfully, but these errors were encountered: