Added fake login page for testing and demo
Change-Id: Ife37444dcede67b54d1f257ee99322b22ac6b78c
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/services/userModel.js b/app/common/services/userModel.js
index e44ba8c..dba607d 100644
--- a/app/common/services/userModel.js
+++ b/app/common/services/userModel.js
@@ -15,6 +15,9 @@
.module('app.common.services')
.service('userModel', ['APIUtils',function(APIUtils){
return {
+ fakeLogin: function(callback){
+ sessionStorage.setItem('LOGIN_ID', 'FAKE_ID');
+ },
login : function(username, password, callback){
APIUtils.login(username, password, function(response, error){
if(response &&
diff --git a/app/common/styles/layout/content.scss b/app/common/styles/layout/content.scss
index 3517cb2..b06175b 100644
--- a/app/common/styles/layout/content.scss
+++ b/app/common/styles/layout/content.scss
@@ -1,17 +1,5 @@
// Content layout styles
-// Page header
-.page-header {
- position: relative;
- border-bottom: 1px solid $lightbg__grey;
- margin: 2.625em 0 1.2em 0;
- .h4 {
- padding: 0;
- margin: 0 0 .5em 0;
- font-weight: bold;
- }
-}
-
.content__container {
margin-left: $nav__toplvlWidth;
padding: 1em .1em;
diff --git a/app/index.html b/app/index.html
index b6e0d3c..79dc11b 100644
--- a/app/index.html
+++ b/app/index.html
@@ -10,12 +10,12 @@
<!-- endbuild -->
</head>
-<body ng-style="dataService.bodyStyle" ng-attr-id="{{dataService.path == '/login' ? 'login': ''}}">
+<body ng-style="dataService.bodyStyle" ng-attr-id="{{!dataService.showNavigation ? 'login': ''}}">
<app-header ng-if="dataService.showNavigation" path="dataService.path"></app-header>
- <app-navigation ng-if="dataService.showNavigation" path="dataService.path" show-navigation=" dataService.showNavigation"></app-navigation>
+ <app-navigation ng-if="dataService.showNavigation" path="dataService.path" show-navigation="dataService.showNavigation"></app-navigation>
- <main ng-view ng-class="{'content__container': dataService.path != '/login', 'login__wrapper': dataService.path == '/login'}">
+ <main ng-view ng-class="{'content__container': dataService.showNavigation, 'login__wrapper': !dataService.showNavigation}">
</main>
<!-- build:js scripts/vendor.min.js -->
diff --git a/app/index.js b/app/index.js
index f54aea0..f799e29 100644
--- a/app/index.js
+++ b/app/index.js
@@ -66,7 +66,8 @@
$rootScope.$on('$locationChangeSuccess', function(event){
var path = $location.path();
dataService.path = path;
- if(['/','/login','/logout'].indexOf(path) == -1){
+ if(['/','/login','/logout'].indexOf(path) == -1 &&
+ path.indexOf('/login') == -1){
dataService.showNavigation = true;
}else{
dataService.showNavigation = false;
@@ -74,6 +75,10 @@
});
$rootScope.$on('timedout-user', function(){
+ if(sessionStorage.getItem('LOGIN_ID') == 'FAKE_ID'){
+ return;
+ }
+
sessionStorage.removeItem('LOGIN_ID');
$location.path('/login');
});
diff --git a/app/login/controllers/login-controller.js b/app/login/controllers/login-controller.js
index b1a0d45..900063a 100644
--- a/app/login/controllers/login-controller.js
+++ b/app/login/controllers/login-controller.js
@@ -17,10 +17,17 @@
'$window',
'APIUtils',
'dataService',
- 'userModel',
- function($scope, $window, APIUtils, dataService, userModel){
+ 'userModel',
+ '$routeParams',
+ function($scope, $window, APIUtils, dataService, userModel, $routeParams){
$scope.dataService = dataService;
+ if($routeParams.fake_login &&
+ $routeParams.fake_login === 'fake_login'){
+ userModel.fakeLogin();
+ $window.location.hash = '#/system-overview';
+ }
+
$scope.tryLogin = function(username, password, event){
if(event.keyCode === 13){
$scope.login(username, password);
diff --git a/app/login/index.js b/app/login/index.js
index 7e86ac4..a12cb6c 100644
--- a/app/login/index.js
+++ b/app/login/index.js
@@ -18,6 +18,11 @@
// Route configuration
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
+ .when('/login/:fake_login', {
+ 'templateUrl': 'login/controllers/login-controller.html',
+ 'controller': 'LoginController',
+ authenticated: false
+ })
.when('/login', {
'templateUrl': 'login/controllers/login-controller.html',
'controller': 'LoginController',