mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: noImplictAny no errors left (#18303)
* Add types and rewrite datasourceChanged to async/await
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user