Commit f9115ff5 authored by Jan Beckmann's avatar Jan Beckmann Committed by Thong Kuah

Fix override of sort_direction_icon in ee sorting_helper

Fixes a special case for sorting by weight, closes #37067
parent d47b3cd0
......@@ -55,10 +55,10 @@ module EE
}.merge(super)
end
override :issuable_sort_icon_suffix
def issuable_sort_icon_suffix(sort_value)
override :sort_direction_icon
def sort_direction_icon(sort_value)
if sort_value == sort_value_weight
'lowest'
'sort-lowest'
else
super
end
......
---
title: Fix sort icon direction when sorting by weight
merge_request: 21447
author: Jan Beckmann
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe SortingHelper do
describe '#sort_direction_icon' do
it 'returns lowest for weight' do
expect(sort_direction_icon('weight')).to eq('sort-lowest')
end
it 'behaves like non-ee for other sort values' do
expect(sort_direction_icon('milestone')).to eq('sort-lowest')
expect(sort_direction_icon('last_joined')).to eq('sort-highest')
end
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