diff --git a/engines/bastion_katello/README.md b/engines/bastion_katello/README.md index fa1f0027e16..e15519fb34d 100644 --- a/engines/bastion_katello/README.md +++ b/engines/bastion_katello/README.md @@ -7,7 +7,8 @@ The only real difference, as far as the user is concerned, is that the applicati # Running tests: ``` -sudo yum -y install npm chromium-headless chromium +sudo dnf -y install epel-release epel-next-release +sudo dnf -y install npm chromium-headless chromium cd ./engines/bastion_katello sudo npm install -g grunt-cli npm install 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 c2a43222935..72b22697abb 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 @@ -24,21 +24,6 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalController', ['$scope', '$http', '$location', '$window', '$timeout', '$uibModalInstance', 'HostBulkAction', 'HostCollection', 'Nutupane', 'CurrentOrganization', 'Erratum', 'Notification', 'BastionConfig', 'hostIds', 'newHostDetailsUI', function ($scope, $http, $location, $window, $timeout, $uibModalInstance, HostBulkAction, HostCollection, Nutupane, CurrentOrganization, Erratum, Notification, BastionConfig, hostIds, newHostDetailsUI) { - function installParams() { - var params = hostIds; - params['content_type'] = 'errata'; - params.content = _.map($scope.table.getSelected(), 'errata_id'); - - if ($scope.nutupane.table.allResultsSelected) { - params['install_all'] = true; - } else { - params['install_all'] = false; - } - - params['organization_id'] = CurrentOrganization; - return params; - } - function fetchErratum(errataId) { $scope.erratum = Erratum.get({id: errataId, 'organization_id': CurrentOrganization}); } @@ -55,8 +40,6 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalC $scope.table.initialLoad = false; $scope.initialLoad = true; $scope.remoteExecutionPresent = BastionConfig.remoteExecutionPresent; - $scope.remoteExecutionByDefault = BastionConfig.remoteExecutionByDefault; - $scope.katelloAgentPresent = BastionConfig.katelloAgentPresent; $scope.allHostsSelected = hostIds.allResultsSelected; $scope.hostToolingEnabled = BastionConfig.hostToolingEnabled; $scope.newHostDetailsUI = newHostDetailsUI; @@ -92,43 +75,19 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkErrataModalC }; $scope.installErrata = function () { - if ($scope.remoteExecutionByDefault) { - $scope.installErrataViaRemoteExecution(); - - } else { - $scope.installErrataViaKatelloAgent(false); - } - }; - - $scope.installErrataViaKatelloAgent = function () { - var params = installParams(); - HostBulkAction.installContent(params, - function (data) { - $scope.nutupane.invalidate(); - $scope.ok(); - $scope.transitionTo('content-hosts.bulk-task', {taskId: data.id}); - }, - function (response) { - angular.forEach(response.data.errors, function (error) { - Notification.setErrorMessage(error); - }); - }); + $scope.installErrataViaRemoteExecution(); }; $scope.selectedErrataIds = function () { - return $scope.nutupane.getAllSelectedResults('errata_id'); + return $scope.table.getSelected(); }; $scope.installErrataViaRemoteExecution = function(customize) { var errataIds = $scope.selectedErrataIds(); - $scope.errataActionFormValues.bulkErrataIds = angular.toJson(errataIds); $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/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js index 7bfc07d9da7..56b20ab39f9 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js @@ -34,7 +34,6 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkModuleStream $scope.moduleStreamsNutupane.primaryOnly = true; $scope.table = $scope.moduleStreamsNutupane.table; $scope.remoteExecutionPresent = BastionConfig.remoteExecutionPresent; - $scope.remoteExecutionByDefault = BastionConfig.remoteExecutionByDefault; $scope.moduleStreamActionFormValues = { authenticityToken: $window.AUTH_TOKEN.replace(/"/g, ''), diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js index b4d208bba6f..2f23b4fb385 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js @@ -21,32 +21,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkPackagesModa ['$scope', '$location', '$timeout', '$window', '$uibModalInstance', 'HostBulkAction', 'CurrentOrganization', 'translate', 'Notification', 'BastionConfig', 'hostIds', function ($scope, $location, $timeout, $window, $uibModalInstance, HostBulkAction, CurrentOrganization, translate, Notification, BastionConfig, hostIds) { - function successMessage(type) { - var messages = { - install: translate("Successfully scheduled package installation"), - update: translate("Successfully scheduled package update"), - remove: translate("Successfully scheduled package removal"), - "update all": translate("Successfully scheduled an update of all packages") - }; - return messages[type]; - } - - function installParams() { - var params = hostIds; - params['content_type'] = $scope.content.contentType; - if ($scope.content.action === "update all") { - params['update_all'] = true; - params.content = null; - } else { - params.content = $scope.content.content.split(/ *, */); - } - params['organization_id'] = CurrentOrganization; - return params; - } - $scope.remoteExecutionPresent = BastionConfig.remoteExecutionPresent; - $scope.remoteExecutionByDefault = BastionConfig.remoteExecutionByDefault; - $scope.katelloAgentPresent = BastionConfig.katelloAgentPresent; $scope.hostToolingEnabled = BastionConfig.hostToolingEnabled; $scope.packageActionFormValues = { @@ -74,46 +49,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkPackagesModa }; $scope.performContentAction = function () { - if ($scope.remoteExecutionByDefault) { - $scope.performViaRemoteExecution(); - } else { - $scope.performViaKatelloAgent(); - } - }; - - $scope.performViaKatelloAgent = function (action, actionInput) { - var success, error, params; - - if (action) { - $scope.content.action = action; - } - - if (actionInput) { - $scope.content.actionInput = actionInput; - } - - $scope.content.confirm = false; - - success = function () { - Notification.setSuccessMessage(successMessage($scope.content.action)); - }; - - error = function (response) { - angular.forEach(response.data.errors, function (responseError) { - Notification.setErrorMessage(responseError); - }); - }; - - params = installParams(); - if ($scope.content.action === "install") { - HostBulkAction.installContent(params, success, error); - } else if ($scope.content.action === "update") { - HostBulkAction.updateContent(params, success, error); - } else if ($scope.content.action === "remove") { - HostBulkAction.removeContent(params, success, error); - } else if ($scope.content.action === "update all") { - HostBulkAction.updateContent(params, success, error); - } + $scope.performViaRemoteExecution(); }; $scope.performViaRemoteExecution = function(action, customize) { diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html index d69f7d846e2..2649837455b 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html @@ -27,11 +27,10 @@
- Performing host package actions is disabled because Katello is not configured for Remote Execution or Katello Agent. + Performing host package actions is disabled because Katello is not configured for Remote Execution.
- Performing host package actions is disabled because Katello is not configured for Remote Execution or Katello Agent. + Performing host package actions is disabled because Katello is not configured for Remote Execution.
@@ -38,7 +37,6 @@