Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-04-04 16:34:55 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2019-04-04 20:34:14 +0300
commitf88607923afd5a2adfb7a28df297528cbb27885b (patch)
tree3415bd1d40ae6bd92c37ac434473c2066dea5f2e /app/helpers/labels_helper.rb
parentfec2e27f1dcbb806247d6f78ebae628622c02d52 (diff)
Fix scoped_labels feature check
Check this feature per project/group instead of globally. Also do not show tooltip if it's disabled.
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r--app/helpers/labels_helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index 5f78219cebb..16f2e51136a 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -89,7 +89,7 @@ module LabelsHelper
def render_colored_label(label, label_suffix: '', tooltip: true, title: nil)
text_color = text_color_for_bg(label.color)
- title ||= label_tooltip_title(label)
+ title ||= tooltip ? label_tooltip_title(label) : ''
# Intentionally not using content_tag here so that this method can be called
# by LabelReferenceFilter
@@ -270,6 +270,12 @@ module LabelsHelper
})
end
+ def label_from_hash(hash)
+ klass = hash[:group_id] ? GroupLabel : ProjectLabel
+
+ klass.new(hash.slice(:color, :description, :title, :group_id, :project_id))
+ end
+
# Required for Banzai::Filter::LabelReferenceFilter
module_function :render_colored_label, :text_color_for_bg, :escape_once, :label_tooltip_title
end