summaryrefslogtreecommitdiffstats
path: root/testapi/3rd_party/static/testapi-ui/app.js
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2017-11-14 15:38:56 +0530
committerthuva4 <tharma.thuva@gmail.com>2017-11-14 15:38:56 +0530
commit265e10a036b545d9d4e15bebef17e38e4b013af3 (patch)
tree253f52de1842ec2ca3dc5e33d381f6108c4c39ab /testapi/3rd_party/static/testapi-ui/app.js
parent3b3477d3f632208d99fe2ab71679ab84b618855a (diff)
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 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/3rd_party/static/testapi-ui/app.js')
-rw-r--r--testapi/3rd_party/static/testapi-ui/app.js19
1 files changed, 19 insertions, 0 deletions
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<groups.length; index++){
+ if(groups[index].indexOf('-submitters')>=0){
+ projectNames.push(groups[index].split('-')[2])
+ }
+ }
+ return projectNames;
+ }
+
$rootScope.auth.doSignCheck();
}