Skip to content

Commit 70de933

Browse files
Merge pull request #5991 from gooddata/SHA_master
fix: long table is blank on content slide
2 parents 23917aa + a3b787c commit 70de933

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

libs/sdk-ui-dashboard/src/presentation/widget/insight/ViewModeDashboardInsight/Insight/DashboardInsight.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export const DashboardInsight = (props: IDashboardInsightProps): JSX.Element =>
131131

132132
// Loading and rendering
133133
const [isVisualizationLoading, setIsVisualizationLoading] = useState(false);
134+
const [isVisualizationInitializing, setIsVisualizationInitializing] = useState(true);
134135
const [visualizationError, setVisualizationError] = useState<GoodDataSdkError | undefined>();
135136

136137
const { onRequestAsyncRender, onResolveAsyncRender } = useDashboardAsyncRender(objRefToString(ref));
@@ -163,6 +164,7 @@ export const DashboardInsight = (props: IDashboardInsightProps): JSX.Element =>
163164
}
164165
executionsHandler.onLoadingChanged({ isLoading });
165166
setIsVisualizationLoading(isLoading);
167+
setIsVisualizationInitializing(isLoading);
166168
onLoadingChanged?.({ isLoading });
167169
},
168170
[
@@ -276,7 +278,11 @@ export const DashboardInsight = (props: IDashboardInsightProps): JSX.Element =>
276278
// if filter status is success and visualization is loading, render both loading and insight
277279
const loading = filtersStatus === "running" || isVisualizationLoading;
278280

279-
const exportDataVis = useVisualizationExportData(exportData, loading, !!effectiveError);
281+
const exportDataVis = useVisualizationExportData(
282+
exportData,
283+
isVisualizationInitializing,
284+
!!effectiveError,
285+
);
280286

281287
const renderComponent = () => {
282288
if (effectiveError) {

libs/sdk-ui-pivot/src/CorePivotTable.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export class CorePivotTableAgImpl extends React.Component<ICorePivotTableProps,
221221
resized: false,
222222
tempExecution: execution,
223223
isLoading: false,
224+
isFirstRender: false,
224225
};
225226

226227
this.errorMap = newErrorMapping(props.intl);
@@ -631,6 +632,7 @@ export class CorePivotTableAgImpl extends React.Component<ICorePivotTableProps,
631632
}
632633

633634
this.updateStickyRow();
635+
this.onLoadingAndRenderChanged(false, true);
634636
};
635637

636638
private onModelUpdated = () => {
@@ -817,12 +819,18 @@ export class CorePivotTableAgImpl extends React.Component<ICorePivotTableProps,
817819
};
818820

819821
private onLoadingChanged = (loadingState: ILoadingState): void => {
822+
this.onLoadingAndRenderChanged(loadingState.isLoading, this.state.isFirstRender);
823+
};
824+
825+
private onLoadingAndRenderChanged = (isLoading: boolean, isFirstRender: boolean): void => {
820826
const { onLoadingChanged } = this.props;
821827

822828
if (onLoadingChanged) {
823-
onLoadingChanged(loadingState);
829+
onLoadingChanged({
830+
isLoading: isLoading || !isFirstRender,
831+
});
824832

825-
this.setState({ isLoading: loadingState.isLoading });
833+
this.setState({ isLoading, isFirstRender });
826834
}
827835
};
828836

@@ -833,7 +841,7 @@ export class CorePivotTableAgImpl extends React.Component<ICorePivotTableProps,
833841
this.setState({ error: error.getMessage(), readyToRender: true });
834842

835843
// update loading state when an error occurs
836-
this.onLoadingChanged({ isLoading: false });
844+
this.onLoadingAndRenderChanged(false, true);
837845

838846
onExportReady!(createExportErrorFunction(error));
839847

libs/sdk-ui-pivot/src/tableState.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// (C) 2007-2021 GoodData Corporation
1+
// (C) 2007-2025 GoodData Corporation
22
import { ITotal } from "@gooddata/sdk-model";
33
import { IPreparedExecution } from "@gooddata/sdk-backend-spi";
44
import { TableFacadeInitializer } from "./impl/tableFacadeInitializer.js";
@@ -14,6 +14,7 @@ export interface ICorePivotTableState {
1414
resized: boolean;
1515
tempExecution: IPreparedExecution;
1616
isLoading: boolean;
17+
isFirstRender: boolean;
1718
error?: string;
1819
}
1920

0 commit comments

Comments
 (0)