Sort order fix if property path gets updated via multiple start nodes (#3194)
This commit is contained in:
parent
e197d13399
commit
3944d7e43e
|
|
@ -243,13 +243,27 @@ export default class DataTreeEvaluator {
|
|||
|
||||
// Remove duplicates from this list. Since we explicitly walk down the tree and implicitly (by fetching parents) walk
|
||||
// up the tree, there are bound to be many duplicates.
|
||||
const uniqueKeysInSortOrder = [...new Set(finalSortOrder)];
|
||||
const uniqueKeysInSortOrder = new Set(finalSortOrder);
|
||||
|
||||
const sortOrderPropertyPaths = Array.from(uniqueKeysInSortOrder);
|
||||
// if a property path evaluation gets triggered by diff top order changes
|
||||
// this could lead to incorrect sort order in spite of the bfs traversal
|
||||
const sortOrderPropertyPaths: string[] = [];
|
||||
this.sortedDependencies.forEach((path) => {
|
||||
if (uniqueKeysInSortOrder.has(path)) {
|
||||
sortOrderPropertyPaths.push(path);
|
||||
// remove from the uniqueKeysInSortOrder
|
||||
uniqueKeysInSortOrder.delete(path);
|
||||
}
|
||||
});
|
||||
// Add any remaining paths in the uniqueKeysInSortOrder
|
||||
const completeSortOrder = [
|
||||
...Array.from(uniqueKeysInSortOrder),
|
||||
...sortOrderPropertyPaths,
|
||||
];
|
||||
|
||||
//Trim this list to now remove the property paths which are simply entity names
|
||||
const finalSortOrderArray: Array<string> = [];
|
||||
sortOrderPropertyPaths.forEach((propertyPath) => {
|
||||
completeSortOrder.forEach((propertyPath) => {
|
||||
const lastIndexOfDot = propertyPath.lastIndexOf(".");
|
||||
// Only do this for property paths and not the entity themselves
|
||||
if (lastIndexOfDot !== -1) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user