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
86c794ea
Commit
86c794ea
authored
May 26, 2021
by
Natalia Tepluhina
Committed by
Simon Knox
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Faster loading of issue lists
Reduce page size to 10 when loading issues on GraphQL boards
parent
4b489b16
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
26 deletions
+12
-26
app/assets/javascripts/boards/components/board_list.vue
app/assets/javascripts/boards/components/board_list.vue
+10
-18
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+1
-1
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+1
-1
spec/frontend/boards/board_list_spec.js
spec/frontend/boards/board_list_spec.js
+0
-6
No files found.
app/assets/javascripts/boards/components/board_list.vue
View file @
86c794ea
<
script
>
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlIntersectionObserver
}
from
'
@gitlab/ui
'
;
import
Draggable
from
'
vuedraggable
'
;
import
Draggable
from
'
vuedraggable
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
sortableStart
,
sortableEnd
}
from
'
~/boards/mixins/sortable_default_options
'
;
import
{
sortableStart
,
sortableEnd
}
from
'
~/boards/mixins/sortable_default_options
'
;
...
@@ -21,6 +21,7 @@ export default {
...
@@ -21,6 +21,7 @@ export default {
BoardCard
,
BoardCard
,
BoardNewIssue
,
BoardNewIssue
,
GlLoadingIcon
,
GlLoadingIcon
,
GlIntersectionObserver
,
},
},
props
:
{
props
:
{
disabled
:
{
disabled
:
{
...
@@ -65,7 +66,7 @@ export default {
...
@@ -65,7 +66,7 @@ export default {
return
this
.
list
.
maxIssueCount
>
0
&&
this
.
listItemsCount
>
this
.
list
.
maxIssueCount
;
return
this
.
list
.
maxIssueCount
>
0
&&
this
.
listItemsCount
>
this
.
list
.
maxIssueCount
;
},
},
hasNextPage
()
{
hasNextPage
()
{
return
this
.
pageInfoByListId
[
this
.
list
.
id
].
hasNextPage
;
return
this
.
pageInfoByListId
[
this
.
list
.
id
]
?
.
hasNextPage
;
},
},
loading
()
{
loading
()
{
return
this
.
listsFlags
[
this
.
list
.
id
]?.
isLoading
;
return
this
.
listsFlags
[
this
.
list
.
id
]?.
isLoading
;
...
@@ -115,14 +116,9 @@ export default {
...
@@ -115,14 +116,9 @@ export default {
eventHub
.
$on
(
`toggle-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$on
(
`toggle-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$on
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
eventHub
.
$on
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
},
},
mounted
()
{
// Scroll event on list to load more
this
.
listRef
.
addEventListener
(
'
scroll
'
,
this
.
onScroll
);
},
beforeDestroy
()
{
beforeDestroy
()
{
eventHub
.
$off
(
`toggle-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$off
(
`toggle-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$off
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
eventHub
.
$off
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
this
.
listRef
.
removeEventListener
(
'
scroll
'
,
this
.
onScroll
);
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
fetchItemsForList
'
,
'
moveItem
'
]),
...
mapActions
([
'
fetchItemsForList
'
,
'
moveItem
'
]),
...
@@ -144,16 +140,10 @@ export default {
...
@@ -144,16 +140,10 @@ export default {
toggleForm
()
{
toggleForm
()
{
this
.
showIssueForm
=
!
this
.
showIssueForm
;
this
.
showIssueForm
=
!
this
.
showIssueForm
;
},
},
onScroll
()
{
onReachingListBottom
()
{
window
.
requestAnimationFrame
(()
=>
{
if
(
!
this
.
loadingMore
&&
this
.
hasNextPage
)
{
if
(
this
.
loadNextPage
();
!
this
.
loadingMore
&&
}
this
.
scrollTop
()
>
this
.
scrollHeight
()
-
this
.
scrollOffset
&&
this
.
hasNextPage
)
{
this
.
loadNextPage
();
}
});
},
},
handleDragOnStart
()
{
handleDragOnStart
()
{
sortableStart
();
sortableStart
();
...
@@ -249,7 +239,9 @@ export default {
...
@@ -249,7 +239,9 @@ export default {
data-testid=
"count-loading-icon"
data-testid=
"count-loading-icon"
/>
/>
<span
v-if=
"showingAllItems"
>
{{
showingAllItemsText
}}
</span>
<span
v-if=
"showingAllItems"
>
{{
showingAllItemsText
}}
</span>
<span
v-else
>
{{
paginatedIssueText
}}
</span>
<gl-intersection-observer
v-else
@
update=
"onReachingListBottom"
>
<span>
{{
paginatedIssueText
}}
</span>
</gl-intersection-observer>
</li>
</li>
</component>
</component>
</div>
</div>
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
86c794ea
...
@@ -298,7 +298,7 @@ export default {
...
@@ -298,7 +298,7 @@ export default {
filters
:
filterParams
,
filters
:
filterParams
,
isGroup
:
boardType
===
BoardType
.
group
,
isGroup
:
boardType
===
BoardType
.
group
,
isProject
:
boardType
===
BoardType
.
project
,
isProject
:
boardType
===
BoardType
.
project
,
first
:
2
0
,
first
:
1
0
,
after
:
fetchNext
?
state
.
pageInfoByListId
[
listId
].
endCursor
:
undefined
,
after
:
fetchNext
?
state
.
pageInfoByListId
[
listId
].
endCursor
:
undefined
,
};
};
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
86c794ea
...
@@ -284,7 +284,7 @@ export default {
...
@@ -284,7 +284,7 @@ export default {
?
{
...
filterParams
,
epicWildcardId
:
EpicFilterType
.
none
.
toUpperCase
()
}
?
{
...
filterParams
,
epicWildcardId
:
EpicFilterType
.
none
.
toUpperCase
()
}
:
{
...
filterParams
,
epicId
},
:
{
...
filterParams
,
epicId
},
after
:
fetchNext
?
state
.
pageInfoByListId
[
listId
].
endCursor
:
undefined
,
after
:
fetchNext
?
state
.
pageInfoByListId
[
listId
].
endCursor
:
undefined
,
first
:
forSwimlanes
?
undefined
:
2
0
,
first
:
forSwimlanes
?
undefined
:
1
0
,
};
};
if
(
getters
.
isEpicBoard
)
{
if
(
getters
.
isEpicBoard
)
{
...
...
spec/frontend/boards/board_list_spec.js
View file @
86c794ea
...
@@ -181,12 +181,6 @@ describe('Board list component', () => {
...
@@ -181,12 +181,6 @@ describe('Board list component', () => {
});
});
});
});
it
(
'
loads more issues after scrolling
'
,
()
=>
{
wrapper
.
vm
.
listRef
.
dispatchEvent
(
new
Event
(
'
scroll
'
));
expect
(
actions
.
fetchItemsForList
).
toHaveBeenCalled
();
});
it
(
'
does not load issues if already loading
'
,
()
=>
{
it
(
'
does not load issues if already loading
'
,
()
=>
{
wrapper
=
createComponent
({
wrapper
=
createComponent
({
state
:
{
listsFlags
:
{
'
gid://gitlab/List/1
'
:
{
isLoadingMore
:
true
}
}
},
state
:
{
listsFlags
:
{
'
gid://gitlab/List/1
'
:
{
isLoadingMore
:
true
}
}
},
...
...
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