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
8811692c
Commit
8811692c
authored
Sep 14, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make using assign and unassign quick actions together work as expected
parent
40074568
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
app/services/quick_actions/interpret_service.rb
app/services/quick_actions/interpret_service.rb
+12
-16
changelogs/unreleased/dm-fix-assign-unassign-quick-actions.yml
...elogs/unreleased/dm-fix-assign-unassign-quick-actions.yml
+6
-0
No files found.
app/services/quick_actions/interpret_service.rb
View file @
8811692c
...
...
@@ -126,18 +126,16 @@ module QuickActions
parse_params
do
|
assignee_param
|
extract_users
(
assignee_param
)
end
# rubocop: disable CodeReuse/ActiveRecord
command
:assign
do
|
users
|
next
if
users
.
empty?
@updates
[
:assignee_ids
]
=
if
issuable
.
allows_multiple_assignees?
issuable
.
assignees
.
pluck
(
:id
)
+
users
.
map
(
&
:id
)
@updates
[
:assignee_ids
]
||=
issuable
.
assignees
.
map
(
&
:id
)
@updates
[
:assignee_ids
]
+=
users
.
map
(
&
:id
)
else
[
users
.
first
.
id
]
@updates
[
:assignee_ids
]
=
[
users
.
first
.
id
]
end
end
# rubocop: enable CodeReuse/ActiveRecord
desc
do
if
issuable
.
allows_multiple_assignees?
...
...
@@ -164,16 +162,14 @@ module QuickActions
# When multiple users are assigned, all will be unassigned if multiple assignees are no longer allowed
extract_users
(
unassign_param
)
if
issuable
.
allows_multiple_assignees?
end
# rubocop: disable CodeReuse/ActiveRecord
command
:unassign
do
|
users
=
nil
|
@updates
[
:assignee_ids
]
=
if
users
&
.
any?
issuable
.
assignees
.
pluck
(
:id
)
-
users
.
map
(
&
:id
)
if
issuable
.
allows_multiple_assignees?
&&
users
&
.
any?
@updates
[
:assignee_ids
]
||=
issuable
.
assignees
.
map
(
&
:id
)
@updates
[
:assignee_ids
]
-=
users
.
map
(
&
:id
)
else
[]
@updates
[
:assignee_ids
]
=
[]
end
end
# rubocop: enable CodeReuse/ActiveRecord
desc
'Set milestone'
explanation
do
|
milestone
|
...
...
changelogs/unreleased/dm-fix-assign-unassign-quick-actions.yml
0 → 100644
View file @
8811692c
---
title
:
Don't ignore first action when assign and unassign quick actions are used in
the same comment
merge_request
:
21749
author
:
type
:
fixed
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