From 265e10a036b545d9d4e15bebef17e38e4b013af3 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Tue, 14 Nov 2017 15:38:56 +0530 Subject: Create functionality and e2e tests for project Implemented the create function for the projects. Wrote the e2e tests for the create function. Change-Id: Iceac650573ca31b6246350c4d60033b42e0ffb0f Signed-off-by: thuva4 --- testapi/3rd_party/static/testapi-ui/app.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'testapi/3rd_party/static/testapi-ui/app.js') diff --git a/testapi/3rd_party/static/testapi-ui/app.js b/testapi/3rd_party/static/testapi-ui/app.js index 5f5b861..0b35162 100644 --- a/testapi/3rd_party/static/testapi-ui/app.js +++ b/testapi/3rd_party/static/testapi-ui/app.js @@ -64,6 +64,11 @@ templateUrl: 'testapi-ui/components/pods/pods.html', controller: 'PodsController as ctrl' }). + state('projects', { + url: '/projects', + templateUrl: 'testapi-ui/components/projects/projects.html', + controller: 'ProjectsController as ctrl' + }). state('communityResults', { url: '/community_results', templateUrl: 'testapi-ui/components/results/results.html', @@ -168,6 +173,7 @@ $rootScope.auth.doSignIn = doSignIn; $rootScope.auth.doSignOut = doSignOut; $rootScope.auth.doSignCheck = doSignCheck; + $rootScope.auth.doSubmitterCheck = doSubmitterCheck; var sign_in_url = testapiApiUrl + '/auth/signin'; var sign_out_url = testapiApiUrl + '/auth/signout'; @@ -182,6 +188,7 @@ function doSignOut() { $rootScope.auth.currentUser = null; $rootScope.auth.isAuthenticated = false; + $rootScope.auth.projectNames = []; $window.location.href = sign_out_url; } @@ -194,13 +201,25 @@ success(function (data) { $rootScope.auth.currentUser = data; $rootScope.auth.isAuthenticated = true; + $rootScope.auth.projectNames = $rootScope.auth.doSubmitterCheck(data.groups); }). error(function () { $rootScope.auth.currentUser = null; $rootScope.auth.isAuthenticated = false; + $rootScope.auth.projectNames = []; }); } + function doSubmitterCheck(groups){ + var projectNames = [] + for(var index=0;index=0){ + projectNames.push(groups[index].split('-')[2]) + } + } + return projectNames; + } + $rootScope.auth.doSignCheck(); } -- cgit 1.2.3-korg