Commit de14439e authored by Phil Hughes's avatar Phil Hughes

Enabled remote filter in compare dropdowns

Previously if the project had more than 100 branches or tags it wouldnt display them even after searching.
This now correctly sends an AJAx request to the backend to search for the branches/tags

Closes #29545
parent 8c5a3ffe
Pipeline #7055352 passed with stages
in 105 minutes and 31 seconds
......@@ -18,7 +18,8 @@ window.CompareAutocomplete = (function() {
return $.ajax({
url: $'refs-url'),
data: {
ref: $'ref')
ref: $'ref'),
search: term,
}).done(function(refs) {
return callback(refs);
......@@ -26,7 +27,7 @@ window.CompareAutocomplete = (function() {
selectable: true,
filterable: true,
filterByText: true,
filterRemote: true,
fieldName: $'field-name'),
filterInput: 'input[type="search"]',
renderRow: function(ref) {
......@@ -26,6 +26,14 @@ describe "Compare", js: true do
click_button "Compare"
expect(page).to have_content "Commits"
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)
describe "tags" do
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment