From c2e64a124d1c8991d640e6f4883812c0230ad01a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 27 Mar 2024 12:21:28 -0700 Subject: [PATCH] Cherry picked from Rome changes to apply to IO. --- .../production-board-kanban/production-board-kanban.utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/production-board-kanban/production-board-kanban.utils.js b/client/src/components/production-board-kanban/production-board-kanban.utils.js index 4ed1a45d5..9cfc81657 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.utils.js +++ b/client/src/components/production-board-kanban/production-board-kanban.utils.js @@ -18,8 +18,8 @@ const sortByParentId = (arr) => { //console.log("sortByParentId -> byParentsIdsList", byParentsIdsList); while (byParentsIdsList[parentId]) { - sortedList.push(byParentsIdsList[parentId][0]); - parentId = byParentsIdsList[parentId][0].id; + sortedList.push(...byParentsIdsList[parentId]); //Spread in the whole list in case several items have the same parents. + parentId = byParentsIdsList[parentId][byParentsIdsList[parentId].length -1].id; //Grab the ID from the last one. } if (byParentsIdsList["null"])