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
f928c22f
Commit
f928c22f
authored
Jun 24, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return all runner tags when search is empty
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
88c8d177
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb
app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb
+1
-2
changelogs/unreleased/63656-runner-tags-search-dropdown-is-empty.yml
...unreleased/63656-runner-tags-search-dropdown-is-empty.yml
+5
-0
spec/finders/autocomplete/acts_as_taggable_on/tags_finder_spec.rb
...ders/autocomplete/acts_as_taggable_on/tags_finder_spec.rb
+4
-4
No files found.
app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb
View file @
f928c22f
...
...
@@ -22,8 +22,7 @@ module Autocomplete
end
def
filter_by_name
(
tags
)
return
tags
unless
search
return
tags
.
none
if
search
.
empty?
return
tags
unless
search
.
present?
if
search
.
length
>=
Gitlab
::
SQL
::
Pattern
::
MIN_CHARS_FOR_PARTIAL_MATCHING
tags
.
named_like
(
search
)
...
...
changelogs/unreleased/63656-runner-tags-search-dropdown-is-empty.yml
0 → 100644
View file @
f928c22f
---
title
:
Fix runner tags search dropdown being empty when there are tags
merge_request
:
29985
author
:
type
:
fixed
spec/finders/autocomplete/acts_as_taggable_on/tags_finder_spec.rb
View file @
f928c22f
...
...
@@ -17,13 +17,13 @@ describe Autocomplete::ActsAsTaggableOn::TagsFinder do
context
'filter by search'
do
context
'with an empty search term'
do
it
'returns a
n empty collection
'
do
ActsAsTaggableOn
::
Tag
.
create!
(
name:
'tag1'
)
ActsAsTaggableOn
::
Tag
.
create!
(
name:
'tag2'
)
it
'returns a
ll tags
'
do
tag1
=
ActsAsTaggableOn
::
Tag
.
create!
(
name:
'tag1'
)
tag2
=
ActsAsTaggableOn
::
Tag
.
create!
(
name:
'tag2'
)
tags
=
described_class
.
new
(
params:
{
search:
''
}).
execute
expect
(
tags
).
to
be_empty
expect
(
tags
).
to
match_array
[
tag1
,
tag2
]
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