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
ec76102b
Commit
ec76102b
authored
Jul 04, 2019
by
Eugenia Grieff
Committed by
Thong Kuah
Jul 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save epic without touching when reordering
parent
b0c6ede1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
ee/app/services/epic_links/update_service.rb
ee/app/services/epic_links/update_service.rb
+1
-1
ee/changelogs/unreleased/12459-do-not-update-updated_at-on-an-epic-when-reordering-it.yml
...o-not-update-updated_at-on-an-epic-when-reordering-it.yml
+5
-0
ee/spec/services/epic_links/update_service_spec.rb
ee/spec/services/epic_links/update_service_spec.rb
+22
-0
No files found.
ee/app/services/epic_links/update_service.rb
View file @
ec76102b
...
...
@@ -27,7 +27,7 @@ module EpicLinks
after_epic
=
Epic
.
in_parents
(
epic
.
parent_id
).
find
(
params
[
:move_after_id
])
if
params
[
:move_after_id
]
epic
.
move_between
(
before_epic
,
after_epic
)
epic
.
save!
epic
.
save!
(
touch:
false
)
end
end
end
ee/changelogs/unreleased/12459-do-not-update-updated_at-on-an-epic-when-reordering-it.yml
0 → 100644
View file @
ec76102b
---
title
:
Change epics reordering to not update timestamps
merge_request
:
14441
author
:
type
:
changed
ee/spec/services/epic_links/update_service_spec.rb
View file @
ec76102b
...
...
@@ -23,6 +23,22 @@ describe EpicLinks::UpdateService do
end
describe
'#execute'
do
shared_examples
'updating timestamps'
do
it
'does not update moved epic'
do
updated_at
=
epic_to_move
.
updated_at
subject
expect
(
epic_to_move
.
reload
.
updated_at
.
change
(
usec:
0
)).
to
eq
(
updated_at
.
change
(
usec:
0
))
end
it
'does not update parent epic'
do
updated_at
=
parent_epic
.
updated_at
subject
expect
(
parent_epic
.
reload
.
updated_at
.
change
(
usec:
0
)).
to
eq
(
updated_at
.
change
(
usec:
0
))
end
end
context
'when params are nil'
do
let
(
:params
)
{
{
move_before_id:
nil
,
move_after_id:
nil
}
}
...
...
@@ -35,6 +51,8 @@ describe EpicLinks::UpdateService do
context
'when moving to start'
do
let
(
:params
)
{
{
move_before_id:
nil
,
move_after_id:
child_epic1
.
id
}
}
it_behaves_like
'updating timestamps'
it
'reorders child epics'
do
expect
(
subject
).
to
include
(
status: :success
)
expect
(
ordered_epics
).
to
eq
([
child_epic3
,
child_epic1
,
child_epic2
,
child_epic4
])
...
...
@@ -44,6 +62,8 @@ describe EpicLinks::UpdateService do
context
'when moving to end'
do
let
(
:params
)
{
{
move_before_id:
child_epic4
.
id
,
move_after_id:
nil
}
}
it_behaves_like
'updating timestamps'
it
'reorders child epics'
do
expect
(
subject
).
to
include
(
status: :success
)
expect
(
ordered_epics
).
to
eq
([
child_epic1
,
child_epic2
,
child_epic4
,
child_epic3
])
...
...
@@ -53,6 +73,8 @@ describe EpicLinks::UpdateService do
context
'when moving between siblings'
do
let
(
:params
)
{
{
move_before_id:
child_epic1
.
id
,
move_after_id:
child_epic2
.
id
}
}
it_behaves_like
'updating timestamps'
it
'reorders child epics'
do
expect
(
subject
).
to
include
(
status: :success
)
expect
(
ordered_epics
).
to
eq
([
child_epic1
,
child_epic3
,
child_epic2
,
child_epic4
])
...
...
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