From d31306af25ba1b7cd58eeb45bd011e5a46c285d9 Mon Sep 17 00:00:00 2001 From: Rady Date: Wed, 7 Oct 2020 00:40:20 +0300 Subject: [PATCH] Add bulk clone for testcases. Ref #1054 --- tcms/testplans/static/testplans/js/get.js | 11 +++++++++++ tcms/testplans/templates/testplans/get.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tcms/testplans/static/testplans/js/get.js b/tcms/testplans/static/testplans/js/get.js index d77772171e..b7d337dfa3 100644 --- a/tcms/testplans/static/testplans/js/get.js +++ b/tcms/testplans/static/testplans/js/get.js @@ -421,6 +421,17 @@ function toolbarEvents(testPlanId, permissions) { } }); + + $('#bulk-clone-button').click(function() { + let selectedCases = getSelectedTestCases(); + + if (!selectedCases.length) { + alert($('#test_plan_pk').data('trans-no-testcases-selected')); + return; + } + + window.location.assign(`/cases/clone?case=${selectedCases.join('&case=')}`); + }); } function toolbarDropdowns() { diff --git a/tcms/testplans/templates/testplans/get.html b/tcms/testplans/templates/testplans/get.html index db5b9ebd55..48b80507b8 100644 --- a/tcms/testplans/templates/testplans/get.html +++ b/tcms/testplans/templates/testplans/get.html @@ -141,7 +141,7 @@

{% if not perms.testruns.add_testrun %} disabled {% endif %}>{% trans 'New TestRun' %} -