open-nomad/ui/app/templates/components/exec/task-group-parent.hbs
Buck Doyle d4708860f0
UI: Fix exec popup link for job id ≠ name (#7815)
This closes #7814. It makes URL-generation more central and changes
the exec URL to include job id instead of name.
2020-04-29 07:54:04 -05:00

25 lines
1,017 B
Handlebars

<button {{action "toggleOpen"}} class="toggle-button {{if hasPendingAllocations "is-loading"}}" data-test-task-group-name>
{{x-icon (if isOpen "chevron-down" "chevron-right")}}
{{taskGroup.name}}
</button>
{{#if isOpen}}
<ul class="task-list">
{{#each sortedTasks as |task|}}
{{#if openInNewWindow}}
<a {{on "click" (action "openInNewWindow" taskGroup.job taskGroup task)}} class="task-item" data-test-task>
{{exec/task-contents
task=task
active=(and currentRouteIsThisTaskGroup (eq task.name activeTaskName))
openInNewWindow=openInNewWindow}}
</a>
{{else}}
{{#link-to "exec.task-group.task" taskGroup.job.plainId taskGroup.name task.name class="task-item" data-test-task=true}}
{{exec/task-contents
task=task
active=(and currentRouteIsThisTaskGroup (eq task.name activeTaskName))
openInNewWindow=openInNewWindow}}
{{/link-to}}
{{/if}}
{{/each}}
</ul>
{{/if}}