Commit c7e62a3e authored by Clement Ho's avatar Clement Ho

[skip ci] fix bug where checkmark would not show up on selected user dropdown

parent 8bf5936d
...@@ -363,15 +363,20 @@ import eventHub from './sidebar/event_hub'; ...@@ -363,15 +363,20 @@ import eventHub from './sidebar/event_hub';
}, },
updateLabel: $dropdown.data('dropdown-title'), updateLabel: $dropdown.data('dropdown-title'),
renderRow: function(user) { renderRow: function(user) {
var avatar, img, listClosingTags, listWithName, listWithUserName, selected, username; var avatar, img, listClosingTags, listWithName, listWithUserName, username;
username = user.username ? "@" + user.username : ""; username = user.username ? "@" + user.username : "";
avatar = user.avatar_url ? user.avatar_url : false; avatar = user.avatar_url ? user.avatar_url : false;
let selected = user.id === parseInt(selectedId, 10);
if (this.multiSelect) {
const fieldName = this.fieldName; const fieldName = this.fieldName;
const field = $dropdown.closest('.selectbox').find("input[name='" + fieldName + "'][value='" + user.id + "']"); const field = $dropdown.closest('.selectbox').find("input[name='" + fieldName + "'][value='" + user.id + "']");
if (field.length) { if (field.length) {
selected = true; selected = true;
} }
}
img = ""; img = "";
if (user.beforeDivider != null) { if (user.beforeDivider != null) {
......
...@@ -30,6 +30,11 @@ RSpec.describe 'Dashboard Issues', feature: true do ...@@ -30,6 +30,11 @@ RSpec.describe 'Dashboard Issues', feature: true do
find('#assignee_id', visible: false).set('') find('#assignee_id', visible: false).set('')
find('.js-author-search', match: :first).click find('.js-author-search', match: :first).click
find('.dropdown-menu-author li a', match: :first, text: current_user.to_reference).click find('.dropdown-menu-author li a', match: :first, text: current_user.to_reference).click
find('.js-author-search', match: :first).click
page.within '.dropdown-menu-user' do
expect(find('.dropdown-menu-author li a.is-active', match: :first, text: current_user.to_reference)).to be_visible
end
expect(page).to have_content(authored_issue.title) expect(page).to have_content(authored_issue.title)
expect(page).to have_content(authored_issue_on_public_project.title) expect(page).to have_content(authored_issue_on_public_project.title)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment