Commit 21d3a17f authored by Sean McGivern's avatar Sean McGivern

Merge branch '27366-supergroup-milestone-not-showing-in-subgroup-board-issue-list' into 'master'

Fix group filter bar not showing milestones from ancestor groups

See merge request gitlab-org/gitlab!23038
parents d13fb4ea 452afad1
...@@ -119,7 +119,9 @@ class Groups::MilestonesController < Groups::ApplicationController ...@@ -119,7 +119,9 @@ class Groups::MilestonesController < Groups::ApplicationController
end end
def search_params def search_params
params.permit(:state, :search_title).merge(group_ids: group.id) groups = request.format.json? ? group.self_and_ancestors.select(:id) : group.id
params.permit(:state, :search_title).merge(group_ids: groups)
end end
end end
......
---
title: Fix group issue list and group issue board filters not showing ancestor group
milestones
merge_request: 23038
author:
type: fixed
...@@ -148,6 +148,19 @@ describe Groups::MilestonesController do ...@@ -148,6 +148,19 @@ describe Groups::MilestonesController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
context 'for a subgroup' do
let(:subgroup) { create(:group, parent: group) }
it 'includes ancestor group milestones' do
get :index, params: { group_id: subgroup.to_param }, format: :json
milestones = json_response
expect(milestones.count).to eq(1)
expect(milestones.first['title']).to eq('group milestone')
end
end
end end
context 'external authorization' do context 'external authorization' do
......
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