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
7075970b
Commit
7075970b
authored
Nov 12, 2019
by
Florie Guibert
Committed by
Natalia Tepluhina
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix loading all issues when board list is collapsed
parent
e345f835
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
172 additions
and
105 deletions
+172
-105
app/assets/javascripts/boards/components/board_list.vue
app/assets/javascripts/boards/components/board_list.vue
+2
-1
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+2
-2
changelogs/unreleased/26207-issue-board-loading-infinite-if-closing-the-closed-row.yml
...ssue-board-loading-infinite-if-closing-the-closed-row.yml
+5
-0
lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
...i/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
+1
-1
spec/javascripts/boards/board_list_common_spec.js
spec/javascripts/boards/board_list_common_spec.js
+10
-3
spec/javascripts/boards/board_list_spec.js
spec/javascripts/boards/board_list_spec.js
+152
-98
No files found.
app/assets/javascripts/boards/components/board_list.vue
View file @
7075970b
...
...
@@ -84,7 +84,8 @@ export default {
this
.
$nextTick
(()
=>
{
if
(
this
.
scrollHeight
()
<=
this
.
listHeight
()
&&
this
.
list
.
issuesSize
>
this
.
list
.
issues
.
length
this
.
list
.
issuesSize
>
this
.
list
.
issues
.
length
&&
this
.
list
.
isExpanded
)
{
this
.
list
.
page
+=
1
;
this
.
list
.
getIssues
(
false
).
catch
(()
=>
{
...
...
app/assets/javascripts/boards/models/list.js
View file @
7075970b
...
...
@@ -50,8 +50,8 @@ class List {
this
.
page
=
1
;
this
.
loading
=
true
;
this
.
loadingMore
=
false
;
this
.
issues
=
[];
this
.
issuesSize
=
0
;
this
.
issues
=
obj
.
issues
||
[];
this
.
issuesSize
=
obj
.
issuesSize
?
obj
.
issuesSize
:
0
;
this
.
defaultAvatar
=
defaultAvatar
;
if
(
obj
.
label
)
{
...
...
changelogs/unreleased/26207-issue-board-loading-infinite-if-closing-the-closed-row.yml
0 → 100644
View file @
7075970b
---
title
:
Fix closed board list loading issue
merge_request
:
author
:
type
:
fixed
lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
View file @
7075970b
spec/javascripts/boards/board_list_common_spec.js
View file @
7075970b
...
...
@@ -15,7 +15,12 @@ import boardsStore from '~/boards/stores/boards_store';
window
.
Sortable
=
Sortable
;
export
default
function
createComponent
({
done
,
listIssueProps
=
{},
componentProps
=
{}
})
{
export
default
function
createComponent
({
done
,
listIssueProps
=
{},
componentProps
=
{},
listProps
=
{},
})
{
const
el
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
el
);
...
...
@@ -25,7 +30,7 @@ export default function createComponent({ done, listIssueProps = {}, componentPr
boardsStore
.
create
();
const
BoardListComp
=
Vue
.
extend
(
BoardList
);
const
list
=
new
List
(
listObj
);
const
list
=
new
List
(
{
...
listObj
,
...
listProps
}
);
const
issue
=
new
ListIssue
({
title
:
'
Testing
'
,
id
:
1
,
...
...
@@ -35,7 +40,9 @@ export default function createComponent({ done, listIssueProps = {}, componentPr
assignees
:
[],
...
listIssueProps
,
});
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
listProps
,
'
issuesSize
'
))
{
list
.
issuesSize
=
1
;
}
list
.
issues
.
push
(
issue
);
const
component
=
new
BoardListComp
({
...
...
spec/javascripts/boards/board_list_spec.js
View file @
7075970b
/* global List */
import
Vue
from
'
vue
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
createComponent
from
'
./board_list_common_spec
'
;
import
waitForPromises
from
'
../helpers/wait_for_promises
'
;
import
'
~/boards/models/list
'
;
describe
(
'
Board list component
'
,
()
=>
{
let
mock
;
let
component
;
let
getIssues
;
function
generateIssues
(
compWrapper
)
{
for
(
let
i
=
1
;
i
<
20
;
i
+=
1
)
{
const
issue
=
Object
.
assign
({},
compWrapper
.
list
.
issues
[
0
]);
issue
.
id
+=
i
;
compWrapper
.
list
.
issues
.
push
(
issue
);
}
}
describe
(
'
When Expanded
'
,
()
=>
{
beforeEach
(
done
=>
{
getIssues
=
spyOn
(
List
.
prototype
,
'
getIssues
'
).
and
.
returnValue
(
new
Promise
(()
=>
{}));
({
mock
,
component
}
=
createComponent
({
done
}));
});
afterEach
(()
=>
{
mock
.
restore
();
component
.
$destroy
();
});
it
(
'
loads first page of issues
'
,
done
=>
{
waitForPromises
()
.
then
(()
=>
{
expect
(
getIssues
).
toHaveBeenCalled
();
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
renders component
'
,
()
=>
{
...
...
@@ -114,25 +139,21 @@ describe('Board list component', () => {
spyOn
(
component
.
list
,
'
nextPage
'
);
component
.
$refs
.
list
.
style
.
height
=
'
100px
'
;
component
.
$refs
.
list
.
style
.
overflow
=
'
scroll
'
;
for
(
let
i
=
1
;
i
<
20
;
i
+=
1
)
{
const
issue
=
Object
.
assign
({},
component
.
list
.
issues
[
0
]);
issue
.
id
+=
i
;
component
.
list
.
issues
.
push
(
issue
);
}
generateIssues
(
component
);
Vue
.
nextTick
(()
=>
{
component
.
$refs
.
list
.
scrollTop
=
20000
;
setTimeout
(()
=>
{
waitForPromises
()
.
then
(()
=>
{
expect
(
component
.
list
.
nextPage
).
toHaveBeenCalled
();
done
();
}
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
does not load issues if already loading
'
,
()
=>
{
it
(
'
does not load issues if already loading
'
,
done
=>
{
component
.
list
.
nextPage
=
spyOn
(
component
.
list
,
'
nextPage
'
).
and
.
returnValue
(
new
Promise
(()
=>
{}),
);
...
...
@@ -140,7 +161,12 @@ describe('Board list component', () => {
component
.
onScroll
();
component
.
onScroll
();
waitForPromises
()
.
then
(()
=>
{
expect
(
component
.
list
.
nextPage
).
toHaveBeenCalledTimes
(
1
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
shows loading more spinner
'
,
done
=>
{
...
...
@@ -153,4 +179,32 @@ describe('Board list component', () => {
done
();
});
});
});
describe
(
'
When Collapsed
'
,
()
=>
{
beforeEach
(
done
=>
{
getIssues
=
spyOn
(
List
.
prototype
,
'
getIssues
'
).
and
.
returnValue
(
new
Promise
(()
=>
{}));
({
mock
,
component
}
=
createComponent
({
done
,
listProps
:
{
type
:
'
closed
'
,
collapsed
:
true
,
issuesSize
:
50
},
}));
generateIssues
(
component
);
component
.
scrollHeight
=
spyOn
(
component
,
'
scrollHeight
'
).
and
.
returnValue
(
0
);
});
afterEach
(()
=>
{
mock
.
restore
();
component
.
$destroy
();
});
it
(
'
does not load all issues
'
,
done
=>
{
waitForPromises
()
.
then
(()
=>
{
// Initial getIssues from list constructor
expect
(
getIssues
).
toHaveBeenCalledTimes
(
1
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
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