mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 06:26:00 +08:00
refactor: updated loading state in gridgraphlayout (#3313)
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
86b725757c
commit
1fc0461c0f
@ -101,7 +101,7 @@ function GridCardGraph({
|
|||||||
|
|
||||||
const isEmptyLayout = widget?.id === 'empty' || isEmpty(widget);
|
const isEmptyLayout = widget?.id === 'empty' || isEmpty(widget);
|
||||||
|
|
||||||
if (queryResponse.isRefetching) {
|
if (queryResponse.isRefetching || queryResponse.isLoading) {
|
||||||
return <Spinner height="20vh" tip="Loading..." />;
|
return <Spinner height="20vh" tip="Loading..." />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,27 +127,23 @@ function GridCardGraph({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queryResponse.status === 'loading' || queryResponse.status === 'idle') {
|
if (!isEmpty(widget) && prevChartDataSetRef?.labels) {
|
||||||
return (
|
return (
|
||||||
<span ref={graphRef}>
|
<span ref={graphRef}>
|
||||||
{!isEmpty(widget) && prevChartDataSetRef?.labels ? (
|
<WidgetGraphComponent
|
||||||
<WidgetGraphComponent
|
enableModel={false}
|
||||||
enableModel={false}
|
enableWidgetHeader
|
||||||
enableWidgetHeader
|
widget={widget}
|
||||||
widget={widget}
|
queryResponse={queryResponse}
|
||||||
queryResponse={queryResponse}
|
errorMessage={errorMessage}
|
||||||
errorMessage={errorMessage}
|
data={prevChartDataSetRef}
|
||||||
data={prevChartDataSetRef}
|
name={name}
|
||||||
name={name}
|
yAxisUnit={yAxisUnit}
|
||||||
yAxisUnit={yAxisUnit}
|
layout={layout}
|
||||||
layout={layout}
|
setLayout={setLayout}
|
||||||
setLayout={setLayout}
|
headerMenuList={headerMenuList}
|
||||||
headerMenuList={headerMenuList}
|
onClickHandler={onClickHandler}
|
||||||
onClickHandler={onClickHandler}
|
/>
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Spinner height="20vh" tip="Loading..." />
|
|
||||||
)}
|
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user