Random exec assignment depends on taskGroup name if provided (#19878)

This commit is contained in:
Phil Renaud
2024-02-05 23:23:01 -05:00
committed by GitHub
parent 50c50a6328
commit c927377700
2 changed files with 7 additions and 1 deletions

3
.changelog/19878.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix an issue where a same-named task from a different group could be selected when the user clicks Exec from a task group page where multiple allocations would be valid
```

View File

@@ -80,7 +80,10 @@ export default class ExecController extends Controller {
if (this.allocationShortId) {
allocation = this.allocations.findBy('shortId', this.allocationShortId);
} else {
allocation = this.allocations.find((allocation) =>
let allocationPool = this.taskGroupName
? this.allocations.filterBy('taskGroupName', this.taskGroupName)
: this.allocations;
allocation = allocationPool.find((allocation) =>
allocation.states
.filterBy('isActive')
.mapBy('name')