diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-21 18:06:14 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-21 22:19:24 +0200 |
commit | 0a11d5e24559d9e22a3e9ab7311646f762a13562 (patch) | |
tree | d737114f2140d04b9e44f71cbbf138a212b0eb35 /app/helpers/labels_helper.rb | |
parent | c8bf9f78f3e481cb7e74384fa45b46b864fa523a (diff) | |
download | gitlab-ce-0a11d5e24559d9e22a3e9ab7311646f762a13562.tar.gz |
Sort labels alphabetically
Sorts labels alphabetically on issues (and merge requests) list.
Before it was order id desc.
Now it will be consistent with sidebar and labels page.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r-- | app/helpers/labels_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 39f661b5f0c..bd53add80ca 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -227,6 +227,10 @@ module LabelsHelper "#{action} at #{level} level" end + def labels_sorted_by_title(labels) + labels.sort_by(&:title) + end + # Required for Banzai::Filter::LabelReferenceFilter module_function :render_colored_label, :text_color_for_bg, :escape_once end |