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
c922b846
Commit
c922b846
authored
Apr 13, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only increase the page number for boards when we need to
Closes #30902
parent
d7a52716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+4
-5
spec/javascripts/boards/list_spec.js
spec/javascripts/boards/list_spec.js
+40
-0
No files found.
app/assets/javascripts/boards/models/list.js
View file @
c922b846
...
...
@@ -58,7 +58,9 @@ class List {
nextPage
()
{
if
(
this
.
issuesSize
>
this
.
issues
.
length
)
{
this
.
page
+=
1
;
if
(
this
.
issues
.
length
/
20
>=
1
)
{
this
.
page
+=
1
;
}
return
this
.
getIssues
(
false
);
}
...
...
@@ -145,10 +147,7 @@ class List {
}
updateIssueLabel
(
issue
,
listFrom
,
moveBeforeIid
,
moveAfterIid
)
{
gl
.
boardService
.
moveIssue
(
issue
.
id
,
listFrom
.
id
,
this
.
id
,
moveBeforeIid
,
moveAfterIid
)
.
then
(()
=>
{
listFrom
.
getIssues
(
false
);
});
gl
.
boardService
.
moveIssue
(
issue
.
id
,
listFrom
.
id
,
this
.
id
,
moveBeforeIid
,
moveAfterIid
);
}
findIssue
(
id
)
{
...
...
spec/javascripts/boards/list_spec.js
View file @
c922b846
...
...
@@ -107,4 +107,44 @@ describe('List model', () => {
expect
(
gl
.
boardService
.
moveIssue
)
.
toHaveBeenCalledWith
(
issue
.
id
,
list
.
id
,
listDup
.
id
,
undefined
,
undefined
);
});
describe
(
'
page number
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
list
,
'
getIssues
'
);
});
it
(
'
increase page number if current issue count is more than the page size
'
,
()
=>
{
for
(
let
i
=
0
;
i
<
30
;
i
+=
1
)
{
list
.
issues
.
push
(
new
ListIssue
({
title
:
'
Testing
'
,
iid
:
_
.
random
(
10000
)
+
i
,
confidential
:
false
,
labels
:
[
list
.
label
]
}));
}
list
.
issuesSize
=
50
;
expect
(
list
.
issues
.
length
).
toBe
(
30
);
list
.
nextPage
();
expect
(
list
.
page
).
toBe
(
2
);
expect
(
list
.
getIssues
).
toHaveBeenCalled
();
});
it
(
'
does not increase page number if issue count is less than the page size
'
,
()
=>
{
list
.
issues
.
push
(
new
ListIssue
({
title
:
'
Testing
'
,
iid
:
_
.
random
(
10000
),
confidential
:
false
,
labels
:
[
list
.
label
]
}));
list
.
issuesSize
=
2
;
list
.
nextPage
();
expect
(
list
.
page
).
toBe
(
1
);
expect
(
list
.
getIssues
).
toHaveBeenCalled
();
});
});
});
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