diff options
Diffstat (limited to 'app/helpers/groups_helper.rb')
-rw-r--r-- | app/helpers/groups_helper.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 9d152416b2e..bb92792de2d 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -134,6 +134,13 @@ module GroupsHelper @group_projects_sort || @sort || params[:sort] || sort_value_recently_created end + def subgroup_creation_data(group) + { + parent_group_name: group.parent&.name, + import_existing_group_path: new_group_path(parent_id: group.parent_id, anchor: 'import-group-pane') + } + end + def verification_for_group_creation_data # overridden in EE {} @@ -144,11 +151,9 @@ module GroupsHelper false end - def group_name_and_path_app_data(group) - parent = group.parent - + def group_name_and_path_app_data { - base_path: URI.join(root_url, parent&.full_path || "").to_s, + base_path: root_url, mattermost_enabled: Gitlab.config.mattermost.enabled.to_s } end @@ -156,7 +161,7 @@ module GroupsHelper def subgroups_and_projects_list_app_data(group) { show_schema_markup: 'true', - new_subgroup_path: new_group_path(parent_id: group.id), + new_subgroup_path: new_group_path(parent_id: group.id, anchor: 'create-group-pane'), new_project_path: new_project_path(namespace_id: group.id), new_subgroup_illustration: image_path('illustrations/subgroup-create-new-sm.svg'), new_project_illustration: image_path('illustrations/project-create-new-sm.svg'), @@ -182,7 +187,7 @@ module GroupsHelper def group_title_link(group, hidable: false, show_avatar: false, for_dropdown: false) link_to(group_path(group), class: "group-path #{'breadcrumb-item-text' unless for_dropdown} js-breadcrumb-item-text #{'hidable' if hidable}") do - icon = group_icon(group, class: "avatar-tile", width: 15, height: 15) if (group.try(:avatar_url) || show_avatar) && !Rails.env.test? + icon = group_icon(group, alt: group.name, class: "avatar-tile", width: 15, height: 15) if group.try(:avatar_url) || show_avatar [icon, simple_sanitize(group.name)].join.html_safe end end |