changeset 220:b686b8d24638

Remove landing state, make jvm-list default Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/025129.html
author Andrew Azores <aazores@redhat.com>
date Thu, 21 Sep 2017 16:26:15 -0400
parents baa2100c95bb
children 362ef36b1cef
files integration-test/specs/launch.spec.js src/app/app.routing.js src/app/app.routing.spec.js src/app/components/about/about.html src/app/components/auth/login/login.controller.js src/app/components/auth/login/login.controller.spec.js src/app/components/auth/login/login.routing.js src/app/components/auth/login/login.routing.spec.js src/app/components/jvm-info/jvm-info.html src/app/components/jvm-list/en.locale.yaml src/app/components/jvm-list/jvm-list.html src/app/components/landing/en.locale.yaml src/app/components/landing/landing.component.js src/app/components/landing/landing.html src/app/components/landing/landing.routing.js src/app/components/landing/landing.routing.spec.js src/app/components/multichart/multichart.html src/app/components/system-info/system-info.html src/app/index.html src/app/shared/templates/404.html src/app/shared/templates/en.locale.yaml
diffstat 21 files changed, 24 insertions(+), 204 deletions(-) [+]
line wrap: on
line diff
--- a/integration-test/specs/launch.spec.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/integration-test/specs/launch.spec.js	Thu Sep 21 16:26:15 2017 -0400
@@ -33,8 +33,8 @@
     browser.getTitle().should.eventually.equal('Thermostat');
   });
 
-  it('should navigate to landing state', () => {
-    browser.getCurrentUrl().should.eventually.containEql('landing');
+  it('should navigate to default state', () => {
+    browser.getCurrentUrl().should.eventually.containEql('jvm-list');
   });
 
 });
--- a/src/app/app.routing.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/app.routing.js	Thu Sep 21 16:26:15 2017 -0400
@@ -54,9 +54,16 @@
 
 let appRouter = angular.module('app.routing', componentRoutingModules);
 
+function defaultState ($stateProvider) {
+  'ngInject';
+  $stateProvider.state('default', {
+    redirectTo: 'jvmList'
+  });
+}
+appRouter.config(defaultState);
 function transitionHook ($q, $transitions, $state, authService) {
   'ngInject';
-  $transitions.onBefore({ to: '/' }, () => $state.target('landing'));
+  $transitions.onBefore({ to: '/' }, () => $state.target('jvmList'));
 
   $transitions.onEnter({}, () => { authService.refresh() });
 
--- a/src/app/app.routing.spec.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/app.routing.spec.js	Thu Sep 21 16:26:15 2017 -0400
@@ -127,7 +127,7 @@
         transitions.onBefore.args[0][0].to.should.equal('/');
       });
 
-      it('should redirect to landing', () => {
+      it('should redirect to jvm-list', () => {
         state.target.should.not.be.called();
         transitions.onBefore.args[0][1].should.be.a.Function();
         let res = transitions.onBefore.args[0][1]();
--- a/src/app/components/about/about.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/about/about.html	Thu Sep 21 16:26:15 2017 -0400
@@ -5,7 +5,7 @@
         <img src="~images/landing-image.png"/>
       </div>
       <div class="col-md-9">
-        <h1><a ui-sref="landing">Thermostat</a></h1>
+        <h1><a style="cursor: pointer; cursor: hand" ui-sref="default">Thermostat</a></h1>
         <h2 translate>about.ABOUT</h2>
         <p translate>about.OVERVIEW</p>
         <h2 translate>about.VERSION</h2>
--- a/src/app/components/auth/login/login.controller.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/auth/login/login.controller.js	Thu Sep 21 16:26:15 2017 -0400
@@ -34,7 +34,7 @@
     this._authService = authService;
 
     if (authService.status()) {
-      $state.go('landing');
+      $state.go('jvmList');
       return;
     }
 
@@ -46,7 +46,7 @@
 
   login () {
     this._authService.rememberUser(this.rememberUser);
-    this._authService.login(this.username, this.password, () => this._state.go('landing'));
+    this._authService.login(this.username, this.password, () => this._state.go('jvmList'));
   }
 }
 
--- a/src/app/components/auth/login/login.controller.spec.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/auth/login/login.controller.spec.js	Thu Sep 21 16:26:15 2017 -0400
@@ -77,9 +77,9 @@
       });
     }));
 
