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

This commit is contained in:
🙈 jacopo beschi 🙉 2018-12-03 16:48:02 +00:00 committed by Clement Ho
parent 006659e745
commit 516378f390
6 changed files with 27 additions and 8 deletions

View File

@ -88,10 +88,15 @@ export const conditions = [
value: 'started',
},
{
url: 'label_name[]=No+Label',
url: 'label_name[]=None',
tokenKey: 'label',
value: 'none',
},
{
url: 'label_name[]=Any',
tokenKey: 'any',
value: 'any',
},
{
url: 'my_reaction_emoji=None',
tokenKey: 'my-reaction',

View File

@ -95,7 +95,10 @@
%ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'none' } }
%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
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item

View File

@ -0,0 +1,5 @@
---
title: Adds Any option to label filters
merge_request: 23111
author: Jacopo Beschi @jacopo-beschi
type: added

View File

@ -4297,9 +4297,6 @@ msgstr ""
msgid "No"
msgstr ""
msgid "No Label"
msgstr ""
msgid "No assignee"
msgstr ""

View File

@ -176,7 +176,7 @@ describe 'Issue Boards add issue modal filtering', :js do
it 'filters by no label' do
set_filter('label')
click_filter_link('No Label')
click_filter_link('None')
submit_filter
page.within('.add-issues-modal') do

View File

@ -45,7 +45,8 @@ describe 'Dropdown label', :js do
bug_label = create(:label, project: project, title: 'bug-label')
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_filtered_search_input_empty
@ -234,12 +235,20 @@ describe 'Dropdown label', :js do
end
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_tokens([label_token('none', false)])
expect_filtered_search_input_empty
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
describe 'input has existing content' do