ui: Fix empty SVG height to prevent service mesh from breaking when there are no upstreams (#10122)

This commit is contained in:
Kenia 2021-04-28 09:22:18 -04:00 committed by Mike Morris
parent 1d6ebf04e6
commit c41ef2d7cf
2 changed files with 12 additions and 7 deletions

3
.changelog/10122.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Adding conditional to prevent Service Mesh from breaking when there are no Upstreams
```

View File

@ -108,14 +108,16 @@ export default class TopologyMetrics extends Component {
// Calculate viewBox dimensions
this.downView = document.getElementById('downstream-lines').getBoundingClientRect();
const upstreamLines = document.getElementById('upstream-lines').getBoundingClientRect();
const upstreamColumn = document.getElementById('upstream-column').getBoundingClientRect();
const upstreamColumn = document.getElementById('upstream-column');
this.upView = {
x: upstreamLines.x,
y: upstreamLines.y,
width: upstreamLines.width,
height: upstreamColumn.height,
};
if (upstreamColumn) {
this.upView = {
x: upstreamLines.x,
y: upstreamLines.y,
width: upstreamLines.width,
height: upstreamColumn.getBoundingClientRect().height + 10,
};
}
// Get Card elements positions
const downCards = [