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
249a4ff6
Commit
249a4ff6
authored
Nov 26, 2019
by
Jason Goodman
Committed by
Clement Ho
Nov 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch the Next Page if Bottom of Scroll is Reached
Also test to ensure pages are fetched as the user scrolls.
parent
87507322
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
ee/app/assets/javascripts/environments_dashboard/components/dashboard/dashboard.vue
...environments_dashboard/components/dashboard/dashboard.vue
+4
-0
ee/changelogs/unreleased/add-infinite-scroll.yml
ee/changelogs/unreleased/add-infinite-scroll.yml
+5
-0
ee/spec/frontend/environments_dashboard/components/dashboard_spec.js
...ntend/environments_dashboard/components/dashboard_spec.js
+11
-1
No files found.
ee/app/assets/javascripts/environments_dashboard/components/dashboard/dashboard.vue
View file @
249a4ff6
...
...
@@ -70,6 +70,7 @@ export default {
'
searchCount
'
,
'
searchQuery
'
,
'
messages
'
,
'
pageInfo
'
,
]),
isSearchingProjects
()
{
return
this
.
searchCount
>
0
;
...
...
@@ -90,6 +91,7 @@ export default {
'
fetchSearchResults
'
,
'
addProjectsToDashboard
'
,
'
fetchProjects
'
,
'
fetchNextPage
'
,
'
setProjectEndpoints
'
,
'
clearSearchResults
'
,
'
toggleSelectedProject
'
,
...
...
@@ -135,8 +137,10 @@ export default {
:show-loading-indicator=
"isSearchingProjects"
:show-minimum-search-query-message=
"messages.minimumQuery"
:show-search-error-message=
"messages.searchError"
:total-results=
"pageInfo.totalResults"
@
searched=
"searched"
@
projectClicked=
"projectClicked"
@
bottomReached=
"fetchNextPage"
/>
</gl-modal>
<div
class=
"page-title-holder flex-fill d-flex align-items-center"
>
...
...
ee/changelogs/unreleased/add-infinite-scroll.yml
0 → 100644
View file @
249a4ff6
---
title
:
Fix Infinite Scrolling on Environments Dashboard Project Selector
merge_request
:
20408
author
:
type
:
fixed
ee/spec/frontend/environments_dashboard/components/dashboard_spec.js
View file @
249a4ff6
...
...
@@ -29,6 +29,7 @@ describe('dashboard', () => {
removeProject
:
jest
.
fn
(),
toggleSelectedProject
:
jest
.
fn
(),
fetchNextPage
:
jest
.
fn
(),
fetchProjects
:
jest
.
fn
(),
};
propsData
=
{
addPath
:
'
mock-addPath
'
,
...
...
@@ -42,7 +43,6 @@ describe('dashboard', () => {
localVue
,
store
,
methods
:
{
fetchProjects
:
()
=>
{},
...
actionSpies
,
},
});
...
...
@@ -135,6 +135,16 @@ describe('dashboard', () => {
wrapper
.
find
(
ProjectSelector
).
vm
.
$emit
(
'
projectClicked
'
,
{
name
:
'
test
'
,
id
:
1
});
expect
(
actionSpies
.
toggleSelectedProject
).
toHaveBeenCalledWith
({
name
:
'
test
'
,
id
:
1
});
});
it
(
'
should fetch the next page when bottom is reached
'
,
()
=>
{
wrapper
.
find
(
ProjectSelector
).
vm
.
$emit
(
'
bottomReached
'
);
expect
(
actionSpies
.
fetchNextPage
).
toHaveBeenCalled
();
});
it
(
'
should get the page info from the state
'
,
()
=>
{
store
.
state
.
pageInfo
=
{
totalResults
:
100
};
expect
(
wrapper
.
find
(
ProjectSelector
).
props
(
'
totalResults
'
)).
toBe
(
100
);
});
});
});
});
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