open-vault/ui/app/components/nav-header.js
Jordan Reimer 52fe56ec87
Eslint prefer-const (#17864)
* adds prefer-const to eslint config and runs fixer

* reverts unintended change
2022-11-09 15:15:31 -08:00

30 lines
850 B
JavaScript

import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
export default Component.extend({
router: service(),
currentCluster: service(),
'data-test-navheader': true,
attributeBindings: ['data-test-navheader'],
classNameBindings: 'consoleFullscreen:panel-fullscreen',
tagName: 'header',
navDrawerOpen: false,
consoleFullscreen: false,
hideLinks: computed('router.currentRouteName', function () {
const currentRoute = this.router.currentRouteName;
if ('vault.cluster.oidc-provider' === currentRoute) {
return true;
}
return false;
}),
actions: {
toggleNavDrawer(isOpen) {
if (isOpen !== undefined) {
return this.set('navDrawerOpen', isOpen);
}
this.toggleProperty('navDrawerOpen');
},
},
});