Skip to content
Snippets Groups Projects
Commit 2b327c1b authored by Jan Provaznik's avatar Jan Provaznik
Browse files

Merge branch '63656-runner-tags-search-dropdown-is-empty' into 'master'

Resolve "Runner tags search dropdown is empty"

Closes #63656

See merge request gitlab-org/gitlab-ce!29985
parents a949cc35 f928c22f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
---
title: Fix runner tags search dropdown being empty when there are tags
merge_request: 29985
author:
type: fixed
Loading
Loading
@@ -17,13 +17,13 @@ describe Autocomplete::ActsAsTaggableOn::TagsFinder do
 
context 'filter by search' do
context 'with an empty search term' do
it 'returns an empty collection' do
ActsAsTaggableOn::Tag.create!(name: 'tag1')
ActsAsTaggableOn::Tag.create!(name: 'tag2')
it 'returns all 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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment