summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/pages/app/scripts
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-03-21 14:48:54 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-03-25 01:07:45 +0000
commit04ef201b1e8f5f3dcfde4319854b81c25240e63f (patch)
tree63668da7fd79ed0071710a5ed69a6c4f348aad7d /utils/test/reporting/pages/app/scripts
parent33ad7e23e1d76011a574f709c0d2bb915983e6d1 (diff)
Create Catalogue page
JIRA: RELENG-193 1.create a page to list all project. 2.This page can get test case list of certain project. 3.This page can show information of certain test case. Change-Id: I79e0d3aafa99c054865a0d2948b99918802f32a7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'utils/test/reporting/pages/app/scripts')
-rw-r--r--utils/test/reporting/pages/app/scripts/app.js5
-rw-r--r--utils/test/reporting/pages/app/scripts/config.router.js47
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/admin.controller.js26
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/case.controller.js70
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js111
-rw-r--r--utils/test/reporting/pages/app/scripts/directives/mydirective.js18
-rw-r--r--utils/test/reporting/pages/app/scripts/factory/table.factory.js22
7 files changed, 272 insertions, 27 deletions
diff --git a/utils/test/reporting/pages/app/scripts/app.js b/utils/test/reporting/pages/app/scripts/app.js
index d06019c55..043e3ca91 100644
--- a/utils/test/reporting/pages/app/scripts/app.js
+++ b/utils/test/reporting/pages/app/scripts/app.js
@@ -16,6 +16,9 @@ angular
'ui.bootstrap',
'ngResource',
'selectize',
- '720kb.tooltips'
+ '720kb.tooltips',
+ 'ngDialog',
+ 'angularUtils.directives.dirPagination',
+ 'darthwade.dwLoading'
]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/config.router.js b/utils/test/reporting/pages/app/scripts/config.router.js
index d38ad7507..d3724b765 100644
--- a/utils/test/reporting/pages/app/scripts/config.router.js
+++ b/utils/test/reporting/pages/app/scripts/config.router.js
@@ -8,15 +8,14 @@
angular.module('opnfvApp')
.run([
'$rootScope', '$state', '$stateParams',
- function ($rootScope, $state, $stateParams) {
+ function($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
}
- ]
- ).config(['$stateProvider', '$urlRouterProvider',
- function ($stateProvider, $urlRouterProvider) {
+ ]).config(['$stateProvider', '$urlRouterProvider',
+ function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/landingpage/table');
@@ -27,7 +26,7 @@ angular.module('opnfvApp')
templateUrl: "views/main.html",
data: { pageTitle: '首页', specialClass: 'landing-page' },
resolve: {
- controller: ['$ocLazyLoad', function ($ocLazyLoad) {
+ controller: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load([
])
@@ -36,10 +35,10 @@ angular.module('opnfvApp')
})
.state('landingpage.table', {
url: "/table",
- controller:'TableController',
+ controller: 'TableController',
templateUrl: "views/commons/table.html",
resolve: {
- controller: ['$ocLazyLoad', function ($ocLazyLoad) {
+ controller: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load([
// 'scripts/controllers/table.controller.js'
@@ -48,6 +47,38 @@ angular.module('opnfvApp')
}]
}
})
+ .state('select', {
+ url: '/select',
+ templateUrl: "views/testcase.html",
+ data: { specialClass: 'top-navigation' },
- }])
+ })
+ .state('select.selectTestCase', {
+ url: "/selectCase",
+ controller: 'CaseController',
+ templateUrl: "views/commons/selectTestcase.html",
+
+ })
+ .state('select.testlist', {
+ url: "/caselist",
+ templateUrl: "views/commons/testCaseList.html"
+ })
+ .state('select.admin', {
+ url: "/admin",
+ controller: 'AdminController',
+ templateUrl: "views/commons/admin.html"
+ })
+ .state('select.testVisual', {
+ url: "/visual",
+ controller: "testVisualController",
+ templateUrl: "views/commons/testCaseVisual.html"
+ })
+ // .state('admin', {
+ // url: '/admin',
+ // data: { specialClass: ' fixed-sidebar pace-done' },
+ // templateUrl: "views/commons/admin.html"
+ // })
+
+ }
+ ])
.run();
diff --git a/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js b/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js
new file mode 100644
index 000000000..e6ecad006
--- /dev/null
+++ b/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js
@@ -0,0 +1,26 @@
+'use strict';
+
+/**
+ * @ngdoc function
+ * @name opnfvdashBoardAngularApp.controller:AdminController
+ * @description
+ * # TableController
+ * Controller of the opnfvdashBoardAngularApp
+ */
+angular.module('opnfvApp')
+ .controller('AdminController', ['$scope', '$state', '$stateParams', 'TableFactory', function($scope, $state, $stateParams, TableFactory) {
+
+ init();
+ $scope.showSelectValue = 0;
+ $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
+
+ function init() {}
+
+
+
+
+
+
+
+
+ }]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/controllers/case.controller.js b/utils/test/reporting/pages/app/scripts/controllers/case.controller.js
new file mode 100644
index 000000000..a4f165119
--- /dev/null
+++ b/utils/test/reporting/pages/app/scripts/controllers/case.controller.js
@@ -0,0 +1,70 @@
+'use strict';
+
+/**
+ * @ngdoc function
+ * @name opnfvdashBoardAngularApp.controller:CaseController
+ * @description
+ * # TableController
+ * Controller of the opnfvdashBoardAngularApp
+ */
+angular.module('opnfvApp')
+ .controller('CaseController', ['$scope', '$state', '$stateParams', 'TableFactory', function($scope, $state, $stateParams, TableFactory) {
+
+ init();
+ $scope.projectSelect = "";
+ $scope.funcTestCase = ['test1func', 'test2func', 'test3func', 'test4func'];
+ $scope.yardStickCase = ['test1yard', 'test2yard', 'test3yard', 'test4yard'];
+ $scope.bottleNeckCase = ['test1bottle', 'test2bottle', 'test3bottle', 'test4bottle',
+ 'test5bottle', 'test6bottle', 'test7bottle', 'test8bottle',
+ 'test9bottle', 'test10bottle', 'test11bottle', 'test12bottle',
+ 'test13bottle', 'test14bottle', 'test15bottle', 'test16bottle',
+ 'test17bottle', 'test18bottle', 'test19bottle', 'test20bottle'
+ ];
+ $scope.selectedFunc = ["test1func"];
+ $scope.selectBottle = ["test8bottle"];
+ $scope.versionlist = ["Colorado", "Master"];
+ $scope.VersionOption = [
+ { title: 'Colorado' },
+ { title: 'Master' }
+ ];
+ $scope.VersionConfig = {
+ create: true,
+ valueField: 'title',
+ labelField: 'title',
+ delimiter: '|',
+ maxItems: 1,
+ placeholder: 'Version',
+ onChange: function(value) {
+ checkElementArrayValue($scope.selection, $scope.VersionOption);
+ $scope.selection.push(value);
+ // console.log($scope.selection);
+
+ }
+ };
+
+
+ function init() {
+ $scope.toggleSelection = toggleSelection;
+ $scope.toggleSelectionMulti = toggleSelectionMulti;
+
+ }
+
+ function toggleSelection(status) {
+ // var idx = $scope.weekselection.indexOf(status);
+ $scope.projectSelect = status;
+
+ }
+
+ function toggleSelectionMulti(status) {
+ var idx = $scope.selection.indexOf(status);
+
+ if (idx > -1) {
+ $scope.selection.splice(idx, 1);
+ } else {
+ $scope.selection.push(status);
+ }
+ console.log($scope.selection);
+ }
+
+
+ }]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js b/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js
new file mode 100644
index 000000000..7082aede0
--- /dev/null
+++ b/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js
@@ -0,0 +1,111 @@
+'use strict';
+
+/**
+ * @ngdoc function
+ * @name opnfvdashBoardAngularApp.controller:testVisualController
+ * @description
+ * # TableController
+ * Controller of the opnfvdashBoardAngularApp
+ */
+angular.module('opnfvApp')
+ .controller('testVisualController', ['$scope', '$state', '$stateParams', 'TableFactory', 'ngDialog', '$http', '$loading',
+ function($scope, $state, $stateParams, TableFactory, ngDialog, $http, $loading) {
+ $scope.dovet = "59,222,156,317";
+ $scope.functest = "203,163,334,365";
+ $scope.yardstick = "398,161,513,384";
+ $scope.vsperf = "567,163,673,350";
+ $scope.stor = "686,165,789,341";
+ $scope.qtip = "802,164,905,341";
+ $scope.bootleneck = "917,161,1022,338";
+ $scope.noPopArea1 = "30,11,1243,146";
+ $scope.noPopArea2 = "1041,157,1250,561";
+ $scope.noPopArea3 = "15,392,1027,561";
+
+ init();
+ $scope.showSelectValue = 0;
+ $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
+
+ function init() {
+ $scope.myTrigger = myTrigger;
+ $scope.openTestDetail = openTestDetail;
+ $scope.pop = pop;
+ $scope.getDetail = getDetail;
+ getUrl();
+
+
+
+ }
+
+ function myTrigger(name) {
+ $loading.start('Key');
+ $scope.tableData = null;
+ $scope.modalName = name;
+
+ var url = PROJECT_URL + '/projects/' + name + '/cases';
+
+ var config = {
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
+ }
+ }
+ $http.get(url, config).then(function(response) {
+ if (response.status == 200) {
+ $scope.tableData = response.data;
+ $loading.finish('Key');
+
+
+ }
+ })
+ }
+
+ function getDetail(casename) {
+ TableFactory.getProjectTestCaseDetail().get({
+ 'project': $scope.modalName,
+ 'testcase': casename
+ }).$promise.then(function(response) {
+ if (response != null) {
+ $scope.project_name_modal = response.project_name;
+ $scope.description_modal = response.description;
+ openTestDetail();
+ }
+ })
+
+ }
+
+
+ function openTestDetail() {
+ ngDialog.open({
+ template: 'views/modal/testcasedetail.html',
+ className: 'ngdialog-theme-default',
+ scope: $scope,
+ showClose: false
+ })
+ }
+
+ function getUrl() {
+ TableFactory.getProjectUrl().get({
+
+ }).$promise.then(function(response) {
+ if (response != null) {
+ $scope.functesturl = response.functest;
+ $scope.yardstickurl = response.yardstick;
+ $scope.vsperfurl = response.vsperf;
+ $scope.storperfurl = response.storperf;
+ $scope.qtipurl = response.qtip;
+ $scope.bottlenecksurl = response.bottlenecks;
+ $scope.doveturl = null;
+ }
+ })
+ }
+
+
+
+
+
+
+
+
+
+
+ }
+ ]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/directives/mydirective.js b/utils/test/reporting/pages/app/scripts/directives/mydirective.js
deleted file mode 100644
index 1d7177a56..000000000
--- a/utils/test/reporting/pages/app/scripts/directives/mydirective.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc directive
- * @name opnfvApp.directive:myDirective
- * @description
- * # myDirective
- */
-angular.module('opnfvApp')
- .directive('myDirective', function () {
- return {
- template: '<div></div>',
- restrict: 'E',
- link: function postLink(scope, element, attrs) {
- element.text('this is the myDirective directive');
- }
- };
- });
diff --git a/utils/test/reporting/pages/app/scripts/factory/table.factory.js b/utils/test/reporting/pages/app/scripts/factory/table.factory.js
index a2e2aeff0..2a8cbd046 100644
--- a/utils/test/reporting/pages/app/scripts/factory/table.factory.js
+++ b/utils/test/reporting/pages/app/scripts/factory/table.factory.js
@@ -21,6 +21,28 @@ angular.module('opnfvApp')
method: 'POST',
}
})
+ },
+ getProjectUrl: function() {
+ return $resource(PROJECT_URL + '/projects-page/projects', {}, {
+ 'get': {
+ method: 'GET'
+ }
+ })
+ },
+ getProjectTestCases: function() {
+ return $resource(PROJECT_URL + '/projects/:project/cases', { project: '@project' }, {
+ 'get': {
+ method: 'GET'
+ }
+ })
+ },
+ getProjectTestCaseDetail: function() {
+ return $resource(PROJECT_URL + '/projects/:project/cases/:testcase', { project: '@project', testcase: '@testcase' }, {
+ 'get': {
+
+ method: 'GET'
+ }
+ })
}
};
}); \ No newline at end of file