Turn reschedule events timeline into a component for isolated testing

This commit is contained in:
Michael Lange 2018-05-04 15:03:00 -07:00
parent d6d7a90c99
commit 4178c2066a
2 changed files with 31 additions and 30 deletions

View File

@ -98,36 +98,7 @@
Reschedule Events
</div>
<div class="boxed-section-body">
<ol class="timeline">
{{#if model.nextAllocation}}
{{reschedule-event-row
label="Next Allocation"
allocation=model.nextAllocation
time=model.nextAllocation.modifyTime}}
{{/if}}
{{#if model.hasStoppedRescheduling}}
<li class="timeline-note">
{{x-icon "warning" class="is-warning is-text"}} Nomad has stopped attempting to reschedule this allocation.
</li>
{{/if}}
{{#if (and model.followUpEvaluation.waitUntil (not model.nextAllocation))}}
<li class="timeline-note">
{{x-icon "clock" class="is-info is-text"}} Nomad will attempt to reschedule
{{moment-from-now model.followUpEvaluation.waitUntil interval=1000}}
</li>
{{/if}}
{{reschedule-event-row
label="This Allocation"
allocation=model
linkToAllocation=false
time=model.modifyTime}}
{{#each (reverse model.rescheduleEvents) as |event|}}
{{reschedule-event-row
allocationId=event.previousAllocationId
time=event.time}}
{{/each}}
</ol>
{{reschedule-event-timeline allocation=model}}
</div>
</div>
{{/if}}

View File

@ -0,0 +1,30 @@
<ol class="timeline">
{{#if allocation.nextAllocation}}
{{reschedule-event-row
label="Next Allocation"
allocation=allocation.nextAllocation
time=allocation.nextAllocation.modifyTime}}
{{/if}}
{{#if allocation.hasStoppedRescheduling}}
<li class="timeline-note">
{{x-icon "warning" class="is-warning is-text"}} Nomad has stopped attempting to reschedule this allocation.
</li>
{{/if}}
{{#if (and allocation.followUpEvaluation.waitUntil (not allocation.nextAllocation))}}
<li class="timeline-note">
{{x-icon "clock" class="is-info is-text"}} Nomad will attempt to reschedule
{{moment-from-now allocation.followUpEvaluation.waitUntil interval=1000}}
</li>
{{/if}}
{{reschedule-event-row
label="This Allocation"
allocation=allocation
linkToAllocation=false
time=allocation.modifyTime}}
{{#each (reverse allocation.rescheduleEvents) as |event|}}
{{reschedule-event-row
allocationId=event.previousAllocationId
time=event.time}}
{{/each}}
</ol>