open-nomad/ui/app/templates/jobs/job/versions.hbs
Buck Doyle 90ecbdf522
Add job version revert buttons ()
This adds a Revert two-step button to the JobVersions component for
not-current versions, which redirects to the overview on success. It
checks the job version before and after reversion to mitigate the edge
case where reverting to an otherwise-identical version has no effect, as
discussed in .

It uses existing facilities for handling other errors and disabling the
button when permissions are lacking.
2021-04-20 08:33:16 -05:00

20 lines
817 B
Handlebars

{{page-title "Job " this.job.name " versions"}}
<JobSubnav @job={{this.job}} />
<section class="section">
{{#if this.error}}
<div data-test-inline-error class="notification {{this.errorLevelClass}}">
<div class="columns">
<div class="column">
<h3 data-test-inline-error-title class="title is-4">{{this.error.title}}</h3>
<p data-test-inline-error-body>{{this.error.description}}</p>
</div>
<div class="column is-centered is-minimum">
<button data-test-inline-error-close class="button {{this.errorLevelClass}}" onclick={{action this.onDismiss}} type="button">Okay</button>
</div>
</div>
</div>
{{/if}}
<JobVersionsStream @versions={{this.model.versions}} @verbose={{true}} @handleError={{action this.handleError}} />
</section>