Sha256: 76674bfc81680c8fe0bbfb1d026ff0634f257e5cdf4d3b08803687644e82c86b

Contents?: true

Size: 1.19 KB

Versions: 149

Compression:

Stored size: 1.19 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-views.controller:FilterEditController
 *
 * @requires $scope
 * @requires $q
 * @requires translate
 * @requires Notification
 *
 * @description
 *   Provides functionality for editing name and description of content view filters.
 */
angular.module('Bastion.content-views').controller('FilterEditController',
    ['$scope', '$q', 'translate', 'Notification', function ($scope, $q, translate, Notification) {
    $scope.save = function (filter) {
        var deferred = $q.defer();
        var success;
        var failure = function (response) {
            deferred.reject(response);
            angular.forEach(response.data.errors, function (errorMessage) {
                Notification.setErrorMessage(translate("An error occurred saving the Filter: ") + errorMessage);
            });
            $scope.working = false;
        };

        success = function (response) {
            deferred.resolve(response);
            Notification.setSuccessMessage(translate('Filter Saved'));
            $scope.working = false;
            $scope.$emit('filter.updated');
        };

        filter.$update(success, failure);
        return deferred.promise;
    };
}]);

Version data entries

149 entries across 149 versions & 1 rubygems

Version Path
katello-4.4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.5.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.5.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.5.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.5.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js
katello-4.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js