From: thuva4 Date: Tue, 27 Feb 2018 11:44:42 +0000 (+0530) Subject: Add resource name in scenario confirm modal X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=e09fdd880ab641026c744a9d8871d90cc692e620;p=releng-testresults.git Add resource name in scenario confirm modal Add the name of the scenarios in the delete confirm modal Change-Id: Ia832b007d21cb51abc55bf0bcc88637bc30eac0e Signed-off-by: thuva4 --- diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js index fd137e5..dff9f26 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js @@ -65,7 +65,7 @@ } function openDeleteModal(name){ - confirmModal("Delete",ctrl.deleteScenario,name); + confirmModal("Delete", 'scenarios', ctrl.deleteScenario,name); } function deleteScenario(name){ @@ -82,15 +82,23 @@ } function openBatchDeleteModal(){ - confirmModal("Delete",ctrl.deleteBatchScenario); + var deleteObjects = [] + ctrl.checkBox.forEach(function(scenario, index){ + if(!ctrl.showError){ + if(scenario){ + deleteObjects.push(ctrl.data.scenarios[index].name); + } + } + }); + confirmModal("Delete", 'scenarios', ctrl.deleteBatchScenario, deleteObjects); } function deleteBatchScenario(){ var index; var checkedBox = []; - ctrl.checkBox.forEach(function(project, index){ + ctrl.checkBox.forEach(function(scenario, index){ if(!ctrl.showError){ - if(project){ + if(scenario){ deleteScenario(ctrl.data.scenarios[index].name); } }