Skip to content

Commit 3fa5f99

Browse files
committed
feature: add data loading
1 parent e3bf21d commit 3fa5f99

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/dashboard/Data/Browser/Browser.react.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import generatePath from 'lib/generatePath';
4242
import { withRouter } from 'lib/withRouter';
4343
import { get } from 'lib/AJAX';
4444
import BrowserFooter from './BrowserFooter.react';
45+
import LoaderDots from 'components/LoaderDots/LoaderDots.react';
4546

4647
// The initial and max amount of rows fetched by lazy loading
4748
const BROWSER_LAST_LOCATION = 'brower_last_location';
@@ -898,6 +899,10 @@ class Browser extends DashboardView {
898899

899900
async fetchParseData(source, filters) {
900901
const { useMasterKey, skip, limit } = this.state;
902+
this.setLoading(true);
903+
this.setState({
904+
data: null,
905+
})
901906
const query = await queryFromFilters(source, filters);
902907
const sortDir = this.state.ordering[0] === '-' ? '-' : '+';
903908
const field = this.state.ordering.substr(sortDir === '-' ? 1 : 0);
@@ -927,6 +932,8 @@ class Browser extends DashboardView {
927932
this.setState({ isUnique, uniqueField });
928933

929934
const data = await promise;
935+
936+
this.setLoading(false);
930937
return data;
931938
}
932939

@@ -2089,6 +2096,7 @@ class Browser extends DashboardView {
20892096
classwiseCloudFunctions={this.state.classwiseCloudFunctions}
20902097
callCloudFunction={this.fetchAggregationPanelData}
20912098
isLoadingCloudFunction={this.state.isLoading}
2099+
isLoading={this.state.isLoading}
20922100
setLoading={this.setLoading}
20932101
AggregationPanelData={this.state.AggregationPanelData}
20942102
setAggregationPanelData={this.setAggregationPanelData}

src/dashboard/Data/Browser/BrowserTable.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export default class BrowserTable extends React.Component {
560560
onResize={this.props.handleResize}
561561
onAddColumn={this.props.onAddColumn}
562562
preventSchemaEdits={this.context.preventSchemaEdits}
563-
isDataLoaded={!!this.props.data}
563+
isDataLoaded={!this.props.isLoading}
564564
setSelectedObjectId={this.props.setSelectedObjectId}
565565
setCurrent={this.props.setCurrent}
566566
/>

0 commit comments

Comments
 (0)