BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
list.js
app/assets/javascripts/boards/models/list.js
+4
-5
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