Skip to content

Commit 55a3506

Browse files
committed
Improve task selection on user group
If a user selects a task owned by a user which has multiple same versions, selection proceeds using source property instead of version property
1 parent 761a9dd commit 55a3506

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/lib/components/workflow/WorkflowTaskSelection.svelte

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,22 @@
8686
}]);
8787
} else {
8888
const taskVersions = selectionTasks.get(task.name);
89-
if (!taskVersions.find(t => t.version === task.version)) {
90-
taskVersions.push({ id: task.id, version: task.version, source: task.source, owner: task.owner });
91-
} else {
89+
90+
if (taskVersions.find(t => t.version === task.version && t.owner === task.owner)) {
91+
// Set the version to null of previous tasks within taskVersions
92+
taskVersions.forEach(t => {
93+
if (t.owner === task.owner) {
94+
t.version = null;
95+
}
96+
});
97+
9298
taskVersions.push({ id: task.id, version: null, source: task.source, owner: task.owner });
99+
} else {
100+
taskVersions.push({ id: task.id, version: task.version, source: task.source, owner: task.owner });
93101
}
94102
}
95103
});
96104
}
97-
98-
99105
setSelectionControlData();
100106
}
101107

0 commit comments

Comments
 (0)