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
60c2beab
Commit
60c2beab
authored
Jul 15, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix create issue with scope
Fix adding milestone from board scope when creating a new issue on board
parent
bd7f09e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+1
-1
spec/frontend/boards/boards_util_spec.js
spec/frontend/boards/boards_util_spec.js
+32
-1
No files found.
app/assets/javascripts/boards/boards_util.js
View file @
60c2beab
...
...
@@ -107,8 +107,8 @@ export function formatIssueInput(issueInput, boardConfig) {
const
{
labels
,
assigneeId
,
milestoneId
}
=
boardConfig
;
return
{
milestoneId
:
milestoneId
?
fullMilestoneId
(
milestoneId
)
:
null
,
...
issueInput
,
milestoneId
:
milestoneId
?
fullMilestoneId
(
milestoneId
)
:
null
,
labelIds
:
[...
labelIds
,
...(
labels
?.
map
((
l
)
=>
fullLabelId
(
l
))
||
[])],
assigneeIds
:
[...
assigneeIds
,
...(
assigneeId
?
[
fullUserId
(
assigneeId
)]
:
[])],
};
...
...
spec/frontend/boards/boards_util_spec.js
View file @
60c2beab
import
{
filterVariables
}
from
'
~/boards/boards_util
'
;
import
{
formatIssueInput
,
filterVariables
}
from
'
~/boards/boards_util
'
;
describe
(
'
formatIssueInput
'
,
()
=>
{
it
(
'
correctly merges boardConfig into the issue
'
,
()
=>
{
const
boardConfig
=
{
labels
:
[
{
type
:
'
GroupLabel
'
,
id
:
44
,
},
],
assigneeId
:
'
55
'
,
milestoneId
:
66
,
weight
:
1
,
};
const
issueInput
=
{
labelIds
:
[
'
gid://gitlab/GroupLabel/5
'
],
projectPath
:
'
gitlab-org/gitlab-test
'
,
id
:
'
gid://gitlab/Issue/11
'
,
};
const
result
=
formatIssueInput
(
issueInput
,
boardConfig
);
expect
(
result
).
toEqual
({
projectPath
:
'
gitlab-org/gitlab-test
'
,
id
:
'
gid://gitlab/Issue/11
'
,
labelIds
:
[
'
gid://gitlab/GroupLabel/5
'
,
'
gid://gitlab/GroupLabel/44
'
],
assigneeIds
:
[
'
gid://gitlab/User/55
'
],
milestoneId
:
'
gid://gitlab/Milestone/66
'
,
});
});
});
describe
(
'
filterVariables
'
,
()
=>
{
it
.
each
([
...
...
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