From df480a31dcbcc8c7a5373419d0a7561f548e1c52 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Thu, 30 Aug 2018 11:30:05 +0300 Subject: Disable Community Results page and restrict access to results to logged in users JIRA: DOVETAIL-736 This patch disables the Community Results page. Furthermore, allows only logged in users to fetch results from the rest api. Finally, fixes a minor bug on the javascript side, where the name of the logged in user is stored. Change-Id: Iedf1f170746501455662dc7e1d01ae0508f79488 Signed-off-by: Stamatis Katsaounis --- 3rd_party/static/testapi-ui/app.js | 14 +++++++------- .../testapi-ui/components/results/resultsController.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to '3rd_party/static/testapi-ui') diff --git a/3rd_party/static/testapi-ui/app.js b/3rd_party/static/testapi-ui/app.js index 02cd768..edf7663 100644 --- a/3rd_party/static/testapi-ui/app.js +++ b/3rd_party/static/testapi-ui/app.js @@ -55,11 +55,11 @@ templateUrl: 'testapi-ui/components/guidelines/guidelines.html', controller: 'GuidelinesController as ctrl' }). - state('communityResults', { - url: '/community_results', - templateUrl: 'testapi-ui/components/results/results.html', - controller: 'ResultsController as ctrl' - }). + // state('communityResults', { + // url: '/community_results', + // templateUrl: 'testapi-ui/components/results/results.html', + // controller: 'ResultsController as ctrl' + // }). state('userResults', { url: '/user_results', templateUrl: 'testapi-ui/components/results/results.html', @@ -78,7 +78,7 @@ }). state('authPortal', { url: '/auth_portal', - templateUrl: 'testapi-ui/components/auth/authPortal.html' + templateUrl: 'testapi-ui/components/auth/authPortal.html' }). state('authFailure', { url: '/auth_failure', @@ -173,7 +173,7 @@ $rootScope.auth.doSignIn = doSignIn; $rootScope.auth.doSignOut = doSignOut; $rootScope.auth.doSignCheck = doSignCheck; - + var sign_in_url = testapiApiUrl + '/auth/signin'; var sign_out_url = testapiApiUrl + '/auth/signout'; diff --git a/3rd_party/static/testapi-ui/components/results/resultsController.js b/3rd_party/static/testapi-ui/components/results/resultsController.js index aa593dc..03c367c 100644 --- a/3rd_party/static/testapi-ui/components/results/resultsController.js +++ b/3rd_party/static/testapi-ui/components/results/resultsController.js @@ -111,7 +111,7 @@ // need auth to browse ctrl.isUserResults = $state.current.name === 'userResults'; - ctrl.currentUser = $scope.auth.name; + ctrl.currentUser = $scope.auth.currentUser ? $scope.auth.currentUser.openid : null; console.log($scope.auth); // Should only be on user-results-page if authenticated. -- cgit 1.2.3-korg