Commit c8b7ed14 authored by Coung Ngo's avatar Coung Ngo

Fix group issues list not showing subgroup issues

When:
- The feature flag `vue_issues_list` is enabled
- A group has no issues
- A subgroup of the group has issues
Then the group issues list does not show the subgroup issues.
The expected behaviour is that it does show the subgroup issues,
which this commit fixes.
parent d94c5986
......@@ -212,7 +212,7 @@ class GroupsController < Groups::ApplicationController
def issues
return super if !html_request? || Feature.disabled?(:vue_issues_list, group, default_enabled: :yaml)
@has_issues = IssuesFinder.new(current_user, group_id: group.id).execute
@has_issues = IssuesFinder.new(current_user, group_id: group.id, include_subgroups: true).execute
.non_archived
.exists?
......
......@@ -108,6 +108,22 @@ RSpec.describe 'Group issues page' do
end
end
context 'group with no issues', :js do
let!(:group_with_no_issues) { create(:group) }
let!(:subgroup_with_issues) { create(:group, parent: group_with_no_issues) }
let!(:subgroup_project) { create(:project, :public, group: subgroup_with_issues) }
let!(:subgroup_issue) { create(:issue, project: subgroup_project) }
before do
stub_feature_flags(vue_issues_list: true)
visit issues_group_path(group_with_no_issues)
end
it 'shows issues from subgroups on issues list' do
expect(page).to have_text subgroup_issue.title
end
end
context 'projects with issues disabled' do
describe 'issue dropdown' do
let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
......
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