From 98386d299511d8fb26d578e88ed96c683351813e Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Wed, 22 Feb 2017 10:45:27 -0600 Subject: [PATCH] "Add guard clause in onLayoutChange callback" If not provided with a position change handler don't send a resquest to persist updated layout position. We must do this until we resolve how we are going to persist changes to precanned dashboards. --- ui/src/shared/components/LayoutRenderer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/src/shared/components/LayoutRenderer.js b/ui/src/shared/components/LayoutRenderer.js index 524fe5a548..d52a8434bc 100644 --- a/ui/src/shared/components/LayoutRenderer.js +++ b/ui/src/shared/components/LayoutRenderer.js @@ -126,6 +126,11 @@ export const LayoutRenderer = React.createClass({ handleLayoutChange(layout) { this.triggerWindowResize() + + if (!this.props.onPositionChange) { + return + } + const newCells = this.props.cells.map((cell) => { const l = layout.find((ly) => ly.i === cell.i) const newLayout = {x: l.x, y: l.y, h: l.h, w: l.w}