2020-01-21 17:52:40 +00:00
|
|
|
import { env } from 'consul-ui/env';
|
2019-12-17 18:47:37 +00:00
|
|
|
export function initialize(container) {
|
2020-01-21 17:52:40 +00:00
|
|
|
if (env('CONSUL_NSPACES_ENABLED')) {
|
2019-12-17 18:47:37 +00:00
|
|
|
['dc', 'settings', 'dc.intentions.edit', 'dc.intentions.create'].forEach(function(item) {
|
|
|
|
container.inject(`route:${item}`, 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
container.inject(`route:nspace.${item}`, 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
});
|
|
|
|
container.inject('route:application', 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
container
|
|
|
|
.lookup('service:dom')
|
|
|
|
.root()
|
|
|
|
.classList.add('has-nspaces');
|
|
|
|
}
|
2019-12-18 18:27:54 +00:00
|
|
|
// TODO: This needs to live in its own initializer, either:
|
2019-12-17 18:47:37 +00:00
|
|
|
// 1. Make it be about adding classes to the root dom node
|
|
|
|
// 2. Make it be about config and things to do on initialization re: config
|
|
|
|
// If we go with 1 then we need to move both this and the above nspaces class
|
2020-01-21 17:52:40 +00:00
|
|
|
if (env('CONSUL_ACLS_ENABLED')) {
|
2019-12-17 18:47:37 +00:00
|
|
|
container
|
|
|
|
.lookup('service:dom')
|
|
|
|
.root()
|
|
|
|
.classList.add('has-acls');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
initialize,
|
|
|
|
};
|