Commit 70cca823 authored by Clement Ho's avatar Clement Ho

Merge branch '52370-filter-by-none-any-for-labels-in-issues-mrs-boards' into 'master'

Resolve "Filter by `None`/`Any` for labels in issues/mrs/boards"

Closes #52370

See merge request gitlab-org/gitlab-ce!23111
parents 006659e7 516378f3
...@@ -88,10 +88,15 @@ export const conditions = [ ...@@ -88,10 +88,15 @@ export const conditions = [
value: 'started', value: 'started',
}, },
{ {
url: 'label_name[]=No+Label', url: 'label_name[]=None',
tokenKey: 'label', tokenKey: 'label',
value: 'none', value: 'none',
}, },
{
url: 'label_name[]=Any',
tokenKey: 'any',
value: 'any',
},
{ {
url: 'my_reaction_emoji=None', url: 'my_reaction_emoji=None',
tokenKey: 'my-reaction', tokenKey: 'my-reaction',
......
...@@ -95,7 +95,10 @@ ...@@ -95,7 +95,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 Label') = _('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
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item %li.filter-dropdown-item
......
---
title: Adds Any option to label filters
merge_request: 23111
author: Jacopo Beschi @jacopo-beschi
type: added
...@@ -4297,9 +4297,6 @@ msgstr "" ...@@ -4297,9 +4297,6 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
msgid "No Label"
msgstr ""
msgid "No assignee" msgid "No assignee"
msgstr "" msgstr ""
......
...@@ -176,7 +176,7 @@ describe 'Issue Boards add issue modal filtering', :js do ...@@ -176,7 +176,7 @@ describe 'Issue Boards add issue modal filtering', :js do
it 'filters by no label' do it 'filters by no label' do
set_filter('label') set_filter('label')
click_filter_link('No Label') click_filter_link('None')
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
......
...@@ -45,7 +45,8 @@ describe 'Dropdown label', :js do ...@@ -45,7 +45,8 @@ describe 'Dropdown label', :js do
bug_label = create(:label, project: project, title: 'bug-label') bug_label = create(:label, project: project, title: 'bug-label')
init_label_search init_label_search
filtered_search.native.send_keys(:down, :down, :enter) # navigate to the bug_label option and selects it
filtered_search.native.send_keys(:down, :down, :down, :enter)
expect_tokens([label_token(bug_label.title)]) expect_tokens([label_token(bug_label.title)])
expect_filtered_search_input_empty expect_filtered_search_input_empty
...@@ -234,12 +235,20 @@ describe 'Dropdown label', :js do ...@@ -234,12 +235,20 @@ describe 'Dropdown label', :js do
end end
it 'selects `no label`' do it 'selects `no label`' do
find("#{js_dropdown_label} .filter-dropdown-item", text: 'No Label').click find("#{js_dropdown_label} .filter-dropdown-item", text: 'None').click
expect(page).not_to have_css(js_dropdown_label) expect(page).not_to have_css(js_dropdown_label)
expect_tokens([label_token('none', false)]) expect_tokens([label_token('none', false)])
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
it 'selects `any label`' do
find("#{js_dropdown_label} .filter-dropdown-item", text: 'Any').click
expect(page).not_to have_css(js_dropdown_label)
expect_tokens([label_token('any', false)])
expect_filtered_search_input_empty
end
end end
describe 'input has existing content' do describe 'input has existing content' 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