diff --git a/ui/app/models/task-group-deployment-summary.js b/ui/app/models/task-group-deployment-summary.js index 8436796466e0..21f795f87ec6 100644 --- a/ui/app/models/task-group-deployment-summary.js +++ b/ui/app/models/task-group-deployment-summary.js @@ -22,4 +22,6 @@ export default Fragment.extend({ placedAllocs: attr('number'), healthyAllocs: attr('number'), unhealthyAllocs: attr('number'), + + requireProgressBy: attr('date'), }); diff --git a/ui/app/templates/components/job-deployment/task-groups.hbs b/ui/app/templates/components/job-deployment/task-groups.hbs index cee10994caff..a25bffd3debb 100644 --- a/ui/app/templates/components/job-deployment/task-groups.hbs +++ b/ui/app/templates/components/job-deployment/task-groups.hbs @@ -15,6 +15,9 @@ Allocs Healthy Allocs Unhealthy Allocs + {{#if inProgress}} + Progress Deadline + {{/if}} {{/t.head}} {{#t.body as |row|}} @@ -31,6 +34,11 @@ {{row.model.placedAllocs}} / {{row.model.desiredTotal}} {{row.model.healthyAllocs}} {{row.model.unhealthyAllocs}} + {{#if inProgress}} + + {{moment-format row.model.requireProgressBy "MM/DD/YY HH:mm:ss"}} + + {{/if}} {{/t.body}} {{/list-table}} diff --git a/ui/app/templates/components/job-page/parts/running-deployment.hbs b/ui/app/templates/components/job-page/parts/running-deployment.hbs index c42bb866d6ac..c04d33c92f47 100644 --- a/ui/app/templates/components/job-page/parts/running-deployment.hbs +++ b/ui/app/templates/components/job-page/parts/running-deployment.hbs @@ -19,7 +19,7 @@ {{#job-deployment-details deployment=job.runningDeployment as |d|}} {{d.metrics}} {{#if isShowingDeploymentDetails}} - {{d.taskGroups}} + {{d.taskGroups inProgress=true}} {{d.allocations}} {{/if}} {{/job-deployment-details}} diff --git a/ui/mirage/factories/deployment-task-group-summary.js b/ui/mirage/factories/deployment-task-group-summary.js index 5858c66fcfe9..addc4c8aa489 100644 --- a/ui/mirage/factories/deployment-task-group-summary.js +++ b/ui/mirage/factories/deployment-task-group-summary.js @@ -1,11 +1,15 @@ import { Factory, faker } from 'ember-cli-mirage'; +const REF_TIME = new Date(); + export default Factory.extend({ name: '', autoRevert: () => Math.random() > 0.5, promoted: () => Math.random() > 0.5, + requireProgressBy: () => faker.date.past(0.5 / 365, REF_TIME), + desiredTotal: faker.random.number({ min: 1, max: 10 }), desiredCanaries() { diff --git a/ui/tests/integration/job-page/parts/running-deployment-test.js b/ui/tests/integration/job-page/parts/running-deployment-test.js index e6cb09bbd242..426de121036d 100644 --- a/ui/tests/integration/job-page/parts/running-deployment-test.js +++ b/ui/tests/integration/job-page/parts/running-deployment-test.js @@ -139,3 +139,34 @@ test('the active deployment section can be expanded to show task groups and allo }); }); }); + +test('each task group in the expanded task group section shows task group details', function(assert) { + this.server.create('node'); + this.server.create('job', { type: 'service', activeDeployment: true }); + + this.store.findAll('job'); + + return wait().then(() => { + const job = this.store.peekAll('job').get('firstObject'); + + this.set('job', job); + this.render(hbs` + {{job-page/parts/running-deployment job=job}} + `); + + return wait() + .then(() => { + click('[data-test-deployment-toggle-details]'); + return wait(); + }) + .then(() => { + const task = job.get('runningDeployment.taskGroupSummaries.firstObject'); + const findForTaskGroup = selector => find(`[data-test-deployment-task-group-${selector}]`); + assert.equal(findForTaskGroup('name').textContent.trim(), task.get('name')); + assert.equal( + findForTaskGroup('progress-deadline').textContent.trim(), + moment(task.get('requireProgressBy')).format('MM/DD/YY HH:mm:ss') + ); + }); + }); +});