forked from Graylog2/graylog2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only update dashboard positions when necessary (Graylog2#4530)
* Correct documentation of `onPositionsChange` * Do not update positions after click in widget actions Clicking anywhere on an unlocked widget generates a drag event, which in our case ends up sending a request to the server to update widgets positions. Use React Grid Layout `draggableCancel` prop, to avoid calling drag callbacks when a user clicks on the edit or delete buttons for a widget. * Be more conservative with layout updates Optimize the number of times we compute and update the layout of a ReactGridContainer component: - Compute ReactGridContainer when the `positions` prop changes - Compare layout changes with the current computed layout to only call `onPositionsChange` when the layout did actually change This will reduce the number of times the layout of a ReactGridContainer component is computed and, more importantly, the number of update positions requests we send to the server.
- Loading branch information
Showing
2 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters