Sha256: 88d8302d27da4912bba6fe552288ee6d5e35b9f08d220665e3848c23f47d1510
Contents?: true
Size: 1.27 KB
Versions: 20
Compression:
Stored size: 1.27 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', 'gpg-keys', '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
20 entries across 20 versions & 1 rubygems