Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6e50b42e
Commit
6e50b42e
authored
Jan 28, 2019
by
Omar Bahareth
Committed by
Kushal Pandya
Jan 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standardize token value capitalization in filter bar
parent
c2b3f64c
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
52 additions
and
45 deletions
+52
-45
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+1
-1
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
...javascripts/filtered_search/filtered_search_token_keys.js
+4
-2
app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
...ts/filtered_search/issuable_filtered_search_token_keys.js
+11
-11
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+10
-10
changelogs/unreleased/54213-standardize-token-value-capitalization-in-filter-bar.yml
...-standardize-token-value-capitalization-in-filter-bar.yml
+5
-0
spec/features/boards/modal_filter_spec.rb
spec/features/boards/modal_filter_spec.rb
+3
-3
spec/features/issues/filtered_search/dropdown_assignee_spec.rb
...features/issues/filtered_search/dropdown_assignee_spec.rb
+2
-2
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
+2
-2
spec/features/issues/filtered_search/dropdown_label_spec.rb
spec/features/issues/filtered_search/dropdown_label_spec.rb
+2
-2
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
...eatures/issues/filtered_search/dropdown_milestone_spec.rb
+4
-4
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+5
-5
spec/features/issues/filtered_search/visual_tokens_spec.rb
spec/features/issues/filtered_search/visual_tokens_spec.rb
+3
-3
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
6e50b42e
...
...
@@ -593,7 +593,7 @@ export default class FilteredSearchManager {
tokens
.
forEach
(
token
=>
{
const
condition
=
this
.
filteredSearchTokenKeys
.
searchByConditionKeyValue
(
token
.
key
,
token
.
value
.
toLowerCase
()
,
token
.
value
,
);
const
tokenConfig
=
this
.
filteredSearchTokenKeys
.
searchByKey
(
token
.
key
)
||
{};
const
{
param
}
=
tokenConfig
;
...
...
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
View file @
6e50b42e
...
...
@@ -65,8 +65,10 @@ export default class FilteredSearchTokenKeys {
searchByConditionKeyValue
(
key
,
value
)
{
return
(
this
.
conditions
.
find
(
condition
=>
condition
.
tokenKey
===
key
&&
condition
.
value
===
value
)
||
null
this
.
conditions
.
find
(
condition
=>
condition
.
tokenKey
===
key
&&
condition
.
value
.
toLowerCase
()
===
value
.
toLowerCase
(),
)
||
null
);
}
...
...
app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
View file @
6e50b42e
...
...
@@ -60,52 +60,52 @@ export const conditions = [
{
url
:
'
assignee_id=None
'
,
tokenKey
:
'
assignee
'
,
value
:
'
n
one
'
,
value
:
'
N
one
'
,
},
{
url
:
'
assignee_id=Any
'
,
tokenKey
:
'
assignee
'
,
value
:
'
a
ny
'
,
value
:
'
A
ny
'
,
},
{
url
:
'
milestone_title=None
'
,
tokenKey
:
'
milestone
'
,
value
:
'
n
one
'
,
value
:
'
N
one
'
,
},
{
url
:
'
milestone_title=Any
'
,
tokenKey
:
'
milestone
'
,
value
:
'
a
ny
'
,
value
:
'
A
ny
'
,
},
{
url
:
'
milestone_title=%23upcoming
'
,
tokenKey
:
'
milestone
'
,
value
:
'
u
pcoming
'
,
value
:
'
U
pcoming
'
,
},
{
url
:
'
milestone_title=%23started
'
,
tokenKey
:
'
milestone
'
,
value
:
'
s
tarted
'
,
value
:
'
S
tarted
'
,
},
{
url
:
'
label_name[]=None
'
,
tokenKey
:
'
label
'
,
value
:
'
n
one
'
,
value
:
'
N
one
'
,
},
{
url
:
'
label_name[]=Any
'
,
tokenKey
:
'
any
'
,
value
:
'
a
ny
'
,
tokenKey
:
'
label
'
,
value
:
'
A
ny
'
,
},
{
url
:
'
my_reaction_emoji=None
'
,
tokenKey
:
'
my-reaction
'
,
value
:
'
n
one
'
,
value
:
'
N
one
'
,
},
{
url
:
'
my_reaction_emoji=Any
'
,
tokenKey
:
'
my-reaction
'
,
value
:
'
a
ny
'
,
value
:
'
A
ny
'
,
},
];
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
6e50b42e
...
...
@@ -57,10 +57,10 @@
avatar:
{
lazy:
true
,
url:
'{{avatar_url}}'
}
#js-dropdown-assignee
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
n
one'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
N
one'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'None'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
a
ny'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
A
ny'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Any'
)
%li
.divider.droplab-item-ignore
...
...
@@ -73,16 +73,16 @@
avatar:
{
lazy:
true
,
url:
'{{avatar_url}}'
}
#js-dropdown-milestone
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
n
one'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
N
one'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'None'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
a
ny'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
A
ny'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Any'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
u
pcoming'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
U
pcoming'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Upcoming'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
s
tarted'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
S
tarted'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Started'
)
%li
.divider.droplab-item-ignore
...
...
@@ -92,10 +92,10 @@
{{title}}
#js-dropdown-label
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
n
one'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
N
one'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'None'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
a
ny'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
A
ny'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Any'
)
%li
.divider.droplab-item-ignore
...
...
@@ -107,10 +107,10 @@
{{title}}
#js-dropdown-my-reaction
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
n
one'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
N
one'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'None'
)
%li
.filter-dropdown-item
{
data:
{
value:
'
a
ny'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'
A
ny'
}
}
%button
.btn.btn-link
{
type:
'button'
}
=
_
(
'Any'
)
%li
.divider.droplab-item-ignore
...
...
changelogs/unreleased/54213-standardize-token-value-capitalization-in-filter-bar.yml
0 → 100644
View file @
6e50b42e
---
title
:
Standardize filter value capitlization in filter bar in both issues and boards pages
merge_request
:
23846
author
:
obahareth
type
:
changed
spec/features/boards/modal_filter_spec.rb
View file @
6e50b42e
...
...
@@ -112,7 +112,7 @@ describe 'Issue Boards add issue modal filtering', :js do
page
.
within
(
'.add-issues-modal'
)
do
wait_for_requests
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
n
one'
)
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
N
one'
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
1
)
end
end
...
...
@@ -147,7 +147,7 @@ describe 'Issue Boards add issue modal filtering', :js do
page
.
within
(
'.add-issues-modal'
)
do
wait_for_requests
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
u
pcoming'
)
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
U
pcoming'
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
0
)
end
end
...
...
@@ -182,7 +182,7 @@ describe 'Issue Boards add issue modal filtering', :js do
page
.
within
(
'.add-issues-modal'
)
do
wait_for_requests
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
n
one'
)
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
text:
'
N
one'
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
1
)
end
end
...
...
spec/features/issues/filtered_search/dropdown_assignee_spec.rb
View file @
6e50b42e
...
...
@@ -160,7 +160,7 @@ describe 'Dropdown assignee', :js 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
(
'
n
one'
)])
expect_tokens
([
assignee_token
(
'
N
one'
)])
expect_filtered_search_input_empty
end
...
...
@@ -168,7 +168,7 @@ describe 'Dropdown assignee', :js 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
(
'
a
ny'
)])
expect_tokens
([
assignee_token
(
'
A
ny'
)])
expect_filtered_search_input_empty
end
end
...
...
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
View file @
6e50b42e
...
...
@@ -125,7 +125,7 @@ describe 'Dropdown emoji', :js do
find
(
'#js-dropdown-my-reaction .filter-dropdown-item'
,
text:
'None'
).
click
expect
(
page
).
to
have_css
(
js_dropdown_emoji
,
visible:
false
)
expect_tokens
([
reaction_token
(
'
n
one'
,
false
)])
expect_tokens
([
reaction_token
(
'
N
one'
,
false
)])
expect_filtered_search_input_empty
end
...
...
@@ -133,7 +133,7 @@ describe 'Dropdown emoji', :js do
find
(
'#js-dropdown-my-reaction .filter-dropdown-item'
,
text:
'Any'
).
click
expect
(
page
).
to
have_css
(
js_dropdown_emoji
,
visible:
false
)
expect_tokens
([
reaction_token
(
'
a
ny'
,
false
)])
expect_tokens
([
reaction_token
(
'
A
ny'
,
false
)])
expect_filtered_search_input_empty
end
...
...
spec/features/issues/filtered_search/dropdown_label_spec.rb
View file @
6e50b42e
...
...
@@ -238,7 +238,7 @@ describe 'Dropdown label', :js do
find
(
"
#{
js_dropdown_label
}
.filter-dropdown-item"
,
text:
'None'
).
click
expect
(
page
).
not_to
have_css
(
js_dropdown_label
)
expect_tokens
([
label_token
(
'
n
one'
,
false
)])
expect_tokens
([
label_token
(
'
N
one'
,
false
)])
expect_filtered_search_input_empty
end
...
...
@@ -246,7 +246,7 @@ describe 'Dropdown label', :js do
find
(
"
#{
js_dropdown_label
}
.filter-dropdown-item"
,
text:
'Any'
).
click
expect
(
page
).
not_to
have_css
(
js_dropdown_label
)
expect_tokens
([
label_token
(
'
a
ny'
,
false
)])
expect_tokens
([
label_token
(
'
A
ny'
,
false
)])
expect_filtered_search_input_empty
end
end
...
...
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
View file @
6e50b42e
...
...
@@ -192,7 +192,7 @@ describe 'Dropdown milestone', :js do
click_static_milestone
(
'None'
)
expect
(
page
).
to
have_css
(
js_dropdown_milestone
,
visible:
false
)
expect_tokens
([
milestone_token
(
'
n
one'
,
false
)])
expect_tokens
([
milestone_token
(
'
N
one'
,
false
)])
expect_filtered_search_input_empty
end
...
...
@@ -200,7 +200,7 @@ describe 'Dropdown milestone', :js do
click_static_milestone
(
'Any'
)
expect
(
page
).
to
have_css
(
js_dropdown_milestone
,
visible:
false
)
expect_tokens
([
milestone_token
(
'
a
ny'
,
false
)])
expect_tokens
([
milestone_token
(
'
A
ny'
,
false
)])
expect_filtered_search_input_empty
end
...
...
@@ -208,7 +208,7 @@ describe 'Dropdown milestone', :js do
click_static_milestone
(
'Upcoming'
)
expect
(
page
).
to
have_css
(
js_dropdown_milestone
,
visible:
false
)
expect_tokens
([
milestone_token
(
'
u
pcoming'
,
false
)])
expect_tokens
([
milestone_token
(
'
U
pcoming'
,
false
)])
expect_filtered_search_input_empty
end
...
...
@@ -216,7 +216,7 @@ describe 'Dropdown milestone', :js do
click_static_milestone
(
'Started'
)
expect
(
page
).
to
have_css
(
js_dropdown_milestone
,
visible:
false
)
expect_tokens
([
milestone_token
(
'
s
tarted'
,
false
)])
expect_tokens
([
milestone_token
(
'
S
tarted'
,
false
)])
expect_filtered_search_input_empty
end
end
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
6e50b42e
...
...
@@ -108,7 +108,7 @@ describe 'Filter issues', :js do
it
'filters issues by no assignee'
do
input_filtered_search
(
'assignee:none'
)
expect_tokens
([
assignee_token
(
'
n
one'
)])
expect_tokens
([
assignee_token
(
'
N
one'
)])
expect_issues_list_count
(
3
)
expect_filtered_search_input_empty
end
...
...
@@ -146,7 +146,7 @@ describe 'Filter issues', :js do
it
'filters issues by no label'
do
input_filtered_search
(
'label:none'
)
expect_tokens
([
label_token
(
'
n
one'
,
false
)])
expect_tokens
([
label_token
(
'
N
one'
,
false
)])
expect_issues_list_count
(
4
)
expect_filtered_search_input_empty
end
...
...
@@ -287,7 +287,7 @@ describe 'Filter issues', :js do
it
'filters issues by no milestone'
do
input_filtered_search
(
"milestone:none"
)
expect_tokens
([
milestone_token
(
'
n
one'
,
false
)])
expect_tokens
([
milestone_token
(
'
N
one'
,
false
)])
expect_issues_list_count
(
3
)
expect_filtered_search_input_empty
end
...
...
@@ -299,7 +299,7 @@ describe 'Filter issues', :js do
input_filtered_search
(
"milestone:upcoming"
)
expect_tokens
([
milestone_token
(
'
u
pcoming'
,
false
)])
expect_tokens
([
milestone_token
(
'
U
pcoming'
,
false
)])
expect_issues_list_count
(
1
)
expect_filtered_search_input_empty
end
...
...
@@ -307,7 +307,7 @@ describe 'Filter issues', :js do
it
'filters issues by started milestones'
do
input_filtered_search
(
"milestone:started"
)
expect_tokens
([
milestone_token
(
'
s
tarted'
,
false
)])
expect_tokens
([
milestone_token
(
'
S
tarted'
,
false
)])
expect_issues_list_count
(
5
)
expect_filtered_search_input_empty
end
...
...
spec/features/issues/filtered_search/visual_tokens_spec.rb
View file @
6e50b42e
...
...
@@ -122,7 +122,7 @@ describe 'Visual tokens', :js do
end
it
'changes value in visual token'
do
expect
(
first
(
'.tokens-container .filtered-search-token .value'
).
text
).
to
eq
(
'
n
one'
)
expect
(
first
(
'.tokens-container .filtered-search-token .value'
).
text
).
to
eq
(
'
N
one'
)
end
it
'moves input to the right'
do
...
...
@@ -147,7 +147,7 @@ describe 'Visual tokens', :js do
it
'selects static option from dropdown'
do
find
(
"#js-dropdown-milestone"
).
find
(
'.filter-dropdown-item'
,
text:
'Upcoming'
).
click
expect
(
first
(
'.tokens-container .filtered-search-token .value'
).
text
).
to
eq
(
'
u
pcoming'
)
expect
(
first
(
'.tokens-container .filtered-search-token .value'
).
text
).
to
eq
(
'
U
pcoming'
)
expect
(
is_input_focused
).
to
eq
(
true
)
end
...
...
@@ -348,7 +348,7 @@ describe 'Visual tokens', :js do
it
'tokenizes the search term to complete visual token'
do
expect_tokens
([
author_token
(
user
.
name
),
assignee_token
(
'
n
one'
)
assignee_token
(
'
N
one'
)
])
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment