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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fad1089b
Commit
fad1089b
authored
Jul 16, 2020
by
Scott Stern
Committed by
Andrew Fontaine
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issuables list search filter on labels
parent
e39fdf7f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
18 deletions
+28
-18
app/assets/javascripts/issuables_list/components/issuable.vue
...assets/javascripts/issuables_list/components/issuable.vue
+1
-0
app/assets/javascripts/issuables_list/components/issuables_list_app.vue
...ascripts/issuables_list/components/issuables_list_app.vue
+12
-0
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+3
-7
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
...eatures/projects/labels/issues_sorted_by_priority_spec.rb
+2
-6
spec/frontend/issuables_list/components/issuables_list_app_spec.js
...tend/issuables_list/components/issuables_list_app_spec.js
+8
-2
spec/support/helpers/filtered_search_helpers.rb
spec/support/helpers/filtered_search_helpers.rb
+2
-3
No files found.
app/assets/javascripts/issuables_list/components/issuable.vue
View file @
fad1089b
...
@@ -313,6 +313,7 @@ export default {
...
@@ -313,6 +313,7 @@ export default {
<gl-label
<gl-label
v-for=
"label in issuable.labels"
v-for=
"label in issuable.labels"
:key=
"label.id"
:key=
"label.id"
data-qa-selector=
"issuable-label"
:target=
"labelHref(label)"
:target=
"labelHref(label)"
:background-color=
"label.color"
:background-color=
"label.color"
:description=
"label.description"
:description=
"label.description"
...
...
app/assets/javascripts/issuables_list/components/issuables_list_app.vue
View file @
fad1089b
...
@@ -275,9 +275,13 @@ export default {
...
@@ -275,9 +275,13 @@ export default {
const
{
const
{
label_name
:
labels
,
label_name
:
labels
,
milestone_title
:
milestoneTitle
,
milestone_title
:
milestoneTitle
,
'
not[label_name]
'
:
excludedLabels
,
'
not[milestone_title]
'
:
excludedMilestone
,
...
filters
...
filters
}
=
this
.
getQueryObject
();
}
=
this
.
getQueryObject
();
// TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/227880
if
(
milestoneTitle
)
{
if
(
milestoneTitle
)
{
filters
.
milestone
=
milestoneTitle
;
filters
.
milestone
=
milestoneTitle
;
}
}
...
@@ -288,6 +292,14 @@ export default {
...
@@ -288,6 +292,14 @@ export default {
filters
.
state
=
'
opened
'
;
filters
.
state
=
'
opened
'
;
}
}
if
(
excludedLabels
)
{
filters
[
'
not[labels]
'
]
=
excludedLabels
;
}
if
(
excludedMilestone
)
{
filters
[
'
not[milestone]
'
]
=
excludedMilestone
;
}
Object
.
assign
(
filters
,
sortOrderMap
[
this
.
sortKey
]);
Object
.
assign
(
filters
,
sortOrderMap
[
this
.
sortKey
]);
this
.
filters
=
filters
;
this
.
filters
=
filters
;
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
fad1089b
...
@@ -20,14 +20,10 @@ RSpec.describe 'Filter issues', :js do
...
@@ -20,14 +20,10 @@ RSpec.describe 'Filter issues', :js do
let!
(
:milestone
)
{
create
(
:milestone
,
title:
"8"
,
project:
project
,
start_date:
2
.
days
.
ago
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
title:
"8"
,
project:
project
,
start_date:
2
.
days
.
ago
)
}
def
expect_no_issues_list
def
expect_no_issues_list
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_no_selector
(
'.issue'
)
expect
(
page
).
to
have_no_selector
(
'.issue'
)
end
end
end
before
do
before
do
stub_feature_flags
(
vue_issuables_list:
false
)
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
create
(
:issue
,
project:
project
,
author:
user2
,
title:
"Bug report 1"
)
create
(
:issue
,
project:
project
,
author:
user2
,
title:
"Bug report 1"
)
...
@@ -90,7 +86,7 @@ RSpec.describe 'Filter issues', :js do
...
@@ -90,7 +86,7 @@ RSpec.describe 'Filter issues', :js do
end
end
it
'does not have the != option'
do
it
'does not have the != option'
do
input_filtered_search
(
"label:"
,
submit:
false
)
input_filtered_search
(
"label:"
,
submit:
false
,
extra_space:
false
)
wait_for_requests
wait_for_requests
within
(
'#js-dropdown-operator'
)
do
within
(
'#js-dropdown-operator'
)
do
...
@@ -346,7 +342,7 @@ RSpec.describe 'Filter issues', :js do
...
@@ -346,7 +342,7 @@ RSpec.describe 'Filter issues', :js do
context
'issue label clicked'
do
context
'issue label clicked'
do
it
'filters and displays in search bar'
do
it
'filters and displays in search bar'
do
find
(
'
.issues-list .issue .issuable-main-info .issuable-info a .gl-label-text
'
,
text:
multiple_words_label
.
title
).
click
find
(
'
[data-qa-selector="issuable-label"]
'
,
text:
multiple_words_label
.
title
).
click
expect_issues_list_count
(
1
)
expect_issues_list_count
(
1
)
expect_tokens
([
label_token
(
"
\"
#{
multiple_words_label
.
title
}
\"
"
)])
expect_tokens
([
label_token
(
"
\"
#{
multiple_words_label
.
title
}
\"
"
)])
...
...
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
View file @
fad1089b
...
@@ -13,12 +13,8 @@ RSpec.describe 'Issue prioritization' do
...
@@ -13,12 +13,8 @@ RSpec.describe 'Issue prioritization' do
let
(
:label_4
)
{
create
(
:label
,
title:
'label_4'
,
project:
project
,
priority:
4
)
}
let
(
:label_4
)
{
create
(
:label
,
title:
'label_4'
,
project:
project
,
priority:
4
)
}
let
(
:label_5
)
{
create
(
:label
,
title:
'label_5'
,
project:
project
)
}
# no priority
let
(
:label_5
)
{
create
(
:label
,
title:
'label_5'
,
project:
project
)
}
# no priority
before
do
stub_feature_flags
(
vue_issuables_list:
false
)
end
# According to https://gitlab.com/gitlab-org/gitlab-foss/issues/14189#note_4360653
# According to https://gitlab.com/gitlab-org/gitlab-foss/issues/14189#note_4360653
context
'when issues have one label'
do
context
'when issues have one label'
,
:js
do
it
'Are sorted properly'
do
it
'Are sorted properly'
do
# Issues
# Issues
issue_1
=
create
(
:issue
,
title:
'issue_1'
,
project:
project
)
issue_1
=
create
(
:issue
,
title:
'issue_1'
,
project:
project
)
...
@@ -48,7 +44,7 @@ RSpec.describe 'Issue prioritization' do
...
@@ -48,7 +44,7 @@ RSpec.describe 'Issue prioritization' do
end
end
end
end
context
'when issues have multiple labels'
do
context
'when issues have multiple labels'
,
:js
do
it
'Are sorted properly'
do
it
'Are sorted properly'
do
# Issues
# Issues
issue_1
=
create
(
:issue
,
title:
'issue_1'
,
project:
project
)
issue_1
=
create
(
:issue
,
title:
'issue_1'
,
project:
project
)
...
...
spec/frontend/issuables_list/components/issuables_list_app_spec.js
View file @
fad1089b
...
@@ -303,7 +303,7 @@ describe('Issuables list component', () => {
...
@@ -303,7 +303,7 @@ describe('Issuables list component', () => {
describe
(
'
when page is not present in params
'
,
()
=>
{
describe
(
'
when page is not present in params
'
,
()
=>
{
const
query
=
const
query
=
'
?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0
'
;
'
?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0
¬[label_name][]=Afterpod¬[milestone_title][]=13
'
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setUrl
(
query
);
setUrl
(
query
);
...
@@ -320,7 +320,11 @@ describe('Issuables list component', () => {
...
@@ -320,7 +320,11 @@ describe('Issuables list component', () => {
it
(
'
applies filters and sorts
'
,
()
=>
{
it
(
'
applies filters and sorts
'
,
()
=>
{
expect
(
wrapper
.
vm
.
hasFilters
).
toBe
(
true
);
expect
(
wrapper
.
vm
.
hasFilters
).
toBe
(
true
);
expect
(
wrapper
.
vm
.
filters
).
toEqual
(
expectedFilters
);
expect
(
wrapper
.
vm
.
filters
).
toEqual
({
...
expectedFilters
,
'
not[milestone]
'
:
[
'
13
'
],
'
not[labels]
'
:
[
'
Afterpod
'
],
});
expect
(
apiSpy
).
toHaveBeenCalledWith
(
expect
(
apiSpy
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
expect
.
objectContaining
({
...
@@ -329,6 +333,8 @@ describe('Issuables list component', () => {
...
@@ -329,6 +333,8 @@ describe('Issuables list component', () => {
with_labels_details
:
true
,
with_labels_details
:
true
,
page
:
1
,
page
:
1
,
per_page
:
PAGE_SIZE
,
per_page
:
PAGE_SIZE
,
'
not[milestone]
'
:
[
'
13
'
],
'
not[labels]
'
:
[
'
Afterpod
'
],
},
},
}),
}),
);
);
...
...
spec/support/helpers/filtered_search_helpers.rb
View file @
fad1089b
...
@@ -45,9 +45,8 @@ module FilteredSearchHelpers
...
@@ -45,9 +45,8 @@ module FilteredSearchHelpers
all_count
=
open_count
+
closed_count
all_count
=
open_count
+
closed_count
expect
(
page
).
to
have_issuable_counts
(
open:
open_count
,
closed:
closed_count
,
all:
all_count
)
expect
(
page
).
to
have_issuable_counts
(
open:
open_count
,
closed:
closed_count
,
all:
all_count
)
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
open_count
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
open_count
)
end
end
end
# Enables input to be added character by character
# Enables input to be added character by character
...
...
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