diff --git a/ui-v2/app/components/app-view/index.hbs b/ui-v2/app/components/app-view/index.hbs index cdc4c49b4..e7e1a542d 100644 --- a/ui-v2/app/components/app-view/index.hbs +++ b/ui-v2/app/components/app-view/index.hbs @@ -1,90 +1,90 @@ -{{yield}} -
-{{#each flashMessages.queue as |flash|}} - - {{#if flash.dom}} - {{{flash.dom}}} - {{else}} - {{#let (lowercase component.flashType) (lowercase flash.action) as |status type|}} - {{! flashes automatically ucfirst the type }} - - - {{/let}} - {{/if}} - -{{/each}} -
-
- {{#if authorized}} - - {{/if}} -
- - {{yield}} - -
- {{#if authorized}} - - - {{yield}} - - {{/if}} -
-
- - {{yield}} - -
-
- {{#if authorized}} - - - {{yield}} - - {{/if}} -
-
- {{#if (not enabled) }} - {{yield}} - {{else if (not authorized)}} - {{yield}} +
+ {{yield}} +
+ {{#each flashMessages.queue as |flash|}} + + {{#if flash.dom}} + {{{flash.dom}}} {{else}} - {{yield}} + {{#let (lowercase component.flashType) (lowercase flash.action) as |status type|}} + {{! flashes automatically ucfirst the type }} + + + {{/let}} {{/if}} + + {{/each}} +
+
+ {{#if authorized}} + + {{/if}} +
+ + {{yield}} + +
+ {{#if authorized}} + + + {{yield}} + + {{/if}} +
+
+ + {{yield}} + +
+
+ {{#if authorized}} + + + {{yield}} + + {{/if}} +
+
+ {{#if (not enabled) }} + {{yield}} + {{else}} + {{yield}} + {{/if}} +
diff --git a/ui-v2/app/components/app-view/index.js b/ui-v2/app/components/app-view/index.js index 7fce237ea..ee99672aa 100644 --- a/ui-v2/app/components/app-view/index.js +++ b/ui-v2/app/components/app-view/index.js @@ -1,46 +1,7 @@ import Component from '@ember/component'; import SlotsMixin from 'block-slots'; -import { inject as service } from '@ember/service'; -import templatize from 'consul-ui/utils/templatize'; export default Component.extend(SlotsMixin, { + tagName: '', authorized: true, enabled: true, - classNames: ['app-view'], - classNameBindings: ['enabled::disabled', 'authorized::unauthorized'], - dom: service('dom'), - didReceiveAttrs: function() { - this._super(...arguments); - // right now only manually added classes are hoisted to - const $root = this.dom.root(); - if (this.loading) { - $root.classList.add('loading'); - } else { - $root.classList.remove('loading'); - } - let cls = this['class'] || ''; - if (cls) { - // its possible for 'layout' templates to change after insert - // check for these specific layouts and clear them out - const receivedClasses = new Set(templatize(cls.split(' '))); - const difference = new Set([...$root.classList].filter(item => !receivedClasses.has(item))); - [...difference].forEach(function(item, i) { - if (templatize(['edit', 'show', 'list']).indexOf(item) !== -1) { - $root.classList.remove(item); - } - }); - $root.classList.add(...receivedClasses); - } - }, - didInsertElement: function() { - this._super(...arguments); - this.didReceiveAttrs(); - }, - didDestroyElement: function() { - this._super(...arguments); - const cls = this['class'] + ' loading'; - if (cls) { - const $root = this.dom.root(); - $root.classList.remove(...templatize(cls.split(' '))); - } - }, }); diff --git a/ui-v2/app/components/empty-state/index.hbs b/ui-v2/app/components/empty-state/index.hbs index c4c255826..e90dbdeb9 100644 --- a/ui-v2/app/components/empty-state/index.hbs +++ b/ui-v2/app/components/empty-state/index.hbs @@ -14,7 +14,7 @@
{{yield}} {{#if (and (env 'CONSUL_ACLS_ENABLED') allowLogin)}} -