Add user autocomplete for test run assignee updates#4356
Open
gondamol wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the Test Run “bulk change assignee” UX by replacing the prompt() flow with a Bootstrap modal and adding a typeahead-backed user autocomplete powered by the existing User.filter JSON-RPC method. It also extends Django view coverage to assert that the assignee UI elements are only visible when the user has the necessary permissions.
Changes:
- Replace bulk assignee
prompt()with a Bootstrap modal form in the Test Run “get” page. - Add a
typeahead.jsuser autocomplete that queriesUser.filterand maps the selected display value back to a username forTestExecution.update. - Add view tests that check modal visibility based on
testruns.change_testexecutionpermission.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tcms/testruns/tests/test_views.py |
Adds assertions ensuring the new assignee modal is present/absent depending on permissions. |
tcms/testruns/templates/testruns/get.html |
Introduces the Bootstrap modal markup for changing assignees in bulk. |
tcms/testruns/static/testruns/js/get.js |
Implements modal open/submit behavior and adds the User.filter-backed typeahead autocomplete. |
Comments suppressed due to low confidence (1)
tcms/testruns/static/testruns/js/get.js:880
- The modal is closed by simulating a click on the close button. This is fragile (depends on the specific button selector) and bypasses Bootstrap’s modal API. Prefer closing with
$('#change-assignee-modal').modal('hide')so the logic keeps working if the modal header markup changes.
changeAssigneeBulk(selected.executionIds, assignee)
$('#change-assignee-modal button.close').click()
return false
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </div> | ||
| </div> | ||
|
|
||
| {% if perms.testruns.change_testexecution %} |
Comment on lines
+262
to
+266
| function userAutoComplete (selector, cache) { | ||
| $(`${selector}.typeahead`).typeahead({ | ||
| minLength: 1, | ||
| highlight: true | ||
| }, { |
Comment on lines
+286
to
+300
| if (isNaN(query)) { | ||
| if (query.length < 3) { | ||
| return | ||
| } | ||
|
|
||
| rpcQuery = { username__icontains: query } | ||
| if (query.indexOf('@') > -1) { | ||
| rpcQuery = { email__icontains: query } | ||
| } | ||
| } | ||
|
|
||
| jsonRPC('User.filter', rpcQuery, function (data) { | ||
| return processAsync(data) | ||
| }) | ||
| } |
ad61aa8 to
7576bcc
Compare
Author
|
Updated the branch to address the review points:
Rechecked:
|
atodorov
requested changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prompt()with a Bootstrap modaltypeahead.jsuser autocomplete backed by the existingUser.filterJSON-RPC methodauth.view_userTestExecution.updateflow and add view coverage for modal visibility/permission textFixes #2510
Verification
cd tcms && .\node_modules\.bin\eslint.cmd static\js\jsonrpc.js testruns\static\testruns\js\get.jsgit diff --checkTest Coverage
auth.view_user-dependent help text.