diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-27 14:23:50 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-27 14:23:50 +0300 |
commit | 81852d1f902c2923c239e9c33cab77f5fd6ca8d8 (patch) | |
tree | b2e882af0c3f673483f1e12517e6bb3f7f11b31f /app/helpers | |
parent | 60503057bcf357bef82e3e61072d2a2646f62279 (diff) | |
parent | 868cb4307f93b2f8fa0d25d9e47e632d0855881e (diff) |
Merge branch '43510-merge-requests-and-issues-don-t-show-for-all-subgroups' into 'master'
Resolve "Merge requests and issues don't show for all subgroups"
Closes #43510
See merge request gitlab-org/gitlab-ce!17312
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/groups_helper.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 5fbaa17c40e..7910de73c52 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -19,6 +19,20 @@ module GroupsHelper can?(current_user, :change_share_with_group_lock, group) end + def group_issues_count(state:) + IssuesFinder + .new(current_user, group_id: @group.id, state: state, non_archived: true, include_subgroups: true) + .execute + .count + end + + def group_merge_requests_count(state:) + MergeRequestsFinder + .new(current_user, group_id: @group.id, state: state, non_archived: true, include_subgroups: true) + .execute + .count + end + def group_icon(group, options = {}) img_path = group_icon_url(group, options) image_tag img_path, options @@ -77,10 +91,6 @@ module GroupsHelper end end - def group_issues(group) - IssuesFinder.new(current_user, group_id: group.id).execute - end - def remove_group_message(group) _("You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?") % { group_name: group.name } |