Commit ff2c22fe authored by Fatih Acet's avatar Fatih Acet Committed by Jose Vargas

Button tooltip, delete unused sort attr and use qa link

parent 44598ec5
......@@ -308,6 +308,16 @@ ul.related-merge-requests > li {
display: block;
}
.issue-sort-dropdown {
.btn-group {
width: 100%;
}
.reverse-sort-btn {
color: $gl-text-color-secondary;
}
}
@include media-breakpoint-up(sm) {
.emoji-block .row {
display: flex;
......
......@@ -162,7 +162,7 @@ module SortingHelper
end
def issuable_sort_direction_button(sort_value)
link_class = 'btn btn-default'
link_class = 'btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort'
reverse_sort = issuable_reverse_sort_order_hash[sort_value]
if reverse_sort
......@@ -172,7 +172,7 @@ module SortingHelper
link_class += ' disabled'
end
link_to(reverse_url, type: 'button', class: link_class) do
link_to(reverse_url, type: 'button', class: link_class, title: 'Sort direction') do
icon_suffix =
case sort_value
when sort_value_milestone, sort_value_due_date, /_asc\z/
......
......@@ -146,7 +146,7 @@ module Issuable
sorted =
case method.to_s
when 'downvotes_desc' then order_downvotes_desc
when 'label_priority', 'label_priority_asc' then order_labels_priority(excluded_labels: excluded_labels)
when 'label_priority' then order_labels_priority(excluded_labels: excluded_labels)
when 'label_priority_desc' then order_labels_priority('DESC', excluded_labels: excluded_labels)
when 'milestone', 'milestone_due_asc' then order_milestone_due_asc
when 'milestone_due_desc' then order_milestone_due_desc
......
......@@ -2,7 +2,7 @@
- sort_title = issuable_sort_option_title(sort_value)
- viewing_issues = controller.controller_name == 'issues' || controller.action_name == 'issues'
.dropdown.inline.prepend-left-10
.dropdown.inline.prepend-left-10.issue-sort-dropdown
.btn-group{ role: 'group' }
.btn-group{ role: 'group' }
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' }
......
......@@ -101,7 +101,7 @@ describe 'Sort Issuable List' do
expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title)
find('.issues-other-filters .filter-dropdown-container a[type=button]').click
find('.issues-other-filters .filter-dropdown-container .qa-reverse-sort').click
expect(first_merge_request).to include(first_updated_issuable.title)
expect(last_merge_request).to include(last_updated_issuable.title)
......@@ -204,7 +204,7 @@ describe 'Sort Issuable List' do
expect(first_issue).to include(last_updated_issuable.title)
expect(last_issue).to include(first_updated_issuable.title)
find('.issues-other-filters .filter-dropdown-container a[type=button]').click
find('.issues-other-filters .filter-dropdown-container .qa-reverse-sort').click
expect(first_issue).to include(first_updated_issuable.title)
expect(last_issue).to include(last_updated_issuable.title)
......
......@@ -21,7 +21,7 @@ describe SortingHelper do
describe '#issuable_sort_direction_button' do
before do
allow(self).to receive(:request).and_return(double(path: 'http://test.com'))
allow(self).to receive(:request).and_return(double(path: 'http://test.com', query_parameters: {}))
end
it 'returns icon with sort-highest when sort is created_date' 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