summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2018-03-12 06:09:27 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-12 06:09:27 +0000
commitc22ede1f489a6b8df123c657a6a0001103eb7ba4 (patch)
treeeca8ef9b120e2b5911310fdc5177d5150af0182b /testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
parentbbdcddf48b7c47f39e65320df46be038ceed8f46 (diff)
parent0326a542bfae2126e8fa087c266bee5253f05991 (diff)
Merge "Add multple customs to scenario"
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js')
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
index dff9f26..98e4089 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
@@ -127,7 +127,6 @@
}
function createScenario(scenario) {
- console.log(scenario)
ctrl.scenarioRequest =
$http.post(ctrl.url, scenario).success(function (data){
ctrl.showCreateSuccess = true;
@@ -270,7 +269,6 @@
}
function openVersionModal(){
- console.log("Hello");
$uibModal.open({
templateUrl: 'testapi-ui/components/scenarios/modals/versionModal.html',
controller: 'versionModalCtrl as versionModalCtrl',
@@ -383,8 +381,10 @@
$uibModalInstance.dismiss('cancel');
}
- function handleModalCustom(custom){
- ctrl.project.customs.push(custom);
+ function handleModalCustom(customs){
+ for (var custom in customs){
+ ctrl.project.customs.push(customs[custom]);
+ }
}
function openCustomModal(){
@@ -418,6 +418,7 @@
ctrl.cancel = cancel;
ctrl.data = angular.copy(data);
ctrl.open = open;
+ ctrl.customs = []
/**
@@ -425,7 +426,11 @@
* inputs.
*/
function confirm() {
- ctrl.data.successHandler(ctrl.custom);
+ var custom = ctrl.custom;
+ if(custom!="" && custom!=undefined ){
+ ctrl.customs = custom.split(/[ ,]+/).filter(Boolean);
+ }
+ ctrl.data.successHandler(ctrl.customs);
$uibModalInstance.dismiss('cancel');
}