From 59267a96aef6602b052b94fb101a93d27f83ab5f Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Wed, 12 Feb 2025 15:39:38 -0500 Subject: [PATCH] Changes the behaviour of system/batch/sysbatch jobs not to look for a latest stable version, as their versions never go to stable --- ui/app/models/job.js | 7 ++++++- .../components/job-page/parts/title.hbs | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ui/app/models/job.js b/ui/app/models/job.js index a6aa6f7e115..0f4f55ed3f1 100644 --- a/ui/app/models/job.js +++ b/ui/app/models/job.js @@ -455,12 +455,17 @@ export default class Job extends Model { .any((version) => version.get('stable')); } - @computed('versions.@each.stable') + @computed('versions.@each.stable', 'aggregateAllocStatus.label') get latestStableVersion() { return this.versions.filterBy('stable').sortBy('number').reverse().slice(1) .firstObject; } + @computed('versions.[]', 'aggregateAllocStatus.label') + get latestVersion() { + return this.versions.sortBy('number').reverse().slice(1).firstObject; + } + get actions() { return this.taskGroups.reduce((acc, taskGroup) => { return acc.concat( diff --git a/ui/app/templates/components/job-page/parts/title.hbs b/ui/app/templates/components/job-page/parts/title.hbs index 391af3af643..de40090cd5f 100644 --- a/ui/app/templates/components/job-page/parts/title.hbs +++ b/ui/app/templates/components/job-page/parts/title.hbs @@ -101,6 +101,25 @@ @awaitingConfirmation={{this.revertTo.isRunning}} @onConfirm={{perform this.revertTo this.job.latestStableVersion}} /> + {{else if + (and + (or (eq this.job.type "batch") (eq this.job.type "system") (eq this.job.type "sysbatch")) + this.job.latestVersion + ) + }} + + {{else}}