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

scope_menu.rb « menus « organizations « sidebars « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a535be2128088c21f4e21f1fd006ac3511e65383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true

module Sidebars
  module Organizations
    module Menus
      class ScopeMenu < ::Sidebars::Menu
        override :link
        def link
          organization_path(context.container)
        end

        override :title
        def title
          context.container.name
        end

        override :active_routes
        def active_routes
          { path: 'organizations/organizations#show' }
        end

        override :render?
        def render?
          true
        end

        override :serialize_as_menu_item_args
        def serialize_as_menu_item_args
          super.merge({
            avatar: nil,
            entity_id: context.container.id,
            super_sidebar_parent: ::Sidebars::StaticMenu,
            item_id: :organization_overview
          })
        end
      end
    end
  end
end