support storagesheet for old scope reports

Old versions of scope reports use `storagesheet` as the value for node
shape. This shape is no longer supported in weaveworks-ui-components and
so this commit normalises to `sheet` for compatiblity with old reports.

related #3322
This commit is contained in:
guyfedwards
2018-08-22 15:32:35 +01:00
parent a38b6213d1
commit ebd6376bd4

View File

@@ -150,6 +150,10 @@ class NodesChartElements extends React.Component {
renderNode(node) {
const { isAnimated } = this.props;
// old versions of scope reports have a node shape of `storagesheet`
// if so, normalise to `sheet`
const shape = node.get('shape') === 'storagesheet' ? 'sheet' : node.get('shape');
return (
<NodeContainer
matches={node.get('matches')}
@@ -157,7 +161,7 @@ class NodesChartElements extends React.Component {
metric={node.get('metric')}
focused={node.get('focused')}
highlighted={node.get('highlighted')}
shape={node.get('shape')}
shape={shape}
stacked={node.get('stack')}
key={node.get('id')}
id={node.get('id')}