-    it('should redirect to landing if already logged in', () => {
+    it('should redirect to jvm-list if already logged in', () => {
       authService.status.should.be.calledOnce();
-      state.go.should.be.calledWith('landing');
+      state.go.should.be.calledWith('jvmList');
     });
   });
 
--- a/src/app/components/auth/login/login.routing.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/auth/login/login.routing.js	Thu Sep 21 16:26:15 2017 -0400
@@ -27,7 +27,7 @@
 
 function config ($urlRouterProvider, $stateProvider) {
   'ngInject';
-  $urlRouterProvider.when('', '/landing');
+  $urlRouterProvider.when('', '/jvm-list');
 
   $stateProvider.state('login', {
     url: '/login',
--- a/src/app/components/auth/login/login.routing.spec.js	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/auth/login/login.routing.spec.js	Thu Sep 21 16:26:15 2017 -0400
@@ -39,8 +39,8 @@
   });
 
   describe('urlRouterProvider', () => {
-    it('should redirect blank path to landing', () => {
-      urlRouterProvider.when.should.be.calledWith('', '/landing');
+    it('should redirect blank path to jvm-list', () => {
+      urlRouterProvider.when.should.be.calledWith('', '/jvm-list');
     });
   });
 
--- a/src/app/components/jvm-info/jvm-info.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/jvm-info/jvm-info.html	Thu Sep 21 16:26:15 2017 -0400
@@ -1,6 +1,5 @@
 <div class="container-fluid container-cards-pf">
   <ol class="breadcrumb" style="margin-bottom: 0px;">
-    <li><a ui-sref="landing">Thermostat</a></li>
     <li><a ui-sref="jvmList({ '#': $ctrl.systemId })" translate>jvmInfo.JVM_LIST_BREADCRUMB</a></li>
     <li><a ui-sref="systemInfo({ systemId: $ctrl.systemId })">{{$ctrl.systemHostname}}</a></li>
     <li><a ui-sref="jvmInfo({ systemId: $ctrl.systemId, jvmId: $ctrl.jvmId })">{{$ctrl.jvmInfo.mainClass | extractClass}}</a></li>
--- a/src/app/components/jvm-list/en.locale.yaml	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/jvm-list/en.locale.yaml	Thu Sep 21 16:26:15 2017 -0400
@@ -1,5 +1,5 @@
 jvmList:
-  BREADCRUMB: '@:landing.nav.JVM_LISTING'
+  BREADCRUMB: JVM Listing
   ALIVE_ONLY: Alive JVMs Only
   SYSTEM_INFO_LABEL: System Information
   START_TIME_LIST: Start Time:&#160;{{date}}
--- a/src/app/components/jvm-list/jvm-list.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/jvm-list/jvm-list.html	Thu Sep 21 16:26:15 2017 -0400
@@ -1,6 +1,5 @@
 <div class="container-fluid container-cards-pf">
   <ol class="breadcrumb" style="margin-bottom: 0px;">
-    <li><a ui-sref="landing">Thermostat</a></li>
     <li><a ui-sref="jvmList" translate>jvmList.BREADCRUMB</a></li>
   </ol>
   <div class="jvmList-container">
--- a/src/app/components/landing/en.locale.yaml	Wed Sep 20 13:29:27 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-landing:
-  WELCOME: Welcome
-  APP_TITLE: Thermostat.next() Web Client
-  NAVIGATION: Navigation
-  nav:
-    JVM_LISTING: JVM Listing
-    MULTICHARTS: Multicharts
--- a/src/app/components/landing/landing.component.js	Wed Sep 20 13:29:27 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/**
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * Thermostat is distributed under the GNU General Public License,
- * version 2 or any later version (with a special exception described
- * below, commonly known as the "Classpath Exception").
- *
- * A copy of GNU General Public License (GPL) is included in this
- * distribution, in the file COPYING.
- *
- * Linking Thermostat code with other modules is making a combined work
- * based on Thermostat.  Thus, the terms and conditions of the GPL
- * cover the whole combination.
- *
- * As a special exception, the copyright holders of Thermostat give you
- * permission to link this code with independent modules to produce an
- * executable, regardless of the license terms of these independent
- * modules, and to copy and distribute the resulting executable under
- * terms of your choice, provided that you also meet, for each linked
- * independent module, the terms and conditions of the license of that
- * module.  An independent module is a module which is not derived from
- * or based on Thermostat code.  If you modify Thermostat, you may
- * extend this exception to your version of the software, but you are
- * not obligated to do so.  If you do not wish to do so, delete this
- * exception statement from your version.
- */
-
-export default angular
-  .module('landingComponent', [])
-  .component('landing', {
-    template: require('./landing.html')
-  })
-  .name;
--- a/src/app/components/landing/landing.html	Wed Sep 20 13:29:27 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<div class="container-fluid container-cards-pf">
-  <ol class="breadcrumb" style="margin-bottom: 0px;">
-    <li><a ui-sref="landing">Thermostat</a></li>
-  </ol>
-
-  <div class="blank-slate-pf" style="">
-    <img src="~images/landing-image.png" alt="Landing Image"/>
-
-    <h1 translate>landing.WELCOME</h1>
-    <h3 translate>landing.APP_TITLE</h3>
-  </div>
-</div>
--- a/src/app/components/landing/landing.routing.js	Wed Sep 20 13:29:27 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/**
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * Thermostat is distributed under the GNU General Public License,
- * version 2 or any later version (with a special exception described
- * below, commonly known as the "Classpath Exception").
- *
- * A copy of GNU General Public License (GPL) is included in this
- * distribution, in the file COPYING.
- *
- * Linking Thermostat code with other modules is making a combined work
- * based on Thermostat.  Thus, the terms and conditions of the GPL
- * cover the whole combination.
- *
- * As a special exception, the copyright holders of Thermostat give you
- * permission to link this code with independent modules to produce an
- * executable, regardless of the license terms of these independent
- * modules, and to copy and distribute the resulting executable under
- * terms of your choice, provided that you also meet, for each linked
- * independent module, the terms and conditions of the license of that
- * module.  An independent module is a module which is not derived from
- * or based on Thermostat code.  If you modify Thermostat, you may
- * extend this exception to your version of the software, but you are
- * not obligated to do so.  If you do not wish to do so, delete this
- * exception statement from your version.
- */
-
-function config ($stateProvider) {
-  'ngInject';
-
-  $stateProvider.state('landing', {
-    url: '/landing',
-    component: 'landing',
-    resolve: {
-      lazyLoad: ($q, $ocLazyLoad) => {
-        'ngInject';
-        return $q(resolve => {
-          require.ensure(['./landing.component.js'], () => {
-            let module = require('./landing.component.js');
-            $ocLazyLoad.load({ name: module.default });
-            resolve(module);
-          });
-        });
-      }
-    }
-  });
-}
-
-export { config };
-
-export default angular
-  .module('landing.routing', [
-    'ui.router',
-    'ui.bootstrap'
-  ])
-  .config(config)
-  .name;
--- a/src/app/components/landing/landing.routing.spec.js	Wed Sep 20 13:29:27 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/**
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * Thermostat is distributed under the GNU General Public License,
- * version 2 or any later version (with a special exception described
- * below, commonly known as the "Classpath Exception").
- *
- * A copy of GNU General Public License (GPL) is included in this
- * distribution, in the file COPYING.
- *
- * Linking Thermostat code with other modules is making a combined work
- * based on Thermostat.  Thus, the terms and conditions of the GPL
- * cover the whole combination.
- *
- * As a special exception, the copyright holders of Thermostat give you
- * permission to link this code with independent modules to produce an
- * executable, regardless of the license terms of these independent
- * modules, and to copy and distribute the resulting executable under
- * terms of your choice, provided that you also meet, for each linked
- * independent module, the terms and conditions of the license of that
- * module.  An independent module is a module which is not derived from
- * or based on Thermostat code.  If you modify Thermostat, you may
- * extend this exception to your version of the software, but you are
- * not obligated to do so.  If you do not wish to do so, delete this
- * exception statement from your version.
- */
-
-describe('LandingModule', () => {
-
-  let module = require('./landing.routing.js');
-
-  let stateProvider, args, q, ocLazyLoad;
-  beforeEach(() => {
-    stateProvider = {
-      state: sinon.spy()
-    };
-    module.config(stateProvider);
-    args = stateProvider.state.args[0];
-    q = sinon.spy();
-    ocLazyLoad = { load: sinon.spy() };
-  });
-
-  describe('stateProvider', () => {
-    it('should call $stateProvider.state', () => {
-      stateProvider.state.should.be.calledOnce();
-      args[0].should.equal('landing');
-    });
-
-    it('should define a \'landing\' state', () => {
-      args[0].should.equal('landing');
-    });
-
-    it('should map to /landing', () => {
-      args[1].url.should.equal('/landing');
-    });
-
-    it('resolve should load landing component', done => {
-      let resolveFn = stateProvider.state.args[0][1].resolve.lazyLoad[2];
-      resolveFn.should.be.a.Function();
-      resolveFn(q, ocLazyLoad);
-      q.should.be.calledOnce();
-
-      let deferred = q.args[0][0];
-      deferred.should.be.a.Function();
-
-      let resolve = sinon.stub().callsFake(val => {
-        ocLazyLoad.load.should.be.calledWith({ name: require('./landing.component.js').default});
-        val.should.equal(require('./landing.component.js'));
-        done();
-      });
-      deferred(resolve);
-    });
-  });
-});
--- a/src/app/components/multichart/multichart.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/multichart/multichart.html	Thu Sep 21 16:26:15 2017 -0400
@@ -1,6 +1,5 @@
 <div class="container-fluid container-cards-pf">
   <ol class="breadcrumb" style="margin-bottom: 0px;">
-    <li><a ui-sref="landing">Thermostat</a></li>
     <li><a ui-sref="multichart" translate>multicharts.BREADCRUMB</a></li>
   </ol>
 
--- a/src/app/components/system-info/system-info.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/components/system-info/system-info.html	Thu Sep 21 16:26:15 2017 -0400
@@ -1,6 +1,5 @@
 <div class="container-fluid container-cards-pf">
   <ol class="breadcrumb" style="margin-bottom: 0px;">
-    <li><a ui-sref="landing">Thermostat</a></li>
     <li><a ui-sref="jvmList({ '#': $ctrl.systemId })" translate>systemInfo.JVM_LIST_BREADCRUMB</a></li>
     <li><a ui-sref="systemInfo({ systemId: $ctrl.systemId })">{{$ctrl.systemInfo.hostname || $ctrl.systemId}}</a></li>
   </ol>
--- a/src/app/index.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/index.html	Thu Sep 21 16:26:15 2017 -0400
@@ -18,7 +18,7 @@
         <nav class="navbar navbar-pf-vertical">
 
           <div class="navbar-header">
-            <a ui-sref="landing" class="navbar-brand">
+            <a ui-sref="default" style="cursor: pointer; cursor: hand" class="navbar-brand">
               <img class="navbar-brand-icon" src="~images/thermostat_logo_white_600px.png" height="57" alt="Thermostat"/>
             </a>
             <p hidden class="navbar-text label label-info infotip">{{$ctrl.env}}</p>
@@ -59,7 +59,7 @@
              update-active-items-on-click="true"
              >
              <div class="navbar-header">
-               <a ui-sref="landing" class="navbar-brand">
+               <a ui-sref="default" style="cursor: pointer; cursor: hand" class="navbar-brand">
                  <img id="brandLogoImg" class="navbar-brand-icon" src="~images/thermostat_logo_white_600px.png" height="57" alt="Thermostat"/>
                </a>
             <p hidden id="envHeader" class="navbar-text label label-info infotip">{{$ctrl.env}}</p>
--- a/src/app/shared/templates/404.html	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/shared/templates/404.html	Thu Sep 21 16:26:15 2017 -0400
@@ -7,5 +7,5 @@
     <span class="fa fa-frown-o fa-lg"></span>
   </div>
   <p translate>404.MESSAGE</p>
-  <p><a ui-sref="landing" class="alert-link" translate>404.LANDING_LINK_MSG</a></p>
+  <p><a ui-sref="/" class="alert-link" translate>404.ROOT_LINK_MSG</a></p>
 </div>
--- a/src/app/shared/templates/en.locale.yaml	Wed Sep 20 13:29:27 2017 -0400
+++ b/src/app/shared/templates/en.locale.yaml	Thu Sep 21 16:26:15 2017 -0400
@@ -1,4 +1,4 @@
 404:
   TITLE: 404 Not Found
   MESSAGE: Oops! The page you're looking for cannot be found.
-  LANDING_LINK_MSG: Click here to go to the landing page.
+  ROOT_LINK_MSG: Click here to go to the application root.