diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-01-11 18:24:31 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-01-16 09:41:26 +0530 |
commit | 16e83d89c4d4d64188bf6d0249050b2740dfd913 (patch) | |
tree | 15b296a5388276f9ca2f9d04ba4474b7354cea79 /testapi/opnfv_testapi/ui/app.js | |
parent | e4f902c091e47a2958d3c39d284a77875541a623 (diff) |
Bug fixes in results, tastcases and header file
Remove the profile, signout option in authenticate false made
Remove the sever request in authenticate false made
Remove stop date, start date in results page
Add build tag in results page
fix issue in test cases page
Change-Id: Ic3d16f53591017d2529926e4e3374aaa245c7dce
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/ui/app.js')
-rw-r--r-- | testapi/opnfv_testapi/ui/app.js | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js index 3da12b1..d5cf0f9 100644 --- a/testapi/opnfv_testapi/ui/app.js +++ b/testapi/opnfv_testapi/ui/app.js @@ -144,6 +144,7 @@ function setup($http, $rootScope, $window, $state, testapiApiUrl, authenticate) { $rootScope.auth = {}; + $rootScope.authenticate = authenticate $rootScope.auth.doSignIn = doSignIn; $rootScope.auth.doSignOut = doSignOut; $rootScope.auth.doSignCheck = doSignCheck; @@ -160,10 +161,14 @@ /** This function will initate a sign out. */ function doSignOut() { - $rootScope.auth.currentUser = null; - $rootScope.auth.isAuthenticated = false; - $rootScope.auth.projectNames = []; - $window.location.href = sign_out_url; + if(authenticate){ + $rootScope.auth.currentUser = null; + $rootScope.auth.isAuthenticated = false; + $rootScope.auth.projectNames = []; + $window.location.href = sign_out_url; + }else{ + $state.go("home", {reload: true}) + } } /** @@ -171,21 +176,23 @@ * authenticated. */ function doSignCheck() { - return $http.get(profile_url, {withCredentials: true}). - success(function (data) { - $rootScope.auth.currentUser = data; - $rootScope.auth.isAuthenticated = true; - if(authenticate){ + if(authenticate){ + return $http.get(profile_url, {withCredentials: true}). + success(function (data) { + $rootScope.auth.currentUser = data; + $rootScope.auth.isAuthenticated = true; $rootScope.auth.projectNames = $rootScope.auth.doSubmitterCheck(data.groups); - }else{ - $rootScope.auth.projectNames = ["anonymous"] - } - }). - error(function () { - $rootScope.auth.currentUser = null; - $rootScope.auth.isAuthenticated = false; - $rootScope.auth.projectNames = []; - }); + }). + error(function () { + $rootScope.auth.currentUser = null; + $rootScope.auth.isAuthenticated = false; + $rootScope.auth.projectNames = []; + }); + }else{ + $rootScope.auth.currentUser = null; + $rootScope.auth.isAuthenticated = true; + $rootScope.auth.projectNames = [] + } } function doSubmitterCheck(groups){ |