Commit cbf4ddd8 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '44106-include-subgroups-in-group-activity' into 'master'

Include events from subgroups in group's activity

Closes #44106

See merge request gitlab-org/gitlab-ce!29953
parents 8611291d b5952294
...@@ -201,8 +201,7 @@ class GroupsController < Groups::ApplicationController ...@@ -201,8 +201,7 @@ class GroupsController < Groups::ApplicationController
params[:sort] ||= 'latest_activity_desc' params[:sort] ||= 'latest_activity_desc'
options = {} options = {}
options[:only_owned] = true if params[:shared] == '0' options[:include_subgroups] = true
options[:only_shared] = true if params[:shared] == '1'
@projects = GroupProjectsFinder.new(params: params, group: group, options: options, current_user: current_user) @projects = GroupProjectsFinder.new(params: params, group: group, options: options, current_user: current_user)
.execute .execute
......
---
title: Include events from subgroups in group's activity
merge_request: 29953
author: Fabian Schneider @fabsrc
type: changed
...@@ -125,11 +125,14 @@ describe GroupsController do ...@@ -125,11 +125,14 @@ describe GroupsController do
end end
context 'as json' do context 'as json' do
it 'includes all projects in event feed' do it 'includes all projects from groups and subgroups in event feed' do
3.times do 2.times do
project = create(:project, group: group) project = create(:project, group: group)
create(:event, project: project) create(:event, project: project)
end end
subgroup = create(:group, parent: group)
project = create(:project, group: subgroup)
create(:event, project: project)
get :activity, params: { id: group.to_param }, format: :json get :activity, params: { id: group.to_param }, format: :json
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment