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 = [ ...@@ -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
......
...@@ -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 ""
......
...@@ -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
......
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