summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2018-03-09 22:42:05 +0530
committerthuva4 <tharma.thuva@gmail.com>2018-03-09 22:42:05 +0530
commit0326a542bfae2126e8fa087c266bee5253f05991 (patch)
tree13de448d3f59100d75e2acb26766c0e8f447ec8f /testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js
parentf3a5531761a38cf40d0469209145394b31af2088 (diff)
Add multple customs to scenario
User can add multiple customs by giving a comma or space sperated string JIRA: RELENG-344 Change-Id: I8e4b37fc476f39e10321755f1e67fe3605178406 Signed-off-by: thuva4 <tharma.thuva@gmail.com>
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');
}