Commit 9ee274c0 authored by Phil Hughes's avatar Phil Hughes

Fixed tags sort dropdown being empty

Closes #31618
parent 554c4e0d
......@@ -70,6 +70,14 @@ module SortingHelper
}
end
def tags_sort_options_hash
{
sort_value_name => sort_title_name,
sort_value_recently_updated => sort_title_recently_updated,
sort_value_oldest_updated => sort_title_oldest_updated
}
end
def sort_title_priority
'Priority'
end
......
......@@ -14,16 +14,14 @@
.dropdown
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown'} }
%span.light
= projects_sort_options_hash[@sort]
= tags_sort_options_hash[@sort]
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-align-right
%li
= link_to filter_tags_path(sort: sort_value_name) do
= sort_title_name
= link_to filter_tags_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
= link_to filter_tags_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
%li.dropdown-header
Sort by
- tags_sort_options_hash.each do |value, title|
%li
= link_to title, filter_tags_path(sort: value), class: ("is-active" if @sort == value)
- if can?(current_user, :push_code, @project)
= link_to new_namespace_project_tag_path(@project.namespace, @project), class: 'btn btn-create new-tag-btn' do
New tag
......
---
title: Fixed tags sort from defaulting to empty
merge_request:
author:
require 'spec_helper'
feature 'Tags sort dropdown', :feature do
let(:project) { create(:project) }
before do
login_as(:admin)
visit namespace_project_tags_path(project.namespace, project)
end
it 'defaults sort dropdown to last updated' do
expect(page).to have_button('Last updated')
end
end
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