Commit e94587af authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '13254-issue-relative-position-scope-in-group-boards-does-not-include-projects-in-subgroups' into 'master'

Issue relative position scope in group boards does not include projects in subgroups

Closes #13254

See merge request gitlab-org/gitlab!21189
parents bc95a38c 9b30ffe5
...@@ -112,7 +112,7 @@ module EE ...@@ -112,7 +112,7 @@ module EE
def parent_ids def parent_ids
return super unless has_group_boards? return super unless has_group_boards?
board_group.projects.select(:id) board_group.all_projects.select(:id)
end end
def has_group_boards? def has_group_boards?
......
---
title: Include projects in subgroups in group boards relative position
merge_request: 21189
author:
type: fixed
...@@ -239,6 +239,33 @@ describe Boards::Issues::MoveService, services: true do ...@@ -239,6 +239,33 @@ describe Boards::Issues::MoveService, services: true do
it_behaves_like 'moving an issue to/from assignee lists' it_behaves_like 'moving an issue to/from assignee lists'
it_behaves_like 'moving an issue to/from milestone lists' it_behaves_like 'moving an issue to/from milestone lists'
context 'when moving to same list' do
let(:subgroup) { create(:group, parent: group) }
let(:subgroup_project) { create(:project, namespace: subgroup) }
let(:params) { { board_id: board1.id, from_list_id: label_list1.id, to_list_id: label_list1.id } }
let(:issue) { create(:labeled_issue, project: subgroup_project, labels: [bug, development]) }
let(:issue0) { create(:labeled_issue, project: subgroup_project, labels: [bug, development]) }
let(:issue1) { create(:labeled_issue, project: project, labels: [bug, development]) }
let(:issue2) { create(:labeled_issue, project: project, labels: [bug, development]) }
it 'sorts issues included in subgroups' do
reorder_issues(params, issues: [issue, issue0, issue1, issue2])
described_class.new(parent, user, params).execute(issue)
expect(issue.relative_position).to be_between(issue0.relative_position, issue1.relative_position)
end
end
def reorder_issues(params, issues: [])
issues.each do |issue|
issue.move_to_end && issue.save!
end
params.merge!(move_after_id: issues[1].id, move_before_id: issues[2].id)
end
end end
end end
end end
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