Skip to content

fix: Data loading indicator not showing when using pagination #2768

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

Merged
merged 2 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,10 @@ class Browser extends DashboardView {

async fetchParseData(source, filters) {
const { useMasterKey, skip, limit } = this.state;
this.setLoading(true);
this.setState({
data: null,
})
const query = await queryFromFilters(source, filters);
const sortDir = this.state.ordering[0] === '-' ? '-' : '+';
const field = this.state.ordering.substr(sortDir === '-' ? 1 : 0);
Expand Down Expand Up @@ -927,6 +931,8 @@ class Browser extends DashboardView {
this.setState({ isUnique, uniqueField });

const data = await promise;

this.setLoading(false);
return data;
}

Expand Down Expand Up @@ -2089,6 +2095,7 @@ class Browser extends DashboardView {
classwiseCloudFunctions={this.state.classwiseCloudFunctions}
callCloudFunction={this.fetchAggregationPanelData}
isLoadingCloudFunction={this.state.isLoading}
isLoading={this.state.isLoading}
setLoading={this.setLoading}
AggregationPanelData={this.state.AggregationPanelData}
setAggregationPanelData={this.setAggregationPanelData}
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/BrowserTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export default class BrowserTable extends React.Component {
onResize={this.props.handleResize}
onAddColumn={this.props.onAddColumn}
preventSchemaEdits={this.context.preventSchemaEdits}
isDataLoaded={!!this.props.data}
isDataLoaded={!this.props.isLoading}
setSelectedObjectId={this.props.setSelectedObjectId}
setCurrent={this.props.setCurrent}
/>
Expand Down
Loading