mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelEvents: Isolating angular panel events into it's own event bus + more event refactoring (#29904)
* PanelEvents: Isolate angular events from panel model events, use new Event patterns * Removing some events that are not longer needed * Updated DashboardModel * Update * Review fixes
This commit is contained in:
@@ -28,7 +28,6 @@ interface GridWrapperProps {
|
||||
onDragStop: ItemCallback;
|
||||
onResize: ItemCallback;
|
||||
onResizeStop: ItemCallback;
|
||||
onWidthChange: () => void;
|
||||
className: string;
|
||||
isResizable?: boolean;
|
||||
isDraggable?: boolean;
|
||||
@@ -43,7 +42,6 @@ function GridWrapper({
|
||||
onDragStop,
|
||||
onResize,
|
||||
onResizeStop,
|
||||
onWidthChange,
|
||||
className,
|
||||
isResizable,
|
||||
isDraggable,
|
||||
@@ -56,7 +54,6 @@ function GridWrapper({
|
||||
if (ignoreNextWidthChange) {
|
||||
ignoreNextWidthChange = false;
|
||||
} else if (!viewPanel && Math.abs(width - lastGridWidth) > 8) {
|
||||
onWidthChange();
|
||||
lastGridWidth = width;
|
||||
}
|
||||
}
|
||||
@@ -164,12 +161,6 @@ export class DashboardGrid extends PureComponent<Props> {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
onWidthChange = () => {
|
||||
for (const panel of this.props.dashboard.panels) {
|
||||
panel.resizeDone();
|
||||
}
|
||||
};
|
||||
|
||||
updateGridPos = (item: ReactGridLayout.Layout, layout: ReactGridLayout.Layout[]) => {
|
||||
this.panelMap[item.i!].updateGridPos(item);
|
||||
|
||||
@@ -184,7 +175,6 @@ export class DashboardGrid extends PureComponent<Props> {
|
||||
|
||||
onResizeStop: ItemCallback = (layout, oldItem, newItem) => {
|
||||
this.updateGridPos(newItem, layout);
|
||||
this.panelMap[newItem.i!].resizeDone();
|
||||
};
|
||||
|
||||
onDragStop: ItemCallback = (layout, oldItem, newItem) => {
|
||||
@@ -277,7 +267,6 @@ export class DashboardGrid extends PureComponent<Props> {
|
||||
isResizable={dashboard.meta.canEdit}
|
||||
isDraggable={dashboard.meta.canEdit}
|
||||
onLayoutChange={this.onLayoutChange}
|
||||
onWidthChange={this.onWidthChange}
|
||||
onDragStop={this.onDragStop}
|
||||
onResize={this.onResize}
|
||||
onResizeStop={this.onResizeStop}
|
||||
|
||||
Reference in New Issue
Block a user