Commit 633c462a authored by Simon Knox's avatar Simon Knox

Include subgroup issues in iteration issue list

Include subgroups for group queries of both
issue list and summaries
parent 8cc902d9
...@@ -16,6 +16,7 @@ query IterationIssues( ...@@ -16,6 +16,7 @@ query IterationIssues(
after: $afterCursor after: $afterCursor
first: $firstPageSize first: $firstPageSize
last: $lastPageSize last: $lastPageSize
includeSubgroups: true
) { ) {
...IterationIssues ...IterationIssues
} }
......
query IterationIssuesSummary($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) { query IterationIssuesSummary($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) {
group(fullPath: $fullPath) @include(if: $isGroup) { group(fullPath: $fullPath) @include(if: $isGroup) {
openIssues: issues(iterationId: [$id], state: opened, assigneeId: "none") { openIssues: issues(
iterationId: [$id]
state: opened
assigneeId: "none"
includeSubgroups: true
) {
count count
} }
assignedIssues: issues(iterationId: [$id], state: opened, assigneeId: "any") { assignedIssues: issues(
iterationId: [$id]
state: opened
assigneeId: "any"
includeSubgroups: true
) {
count count
} }
closedIssues: issues(iterationId: [$id], state: closed) { closedIssues: issues(iterationId: [$id], state: closed, includeSubgroups: true) {
count count
} }
} }
......
---
title: Include subgroup issues in iteration issue list
merge_request: 40099
author:
type: added
...@@ -5,14 +5,17 @@ require 'spec_helper' ...@@ -5,14 +5,17 @@ require 'spec_helper'
RSpec.describe 'User views iteration' do RSpec.describe 'User views iteration' do
let_it_be(:now) { Time.now } let_it_be(:now) { Time.now }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:sub_group) { create(:group, :private, parent: group) }
let_it_be(:project) { create(:project, group: group) } let_it_be(:project) { create(:project, group: group) }
let_it_be(:project_2) { create(:project, group: group) } let_it_be(:sub_project) { create(:project, group: sub_group) }
let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group).user } let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group).user }
let_it_be(:iteration) { create(:iteration, :skip_future_date_validation, iid: 1, id: 2, group: group, title: 'Correct Iteration', start_date: now - 1.day, due_date: now) } let_it_be(:iteration) { create(:iteration, :skip_future_date_validation, iid: 1, id: 2, group: group, title: 'Correct Iteration', start_date: now - 1.day, due_date: now) }
let_it_be(:other_iteration) { create(:iteration, :skip_future_date_validation, iid: 2, id: 1, group: group, title: 'Wrong Iteration', start_date: now - 4.days, due_date: now - 3.days) } let_it_be(:other_iteration) { create(:iteration, :skip_future_date_validation, iid: 2, id: 1, group: group, title: 'Wrong Iteration', start_date: now - 4.days, due_date: now - 3.days) }
let_it_be(:sub_group_iteration) { create(:iteration, id: 3, group: sub_group) }
let_it_be(:issue) { create(:issue, project: project, iteration: iteration) } let_it_be(:issue) { create(:issue, project: project, iteration: iteration) }
let_it_be(:assigned_issue) { create(:issue, project: project_2, iteration: iteration, assignees: [user]) } let_it_be(:assigned_issue) { create(:issue, project: project, iteration: iteration, assignees: [user]) }
let_it_be(:closed_issue) { create(:closed_issue, project: project, iteration: iteration) } let_it_be(:closed_issue) { create(:closed_issue, project: project, iteration: iteration) }
let_it_be(:sub_group_issue) { create(:issue, project: sub_project, iteration: iteration) }
let_it_be(:other_issue) { create(:issue, project: project, iteration: other_iteration) } let_it_be(:other_issue) { create(:issue, project: project, iteration: other_iteration) }
context 'with license' do context 'with license' do
...@@ -23,7 +26,7 @@ RSpec.describe 'User views iteration' do ...@@ -23,7 +26,7 @@ RSpec.describe 'User views iteration' do
context 'view an iteration', :js do context 'view an iteration', :js do
before do before do
visit group_iteration_path(iteration.group, iteration.iid) visit group_iteration_path(group, iteration.iid)
end end
it 'shows iteration info and dates' do it 'shows iteration info and dates' do
...@@ -34,8 +37,8 @@ RSpec.describe 'User views iteration' do ...@@ -34,8 +37,8 @@ RSpec.describe 'User views iteration' do
end end
it 'shows correct summary information' do it 'shows correct summary information' do
expect(page).to have_content("Complete 33%") expect(page).to have_content("Complete 25%")
expect(page).to have_content("Open 1") expect(page).to have_content("Open 2")
expect(page).to have_content("In progress 1") expect(page).to have_content("In progress 1")
expect(page).to have_content("Completed 1") expect(page).to have_content("Completed 1")
end end
...@@ -44,6 +47,7 @@ RSpec.describe 'User views iteration' do ...@@ -44,6 +47,7 @@ RSpec.describe 'User views iteration' do
expect(page).to have_content(issue.title) expect(page).to have_content(issue.title)
expect(page).to have_content(assigned_issue.title) expect(page).to have_content(assigned_issue.title)
expect(page).to have_content(closed_issue.title) expect(page).to have_content(closed_issue.title)
expect(page).to have_content(sub_group_issue.title)
expect(page).not_to have_content(other_issue.title) expect(page).not_to have_content(other_issue.title)
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