-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui, deployments] Show a "Latest Deployment Status" cell within the J…
…ob Status panel on steady service jobs (#17246) * Failed or lost cell condensed * Latest Deployment cell * Stylistic changes and deploying state fixup * Rewritten tooltip message and updated lost/failed tests * failed-or-lost cell updates to job status panel acceptance tests
- Loading branch information
1 parent
9ff1d92
commit 3bde355
Showing
9 changed files
with
205 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
<section class="failed-or-lost"> | ||
<h4> | ||
{{@title}} | ||
<span | ||
class="tooltip multiline text-center" | ||
role="tooltip" | ||
aria-label={{@description}} | ||
> | ||
<FlightIcon @name="info" /> | ||
<h4>Replaced Allocations</h4> | ||
<div class="failed-or-lost-links"> | ||
{{#if @supportsRescheduling}} | ||
<span> | ||
<span | ||
class="tooltip multiline text-center" | ||
role="tooltip" | ||
aria-label="Allocations that have been rescheduled, on another node if possible, due to failure or manual restart" | ||
> | ||
<FlightIcon @name="info" /> | ||
</span> | ||
<ConditionalLinkTo | ||
@condition={{@rescheduledAllocs.length}} | ||
@route="jobs.job.allocations" | ||
@model={{@job}} | ||
@query={{hash scheduling='["has-been-rescheduled"]' version=(concat '[' @job.latestDeployment.versionNumber ']')}} | ||
@label="View Allocations" | ||
> | ||
{{@rescheduledAllocs.length}} Rescheduled | ||
</ConditionalLinkTo> | ||
</span> | ||
{{/if}} | ||
|
||
<span> | ||
<span | ||
class="tooltip multiline text-center" | ||
role="tooltip" | ||
aria-label="Allocations that have been restarted in-place due to a task failure or manual restart" | ||
> | ||
<FlightIcon @name="info" /> | ||
</span> | ||
<ConditionalLinkTo | ||
@condition={{@restartedAllocs.length}} | ||
@route="jobs.job.allocations" | ||
@model={{@job}} | ||
@query={{hash scheduling='["has-been-restarted"]' version=(concat '[' @job.latestDeployment.versionNumber ']')}} | ||
@label="View Allocations" | ||
> | ||
{{@restartedAllocs.length}} Restarted | ||
</ConditionalLinkTo> | ||
</span> | ||
</h4> | ||
{{#if (eq @title "Rescheduled")}} | ||
<ConditionalLinkTo | ||
@condition={{this.shouldLinkToAllocations}} | ||
@route="jobs.job.allocations" | ||
@model={{@job}} | ||
@query={{hash scheduling='["has-been-rescheduled"]' version=(concat '[' @job.latestDeployment.versionNumber ']')}} | ||
@label="View Allocations" | ||
@class="failed-or-lost-link" | ||
> | ||
{{@allocs.length}} | ||
</ConditionalLinkTo> | ||
{{/if}} | ||
{{#if (eq @title "Restarted")}} | ||
<ConditionalLinkTo | ||
@condition={{this.shouldLinkToAllocations}} | ||
@route="jobs.job.allocations" | ||
@model={{@job}} | ||
@query={{hash scheduling='["has-been-restarted"]' version=(concat '[' @job.latestDeployment.versionNumber ']')}} | ||
@label="View Allocations" | ||
@class="failed-or-lost-link" | ||
> | ||
{{@allocs.length}} | ||
</ConditionalLinkTo> | ||
{{/if}} | ||
</div> | ||
</section> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<section class="latest-deployment"> | ||
<LinkTo @route="jobs.job.deployments" @model={{@job}}> | ||
<h4> | ||
Latest Deployment | ||
<FlightIcon @name="arrow-right" /> | ||
</h4> | ||
</LinkTo> | ||
<Hds::Badge @text={{capitalize this.status}} @size="small" @color={{this.statusColor}} @type="filled" /> | ||
<p>{{this.healthyAllocs}}/{{this.desiredTotal}} Healthy</p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Component from '@glimmer/component'; | ||
import { alias } from '@ember/object/computed'; | ||
|
||
export default class JobStatusLatestDeploymentComponent extends Component { | ||
@alias('args.job.latestDeployment') deployment; | ||
@alias('deployment.status') status; | ||
|
||
get healthyAllocs() { | ||
return this.deployment | ||
.get('taskGroupSummaries') | ||
.mapBy('healthyAllocs') | ||
.reduce((sum, count) => sum + count, 0); | ||
} | ||
get desiredTotal() { | ||
return this.deployment | ||
.get('taskGroupSummaries') | ||
.mapBy('desiredTotal') | ||
.reduce((sum, count) => sum + count, 0); | ||
} | ||
|
||
get statusColor() { | ||
switch (this.status) { | ||
case 'successful': | ||
return 'success'; | ||
case 'failed': | ||
return 'critical'; | ||
default: | ||
return 'neutral'; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.