Merge branch 'issue-sidebar-empty-assignee' into 'master'

Resets issue boards assignee dropdown

Closes #26514 and #26814

See merge request !8540
This commit is contained in:
Fatih Acet 2017-01-30 20:06:07 +00:00
commit 3995baad6a
4 changed files with 46 additions and 1 deletions

View File

@ -29,6 +29,12 @@
watch: {
detail: {
handler () {
if (this.issue.id !== this.detail.issue.id) {
$('.js-issue-board-sidebar', this.$el).each((i, el) => {
$(el).data('glDropdown').clearMenu();
});
}
this.issue = this.detail.issue;
},
deep: true

View File

@ -512,12 +512,17 @@
// Append the menu into the dropdown
GitLabDropdown.prototype.appendMenu = function(html) {
return this.clearMenu().append(html);
};
GitLabDropdown.prototype.clearMenu = function() {
var selector;
selector = '.dropdown-content';
if (this.dropdown.find(".dropdown-toggle-page").length) {
selector = ".dropdown-page-one .dropdown-content";
}
return $(selector, this.dropdown).empty().append(html);
return $(selector, this.dropdown).empty();
};
GitLabDropdown.prototype.renderItem = function(data, group, index) {

View File

@ -0,0 +1,4 @@
---
title: Resets assignee dropdown when sidebar is open
merge_request:
author:

View File

@ -141,6 +141,36 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
it 'resets assignee dropdown' do
page.within(first('.board')) do
first('.card').click
end
page.within('.assignee') do
click_link 'Edit'
wait_for_ajax
page.within('.dropdown-menu-user') do
click_link user.name
wait_for_vue_resource
end
expect(page).to have_content(user.name)
end
page.within(first('.board')) do
find('.card:nth-child(2)').click
end
page.within('.assignee') do
click_link 'Edit'
expect(page).not_to have_selector('.is-active')
end
end
end
context 'milestone' do