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

organization_helper.rb « organizations « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b5c4342c5cfcc00331974cebf09577af1ea5e7b (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
# frozen_string_literal: true

module Organizations
  module OrganizationHelper
    def organization_show_app_data(organization)
      {
        organization: organization.slice(:id, :name),
        groups_and_projects_organization_path: groups_and_projects_organization_path(organization),
        # TODO: Update counts to use real data
        # https://gitlab.com/gitlab-org/gitlab/-/issues/424531
        association_counts: {
          groups: 10,
          projects: 5,
          users: 1050
        }
      }.merge(shared_groups_and_projects_app_data).to_json
    end

    def organization_groups_and_projects_app_data
      shared_groups_and_projects_app_data.to_json
    end

    private

    def shared_groups_and_projects_app_data
      {
        projects_empty_state_svg_path: image_path('illustrations/empty-state/empty-projects-md.svg'),
        groups_empty_state_svg_path: image_path('illustrations/empty-state/empty-groups-md.svg'),
        new_group_path: new_group_path,
        new_project_path: new_project_path
      }
    end
  end
end