Sha256: 72099a0d5a4985c996253f4f3fbd69cb41d338905e667407e658ec0610482ec4

Contents?: true

Size: 1.28 KB

Versions: 71

Compression:

Stored size: 1.28 KB

Contents

/**
 *@ngdoc service
 *@name Bastion.organizations.service:FencedPages
 *
 *@descriptions
 * Service that keeps track of pages that require an organization to be selected
 */

angular.module('Bastion.organizations').service('FencedPages', ['$state',
    function ($state) {
        var fencedPages = [
            'activation-keys',
            'content-hosts',
            'content-views',
            'docker-tags',
            'errata',
            'content-credentials',
            'host-collections',
            'lifecycle-environments',
            'packages',
            'products',
            'puppet-modules',
            'subscriptions',
            'sync-plans'
        ];

        function getRootPath(path) {
            var rootPath = null;

            if (path && angular.isString(path)) {
                rootPath = path.replace('_', '-').split('/')[1];
            }
            return rootPath;
        }

        this.addPages = function (pages) {
            fencedPages = _.uniq(fencedPages.concat(pages));
        };

        this.list = function () {
            return fencedPages;
        };

        this.isFenced = function (toState) {
            var stateUrl = $state.href(toState);
            return fencedPages.indexOf(getRootPath(stateUrl)) !== -1;
        };
    }
]);

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
katello-3.16.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.17.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc5.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc5 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.15.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.15.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.15.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.15.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.16.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js
katello-3.15.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js