-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolving some issues around rendering pagination loading on resource list pages #12884
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -415,10 +415,7 @@ export default { | |
background-color: var(--sortable-table-header-bg); | ||
color: var(--body-text); | ||
text-align: left; | ||
|
||
&:not(.loading) { | ||
border-bottom: 1px solid var(--sortable-table-top-divider); | ||
} | ||
border-bottom: 1px solid var(--sortable-table-top-divider); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We get a flicker without a border momentarily if we keep the .loading negation. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,8 +374,10 @@ export default { | |
eventualSearchQuery = this.$route.query?.q; | ||
} | ||
|
||
const isLoading = this.loading || false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes loading has a value and that's what we should initiate our state with. |
||
|
||
return { | ||
refreshButtonPhase: ASYNC_BUTTON_STATES.WAITING, | ||
refreshButtonPhase: isLoading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION, | ||
expanded: {}, | ||
searchQuery, | ||
eventualSearchQuery, | ||
|
@@ -386,7 +388,7 @@ export default { | |
/** | ||
* The is the bool the DOM uses to show loading state. it's proxied from `loading` to avoid blipping the indicator (see usages) | ||
*/ | ||
isLoading: false, | ||
isLoading | ||
}; | ||
}, | ||
|
||
|
@@ -512,7 +514,7 @@ export default { | |
}, | ||
|
||
created() { | ||
this.debouncedRefreshTableData = debounce(this.refreshTableData, 500); | ||
this.debouncedRefreshTableData = debounce(this.refreshTableData, 500, { leading: true }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This forces us to trigger at the beginning of the timer instead of the end which makes the visual for loading appear sooner. |
||
this.debouncedPaginationChanged = debounce(this.paginationChanged, 50); | ||
}, | ||
|
||
|
@@ -530,9 +532,6 @@ export default { | |
manualRefreshLoadingFinished() { | ||
const res = !!(!this.isLoading && this._didinit && this.rows?.length && !this.isManualRefreshLoading); | ||
|
||
// Always ensure the Refresh button phase aligns with loading state (regardless of if manualRefreshLoadingFinished has changed or not) | ||
this.refreshButtonPhase = !res || this.loading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION; | ||
|
||
Comment on lines
-534
to
-535
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would cause the refresh button to get stuck on page load and refreshButtonPhase expects a phase value not a boolean true or false value. You'll also notice that we have a manualRefreshLoadingFinished watcher which updates the phase as well so it seems safe to remove. |
||
return res; | ||
}, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really only want alt-loading to happen on manual refresh and when changing pages. It seemed easiest to base this on whether or not it was the first load or not.