Skip to content

Commit

Permalink
fix: resize observer charts issue in alerts builder (#5436)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored Jul 8, 2024
1 parent f6b2999 commit bf17788
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions frontend/src/container/FormAlertRules/ChartPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,19 @@ function ChartPreview({
return (
<ChartContainer>
{headline}
{(queryResponse?.isError || queryResponse?.error) && (
<FailedMessageContainer color="red" title="Failed to refresh the chart">
<InfoCircleOutlined />{' '}
{queryResponse.error.message || t('preview_chart_unexpected_error')}
</FailedMessageContainer>
)}
{chartData && !queryResponse.isError && (
<div ref={graphRef} style={{ height: '100%' }}>
{queryResponse.isLoading && (
<Spinner size="large" tip="Loading..." height="100%" />
)}

<div ref={graphRef} style={{ height: '100%' }}>
{queryResponse.isLoading && (
<Spinner size="large" tip="Loading..." height="100%" />
)}
{(queryResponse?.isError || queryResponse?.error) && (
<FailedMessageContainer color="red" title="Failed to refresh the chart">
<InfoCircleOutlined />{' '}
{queryResponse.error.message || t('preview_chart_unexpected_error')}
</FailedMessageContainer>
)}

{chartData && !queryResponse.isError && (
<GridPanelSwitch
options={options}
panelType={graphType}
Expand All @@ -268,8 +270,8 @@ function ChartPreview({
query={query || initialQueriesMap.metrics}
yAxisUnit={yAxisUnit}
/>
</div>
)}
)}
</div>
</ChartContainer>
);
}
Expand Down

0 comments on commit bf17788

Please sign in to comment.