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.1.0.rc2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.1.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.0.rc3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.17.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.17.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-4.0.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js
katello-3.18.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js