Sha256: ce373d990dbd3e40d918bea254736b93a4c58d3df54cbbbfe1c1212524010037

Contents?: true

Size: 1.42 KB

Versions: 9

Compression:

Stored size: 1.42 KB

Contents

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

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

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

        $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-2.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js
katello-2.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js