Sha256: 92d733baf393e4e42dde6a9f0f6e9849762e440f78175abeac4c860dea34f4e1

Contents?: true

Size: 1.21 KB

Versions: 75

Compression:

Stored size: 1.21 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-views.controller:FilterDetailsController
 *
 * @requires $scope
 * @requires $q
 * @requires translate
 * @requires Notification
 * @requires Filter
 *
 * @description
 *   Handles fetching a filter.
 */
angular.module('Bastion.content-views').controller('FilterDetailsController',
    ['$scope', '$q', 'translate', 'Notification', 'Filter', function ($scope, $q, translate, Notification, Filter) {
        $scope.filter = Filter.get({'content_view_id': $scope.$stateParams.contentViewId, filterId: $scope.$stateParams.filterId});

        $scope.updateFilter = function (filter) {
            var deferred = $q.defer();

            filter.$update(function (response) {
                deferred.resolve(response);
                Notification.setSuccessMessage(translate('Filter Updated - ' + $scope.filter.name));
            }, function (response) {
                deferred.reject(response);
                angular.forEach(response.data.errors, function (errorMessage) {
                    Notification.setErrorMessage(translate("An error occurred saving the Filter: ") + errorMessage);
                });
            });

            return deferred.promise;
        };
    }]
);

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
katello-4.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.0.1.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.0.1.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.2.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js