diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /lib/sidebars/menu_item.rb | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'lib/sidebars/menu_item.rb')
-rw-r--r-- | lib/sidebars/menu_item.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sidebars/menu_item.rb b/lib/sidebars/menu_item.rb index 7ed3e47ae34..efdedf6c3bd 100644 --- a/lib/sidebars/menu_item.rb +++ b/lib/sidebars/menu_item.rb @@ -4,9 +4,11 @@ module Sidebars class MenuItem include ::Sidebars::Concerns::LinkWithHtmlOptions - attr_reader :title, :link, :active_routes, :item_id, :container_html_options, :sprite_icon, :sprite_icon_html_options, :hint_html_options + attr_reader :title, :link, :active_routes, :item_id, :container_html_options, :sprite_icon, :sprite_icon_html_options, :hint_html_options, :has_pill, :pill_count + alias_method :has_pill?, :has_pill - def initialize(title:, link:, active_routes:, item_id: nil, container_html_options: {}, sprite_icon: nil, sprite_icon_html_options: {}, hint_html_options: {}) + # rubocop: disable Metrics/ParameterLists + def initialize(title:, link:, active_routes:, item_id: nil, container_html_options: {}, sprite_icon: nil, sprite_icon_html_options: {}, hint_html_options: {}, has_pill: false, pill_count: nil) @title = title @link = link @active_routes = active_routes @@ -15,7 +17,10 @@ module Sidebars @sprite_icon = sprite_icon @sprite_icon_html_options = sprite_icon_html_options @hint_html_options = hint_html_options + @has_pill = has_pill + @pill_count = pill_count end + # rubocop: enable Metrics/ParameterLists def show_hint? hint_html_options.present? |