Sha256: 33051c3295495ee942e5e42971805934eabec633ae3e3d116ab06f3d37e4fe2a

Contents?: true

Size: 1.68 KB

Versions: 9

Compression:

Stored size: 1.68 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'));
                $scope.table.replaceRow(response);

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

            return deferred.promise;
        };

        $scope.removeGPGKey = function (gpgKey) {
            var id = gpgKey.id;

            gpgKey.$delete(function () {
                $scope.removeRow(id);
                $scope.transitionTo('gpgKeys.index');
            });
        };
    }]
);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-3.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc7 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc5 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-3.0.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js