Unify git reference dropdowns

We have git reference dropdowns in a number of places. Currently they use glDropdown and have different implementations.

  • Compare index page
  • New tag page
  • New branch page
  • ? (probably more)

The most recent implementation is seen on the compare page. It allows the user to select from a list of branches and tags. It also lets the users manually enter a commit SHA. When selected, it replaces the text of the toggle button.

On the new tag page it is a text input with no dropdown.

On the new branch page it is a dropdown but with no manual SHA acceptance (https://gitlab.com/gitlab-org/gitlab-ce/issues/30329 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10738).

The compare page and new branch page are different in that the compare page allows for remote filtering, whereas new branch page uses static data.

After gitlab-ce!10738 the new branch page will use the same code as the compare page, apart from the inconsistency highlighted in the previous paragraph.

We should DRY up this code and use the same implementation (compare page being the best IMO) for all these dropdowns. We can also use this as an opportunity to remove one use of glDropdown.

Assignee Loading
Time tracking Loading