Sha256: e1c4544dfd9aa954d67b420162bcf1f046fec133174a9c3bc972b272c65d0394

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-views.controller:ContentViewDeletionController
 *
 * @requires $scope
 * @requires ContentView
 * @requires GlobalNotification
 *
 * @description
 *   Provides the functionality for deleting Content Views
 */
angular.module('Bastion.content-views').controller('ContentViewDeletionController',
    ['$scope', 'ContentView', 'GlobalNotification', function ($scope, ContentView, GlobalNotification) {

        function success() {
            $scope.transitionTo('content-views');
            $scope.working = false;
        }

        function failure(response) {
            GlobalNotification.setErrorMessage(response.data.displayMessage);
            $scope.working = false;
        }

        $scope.delete = function () {
            $scope.working = true;
            ContentView.remove({id: $scope.contentView.id}, success, failure);
        };

        $scope.environmentNames = function (version) {
            return _.map($scope.readableEnvironments(version), 'name');
        };

        $scope.readableEnvironments = function (version) {
            return _.reject(version.environments, function (env) {
                return !env.permissions.readable;
            });
        };

        $scope.conflictingVersions = ContentView.conflictingVersions({id: $scope.$stateParams.contentViewId});
    }]
);

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
katello-3.5.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js
katello-3.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js