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
ae4968d0
Commit
ae4968d0
authored
Jan 07, 2021
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow removing iterations in Issues::Updateservice
We missed a spot earlier when enabling bulk editing of iterations!
parent
720bd35b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
ee/app/services/ee/issues/base_service.rb
ee/app/services/ee/issues/base_service.rb
+12
-0
ee/app/services/ee/issues/update_service.rb
ee/app/services/ee/issues/update_service.rb
+3
-0
ee/spec/services/ee/issues/update_service_spec.rb
ee/spec/services/ee/issues/update_service_spec.rb
+16
-0
No files found.
ee/app/services/ee/issues/base_service.rb
View file @
ae4968d0
...
...
@@ -74,6 +74,18 @@ module EE
def
epic_param_present?
params
.
key?
(
:epic
)
||
params
.
key?
(
:epic_id
)
end
def
filter_iteration
return
unless
params
[
:sprint_id
]
return
params
[
:sprint_id
]
=
''
if
params
[
:sprint_id
]
==
IssuableFinder
::
Params
::
NONE
groups
=
project
.
group
&
.
self_and_ancestors
&
.
select
(
:id
)
iteration
=
::
Iteration
.
for_projects_and_groups
([
project
.
id
],
groups
).
find_by_id
(
params
[
:sprint_id
])
params
[
:sprint_id
]
=
''
unless
iteration
end
end
end
end
ee/app/services/ee/issues/update_service.rb
View file @
ae4968d0
...
...
@@ -8,7 +8,10 @@ module EE
override
:filter_params
def
filter_params
(
issue
)
params
.
delete
(
:sprint_id
)
unless
can_admin_issuable?
(
issue
)
handle_epic
(
issue
)
filter_iteration
super
end
...
...
ee/spec/services/ee/issues/update_service_spec.rb
View file @
ae4968d0
...
...
@@ -62,6 +62,22 @@ RSpec.describe Issues::UpdateService do
end
end
context
'setting to IssuableFinder::Params::NONE'
do
it
'calls NotificationService#removed_iteration_issue'
do
expect_next_instance_of
(
NotificationService
::
Async
)
do
|
ns
|
expect
(
ns
).
to
receive
(
:removed_iteration_issue
)
end
update_issue
(
sprint_id:
IssuableFinder
::
Params
::
NONE
)
end
it
'removes the iteration properly'
do
update_issue
(
sprint_id:
IssuableFinder
::
Params
::
NONE
)
expect
(
issue
.
reload
.
iteration
).
to
be_nil
end
end
context
'setting to another iteration'
do
it
'calls NotificationService#changed_iteration_issue'
do
expect_next_instance_of
(
NotificationService
::
Async
)
do
|
ns
|
...
...
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