open-nomad/ui/app/templates/components/exec/task-group-parent.hbs
Buck Doyle 2998deac50
Convert to angle bracket invocation (#8075)
This is mostly a direct application of the ember-angle-brackets-codemod.
I manually restored newlines in multi-line component invocations, usually
preserving file line length except for now-non-positional link-to @route.

I needed to rename task to taskState in some cases to avoid Ember
Concurrency naming conflicts.
2020-06-01 14:03:56 -05:00

25 lines
1 KiB
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::TaskContents
@task={{task}}
@active={{and currentRouteIsThisTaskGroup (eq task.name activeTaskName)}}
@openInNewWindow={{openInNewWindow}} />
</a>
{{else}}
<LinkTo @route="exec.task-group.task" @models={{array taskGroup.job.plainId taskGroup.name task.name}} class="task-item" data-test-task={{true}}>
<Exec::TaskContents
@task={{task}}
@active={{and currentRouteIsThisTaskGroup (eq task.name activeTaskName)}}
@openInNewWindow={{openInNewWindow}} />
</LinkTo>
{{/if}}
{{/each}}
</ul>
{{/if}}