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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# 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_new_app_data
{
organizations_path: organizations_path,
root_url: root_url
}.to_json
end
def organization_settings_general_app_data(organization)
{
organization: organization.slice(:id, :name, :path),
organizations_path: organizations_path,
root_url: root_url
}.to_json
end
def organization_groups_and_projects_app_data
shared_groups_and_projects_app_data.to_json
end
def organization_index_app_data
{
new_organization_url: new_organization_path,
organizations_empty_state_svg_path: image_path('illustrations/empty-state/empty-organizations-md.svg')
}
end
def organization_user_app_data(organization)
{
organization_gid: organization.to_global_id
}
end
def home_organization_setting_app_data
{
# TODO: use real setting - https://gitlab.com/gitlab-org/gitlab/-/issues/428668
initial_selection: 1
}.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
|