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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
a0108c69
Commit
a0108c69
authored
Mar 07, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments
parent
710e4df9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
app/services/issues/update_service.rb
app/services/issues/update_service.rb
+2
-2
spec/models/concerns/relative_positioning_spec.rb
spec/models/concerns/relative_positioning_spec.rb
+1
-9
spec/services/boards/issues/move_service_spec.rb
spec/services/boards/issues/move_service_spec.rb
+1
-1
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+2
-2
No files found.
app/services/issues/update_service.rb
View file @
a0108c69
...
...
@@ -58,9 +58,9 @@ module Issues
end
def
handle_move_between_iids
(
issue
)
return
unless
move_between_iids
=
params
.
delete
(
:move_between_iids
)
return
unless
params
[
:move_between_iids
]
after_iid
,
before_iid
=
move_between_iids
after_iid
,
before_iid
=
params
.
delete
(
:move_between_iids
)
issue_before
=
get_issue_if_allowed
(
issue
.
project
,
before_iid
)
if
before_iid
issue_after
=
get_issue_if_allowed
(
issue
.
project
,
after_iid
)
if
after_iid
...
...
spec/models/concerns/relative_positioning_spec.rb
View file @
a0108c69
...
...
@@ -4,6 +4,7 @@ describe Issue, 'RelativePositioning' do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue1
)
{
create
(
:issue
,
project:
project
)
}
let
(
:new_issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
[
issue
,
issue1
].
each
do
|
issue
|
...
...
@@ -36,8 +37,6 @@ describe Issue, 'RelativePositioning' do
describe
'#move_to_end'
do
it
'moves issue to the end'
do
new_issue
=
create
:issue
,
project:
project
new_issue
.
move_to_end
expect
(
new_issue
.
relative_position
).
to
be
>
issue1
.
relative_position
...
...
@@ -46,8 +45,6 @@ describe Issue, 'RelativePositioning' do
describe
'#move_between'
do
it
'positions issue between two other'
do
new_issue
=
create
:issue
,
project:
project
new_issue
.
move_between
(
issue
,
issue1
)
expect
(
new_issue
.
relative_position
).
to
be
>
issue
.
relative_position
...
...
@@ -55,23 +52,18 @@ describe Issue, 'RelativePositioning' do
end
it
'positions issue between on top'
do
new_issue
=
create
:issue
,
project:
project
new_issue
.
move_between
(
nil
,
issue
)
expect
(
new_issue
.
relative_position
).
to
be
<
issue
.
relative_position
end
it
'positions issue between to end'
do
new_issue
=
create
:issue
,
project:
project
new_issue
.
move_between
(
issue1
,
nil
)
expect
(
new_issue
.
relative_position
).
to
be
>
issue1
.
relative_position
end
it
'positions issues even when after and before positions are the same'
do
new_issue
=
create
:issue
,
project:
project
issue1
.
update
relative_position:
issue
.
relative_position
new_issue
.
move_between
(
issue
,
issue1
)
...
...
spec/services/boards/issues/move_service_spec.rb
View file @
a0108c69
...
...
@@ -98,7 +98,7 @@ describe Boards::Issues::MoveService, services: true do
issue
.
move_between!
(
issue1
,
issue2
)
params
.
merge!
move_after_iid:
issue
.
iid
,
move_before_iid:
issue2
.
iid
params
.
merge!
(
move_after_iid:
issue
.
iid
,
move_before_iid:
issue2
.
iid
)
described_class
.
new
(
project
,
user
,
params
).
execute
(
issue1
)
...
...
spec/services/issues/update_service_spec.rb
View file @
a0108c69
...
...
@@ -59,8 +59,8 @@ describe Issues::UpdateService, services: true do
end
it
'sorts issues as specified by parameters'
do
issue1
=
create
:issue
,
project:
project
,
assignee_id:
user3
.
id
issue2
=
create
:issue
,
project:
project
,
assignee_id:
user3
.
id
issue1
=
create
(
:issue
,
project:
project
,
assignee_id:
user3
.
id
)
issue2
=
create
(
:issue
,
project:
project
,
assignee_id:
user3
.
id
)
[
issue
,
issue1
,
issue2
].
each
do
|
issue
|
issue
.
move_to_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