Skip to content

Commit

Permalink
chore: use explicit update calls instead of helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
stacey-gammon committed Jun 14, 2019
1 parent f8ae279 commit ff5cede
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@ export class DashboardContainer extends Container<InheritedChildInput, Dashboard
return createPanelState(panelState, Object.values(this.input.panels));
}

public onPanelsUpdated = (panels: { [panelId: string]: DashboardPanelState }) => {
this.updateInput({
panels: {
...panels,
},
});
};

public onExitFullScreenMode = () => {
this.updateInput({
isFullScreenMode: false,
});
};

public render(dom: HTMLElement) {
ReactDOM.render(
// @ts-ignore - hitting https://github.com/DefinitelyTyped/DefinitelyTyped/issues/27805
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ class DashboardGridUi extends React.Component<DashboardGridProps, State> {
};

public onPanelsUpdated = (panels: { [key: string]: DashboardPanelState }) => {
this.props.container.onPanelsUpdated(panels);
this.props.container.updateInput({
panels,
});
};

public onPanelFocused = (focusedPanelIndex: string): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export class DashboardViewport extends React.Component<DashboardViewportProps, S
}

public onExitFullScreenMode = () => {
this.props.container.onExitFullScreenMode();
this.props.container.updateInput({
isFullScreenMode: false,
});
};

public render() {
Expand Down

0 comments on commit ff5cede

Please sign in to comment.