@fundamental-ngx/platform 0.58.10 → 0.58.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -286,12 +286,16 @@ function makePathsSameLength(paths) {
|
|
|
286
286
|
processedPaths.push(path);
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
path.
|
|
289
|
+
for (let nodeIndex = 0; nodeIndex < path.length; nodeIndex++) {
|
|
290
|
+
if (nodeIndex >= longestPathLength - 1) {
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
const node = path[nodeIndex];
|
|
290
294
|
/** Try to get blank nodes from already processed paths as paths may be the same within some part */
|
|
291
295
|
let blankNodes = getBlankNodesAfterNode(node, processedPaths);
|
|
292
296
|
if (blankNodes.length && blankNodes[0].id !== path[nodeIndex + 1]?.id) {
|
|
293
297
|
path.splice(nodeIndex + 1, 0, ...blankNodes);
|
|
294
|
-
|
|
298
|
+
continue;
|
|
295
299
|
}
|
|
296
300
|
const nodeIndexInPaths = paths.map((_path) => _path.indexOf(node));
|
|
297
301
|
const mostFarNodeIndexInPaths = Math.max(...nodeIndexInPaths);
|
|
@@ -300,15 +304,14 @@ function makePathsSameLength(paths) {
|
|
|
300
304
|
blankNodes[blankNodes.length - 1].targets = [node.id];
|
|
301
305
|
path[nodeIndex - 1].targets = [blankNodes[0].id];
|
|
302
306
|
path.splice(nodeIndex, 0, ...blankNodes);
|
|
303
|
-
|
|
307
|
+
continue;
|
|
304
308
|
}
|
|
305
309
|
if (nodeIndex === mostFarNodeIndexInPaths && nodeIndex === path.length - 1) {
|
|
306
310
|
blankNodes = getBlankNodes(longestPathLength - path.length, path[nodeIndex].status);
|
|
307
311
|
path[nodeIndex].targets = [blankNodes[0].id];
|
|
308
312
|
path.splice(nodeIndex + 1, 0, ...blankNodes);
|
|
309
|
-
return;
|
|
310
313
|
}
|
|
311
|
-
}
|
|
314
|
+
}
|
|
312
315
|
processedPaths.push(path);
|
|
313
316
|
});
|
|
314
317
|
return processedPaths;
|