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
423d98d7
Commit
423d98d7
authored
Apr 18, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-boards-count-not-updating' into 'master'
Only increase the page number for boards when we need to Closes #30902 See merge request !10684
parents
f390be8a
4a129ece
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
5 deletions
+46
-5
list.js
app/assets/javascripts/boards/models/list.js
+6
-5
list_spec.js
spec/javascripts/boards/list_spec.js
+40
-0
No files found.
app/assets/javascripts/boards/models/list.js
View file @
423d98d7
...
...
@@ -3,6 +3,8 @@
/* global ListLabel */
import
queryData
from
'../utils/query_data'
;
const
PER_PAGE
=
20
;
class
List
{
constructor
(
obj
)
{
this
.
id
=
obj
.
id
;
...
...
@@ -58,7 +60,9 @@ class List {
nextPage
()
{
if
(
this
.
issuesSize
>
this
.
issues
.
length
)
{
this
.
page
+=
1
;
if
(
this
.
issues
.
length
/
PER_PAGE
>=
1
)
{
this
.
page
+=
1
;
}
return
this
.
getIssues
(
false
);
}
...
...
@@ -145,10 +149,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 @
423d98d7
...
...
@@ -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