From 506c5282e72d1c4dcbd5a579d189641b0ec84f4b Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 7 Sep 2023 01:11:08 +0000 Subject: [PATCH] Fixes #36713 - Fix errata workflow in host collections --- .../bulk/content-hosts-bulk-errata-modal.controller.js | 6 +++++- .../bulk/content-hosts-bulk-errata-modal.controller.test.js | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js index 72b22697abb..f74b7f0637c 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js @@ -79,7 +79,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalC }; $scope.selectedErrataIds = function () { - return $scope.table.getSelected(); + return $scope.nutupane.getAllSelectedResults('errata_id'); }; $scope.installErrataViaRemoteExecution = function(customize) { @@ -88,6 +88,10 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalC $scope.errataActionFormValues.remoteAction = 'errata_install'; $scope.errataActionFormValues.bulkErrataIds = angular.toJson(errataIds); $scope.errataActionFormValues.customize = customize; + + $timeout(function () { + angular.element('#errataActionForm').submit(); + }, 0); }; $scope.ok = function () { diff --git a/engines/bastion_katello/test/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.test.js b/engines/bastion_katello/test/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.test.js index 64411b080c3..82b0db27752 100644 --- a/engines/bastion_katello/test/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.test.js +++ b/engines/bastion_katello/test/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.test.js @@ -16,6 +16,9 @@ describe('Controller: ContentHostsBulkErrataModalController', function() { }; this.enableSelectAllResults = function () {}; + this.getAllSelectedResults = function() { + return [1, 2, 3, 4] + }; this.setParams = function () {} }; @@ -51,6 +54,7 @@ describe('Controller: ContentHostsBulkErrataModalController', function() { })); it("can install errata on multiple content hosts", function () { + $scope.remoteExecutionPresent = true; $scope.installErrata(); expect($scope.errataActionFormValues.remoteAction).toEqual('errata_install');