# HG changeset patch # User Andrew Azores # Date 1505858215 14400 # Node ID de738e948f0a3ae1521d8b003fa2b9540bfd67e8 # Parent d37a36efafa323d76a0558fb024e7b9f74615ae3 Add vertical navigation drawer Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/025113.html diff -r d37a36efafa3 -r de738e948f0a src/app/app.controller.js --- a/src/app/app.controller.js Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/app.controller.js Tue Sep 19 17:56:55 2017 -0400 @@ -28,10 +28,11 @@ import authModule from 'components/auth/auth.module.js'; class AppController { - constructor ($scope, environment, authService) { + constructor ($scope, environment, authService, $translate) { 'ngInject'; this.env = environment; this._authService = authService; + this._translate = $translate; $scope.$on('userLoginChanged', () => this._updateUsernameLabel()); } @@ -43,6 +44,24 @@ } this._updateUsernameLabel(); + + this._translate([ + 'navbar.states.JVM_LISTING', + 'navbar.states.MULTICHARTS' + ]).then(translations => { + this.navigationItems = [ + { + title: translations['navbar.states.JVM_LISTING'], + iconClass: 'fa pficon-domain', + uiSref: 'jvmList' + }, + { + title: translations['navbar.states.MULTICHARTS'], + iconClass: 'fa pficon-trend-up', + uiSref: 'multichart' + } + ]; + }); } get loginStatus () { diff -r d37a36efafa3 -r de738e948f0a src/app/app.controller.spec.js --- a/src/app/app.controller.spec.js Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/app.controller.spec.js Tue Sep 19 17:56:55 2017 -0400 @@ -45,7 +45,7 @@ ['testing', 'development', 'production'].forEach(env => { describe(env, () => { - let ctrl, scope, authService; + let ctrl, scope, authService, translate; beforeEach(inject($controller => { 'ngInject'; @@ -55,11 +55,20 @@ login: sinon.spy(), logout: sinon.spy() }; + translate = sinon.stub().returns({ + then: sinon.stub().yields( + { + 'navbar.states.JVM_LISTING': 'JVM Listing', + 'navbar.states.MULTICHARTS': 'Multicharts' + } + ) + }); ctrl = $controller('AppController', { environment: env, $scope: scope, - authService: authService + authService: authService, + $translate: translate }); ctrl.$onInit(); })); @@ -72,7 +81,7 @@ }); describe('logout()', () => { - let ctrl, scope, authService; + let ctrl, scope, authService, translate; beforeEach(inject($controller => { 'ngInject'; @@ -82,11 +91,20 @@ login: sinon.spy(), logout: sinon.spy() }; + translate = sinon.stub().returns({ + then: sinon.stub().yields( + { + 'navbar.states.JVM_LISTING': 'JVM Listing', + 'navbar.states.MULTICHARTS': 'Multicharts' + } + ) + }); ctrl = $controller('AppController', { environment: 'testing', $scope: scope, - authService: authService + authService: authService, + $translate: translate }); ctrl.$onInit(); })); @@ -99,7 +117,7 @@ }); describe('username', () => { - let rootScope, scope, ctrl, authService; + let rootScope, scope, ctrl, authService, translate; beforeEach(inject(($controller, $rootScope) => { 'ngInject'; @@ -111,11 +129,20 @@ logout: sinon.spy(), username: 'fake-username' }; + translate = sinon.stub().returns({ + then: sinon.stub().yields( + { + 'navbar.states.JVM_LISTING': 'JVM Listing', + 'navbar.states.MULTICHARTS': 'Multicharts' + } + ) + }); ctrl = $controller('AppController', { $scope: scope, environment: 'testing', - authService: authService + authService: authService, + $translate: translate }); ctrl.$onInit(); })); diff -r d37a36efafa3 -r de738e948f0a src/app/app.module.js --- a/src/app/app.module.js Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/app.module.js Tue Sep 19 17:56:55 2017 -0400 @@ -48,6 +48,8 @@ .module('appModule', [ 'ui.router', 'ui.bootstrap', + 'patternfly', + 'patternfly.navigation', angularTranslate, authModule, // non-core modules diff -r d37a36efafa3 -r de738e948f0a src/app/components/landing/landing.html --- a/src/app/components/landing/landing.html Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/components/landing/landing.html Tue Sep 19 17:56:55 2017 -0400 @@ -10,30 +10,3 @@

landing.APP_TITLE

- -
-
-
-
- -
-
landing.NAVIGATION
-
- - - -
-
-
-
diff -r d37a36efafa3 -r de738e948f0a src/app/en.locale.yaml --- a/src/app/en.locale.yaml Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/en.locale.yaml Tue Sep 19 17:56:55 2017 -0400 @@ -12,3 +12,7 @@ LOGOUT: Log Out USER_PREFS: Preferences + + states: + JVM_LISTING: JVM Listing + MULTICHARTS: Multicharts diff -r d37a36efafa3 -r de738e948f0a src/app/index.html --- a/src/app/index.html Mon Sep 18 16:54:31 2017 -0400 +++ b/src/app/index.html Tue Sep 19 17:56:55 2017 -0400 @@ -1,6 +1,6 @@ - + Thermostat @@ -8,49 +8,105 @@ - - -
- + +
+
+
+
+
+
+ +
- - - - - +
+
+ + + +
+ +
+ +
+
+
+
+
+
+
+
+
+ - - +