summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.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/scenario/scenarioController.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/scenario/scenarioController.js')
-rw-r--r--testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js24
1 files changed, 2 insertions, 22 deletions
diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
index 36e54f5..51f4242 100644
--- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
+++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js
@@ -434,35 +434,15 @@
ctrl.confirm = confirm;
ctrl.cancel = cancel;
ctrl.data = angular.copy(data);
- ctrl.open = open;
- ctrl.add = add;
- ctrl.remove = remove;
ctrl.customs = [];
- function add() {
- var custom = ctrl.custom;
- if(custom!="" && custom!=undefined ){
- ctrl.customs.push(custom);
- ctrl.custom = "";
- }
- };
-
- function remove(index) {
- // var name = ctrl.customs[index].Name;
- ctrl.customs.splice(index, 1);
-
- }
-
- /**
- * Initiate confirmation and call the success handler with the
- * inputs.
- */
function confirm() {
var custom = ctrl.custom;
if(custom!="" && custom!=undefined ){
- ctrl.customs.push(custom);
+ ctrl.customs = custom.split(/[ ,]+/).filter(Boolean);
}
+ console.log(ctrl.customs)
ctrl.data.successHandler(ctrl.customs,ctrl.data.project,ctrl.data.version,ctrl.data.installer);
$uibModalInstance.dismiss('cancel');