fix(dashboard): Fix BigNumber causing dashboard to crash when overflowing (#19688)

* fix(dashboard): fix(plugin-chart-echarts): Fix BigNumber causing dashboard to crash when overflowing

* Add tooltips for truncated titles

* Fix type
This commit is contained in:
Kamil Gabryjelski
2022-04-13 14:22:46 +02:00
committed by GitHub
parent 4a5dddf52d
commit ee85466f2e
5 changed files with 63 additions and 22 deletions

View File

@@ -113,6 +113,12 @@ const ChartOverlay = styled.div`
}
`;
const SliceContainer = styled.div`
display: flex;
flex-direction: column;
max-height: 100%;
`;
export default class Chart extends React.Component {
constructor(props) {
super(props);
@@ -210,7 +216,10 @@ export default class Chart extends React.Component {
getChartHeight() {
const headerHeight = this.getHeaderHeight();
return this.state.height - headerHeight - this.state.descriptionHeight;
return Math.max(
this.state.height - headerHeight - this.state.descriptionHeight,
20,
);
}
getHeaderHeight() {
@@ -370,7 +379,7 @@ export default class Chart extends React.Component {
})
: {};
return (
<div
<SliceContainer
className="chart-slice"
data-test="chart-grid-component"
data-test-chart-id={id}
@@ -407,6 +416,8 @@ export default class Chart extends React.Component {
isFullSize={isFullSize}
chartStatus={chart.chartStatus}
formData={formData}
width={width}
height={this.getHeaderHeight()}
/>
{/*
@@ -468,7 +479,7 @@ export default class Chart extends React.Component {
datasetsStatus={datasetsStatus}
/>
</div>
</div>
</SliceContainer>
);
}
}