Skip to content

Commit

Permalink
Select testplan data element only once
Browse files Browse the repository at this point in the history
  • Loading branch information
RMadjev authored and atodorov committed Nov 12, 2020
1 parent 4b2e7e1 commit 54fcd23
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tcms/testplans/static/testplans/js/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ let testCaseStatusConfirmedPK = null;


$(document).ready(function() {
testCaseStatusConfirmedPK = Number($('#test_plan_pk').data('testcasestatus-confirmed-pk'));
const testPlanDataElement = $('#test_plan_pk');
testCaseStatusConfirmedPK = Number(testPlanDataElement.data('testcasestatus-confirmed-pk'));

const testPlanId = $('#test_plan_pk').data('testplan-pk');
const testPlanId = testPlanDataElement.data('testplan-pk');

const permissions = {
'perm-change-testcase': $('#test_plan_pk').data('perm-change-testcase') === 'True',
'perm-remove-testcase': $('#test_plan_pk').data('perm-remove-testcase') === 'True',
'perm-add-testcase': $('#test_plan_pk').data('perm-add-testcase') === 'True',
'perm-add-comment': $('#test_plan_pk').data('perm-add-comment') === 'True',
'perm-delete-comment': $('#test_plan_pk').data('perm-delete-comment') === 'True'
'perm-change-testcase': testPlanDataElement.data('perm-change-testcase') === 'True',
'perm-remove-testcase': testPlanDataElement.data('perm-remove-testcase') === 'True',
'perm-add-testcase': testPlanDataElement.data('perm-add-testcase') === 'True',
'perm-add-comment': testPlanDataElement.data('perm-add-comment') === 'True',
'perm-delete-comment': testPlanDataElement.data('perm-delete-comment') === 'True'
};

$('#btn-search-cases').click(function () {
return searchAndSelectTestCases(testPlanId, $(this).attr('href'));
});

// bind everything in tags table
const perm_remove_tag = $('#test_plan_pk').data('perm-remove-tag') === 'True';
const perm_remove_tag = testPlanDataElement.data('perm-remove-tag') === 'True';
tagsCard('TestPlan', testPlanId, {plan: testPlanId}, perm_remove_tag);

jsonRPC('TestCase.sortkeys', {'plan': testPlanId}, function(sortkeys) {
Expand Down

0 comments on commit 54fcd23

Please sign in to comment.