From b5952294cefa52d58f6cb58e88460ca3551cf377 Mon Sep 17 00:00:00 2001 From: Fabian Schneider Date: Mon, 1 Jul 2019 11:17:47 +0000 Subject: Revert "Include subgroups in shared_projects" This reverts commit 4bed2daef935bb4097988e0eff4830fc13a23c37. --- app/controllers/groups_controller.rb | 3 +-- .../unreleased/44106-include-subgroups-in-group-activity.yml | 5 +++++ spec/controllers/groups_controller_spec.rb | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/44106-include-subgroups-in-group-activity.yml diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 316da8f129d..797833e3f91 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -201,8 +201,7 @@ class GroupsController < Groups::ApplicationController params[:sort] ||= 'latest_activity_desc' options = {} - options[:only_owned] = true if params[:shared] == '0' - options[:only_shared] = true if params[:shared] == '1' + options[:include_subgroups] = true @projects = GroupProjectsFinder.new(params: params, group: group, options: options, current_user: current_user) .execute diff --git a/changelogs/unreleased/44106-include-subgroups-in-group-activity.yml b/changelogs/unreleased/44106-include-subgroups-in-group-activity.yml new file mode 100644 index 00000000000..6e78d61ebc4 --- /dev/null +++ b/changelogs/unreleased/44106-include-subgroups-in-group-activity.yml @@ -0,0 +1,5 @@ +--- +title: Include events from subgroups in group's activity +merge_request: 29953 +author: Fabian Schneider @fabsrc +type: changed diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index 47d7e278183..d2faef5b12b 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -125,11 +125,14 @@ describe GroupsController do end context 'as json' do - it 'includes all projects in event feed' do - 3.times do + it 'includes all projects from groups and subgroups in event feed' do + 2.times do project = create(:project, group: group) create(:event, project: project) end + subgroup = create(:group, parent: group) + project = create(:project, group: subgroup) + create(:event, project: project) get :activity, params: { id: group.to_param }, format: :json -- cgit v1.2.1