Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
- don't fail if `tracker` is None
- use `.click(handler)` instead of `.on('click', handler)`
- bootstrap switch allignment
  • Loading branch information
asankov committed Aug 21, 2020
1 parent e71ce80 commit 30c7c0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions tcms/rpc/api/testexecution.py
Expand Up @@ -225,6 +225,7 @@ def add_link(values, update_tracker=False):
tracker = tracker_from_url(link.url)

if (link.is_defect and
tracker is not None and
update_tracker and
not tracker.is_adding_testcase_to_issue_disabled()) or \
isinstance(tracker, KiwiTCMS):
Expand Down
2 changes: 1 addition & 1 deletion tcms/testruns/static/testruns/js/get.js
Expand Up @@ -135,7 +135,7 @@ function renderAdditionalInformation(testExecutions, testExecutionCaseIds) {
const bugCount = links.filter(link => link.is_defect).length;
listGroupItem.find('.test-execution-bugs-count').html(bugCount)

listGroupItem.find('.add-link-button').on('click', () => addLinkToExecution(testExecution))
listGroupItem.find('.add-link-button').click(() => addLinkToExecution(testExecution))

const ul = listGroupItem.find('.test-execution-hyperlinks')
links.forEach(link => ul.append(renderLink(link)))
Expand Down
4 changes: 3 additions & 1 deletion tcms/testruns/templates/testruns/get.html
Expand Up @@ -302,7 +302,9 @@ <h4 class="modal-title" id="add-hyperlink-modal-title">{% trans "Add hyperlink"
</div>
<div class="form-group">
<label class="col-md-3 col-lg-3 col-sm-3 control-label" for="defectCheckbox">{% trans "Is a defect" %}</label>
<input class="col-md-9 col-lg-9 col-sm-9 bootstrap-switch" type="checkbox" id="defectCheckbox" data-on-text="{% trans 'Yes' %}" data-off-text="{% trans 'No' %}"/>
<div class="col-md-3 col-lg-3">
<input class="bootstrap-switch" type="checkbox" id="defectCheckbox" data-on-text="{% trans 'Yes' %}" data-off-text="{% trans 'No' %}"/>
</div>
</div>
</div>
<div class="modal-footer">
Expand Down

0 comments on commit 30c7c0f

Please sign in to comment.