Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a0e99f27
Commit
a0e99f27
authored
May 14, 2021
by
Eulyeon Ko
Committed by
Olena Horal-Koretska
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List all projects when creating issues in group boards [RUN-AS-IF-FOSS]
parent
0289efc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
34 deletions
+66
-34
app/assets/javascripts/boards/graphql/group_projects.query.graphql
...s/javascripts/boards/graphql/group_projects.query.graphql
+1
-1
ee/changelogs/unreleased/330568-create-new-issue-dropdown-doesn-t-show-projects-from-sub-group-.yml
...-issue-dropdown-doesn-t-show-projects-from-sub-group-.yml
+5
-0
spec/features/boards/new_issue_spec.rb
spec/features/boards/new_issue_spec.rb
+60
-33
No files found.
app/assets/javascripts/boards/graphql/group_projects.query.graphql
View file @
a0e99f27
...
...
@@ -2,7 +2,7 @@
query
getGroupProjects
(
$fullPath
:
ID
!,
$search
:
String
,
$after
:
String
)
{
group
(
fullPath
:
$fullPath
)
{
projects
(
search
:
$search
,
after
:
$after
,
first
:
100
)
{
projects
(
search
:
$search
,
after
:
$after
,
first
:
100
,
includeSubgroups
:
true
)
{
nodes
{
id
name
...
...
ee/changelogs/unreleased/330568-create-new-issue-dropdown-doesn-t-show-projects-from-sub-group-.yml
0 → 100644
View file @
a0e99f27
---
title
:
Display descendant projects of a group when creating issues in epic swimlanes
merge_request
:
61456
author
:
type
:
fixed
spec/features/boards/new_issue_spec.rb
View file @
a0e99f27
...
...
@@ -10,6 +10,9 @@ RSpec.describe 'Issue Boards new issue', :js do
let_it_be
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:board_list_header
)
{
first
(
'[data-testid="board-list-header"]'
)
}
let
(
:project_select_dropdown
)
{
find
(
'[data-testid="project-select-dropdown"]'
)
}
context
'authorized user'
do
before
do
project
.
add_maintainer
(
user
)
...
...
@@ -24,18 +27,18 @@ RSpec.describe 'Issue Boards new issue', :js do
end
it
'displays new issue button'
do
expect
(
first
(
'.board'
)).
to
have_
selector
(
'.issue-count-badge-add-button
'
,
count:
1
)
expect
(
first
(
'.board'
)).
to
have_
button
(
'New issue
'
,
count:
1
)
end
it
'does not display new issue button in closed list'
do
page
.
within
(
'.board:nth-child(3)'
)
do
expect
(
page
).
not_to
have_
selector
(
'.issue-count-badge-add-button
'
)
expect
(
page
).
not_to
have_
button
(
'New issue
'
)
end
end
it
'shows form when clicking button'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.issue-count-badge-add-button'
).
click
click_button
'New issue'
expect
(
page
).
to
have_selector
(
'.board-new-issue-form'
)
end
...
...
@@ -43,7 +46,7 @@ RSpec.describe 'Issue Boards new issue', :js do
it
'hides form when clicking cancel'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.issue-count-badge-add-button'
).
click
click_button
'New issue'
expect
(
page
).
to
have_selector
(
'.board-new-issue-form'
)
...
...
@@ -55,7 +58,7 @@ RSpec.describe 'Issue Boards new issue', :js do
it
'creates new issue'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.issue-count-badge-add-button'
).
click
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
...
...
@@ -80,7 +83,7 @@ RSpec.describe 'Issue Boards new issue', :js do
# TODO https://gitlab.com/gitlab-org/gitlab/-/issues/323446
xit
'shows sidebar when creating new issue'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.issue-count-badge-add-button'
).
click
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
...
...
@@ -95,7 +98,7 @@ RSpec.describe 'Issue Boards new issue', :js do
it
'successfuly loads labels to be added to newly created issue'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.issue-count-badge-add-button'
).
click
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
...
...
@@ -109,12 +112,12 @@ RSpec.describe 'Issue Boards new issue', :js do
find
(
'.board-card'
).
click
end
page
.
within
(
first
(
'[data-testid="issue-boards-sidebar"]'
)
)
do
find
(
'.labels [data-testid="edit-button"]'
).
click
page
.
within
(
'[data-testid="sidebar-labels"]'
)
do
click_button
'Edit'
wait_for_requests
expect
(
page
).
to
have_
selector
(
'.labels-select-contents-list .dropdown-content li a'
)
expect
(
page
).
to
have_
content
'Label 1'
end
end
end
...
...
@@ -126,70 +129,94 @@ RSpec.describe 'Issue Boards new issue', :js do
end
it
'displays new issue button in open list'
do
expect
(
first
(
'.board'
)).
to
have_
selector
(
'.issue-count-badge-add-button
'
,
count:
1
)
expect
(
first
(
'.board'
)).
to
have_
button
(
'New issue
'
,
count:
1
)
end
it
'does not display new issue button in label list'
do
page
.
within
(
'.board:nth-child(2)'
)
do
expect
(
page
).
not_to
have_
selector
(
'.issue-count-badge-add-button
'
)
expect
(
page
).
not_to
have_
button
(
'New issue
'
)
end
end
end
context
'group boards'
do
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
,
name:
"root project"
)
}
let_it_be
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:subproject1
)
{
create
(
:project
,
group:
subgroup
,
name:
"sub project1"
)
}
let_it_be
(
:subproject2
)
{
create
(
:project
,
group:
subgroup
,
name:
"sub project2"
)
}
let_it_be
(
:group_board
)
{
create
(
:board
,
group:
group
)
}
let_it_be
(
:project_label
)
{
create
(
:label
,
project:
project
,
name:
'label'
)
}
let_it_be
(
:list
)
{
create
(
:list
,
board:
group_board
,
label:
project_label
,
position:
0
)
}
context
'for unauthorized users'
do
context
'when backlog does not exist'
do
before
do
sign_in
(
user
)
visit
group_board_path
(
group
,
group_board
)
wait_for_requests
end
before
do
visit
group_board_path
(
group
,
group_board
)
wait_for_requests
end
context
'when backlog does not exist'
do
it
'does not display new issue button in label list'
do
page
.
within
(
'.board.is-draggable'
)
do
expect
(
page
).
not_to
have_
selector
(
'.issue-count-badge-add-button
'
)
expect
(
page
).
not_to
have_
button
(
'New issue
'
)
end
end
end
context
'when backlog list already exists'
do
let!
(
:backlog_list
)
{
create
(
:backlog_list
,
board:
group_board
)
}
before
do
sign_in
(
user
)
visit
group_board_path
(
group
,
group_board
)
wait_for_requests
end
let_it_be
(
:backlog_list
)
{
create
(
:backlog_list
,
board:
group_board
)
}
it
'displays new issue button in open list'
do
expect
(
first
(
'.board'
)).
to
have_
selector
(
'.issue-count-badge-add-button
'
,
count:
1
)
expect
(
first
(
'.board'
)).
to
have_
button
(
'New issue
'
,
count:
1
)
end
it
'does not display new issue button in label list'
do
page
.
within
(
'.board.is-draggable'
)
do
expect
(
page
).
not_to
have_
selector
(
'.issue-count-badge-add-button
'
)
expect
(
page
).
not_to
have_
button
(
'New issue
'
)
end
end
end
end
context
'for authorized users'
do
it
'display new issue button in label list'
do
project
=
create
(
:project
,
namespace:
group
)
before
do
project
.
add_reporter
(
user
)
subproject1
.
add_reporter
(
user
)
sign_in
(
user
)
visit
group_board_path
(
group
,
group_board
)
wait_for_requests
end
context
'when backlog does not exist'
do
it
'display new issue button in label list'
do
expect
(
board_list_header
).
to
have_button
(
'New issue'
)
end
end
context
'project select dropdown'
do
let_it_be
(
:backlog_list
)
{
create
(
:backlog_list
,
board:
group_board
)
}
before
do
page
.
within
(
board_list_header
)
do
click_button
'New issue'
end
project_select_dropdown
.
click
wait_for_requests
end
it
'lists a project which is a direct descendant of the top-level group'
do
expect
(
project_select_dropdown
).
to
have_button
(
"root project"
)
end
it
'lists a project that belongs to a subgroup'
do
expect
(
project_select_dropdown
).
to
have_button
(
"sub project1"
)
end
page
.
within
(
'.board.is-draggable'
)
do
expect
(
p
age
).
to
have_selector
(
'.issue-count-badge-add-button'
)
it
"does not list projects to which user doesn't have access"
do
expect
(
p
roject_select_dropdown
).
not_to
have_button
(
"sub project2"
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment