Commit 2f5c551f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Add None/Any options for assignee in search bar

parent ad8a859b
......@@ -58,10 +58,15 @@ export const alternativeTokenKeys = [
export const conditions = [
{
url: 'assignee_id=0',
url: 'assignee_id=None',
tokenKey: 'assignee',
value: 'none',
},
{
url: 'assignee_id=Any',
tokenKey: 'assignee',
value: 'any',
},
{
url: 'milestone_title=No+Milestone',
tokenKey: 'milestone',
......
......@@ -61,7 +61,10 @@
%ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'none' } }
%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
- if current_user
= render 'shared/issuable/user_dropdown_item',
......@@ -81,7 +84,7 @@
%li.filter-dropdown-item{ data: { value: 'upcoming' } }
%button.btn.btn-link{ type: 'button' }
= _('Upcoming')
%li.filter-dropdown-item{ 'data-value' => 'started' }
%li.filter-dropdown-item{ data: { value: 'started' } }
%button.btn.btn-link{ type: 'button' }
= _('Started')
%li.divider.droplab-item-ignore
......
......@@ -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,
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
You can filter issues and merge requests by specific terms included in titles or descriptions.
......
......@@ -4030,9 +4030,6 @@ msgstr ""
msgid "No"
msgstr ""
msgid "No Assignee"
msgstr ""
msgid "No Label"
msgstr ""
......
......@@ -156,13 +156,21 @@ describe 'Dropdown assignee', :js do
expect_filtered_search_input_empty
end
it 'selects `no assignee`' do
find('#js-dropdown-assignee .filter-dropdown-item', text: 'No Assignee').click
it 'selects `None`' do
find('#js-dropdown-assignee .filter-dropdown-item', text: 'None').click
expect(page).to have_css(js_dropdown_assignee, visible: false)
expect_tokens([assignee_token('none')])
expect_filtered_search_input_empty
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
describe 'selecting from dropdown without Ajax call' 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