summaryrefslogtreecommitdiffstats
path: root/testapi/3rd_party
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/3rd_party')
-rw-r--r--testapi/3rd_party/static/testapi-ui/Gruntfile.js38
-rw-r--r--testapi/3rd_party/static/testapi-ui/app.js19
-rw-r--r--testapi/3rd_party/static/testapi-ui/index.html1
-rw-r--r--testapi/3rd_party/static/testapi-ui/shared/header/header.html1
4 files changed, 42 insertions, 17 deletions
diff --git a/testapi/3rd_party/static/testapi-ui/Gruntfile.js b/testapi/3rd_party/static/testapi-ui/Gruntfile.js
index 8ff2802..f82269e 100644
--- a/testapi/3rd_party/static/testapi-ui/Gruntfile.js
+++ b/testapi/3rd_party/static/testapi-ui/Gruntfile.js
@@ -31,6 +31,12 @@ module.exports = function (grunt) {
},
components: {
expand: true,
+ cwd: '../../../opnfv_testapi/ui',
+ src: '**',
+ dest: 'components',
+ },
+ copyComponents: {
+ expand: true,
cwd: 'components',
src: '**',
dest: 'testapi-ui/components',
@@ -82,6 +88,12 @@ module.exports = function (grunt) {
async: true
}
},
+ deleteFiles: {
+ command: 'rm -r testapi-ui && rm -r components',
+ options: {
+ async: false
+ }
+ },
options: {
stdout: false,
stderr: false
@@ -90,8 +102,8 @@ module.exports = function (grunt) {
instrument: {
files: ['components/**/*.js'],
options: {
- lazy: false,
- basePath: "./testapi-ui/"
+ lazy: false,
+ basePath: "./testapi-ui/"
}
},
karma: {
@@ -105,7 +117,8 @@ module.exports = function (grunt) {
noColor: false,
coverageDir: '../../../opnfv_testapi/tests/UI/coverage',
args: {
- specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js']
+ specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js',
+ '../../../opnfv_testapi/tests/UI/e2e/projectControllerSpec.js']
}
},
local: {
@@ -119,18 +132,7 @@ module.exports = function (grunt) {
options: {
print: 'detail'
}
- },
- protractor: {
- e2e: {
- options: {
- args: {
- specs: ['../../../opnfv_testapi/tests/UI/e2e/podsControllerSpec.js']
- },
- configFile: '../../../opnfv_testapi/tests/UI/protractor-conf.js',
- keepAlive: true
- }
- }
- }
+ }
});
grunt.registerTask('test', [
'karma:unit'
@@ -138,6 +140,7 @@ module.exports = function (grunt) {
grunt.registerTask('e2e', [
'copy:assets',
'copy:components',
+ 'copy:copyComponents',
'copy:shared',
'copy:filesPng',
'copy:filesIco',
@@ -149,7 +152,8 @@ module.exports = function (grunt) {
'shell:startSelenium',
'wait:default',
'protractor_coverage',
- 'makeReport'
- // 'protractor'
+ 'makeReport',
+ 'shell:deleteFiles'
+
]);
}
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();
}
diff --git a/testapi/3rd_party/static/testapi-ui/index.html b/testapi/3rd_party/static/testapi-ui/index.html
index 2d7399f..45162dc 100644
--- a/testapi/3rd_party/static/testapi-ui/index.html
+++ b/testapi/3rd_party/static/testapi-ui/index.html
@@ -46,6 +46,7 @@
<script src="testapi-ui/components/profile/profileController.js"></script>
<script src="testapi-ui/components/auth-failure/authFailureController.js"></script>
<script src="testapi-ui/components/logout/logoutController.js"></script>
+ <script src="testapi-ui/components/projects/projectsController.js"></script>
<!-- Filters -->
<script src="testapi-ui/shared/filters.js"></script>
diff --git a/testapi/3rd_party/static/testapi-ui/shared/header/header.html b/testapi/3rd_party/static/testapi-ui/shared/header/header.html
index f5b2414..4b3f8dd 100644
--- a/testapi/3rd_party/static/testapi-ui/shared/header/header.html
+++ b/testapi/3rd_party/static/testapi-ui/shared/header/header.html
@@ -19,6 +19,7 @@ TestAPI
<li ng-class="{ active: header.isActive('/about')}"><a ui-sref="about">About</a></li>
<li ng-class="{ active: header.isActive('/pods')}"><a ui-sref="pods">Pods</a></li>
<li ng-class="{ active: header.isActive('/community_results')}"><a ui-sref="communityResults">Community Results</a></li>
+ <li ng-class="{ active: header.isActive('/projects')}"><a ui-sref="projects">Projects</a></li>
<!--
<li ng-class="{ active: header.isCatalogActive('public')}" class="dropdown" uib-dropdown>
<a role="button" class="dropdown-toggle" uib-dropdown-toggle>