Skip to content

Commit

Permalink
Add bulk clone for testcases. Ref #1054
Browse files Browse the repository at this point in the history
  • Loading branch information
RMadjev authored and atodorov committed Oct 8, 2020
1 parent 950c35a commit d31306a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions tcms/testplans/static/testplans/js/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tcms/testplans/templates/testplans/get.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h2 class="card-pf-title">
{% if not perms.testruns.add_testrun %}
disabled
{% endif %}>{% trans 'New TestRun' %}</button>
<button class="btn btn-default" type="button"
<button class="btn btn-default" type="button" id="bulk-clone-button"
{% if not perms.testcases.add_testcase %}
disabled
{% endif %}>{% trans 'Clone' %}</button>
Expand Down

0 comments on commit d31306a

Please sign in to comment.