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
ebb8e3a6
Commit
ebb8e3a6
authored
Sep 11, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass ignoring as an optional argument to `ItemContext`
parent
20eb0ab8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
lib/gitlab/relative_positioning/item_context.rb
lib/gitlab/relative_positioning/item_context.rb
+5
-6
lib/gitlab/relative_positioning/mover.rb
lib/gitlab/relative_positioning/mover.rb
+1
-3
No files found.
lib/gitlab/relative_positioning/item_context.rb
View file @
ebb8e3a6
...
...
@@ -11,10 +11,11 @@ module Gitlab
attr_reader
:object
,
:model_class
,
:range
attr_accessor
:ignoring
def
initialize
(
object
,
range
)
def
initialize
(
object
,
range
,
ignoring:
nil
)
@object
=
object
@range
=
range
@model_class
=
object
.
class
@ignoring
=
ignoring
end
def
min_relative_position
...
...
@@ -75,9 +76,7 @@ module Gitlab
def
neighbour
(
item
)
return
unless
item
.
present?
n
=
self
.
class
.
new
(
item
,
range
)
n
.
ignoring
=
ignoring
n
self
.
class
.
new
(
item
,
range
,
ignoring:
ignoring
)
end
def
scoped_items
...
...
@@ -111,7 +110,7 @@ module Gitlab
.
order
(
Gitlab
::
Database
.
nulls_last_order
(
'relative_position'
,
'DESC'
))
.
first
self
.
class
.
new
(
sib
,
range
)
neighbour
(
sib
)
end
def
min_sibling
...
...
@@ -119,7 +118,7 @@ module Gitlab
.
order
(
Gitlab
::
Database
.
nulls_last_order
(
'relative_position'
,
'ASC'
))
.
first
self
.
class
.
new
(
sib
,
range
)
neighbour
(
sib
)
end
def
shift_left
...
...
lib/gitlab/relative_positioning/mover.rb
View file @
ebb8e3a6
...
...
@@ -50,9 +50,7 @@ module Gitlab
def
context
(
object
,
ignoring:
nil
)
return
unless
object
c
=
ItemContext
.
new
(
object
,
range
)
c
.
ignoring
=
ignoring
c
ItemContext
.
new
(
object
,
range
,
ignoring:
ignoring
)
end
private
...
...
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