Sha256: 7c93846a903462c7de8103dacb933f99c913895d13259a4e4b12d205c4dfd040

Contents?: true

Size: 1.74 KB

Versions: 145

Compression:

Stored size: 1.74 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-credentials.controller:ContentCredentialDetailsController
 *
 * @requires $scope
 * @requires ContentCredential
 * @requires $q
 * @requires translate
 * @requires ApiErrorHandler
 * @requires Notification
 *
 * @description
 *   Provides the functionality for the contentCredential details action pane.
 */
angular.module('Bastion.content-credentials').controller('ContentCredentialDetailsController',
    ['$scope', 'ContentCredential', '$q', 'translate', 'ApiErrorHandler', 'Notification', function ($scope, ContentCredential, $q, translate, ApiErrorHandler, Notification) {
        $scope.panel = $scope.panel || {error: false, loading: false};

        $scope.contentCredential = ContentCredential.get({id: $scope.$stateParams.contentCredentialId}, function () {
            $scope.panel.error = false;
            $scope.panel.loading = false;
        }, function (response) {
            $scope.panel.loading = false;
            ApiErrorHandler.handleGETRequestErrors(response, $scope);
        });

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

            contentCredential.$update(function (response) {
                deferred.resolve(response);
                Notification.setSuccessMessage(translate('Content credential updated'));

            }, function (response) {
                deferred.reject(response);
                Notification.setErrorMessage(response.data.displayMessage);
            });

            return deferred.promise;
        };

        $scope.removeContentCredential = function (contentCredential) {
            contentCredential.$delete(function () {
                $scope.transitionTo('content-credentials');
            });
        };
    }]
);

Version data entries

145 entries across 145 versions & 1 rubygems

Version Path
katello-4.6.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.6.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.6.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.5.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.6.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.6.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.6.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.5.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.5.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.5.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
katello-4.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js