Skip to content
Snippets Groups Projects
Commit 69019797 authored by Phil Hughes's avatar Phil Hughes Committed by Timothy Andrew
Browse files

Merge branch...

Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'

Automatically close user dropdown for CE

Closes #31987

See merge request !11189

Conflicts:
	spec/features/issues/form_spec.rb
parent f12d7db1
No related branches found
No related tags found
2 merge requests!12258Update Prometheus Merge Request Metrics page,!11530Fix 9.2 conflicts for "Automatically close user dropdown for CE"
Pipeline #
Loading
Loading
@@ -484,6 +484,15 @@ import eventHub from './sidebar/event_hub';
selected = $dropdown.closest('.selectbox').find("input[name='" + ($dropdown.data('field-name')) + "']").val();
return assignTo(selected);
}
// Automatically close dropdown after assignee is selected
// since CE has no multiple assignees
// EE does not have a max-select
if ($dropdown.data('max-select') &&
getSelected().length === $dropdown.data('max-select')) {
// Close the dropdown
$dropdown.dropdown('toggle');
}
},
id: function (user) {
return user.id;
Loading
Loading
Loading
Loading
@@ -115,7 +115,6 @@ describe 'Issue Boards', feature: true, js: true do
click_link 'Unassigned'
end
 
find('.dropdown-menu-toggle').click
wait_for_vue_resource
 
expect(page).to have_content('No assignee')
Loading
Loading
Loading
Loading
@@ -23,9 +23,14 @@ describe 'New/edit issue', feature: true, js: true do
visit new_namespace_project_issue_path(project.namespace, project)
end
 
describe 'multiple assignees' do
describe 'single assignee' do
before do
click_button 'Unassigned'
<<<<<<< HEAD
=======
wait_for_ajax
>>>>>>> a493377... Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
end
 
it 'unselects other assignees when unassigned is selected' do
Loading
Loading
@@ -33,14 +38,12 @@ describe 'New/edit issue', feature: true, js: true do
click_link user2.name
end
 
click_button user2.name
page.within '.dropdown-menu-user' do
click_link 'Unassigned'
end
 
page.within '.js-assignee-search' do
expect(page).to have_content 'Unassigned'
end
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match('0')
end
 
Loading
Loading
@@ -51,11 +54,13 @@ describe 'New/edit issue', feature: true, js: true do
 
expect(find('a', text: 'Assign to me', visible: false)).not_to be_visible
 
page.within '.dropdown-menu-user' do
click_button user.name
page.within('.dropdown-menu-user') do
click_link user.name
end
 
expect(find('a', text: 'Assign to me')).to be_visible
expect(page.find('.dropdown-menu-user', visible: false)).not_to be_visible
end
end
 
Loading
Loading
@@ -148,10 +153,17 @@ describe 'New/edit issue', feature: true, js: true do
 
it 'correctly updates the selected user when changing assignee' do
click_button 'Unassigned'
<<<<<<< HEAD
=======
wait_for_ajax
>>>>>>> a493377... Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
page.within '.dropdown-menu-user' do
click_link user.name
end
 
<<<<<<< HEAD
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user.id.to_s)
 
click_button user.name
Loading
Loading
@@ -161,16 +173,24 @@ describe 'New/edit issue', feature: true, js: true do
# check the ::before pseudo element to ensure checkmark icon is present
expect(before_for_selector('.dropdown-menu-selectable a.is-active')).not_to eq('')
expect(before_for_selector('.dropdown-menu-selectable a:not(.is-active)')).to eq('')
=======
expect(find('.js-assignee-search')).to have_content(user.name)
click_button user.name
>>>>>>> a493377... Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
 
page.within '.dropdown-menu-user' do
click_link user2.name
end
 
<<<<<<< HEAD
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user2.id.to_s)
 
click_button user2.name
 
expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user2.id.to_s)
=======
expect(find('.js-assignee-search')).to have_content(user2.name)
>>>>>>> a493377... Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
end
end
 
Loading
Loading
Loading
Loading
@@ -465,8 +465,6 @@ describe 'Issues', feature: true do
click_link 'Edit'
click_link @user.name
 
find('.dropdown-menu-toggle').click
page.within '.value .author' do
expect(page).to have_content @user.name
end
Loading
Loading
@@ -474,8 +472,6 @@ describe 'Issues', feature: true do
click_link 'Edit'
click_link @user.name
 
find('.dropdown-menu-toggle').click
page.within '.value .assign-yourself' do
expect(page).to have_content "No assignee"
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment