From 4178c2066ad267affc98202884ef617e34a1633c Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 4 May 2018 15:03:00 -0700 Subject: [PATCH] Turn reschedule events timeline into a component for isolated testing --- .../allocations/allocation/index.hbs | 31 +------------------ .../components/reschedule-event-timeline.hbs | 30 ++++++++++++++++++ 2 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 ui/app/templates/components/reschedule-event-timeline.hbs diff --git a/ui/app/templates/allocations/allocation/index.hbs b/ui/app/templates/allocations/allocation/index.hbs index a4e885fd0..1aa22ab0a 100644 --- a/ui/app/templates/allocations/allocation/index.hbs +++ b/ui/app/templates/allocations/allocation/index.hbs @@ -98,36 +98,7 @@ Reschedule Events
-
    - {{#if model.nextAllocation}} - {{reschedule-event-row - label="Next Allocation" - allocation=model.nextAllocation - time=model.nextAllocation.modifyTime}} - {{/if}} - {{#if model.hasStoppedRescheduling}} -
  1. - {{x-icon "warning" class="is-warning is-text"}} Nomad has stopped attempting to reschedule this allocation. -
  2. - {{/if}} - {{#if (and model.followUpEvaluation.waitUntil (not model.nextAllocation))}} -
  3. - {{x-icon "clock" class="is-info is-text"}} Nomad will attempt to reschedule - {{moment-from-now model.followUpEvaluation.waitUntil interval=1000}} -
  4. - {{/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}} -
+ {{reschedule-event-timeline allocation=model}}
{{/if}} diff --git a/ui/app/templates/components/reschedule-event-timeline.hbs b/ui/app/templates/components/reschedule-event-timeline.hbs new file mode 100644 index 000000000..8a75433c2 --- /dev/null +++ b/ui/app/templates/components/reschedule-event-timeline.hbs @@ -0,0 +1,30 @@ +
    + {{#if allocation.nextAllocation}} + {{reschedule-event-row + label="Next Allocation" + allocation=allocation.nextAllocation + time=allocation.nextAllocation.modifyTime}} + {{/if}} + {{#if allocation.hasStoppedRescheduling}} +
  1. + {{x-icon "warning" class="is-warning is-text"}} Nomad has stopped attempting to reschedule this allocation. +
  2. + {{/if}} + {{#if (and allocation.followUpEvaluation.waitUntil (not allocation.nextAllocation))}} +
  3. + {{x-icon "clock" class="is-info is-text"}} Nomad will attempt to reschedule + {{moment-from-now allocation.followUpEvaluation.waitUntil interval=1000}} +
  4. + {{/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}} +