Chore: noImplictAny no errors left (#18303)

* Add types and rewrite datasourceChanged to async/await
This commit is contained in:
Tobias Skarhed
2019-08-01 14:38:34 +02:00
committed by GitHub
parent bcf28cb7a2
commit 83da3660da
63 changed files with 285 additions and 211 deletions

View File

@@ -16,6 +16,8 @@ import { DashboardModel } from '../../state';
import { LS_PANEL_COPY_KEY } from 'app/core/constants';
import { LocationUpdate } from '@grafana/runtime';
export type PanelPluginInfo = { id: any; defaults: { gridPos: { w: any; h: any }; title: any } };
export interface Props {
panel: PanelModel;
dashboard: DashboardModel;
@@ -26,7 +28,7 @@ export interface State {
}
export class AddPanelWidget extends React.Component<Props, State> {
constructor(props) {
constructor(props: Props) {
super(props);
this.handleCloseAddPanel = this.handleCloseAddPanel.bind(this);
@@ -58,7 +60,7 @@ export class AddPanelWidget extends React.Component<Props, State> {
return _.sortBy(copiedPanels, 'sort');
}
handleCloseAddPanel(evt) {
handleCloseAddPanel(evt: any) {
evt.preventDefault();
this.props.dashboard.removePanel(this.props.panel);
}
@@ -93,7 +95,7 @@ export class AddPanelWidget extends React.Component<Props, State> {
reduxStore.dispatch(updateLocation(location));
};
onPasteCopiedPanel = panelPluginInfo => {
onPasteCopiedPanel = (panelPluginInfo: PanelPluginInfo) => {
const dashboard = this.props.dashboard;
const { gridPos } = this.props.panel;
@@ -132,7 +134,7 @@ export class AddPanelWidget extends React.Component<Props, State> {
dashboard.removePanel(this.props.panel);
};
renderOptionLink = (icon: string, text: string, onClick) => {
renderOptionLink = (icon: string, text: string, onClick: any) => {
return (
<div>
<a