Commit e69a4b08 authored by Sean McGivern's avatar Sean McGivern

Merge branch '52383-ui-filter-assignee-none-any' into 'master'

Add None/Any options for assignee in search bar

Closes #52383

See merge request gitlab-org/gitlab-ce!22599
parents 8ba44e46 ea05f665
...@@ -58,10 +58,15 @@ export const alternativeTokenKeys = [ ...@@ -58,10 +58,15 @@ export const alternativeTokenKeys = [
export const conditions = [ export const conditions = [
{ {
url: 'assignee_id=0', url: 'assignee_id=None',
tokenKey: 'assignee', tokenKey: 'assignee',
value: 'none', value: 'none',
}, },
{
url: 'assignee_id=Any',
tokenKey: 'assignee',
value: 'any',
},
{ {
url: 'milestone_title=No+Milestone', url: 'milestone_title=No+Milestone',
tokenKey: 'milestone', tokenKey: 'milestone',
......
...@@ -61,7 +61,10 @@ ...@@ -61,7 +61,10 @@
%ul{ data: { dropdown: true } } %ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'none' } } %li.filter-dropdown-item{ data: { value: 'none' } }
%button.btn.btn-link{ type: 'button' } %button.btn.btn-link{ type: 'button' }
= _('No Assignee') = _('None')
%li.filter-dropdown-item{ data: { value: 'any' } }
%button.btn.btn-link{ type: 'button' }
= _('Any')
%li.divider.droplab-item-ignore %li.divider.droplab-item-ignore
- if current_user - if current_user
= render 'shared/issuable/user_dropdown_item', = render 'shared/issuable/user_dropdown_item',
...@@ -81,7 +84,7 @@ ...@@ -81,7 +84,7 @@
%li.filter-dropdown-item{ data: { value: 'upcoming' } } %li.filter-dropdown-item{ data: { value: 'upcoming' } }
%button.btn.btn-link{ type: 'button' } %button.btn.btn-link{ type: 'button' }
= _('Upcoming') = _('Upcoming')
%li.filter-dropdown-item{ 'data-value' => 'started' } %li.filter-dropdown-item{ data: { value: 'started' } }
%button.btn.btn-link{ type: 'button' } %button.btn.btn-link{ type: 'button' }
= _('Started') = _('Started')
%li.divider.droplab-item-ignore %li.divider.droplab-item-ignore
......
---
title: Add None/Any option for assignee_id in search bar
merge_request: 22599
author: Heinrich Lee Yu
type: added
...@@ -40,6 +40,16 @@ The same process is valid for merge requests. Navigate to your project's **Merge ...@@ -40,6 +40,16 @@ The same process is valid for merge requests. Navigate to your project's **Merge
and click **Search or filter results...**. Merge requests can be filtered by author, assignee, and click **Search or filter results...**. Merge requests can be filtered by author, assignee,
milestone, and label. milestone, and label.
### Filtering by **None** / **Any**
Some filter fields like milestone and assignee, allow you to filter by **None** or **Any**.
![filter by none any](img/issues_filter_none_any.png)
Selecting **None** returns results that have an empty value for that field. E.g.: no milestone, no assignee.
Selecting **Any** does the opposite. It returns results that have a non-empty value for that field.
### Searching for specific terms ### Searching for specific terms
You can filter issues and merge requests by specific terms included in titles or descriptions. You can filter issues and merge requests by specific terms included in titles or descriptions.
......
...@@ -4030,9 +4030,6 @@ msgstr "" ...@@ -4030,9 +4030,6 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
msgid "No Assignee"
msgstr ""
msgid "No Label" msgid "No Label"
msgstr "" msgstr ""
......
...@@ -106,7 +106,7 @@ describe 'Issue Boards add issue modal filtering', :js do ...@@ -106,7 +106,7 @@ describe 'Issue Boards add issue modal filtering', :js do
it 'filters by unassigned' do it 'filters by unassigned' do
set_filter('assignee') set_filter('assignee')
click_filter_link('No Assignee') click_filter_link('None')
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
......
...@@ -156,13 +156,21 @@ describe 'Dropdown assignee', :js do ...@@ -156,13 +156,21 @@ describe 'Dropdown assignee', :js do
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
it 'selects `no assignee`' do it 'selects `None`' do
find('#js-dropdown-assignee .filter-dropdown-item', text: 'No Assignee').click find('#js-dropdown-assignee .filter-dropdown-item', text: 'None').click
expect(page).to have_css(js_dropdown_assignee, visible: false) expect(page).to have_css(js_dropdown_assignee, visible: false)
expect_tokens([assignee_token('none')]) expect_tokens([assignee_token('none')])
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
it 'selects `Any`' do
find('#js-dropdown-assignee .filter-dropdown-item', text: 'Any').click
expect(page).to have_css(js_dropdown_assignee, visible: false)
expect_tokens([assignee_token('any')])
expect_filtered_search_input_empty
end
end end
describe 'selecting from dropdown without Ajax call' do describe 'selecting from dropdown without Ajax call' do
......
...@@ -118,7 +118,7 @@ describe 'Visual tokens', :js do ...@@ -118,7 +118,7 @@ describe 'Visual tokens', :js do
describe 'selecting static option from dropdown' do describe 'selecting static option from dropdown' do
before do before do
find("#js-dropdown-assignee").find('.filter-dropdown-item', text: 'No Assignee').click find("#js-dropdown-assignee").find('.filter-dropdown-item', text: 'None').click
end end
it 'changes value in visual token' do it 'changes value in visual token' do
......
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