Sha256: af3f28a78a6648515dbfb8ec27b20f4e1b065b0daa91667c556105dc06e34623

Contents?: true

Size: 1.56 KB

Versions: 18

Compression:

Stored size: 1.56 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.gpg-keys.controller:GPGKeyDetailsController
 *
 * @requires $scope
 * @requires GPGKey
 * @requires $q
 * @requires translate
 * @requires ApiErrorHandler
 *
 * @description
 *   Provides the functionality for the gpgKey details action pane.
 */
angular.module('Bastion.gpg-keys').controller('GPGKeyDetailsController',
    ['$scope', 'GPGKey', '$q', 'translate', 'ApiErrorHandler', function ($scope, GPGKey, $q, translate, ApiErrorHandler) {
        $scope.errorMessages = [];
        $scope.successMessages = [];

        $scope.panel = $scope.panel || {error: false, loading: false};

        $scope.gpgKey = GPGKey.get({id: $scope.$stateParams.gpgKeyId}, function () {
            $scope.panel.error = false;
            $scope.panel.loading = false;
        }, function (response) {
            $scope.panel.loading = false;
            ApiErrorHandler.handleGETRequestErrors(response, $scope);
        });

        $scope.save = function (gpgKey) {
            var deferred = $q.defer();

            gpgKey.$update(function (response) {
                deferred.resolve(response);
                $scope.successMessages.push(translate('GPG Key updated'));

            }, function (response) {
                deferred.reject(response);
                $scope.errorMessages = [response.data.displayMessage];
            });

            return deferred.promise;
        };

        $scope.removeGPGKey = function (gpgKey) {
            gpgKey.$delete(function () {
                $scope.transitionTo('gpg-keys');
            });
        };
    }]
);

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
katello-3.5.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js