From 86db2b6832d51f8cd4d428bc431aca9daa99c4e0 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Tue, 16 Jan 2018 00:09:51 +0530 Subject: Design the scenario create method design scenario create method in modal way. design scenario page. Add,delete for installers,versions, projects and customs are implemented. tests are added. 1. Pods page 2. project page 3. Scenarios 4. Scenario Change-Id: Ice26af77ec3d5fe874cf5c2062f208072dea289f Signed-off-by: thuva4 --- .../components/scenarios/modals/projectModal.html | 62 --- .../ui/components/scenarios/scenario/scenario.html | 463 +++++++++++---------- .../scenarios/scenario/scenarioController.js | 319 ++++---------- .../ui/components/scenarios/scenarios.html | 4 +- .../ui/components/scenarios/scenariosController.js | 142 ------- 5 files changed, 325 insertions(+), 665 deletions(-) (limited to 'testapi/opnfv_testapi/ui/components/scenarios') diff --git a/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html b/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html index 5885a61..0a14be9 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html +++ b/testapi/opnfv_testapi/ui/components/scenarios/modals/projectModal.html @@ -14,24 +14,6 @@

-
-
- -
-
- -

-
-
-
-
- -
-
- -

-
-
@@ -45,50 +27,6 @@
-
-

Scores

-
- - - - - - - - - - - - - - - -
ScoreDate
{{score.score}}{{score.date}}
-
-
-
-

Trust Indicator

-
- - - - - - - - - - - - - - - -
StatusDate
{{trustIndicator.status}}{{trustIndicator.date}}
-
-

Customs

diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html index d96986e..328a5e6 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html @@ -1,234 +1,241 @@ Scenario -
-
- - - - - - - - - - - - - - - - - + + +
Id :{{ctrl.data.scenarios[0]._id}}
Name :{{ctrl.data.scenarios[0].name}}
Created at :{{ctrl.data.scenarios[0].creation_date}}
Installers - -
- -
-
-
- - - - - - - - - - + + +
- {{index+1}}. Installer:  - - {{installer.installer}} - - -
- Versions: - -
- -

Hide

-

Show

-
+
+
+ + + + + + + + + + + + + + + + + - - -
Id :{{ctrl.data.scenarios[0]._id}}
Name :{{ctrl.data.scenarios[0].name}}
Created at :{{ctrl.data.scenarios[0].creation_date}}
Installers + +
+ +
+
+
+ + + + + + + + + + - - -
+ {{indexI+1}}. Installer:  + + {{installer.installer}} + + +
+ Versions: + + +
+ +
+
+
+ + + + + + + + + + + + + + + + +
+ {{indexV+1}}. Version: + + {{version.version}} + + +
+ Owner: + {{version.owner}}
+ Projects: + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ {{indexP+1}}. Project: + + {{project.project}} + + +
+ Trust Indicators: + + +

Hide

+

Show

+
+ + + + + + + + + + + + + + +
+ Status:  + + {{trust_indicator.status}} +
+ Date:  + + {{trust_indicator.date}} +
+
+ Scores: + + +

Hide

+

Show

+
+ + + + + + + + + + + + + + +
+ Score:  + + {{score.score}} +
+ Date:  + + {{score.date}} +
+
+ Customs: + + +

Hide

+

Show

+
+ + + + + + + + + + + + +
+ {{custom}} + + +
+
+
+
+
-
- -
-
-
- - - - - - - - - - - - - - - - -
- {{index+1}}. Version: - - {{version.version}} - - -
- Owner: - {{version.owner}}
- Projects: - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - -
- {{index+1}}. Project: - - {{project.project}} -
- Trust Indicators: - - -

Hide

-

Show

-
- - - - - - - - - - - - - - -
- Status:  - - {{trust_indicator.status}} -
- Date:  - - {{trust_indicator.date}} -
-
- Scores: - - -

Hide

-

Show

-
- - - - - - - - - - - - - - -
- Score:  - - {{score.score}} -
- Date:  - - {{score.date}} -
-
- Customs: - - -

Hide

-

Show

