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:
Diffstat (limited to 'lib/sidebars/projects/menus/labels_menu.rb')
-rw-r--r--lib/sidebars/projects/menus/labels_menu.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/sidebars/projects/menus/labels_menu.rb b/lib/sidebars/projects/menus/labels_menu.rb
new file mode 100644
index 00000000000..12cf0444994
--- /dev/null
+++ b/lib/sidebars/projects/menus/labels_menu.rb
@@ -0,0 +1,50 @@
+# frozen_string_literal: true
+
+module Sidebars
+ module Projects
+ module Menus
+ class LabelsMenu < ::Sidebars::Menu
+ override :link
+ def link
+ project_labels_path(context.project)
+ end
+
+ override :extra_container_html_options
+ def extra_container_html_options
+ {
+ class: 'shortcuts-labels'
+ }
+ end
+
+ override :title
+ def title
+ _('Labels')
+ end
+
+ override :title_html_options
+ def title_html_options
+ {
+ id: 'js-onboarding-labels-link'
+ }
+ end
+
+ override :active_routes
+ def active_routes
+ { controller: :labels }
+ end
+
+ override :sprite_icon
+ def sprite_icon
+ 'label'
+ end
+
+ override :render?
+ def render?
+ return false if Feature.enabled?(:sidebar_refactor, context.current_user)
+
+ can?(context.current_user, :read_label, context.project) && !context.project.issues_enabled?
+ end
+ end
+ end
+ end
+end