Sha256: 9245cbf972d6b7c6c3c1e825556ff46a216a929aa30e21b2375caf2a0814ff7f

Contents?: true

Size: 1.97 KB

Versions: 4

Compression:

Stored size: 1.97 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.syncPlans.controller:SyncPlansController
 *
 * @requires $scope
 * @requires $location
 * @requires translate
 * @requires Nutupane
 * @requires SyncPlan
 * @requires CurrentOrganization
 *
 * @description
 *   Provides the functionality specific to Sync Plans for use with the Nutupane UI pattern.
 *   Defines the columns to display and the transform function for how to generate each row
 *   within the table.
 */
angular.module('Bastion.sync-plans').controller('SyncPlansController',
    ['$scope', '$location', 'translate', 'Nutupane', 'SyncPlan', 'CurrentOrganization', 'GlobalNotification',
        function ($scope, $location, translate, Nutupane, SyncPlan, CurrentOrganization, GlobalNotification) {
            var params, nutupane;

            params = {
                'organization_id': CurrentOrganization,
                'search': $location.search().search || "",
                'sort_by': 'name',
                'sort_order': 'ASC'
            };

            nutupane = new Nutupane(SyncPlan, params);
            $scope.syncPlanTable = nutupane.table;
            $scope.removeRow = nutupane.removeRow;
            $scope.nutupane = nutupane;
            $scope.controllerName = 'katello_sync_plans';

            nutupane.enableSelectAllResults();

            if ($location.search()['select_all']) {
                nutupane.table.selectAllResults(true);
            }

            $scope.syncPlanTable.closeItem = function () {
                $scope.transitionTo('sync-plans.index');
            };

            $scope.table = $scope.syncPlanTable;

            $scope.removeSyncPlan = function (syncPlan) {
                syncPlan.$remove(function () {
                    GlobalNotification.setSuccessMessage(translate('Sync Plan %s has been deleted.').replace('%s', syncPlan.name));
                    $scope.removeRow(syncPlan.id);
                    $scope.transitionTo('sync-plans.index');
                });
            };
        }]
);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-3.0.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js
katello-3.0.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js
katello-3.0.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js
katello-3.0.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js