Commit 7cad36d0 authored by Simon Knox's avatar Simon Knox

Merge branch '353899-include-invited-group-members-on-issues-list' into 'master'

Fix invited group members not showing on group/project issues list

See merge request gitlab-org/gitlab!82317
parents 4c3e65b0 856a7d1c
......@@ -3,7 +3,7 @@
query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
groupMembers(search: $search) {
groupMembers(search: $search, relations: [DIRECT, INHERITED, SHARED_FROM_GROUPS]) {
nodes {
id
user {
......@@ -14,7 +14,7 @@ query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false)
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
projectMembers(search: $search) {
projectMembers(search: $search, relations: [DIRECT, INHERITED, INVITED_GROUPS]) {
nodes {
id
user {
......
......@@ -12,14 +12,14 @@ RSpec.describe 'Dropdown assignee', :js do
let(:js_dropdown_assignee) { '#js-dropdown-assignee' }
let(:filter_dropdown) { find("#{js_dropdown_assignee} .filter-dropdown") }
before do
project.add_maintainer(user)
sign_in(user)
describe 'behavior' do
before do
project.add_maintainer(user)
sign_in(user)
visit project_issues_path(project)
end
visit project_issues_path(project)
end
describe 'behavior' do
it 'loads all the assignees when opened' do
input_filtered_search('assignee:=', submit: false, extra_space: false)
......@@ -35,6 +35,11 @@ RSpec.describe 'Dropdown assignee', :js do
describe 'selecting from dropdown without Ajax call' do
before do
project.add_maintainer(user)
sign_in(user)
visit project_issues_path(project)
Gitlab::Testing::RequestBlockerMiddleware.block_requests!
input_filtered_search('assignee:=', submit: false, extra_space: false)
end
......@@ -51,4 +56,60 @@ RSpec.describe 'Dropdown assignee', :js do
expect_filtered_search_input_empty
end
end
context 'assignee suggestions' do
let!(:group) { create(:group) }
let!(:group_project) { create(:project, namespace: group) }
let!(:group_user) { create(:user) }
let!(:subgroup) { create(:group, parent: group) }
let!(:subgroup_project) { create(:project, namespace: subgroup) }
let!(:subgroup_project_issue) { create(:issue, project: subgroup_project) }
let!(:subgroup_user) { create(:user) }
let!(:subsubgroup) { create(:group, parent: subgroup) }
let!(:subsubgroup_project) { create(:project, namespace: subsubgroup) }
let!(:subsubgroup_user) { create(:user) }
let!(:invited_to_group_group) { create(:group) }
let!(:invited_to_group_group_user) { create(:user) }
let!(:invited_to_project_group) { create(:group) }
let!(:invited_to_project_group_user) { create(:user) }
before do
group.add_developer(group_user)
subgroup.add_developer(subgroup_user)
subsubgroup.add_developer(subsubgroup_user)
invited_to_group_group.add_developer(invited_to_group_group_user)
invited_to_project_group.add_developer(invited_to_project_group_user)
create(:group_group_link, shared_group: subgroup, shared_with_group: invited_to_group_group)
create(:project_group_link, project: subgroup_project, group: invited_to_project_group)
sign_in(subgroup_user)
end
it 'shows inherited, direct, and invited group members but not descendent members', :aggregate_failures do
visit issues_group_path(subgroup)
input_filtered_search('assignee:=', submit: false, extra_space: false)
expect(page).to have_text group_user.name
expect(page).to have_text subgroup_user.name
expect(page).to have_text invited_to_group_group_user.name
expect(page).not_to have_text subsubgroup_user.name
expect(page).not_to have_text invited_to_project_group_user.name
visit project_issues_path(subgroup_project)
input_filtered_search('assignee:=', submit: false, extra_space: false)
expect(page).to have_text group_user.name
expect(page).to have_text subgroup_user.name
expect(page).to have_text invited_to_project_group_user.name
expect(page).not_to have_text subsubgroup_user.name
expect(page).not_to have_text invited_to_group_group_user.name
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