-
- - - - - - - - - - - - -
- {{custom}} - - -
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+ Create
@@ -45,7 +45,7 @@ - + diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js index 4243e21..fd137e5 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js @@ -348,11 +348,7 @@ ctrl.confirm = confirm; ctrl.cancel = cancel; ctrl.data = angular.copy(data); - ctrl.openScoreModal = openScoreModal; - ctrl.openTrustIndicatorModal = openTrustIndicatorModal; ctrl.openCustomModal = openCustomModal; - ctrl.handleScore = handleScore; - ctrl.handleModalTrustIndicator = handleModalTrustIndicator; ctrl.handleModalCustom = handleModalCustom; ctrl.project = { "scores": [], @@ -379,48 +375,10 @@ $uibModalInstance.dismiss('cancel'); } - function handleModalTrustIndicator(trustIndicator){ - ctrl.project.trust_indicators.push(trustIndicator) - } - - function handleScore(score){ - ctrl.project.scores.push(score); - } - function handleModalCustom(custom){ ctrl.project.customs.push(custom); } - function openScoreModal(){ - $uibModal.open({ - templateUrl: 'testapi-ui/components/scenarios/modals/scoreModal.html', - controller: 'scoreModalCtrl as scoreModalCtrl', - size: 'md', - resolve: { - data: function () { - return { - text: "Score", - successHandler: ctrl.handleScore, - }; - } - } - }); - } - function openTrustIndicatorModal(){ - $uibModal.open({ - templateUrl: 'testapi-ui/components/scenarios/modals/trustIndicatorModal.html', - controller: 'trustIndicatorModalCtrl as trustIndicatorModalCtrl', - size: 'md', - resolve: { - data: function () { - return { - text: "Trust Indicator", - successHandler: ctrl.handleModalTrustIndicator - }; - } - } - }); - } function openCustomModal(){ $uibModal.open({ templateUrl: 'testapi-ui/components/scenarios/modals/customModal.html', @@ -438,106 +396,6 @@ } } - /** - * TestAPI Project Modal Controller - * This controller is for the create modal where a user can create - * the project information and for the edit modal where user can - * edit the project's details - */ - angular.module('testapiApp').controller('scoreModalCtrl', scoreModalCtrl); - scoreModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data']; - function scoreModalCtrl($scope, $uibModalInstance, data) { - var ctrl = this; - ctrl.confirm = confirm; - ctrl.cancel = cancel; - ctrl.data = angular.copy(data); - ctrl.open = open; - - /** - * Initiate confirmation and call the success handler with the - * inputs. - */ - function confirm() { - ctrl.data.successHandler(ctrl.score); - $uibModalInstance.dismiss('cancel'); - } - - /** - * Close the confirm modal without initiating changes. - */ - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function handleModalData(){ - - } - - /** - * This is called when the date filter calendar is opened. It - * does some event handling, and sets a scope variable so the UI - * knows which calendar was opened. - * @param {Object} $event - The Event object - * @param {String} openVar - Tells which calendar was opened - */ - function open($event, openVar) { - $event.preventDefault(); - $event.stopPropagation(); - ctrl[openVar] = true; - } - } - - /** - * TestAPI Project Modal Controller - * This controller is for the create modal where a user can create - * the project information and for the edit modal where user can - * edit the project's details - */ - angular.module('testapiApp').controller('trustIndicatorModalCtrl', trustIndicatorModalCtrl); - trustIndicatorModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data']; - function trustIndicatorModalCtrl($scope, $uibModalInstance, data) { - var ctrl = this; - ctrl.confirm = confirm; - ctrl.cancel = cancel; - ctrl.data = angular.copy(data); - ctrl.open = open; - - - /** - * Initiate confirmation and call the success handler with the - * inputs. - */ - function confirm() { - ctrl.data.successHandler(ctrl.ti); - $uibModalInstance.dismiss('cancel'); - - } - - /** - * Close the confirm modal without initiating changes. - */ - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function handleModalData(){ - - } - - /** - * This is called when the date filter calendar is opened. It - * does some event handling, and sets a scope variable so the UI - * knows which calendar was opened. - * @param {Object} $event - The Event object - * @param {String} openVar - Tells which calendar was opened - */ - function open($event, openVar) { - $event.preventDefault(); - $event.stopPropagation(); - ctrl[openVar] = true; - } - } - /** * TestAPI Project Modal Controller * This controller is for the create modal where a user can create -- cgit 1.2.3-korg