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
12900923
Commit
12900923
authored
Sep 07, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creating issue in milestone list
Review feedback
parent
e7b3a118
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
23 deletions
+25
-23
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+4
-2
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+5
-0
ee/app/assets/javascripts/boards/constants.js
ee/app/assets/javascripts/boards/constants.js
+1
-0
ee/spec/features/boards/new_issue_spec.rb
ee/spec/features/boards/new_issue_spec.rb
+15
-21
No files found.
app/assets/javascripts/boards/boards_util.js
View file @
12900923
import
{
sortBy
,
cloneDeep
}
from
'
lodash
'
;
import
{
sortBy
,
cloneDeep
}
from
'
lodash
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
ListType
}
from
'
./constants
'
;
import
{
ListType
,
MilestoneIDs
}
from
'
./constants
'
;
export
function
getMilestone
()
{
export
function
getMilestone
()
{
return
null
;
return
null
;
...
@@ -109,7 +109,9 @@ export function formatIssueInput(issueInput, boardConfig) {
...
@@ -109,7 +109,9 @@ export function formatIssueInput(issueInput, boardConfig) {
return
{
return
{
...
issueInput
,
...
issueInput
,
milestoneId
:
milestoneId
:
milestoneId
&&
milestoneId
!==
-
1
?
fullMilestoneId
(
milestoneId
)
:
issueInput
.
milestoneId
,
milestoneId
&&
milestoneId
!==
MilestoneIDs
.
ANY
?
fullMilestoneId
(
milestoneId
)
:
issueInput
?.
milestoneId
,
labelIds
:
[...
labelIds
,
...(
labels
?.
map
((
l
)
=>
fullLabelId
(
l
))
||
[])],
labelIds
:
[...
labelIds
,
...(
labels
?.
map
((
l
)
=>
fullLabelId
(
l
))
||
[])],
assigneeIds
:
[...
assigneeIds
,
...(
assigneeId
?
[
fullUserId
(
assigneeId
)]
:
[])],
assigneeIds
:
[...
assigneeIds
,
...(
assigneeId
?
[
fullUserId
(
assigneeId
)]
:
[])],
};
};
...
...
app/assets/javascripts/boards/constants.js
View file @
12900923
...
@@ -119,6 +119,11 @@ export const DraggableItemTypes = {
...
@@ -119,6 +119,11 @@ export const DraggableItemTypes = {
list
:
'
list
'
,
list
:
'
list
'
,
};
};
export
const
MilestoneIDs
=
{
NONE
:
0
,
ANY
:
-
1
,
};
export
default
{
export
default
{
BoardType
,
BoardType
,
ListType
,
ListType
,
...
...
ee/app/assets/javascripts/boards/constants.js
View file @
12900923
...
@@ -53,6 +53,7 @@ export const MilestoneFilterType = {
...
@@ -53,6 +53,7 @@ export const MilestoneFilterType = {
export
const
MilestoneIDs
=
{
export
const
MilestoneIDs
=
{
NONE
:
0
,
NONE
:
0
,
ANY
:
-
1
,
};
};
export
const
ANY_MILESTONE
=
{
export
const
ANY_MILESTONE
=
{
...
...
ee/spec/features/boards/new_issue_spec.rb
View file @
12900923
...
@@ -28,17 +28,7 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -28,17 +28,7 @@ RSpec.describe 'Issue Boards new issue', :js do
end
end
it
'successfully assigns weight to newly-created issue'
do
it
'successfully assigns weight to newly-created issue'
do
page
.
within
(
first
(
'.board'
))
do
create_issue_in_board_list
(
0
)
find
(
'.issue-count-badge-add-button'
).
click
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
fill_in
'issue_title'
,
with:
'new issue'
click_button
'Create issue'
end
wait_for_requests
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.board-card'
).
click
find
(
'.board-card'
).
click
...
@@ -58,16 +48,7 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -58,16 +48,7 @@ RSpec.describe 'Issue Boards new issue', :js do
describe
'milestone list'
do
describe
'milestone list'
do
it
'successfuly loads milestone to be added to newly created issue'
do
it
'successfuly loads milestone to be added to newly created issue'
do
page
.
within
(
all
(
'.board'
)[
1
])
do
create_issue_in_board_list
(
1
)
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
find
(
'.form-control'
).
set
(
'new issue'
)
click_button
'Create issue'
end
wait_for_requests
page
.
within
(
all
(
'.board'
)[
1
])
do
page
.
within
(
all
(
'.board'
)[
1
])
do
find
(
'.board-card'
).
click
find
(
'.board-card'
).
click
...
@@ -83,4 +64,17 @@ RSpec.describe 'Issue Boards new issue', :js do
...
@@ -83,4 +64,17 @@ RSpec.describe 'Issue Boards new issue', :js do
end
end
end
end
end
end
def
create_issue_in_board_list
(
list_index
)
page
.
within
(
all
(
'.board'
)[
list_index
])
do
click_button
'New issue'
end
page
.
within
(
first
(
'.board-new-issue-form'
))
do
find
(
'.form-control'
).
set
(
'new issue'
)
click_button
'Create issue'
end
wait_for_requests
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