Commit d6ff16fe by David Kaltschmidt

Explore: fix graph resize on window resize

- resize HOC wrapper only resized first child which in case of large
  graphs was the warning button
- moved warning button inside the panel parent
parent 7d0eccdd
......@@ -168,7 +168,8 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
const data = this.getGraphData();
return (
<>
<div className="panel-container">
{loading && <div className="explore-graph__loader" />}
{this.props.data &&
this.props.data.length > MAX_NUMBER_OF_TIME_SERIES &&
!this.state.showAllTimeSeries && (
......@@ -180,12 +181,9 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
}`}</span>
</div>
)}
<div className="panel-container">
{loading && <div className="explore-graph__loader" />}
<div id={id} className="explore-graph" style={{ height }} />
<Legend data={data} />
</div>
</>
);
}
}
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render should render component 1`] = `
<Fragment>
<div
<div
className="panel-container"
>
>
<div
className="explore-graph"
id="graph"
......@@ -457,12 +456,13 @@ exports[`Render should render component 1`] = `
]
}
/>
</div>
</Fragment>
</div>
`;
exports[`Render should render component with disclaimer 1`] = `
<Fragment>
<div
className="panel-container"
>
<div
className="time-series-disclaimer"
>
......@@ -478,9 +478,6 @@ exports[`Render should render component with disclaimer 1`] = `
</span>
</div>
<div
className="panel-container"
>
<div
className="explore-graph"
id="graph"
style={
......@@ -955,15 +952,13 @@ exports[`Render should render component with disclaimer 1`] = `
]
}
/>
</div>
</Fragment>
</div>
`;
exports[`Render should show query return no time series 1`] = `
<Fragment>
<div
<div
className="panel-container"
>
>
<div
className="explore-graph"
id="graph"
......@@ -976,6 +971,5 @@ exports[`Render should show query return no time series 1`] = `
<Legend
data={Array []}
/>
</div>
</Fragment>
</div>
`;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment