Przeglądaj źródła

[jb] Allow rerun of multiple selected tasks in the schedules page

Johan Åhlén 2 lat temu
rodzic
commit
8b41801713

+ 6 - 3
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -3671,9 +3671,12 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
         return self.isCoordinator();
         return self.isCoordinator();
       });
       });
       self.rerunEnabled = ko.pureComputed(function() {
       self.rerunEnabled = ko.pureComputed(function() {
-        return self.hasRerun() && self.selectedJobs().length == 1 && $.grep(self.selectedJobs(), function(job) {
-          return job.rerunEnabled();
-        }).length == self.selectedJobs().length;
+          var validSelectionCount =
+                  self.selectedJobs().length === 1 ||
+                  (self.selectedJobs().length > 1 && vm.interface() === 'schedules');
+          return self.hasRerun() && validSelectionCount && $.grep(self.selectedJobs(), function (job) {
+              return job.rerunEnabled();
+          }).length === self.selectedJobs().length;
       });
       });
 
 
       self.hasPause = ko.pureComputed(function() {
       self.hasPause = ko.pureComputed(function() {