Commit c2d3ea04 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch 'compare-remote-search' into 'master'

Enabled remote filter in compare dropdowns

Closes #29545

See merge request !9997
parents adb7ed3f de14439e
...@@ -18,7 +18,8 @@ window.CompareAutocomplete = (function() { ...@@ -18,7 +18,8 @@ window.CompareAutocomplete = (function() {
return $.ajax({ return $.ajax({
url: $dropdown.data('refs-url'), url: $dropdown.data('refs-url'),
data: { data: {
ref: $dropdown.data('ref') ref: $dropdown.data('ref'),
search: term,
} }
}).done(function(refs) { }).done(function(refs) {
return callback(refs); return callback(refs);
...@@ -26,7 +27,7 @@ window.CompareAutocomplete = (function() { ...@@ -26,7 +27,7 @@ window.CompareAutocomplete = (function() {
}, },
selectable: true, selectable: true,
filterable: true, filterable: true,
filterByText: true, filterRemote: true,
fieldName: $dropdown.data('field-name'), fieldName: $dropdown.data('field-name'),
filterInput: 'input[type="search"]', filterInput: 'input[type="search"]',
renderRow: function(ref) { renderRow: function(ref) {
......
...@@ -26,6 +26,14 @@ describe "Compare", js: true do ...@@ -26,6 +26,14 @@ describe "Compare", js: true do
click_button "Compare" click_button "Compare"
expect(page).to have_content "Commits" expect(page).to have_content "Commits"
end end
it "filters branches" do
select_using_dropdown("from", "wip")
find(".js-compare-from-dropdown .compare-dropdown-toggle").click
expect(find(".js-compare-from-dropdown .dropdown-content")).to have_selector("li", count: 3)
end
end end
describe "tags" do describe "tags" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment