mirror of
https://github.com/grafana/grafana.git
synced 2025-01-15 19:22:34 -06:00
parent
860e25df3c
commit
500cf16142
@ -2780,9 +2780,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/admin/OrgRolePicker.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/admin/UserProfile.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/admin/ldap/LdapPage.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3106,9 +3103,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/annotations/components/AnnotationResultMapper.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/annotations/events_processing.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3177,9 +3171,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"public/app/features/comments/CommentView.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3238,32 +3229,14 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "7"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "8"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardRow/DashboardRow.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/DashboardSettings.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/GeneralSettings.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/HelpWizard/randomizer.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@ -3280,12 +3253,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
@ -3304,8 +3271,7 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/getFieldOverrideElements.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -3313,8 +3279,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/state/actions.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -3336,10 +3301,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/utils.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/utils.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@ -3351,10 +3312,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/RepeatRowSelect/RepeatRowSelect.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3391,9 +3348,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/ShareModal/ShareModal.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3408,8 +3362,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/TransformationsEditor/TransformationEditor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/TransformationsEditor/TransformationOperationRow.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -3419,16 +3372,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/VersionHistory/HistorySrv.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/features/dashboard/components/VersionHistory/VersionHistoryComparison.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/VersionHistory/__mocks__/dashboardHistoryMocks.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@ -3450,8 +3393,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/features/dashboard/containers/DashboardPage.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
@ -3473,10 +3415,7 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/DashboardGrid.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/DashboardPanel.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -3484,9 +3423,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/dashgrid/LazyLoader.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuItem.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@ -3507,13 +3443,10 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "8"]
|
||||
],
|
||||
"public/app/features/dashboard/services/DashboardSrv.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/services/PublicDashboardDataSource.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/services/TimeSrv.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
@ -295,7 +295,7 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
|
||||
interface LockedRowProps {
|
||||
label: string;
|
||||
value?: any;
|
||||
value?: string;
|
||||
lockMessage?: string;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ interface State {
|
||||
}
|
||||
|
||||
export default class StandardAnnotationQueryEditor extends PureComponent<Props, State> {
|
||||
state = {} as State;
|
||||
state: State = {};
|
||||
|
||||
componentDidMount() {
|
||||
this.verifyDataSource();
|
||||
|
@ -29,7 +29,7 @@ export const CommentView = ({ comments, packetCounter, addComment }: Props) => {
|
||||
}, [packetCounter]);
|
||||
|
||||
const onUpdateComment = (event: FormEvent<HTMLTextAreaElement>) => {
|
||||
const element = event.target as HTMLInputElement;
|
||||
const element = event.currentTarget;
|
||||
setComment(element.value);
|
||||
};
|
||||
|
||||
|
@ -87,7 +87,7 @@ export const DashNav = React.memo<Props>((props) => {
|
||||
const dashboardSrv = getDashboardSrv();
|
||||
const { dashboard, setStarred } = props;
|
||||
|
||||
dashboardSrv.starDashboard(dashboard.id, dashboard.meta.isStarred).then((newState) => {
|
||||
dashboardSrv.starDashboard(dashboard.id, Boolean(dashboard.meta.isStarred)).then((newState) => {
|
||||
setStarred({ id: dashboard.uid, title: dashboard.title, url: dashboard.meta.url ?? '', isStarred: newState });
|
||||
dashboard.meta.isStarred = newState;
|
||||
forceUpdate();
|
||||
|
@ -201,8 +201,8 @@ export function hasChanges(current: DashboardModel, original: unknown) {
|
||||
const currentClean = cleanDashboardFromIgnoredChanges(current.getSaveModelClone());
|
||||
const originalClean = cleanDashboardFromIgnoredChanges(original);
|
||||
|
||||
const currentTimepicker: any = find((currentClean as any).nav, { type: 'timepicker' });
|
||||
const originalTimepicker: any = find((originalClean as any).nav, { type: 'timepicker' });
|
||||
const currentTimepicker = find((currentClean as any).nav, { type: 'timepicker' });
|
||||
const originalTimepicker = find((originalClean as any).nav, { type: 'timepicker' });
|
||||
|
||||
if (currentTimepicker && originalTimepicker) {
|
||||
currentTimepicker.now = originalTimepicker.now;
|
||||
|
@ -17,7 +17,7 @@ export interface DashboardRowProps {
|
||||
dashboard: DashboardModel;
|
||||
}
|
||||
|
||||
export class DashboardRow extends React.Component<DashboardRowProps, any> {
|
||||
export class DashboardRow extends React.Component<DashboardRowProps> {
|
||||
sub?: Unsubscribable;
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -5,7 +5,7 @@ import { BrowserRouter } from 'react-router-dom';
|
||||
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
|
||||
|
||||
import { NavModel, NavModelItem } from '@grafana/data';
|
||||
import { setBackendSrv } from '@grafana/runtime';
|
||||
import { BackendSrv, setBackendSrv } from '@grafana/runtime';
|
||||
import { GrafanaContext } from 'app/core/context/GrafanaContext';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
|
||||
@ -23,7 +23,7 @@ jest.mock('@grafana/runtime', () => ({
|
||||
|
||||
setBackendSrv({
|
||||
get: jest.fn().mockResolvedValue([]),
|
||||
} as any);
|
||||
} as unknown as BackendSrv);
|
||||
|
||||
describe('DashboardSettings', () => {
|
||||
it('pressing escape navigates away correctly', async () => {
|
||||
|
@ -7,7 +7,7 @@ import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
|
||||
import { byRole } from 'testing-library-selector';
|
||||
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { setBackendSrv } from '@grafana/runtime';
|
||||
import { BackendSrv, setBackendSrv } from '@grafana/runtime';
|
||||
import { GrafanaContext } from 'app/core/context/GrafanaContext';
|
||||
|
||||
import { DashboardModel } from '../../state';
|
||||
@ -16,7 +16,7 @@ import { GeneralSettingsUnconnected as GeneralSettings, Props } from './GeneralS
|
||||
|
||||
setBackendSrv({
|
||||
get: jest.fn().mockResolvedValue([]),
|
||||
} as any);
|
||||
} as unknown as BackendSrv);
|
||||
|
||||
const setupTestContext = (options: Partial<Props>) => {
|
||||
const defaults: Props = {
|
||||
|
@ -37,7 +37,9 @@ export function GeneralSettingsUnconnected({
|
||||
};
|
||||
|
||||
const onBlur = (event: React.FocusEvent<HTMLInputElement>) => {
|
||||
dashboard[event.currentTarget.name as 'title' | 'description'] = event.currentTarget.value;
|
||||
if (event.currentTarget.name === 'title' || event.currentTarget.name === 'description') {
|
||||
dashboard[event.currentTarget.name] = event.currentTarget.value;
|
||||
}
|
||||
};
|
||||
|
||||
const onTooltipChange = (graphTooltip: number) => {
|
||||
|
@ -21,7 +21,7 @@ type State = {
|
||||
isAppending: boolean;
|
||||
versions: DecoratedRevisionModel[];
|
||||
viewMode: 'list' | 'compare';
|
||||
diffData: { lhs: any; rhs: any };
|
||||
diffData: { lhs: unknown; rhs: unknown };
|
||||
newInfo?: DecoratedRevisionModel;
|
||||
baseInfo?: DecoratedRevisionModel;
|
||||
isNewLatest: boolean;
|
||||
|
@ -5,7 +5,7 @@ import { CollapsableSection, TagsInput, Select, Field, Input, Checkbox, Button,
|
||||
|
||||
import { DashboardLink, DashboardModel } from '../../state/DashboardModel';
|
||||
|
||||
export const newLink = {
|
||||
export const newLink: DashboardLink = {
|
||||
icon: 'external link',
|
||||
title: 'New link',
|
||||
tooltip: '',
|
||||
@ -16,7 +16,7 @@ export const newLink = {
|
||||
targetBlank: false,
|
||||
keepTime: false,
|
||||
includeVars: false,
|
||||
} as DashboardLink;
|
||||
};
|
||||
|
||||
const linkTypeOptions = [
|
||||
{ value: 'dashboards', label: 'Dashboards' },
|
||||
|
@ -110,7 +110,7 @@ export class AngularPanelOptionsUnconnected extends PureComponent<Props> {
|
||||
toggleOptionGroup: (index: number) => {
|
||||
const tab = panelCtrl.editorTabs[index];
|
||||
tab.isOpen = !tab.isOpen;
|
||||
saveSectionOpenState(tab.title, tab.isOpen as boolean);
|
||||
saveSectionOpenState(tab.title, Boolean(tab.isOpen));
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ export function getFieldOverrideCategories(
|
||||
return [];
|
||||
}
|
||||
|
||||
const onOverrideChange = (index: number, override: any) => {
|
||||
const onOverrideChange = (index: number, override: ConfigOverrideRule) => {
|
||||
let overrides = cloneDeep(currentFieldConfig.overrides);
|
||||
overrides[index] = override;
|
||||
props.onFieldConfigsChange({ ...currentFieldConfig, overrides });
|
||||
|
@ -196,7 +196,7 @@ export function fillOptionsPaneItems(
|
||||
return (
|
||||
<Editor
|
||||
value={access.getValue(pluginOption.path)}
|
||||
onChange={(value: any) => {
|
||||
onChange={(value) => {
|
||||
access.onChange(pluginOption.path, value);
|
||||
}}
|
||||
item={pluginOption}
|
||||
|
@ -1,4 +1,10 @@
|
||||
import { FieldConfig, FieldConfigSource, PanelPlugin, standardFieldConfigEditorRegistry } from '@grafana/data';
|
||||
import {
|
||||
FieldConfig,
|
||||
FieldConfigSource,
|
||||
PanelPlugin,
|
||||
standardFieldConfigEditorRegistry,
|
||||
ThresholdsMode,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { setOptionImmutably, supportsDataQuery, updateDefaultFieldConfigValue } from './utils';
|
||||
|
||||
@ -8,10 +14,13 @@ describe('standardFieldConfigEditorRegistry', () => {
|
||||
min: 10,
|
||||
max: 10,
|
||||
decimals: 10,
|
||||
thresholds: {} as any,
|
||||
thresholds: {
|
||||
mode: ThresholdsMode.Absolute,
|
||||
steps: [],
|
||||
},
|
||||
noValue: 'no value',
|
||||
unit: 'km/s',
|
||||
links: {} as any,
|
||||
links: [],
|
||||
};
|
||||
|
||||
it('make sure all fields have a valid name', () => {
|
||||
|
@ -10,8 +10,8 @@ import { DiffViewer } from '../VersionHistory/DiffViewer';
|
||||
import { Diffs } from '../VersionHistory/utils';
|
||||
|
||||
interface SaveDashboardDiffProps {
|
||||
oldValue?: any;
|
||||
newValue?: any;
|
||||
oldValue?: unknown;
|
||||
newValue?: unknown;
|
||||
|
||||
// calculated by parent so we can see summary in tabs
|
||||
diff?: Diffs;
|
||||
|
@ -62,7 +62,7 @@ beforeAll(() => {
|
||||
],
|
||||
},
|
||||
],
|
||||
} as any;
|
||||
} as BootData;
|
||||
|
||||
server.listen({ onUnhandledRequest: 'bypass' });
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ export const TransformationEditor = ({
|
||||
React.createElement(uiConfig.editor, {
|
||||
options: { ...uiConfig.transformation.defaultOptions, ...config.transformation.options },
|
||||
input,
|
||||
onChange: (opts: any) => {
|
||||
onChange: (opts) => {
|
||||
onChange(index, { id: config.transformation.id, options: opts });
|
||||
},
|
||||
}),
|
||||
|
@ -38,19 +38,19 @@ describe('historySrv', () => {
|
||||
getMock.mockImplementation(() => Promise.resolve(versionsResponse));
|
||||
historySrv = new HistorySrv();
|
||||
|
||||
return historySrv.getHistoryList(dash, historyListOpts).then((versions: any) => {
|
||||
return historySrv.getHistoryList(dash, historyListOpts).then((versions) => {
|
||||
expect(versions).toEqual(versionsResponse);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an empty array when not given an id', () => {
|
||||
return historySrv.getHistoryList(emptyDash, historyListOpts).then((versions: any) => {
|
||||
return historySrv.getHistoryList(emptyDash, historyListOpts).then((versions) => {
|
||||
expect(versions).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an empty array when not given a dashboard', () => {
|
||||
return historySrv.getHistoryList(null as unknown as DashboardModel, historyListOpts).then((versions: any) => {
|
||||
return historySrv.getHistoryList(null as unknown as DashboardModel, historyListOpts).then((versions) => {
|
||||
expect(versions).toEqual([]);
|
||||
});
|
||||
});
|
||||
@ -61,7 +61,7 @@ describe('historySrv', () => {
|
||||
const version = 6;
|
||||
postMock.mockImplementation(() => Promise.resolve(restoreResponse(version)));
|
||||
historySrv = new HistorySrv();
|
||||
return historySrv.restoreDashboard(dash, version).then((response: any) => {
|
||||
return historySrv.restoreDashboard(dash, version).then((response) => {
|
||||
expect(response).toEqual(restoreResponse(version));
|
||||
});
|
||||
});
|
||||
|
@ -15,7 +15,7 @@ type DiffViewProps = {
|
||||
isNewLatest: boolean;
|
||||
newInfo: DecoratedRevisionModel;
|
||||
baseInfo: DecoratedRevisionModel;
|
||||
diffData: { lhs: any; rhs: any };
|
||||
diffData: { lhs: unknown; rhs: unknown };
|
||||
};
|
||||
|
||||
export const VersionHistoryComparison: React.FC<DiffViewProps> = ({ baseInfo, newInfo, diffData, isNewLatest }) => {
|
||||
|
@ -17,7 +17,7 @@ import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types';
|
||||
|
||||
import { configureStore } from '../../../store/configureStore';
|
||||
import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader';
|
||||
import { setDashboardSrv } from '../services/DashboardSrv';
|
||||
import { DashboardSrv, setDashboardSrv } from '../services/DashboardSrv';
|
||||
import { DashboardModel } from '../state';
|
||||
|
||||
import { Props, UnthemedDashboardPage } from './DashboardPage';
|
||||
@ -217,7 +217,7 @@ describe('DashboardPage', () => {
|
||||
});
|
||||
setDashboardSrv({
|
||||
getCurrent: () => getTestDashboard(),
|
||||
} as any);
|
||||
} as DashboardSrv);
|
||||
ctx.mount({
|
||||
dashboard: getTestDashboard(),
|
||||
queryParams: { viewPanel: '1' },
|
||||
|
@ -52,7 +52,7 @@ export class DashboardGrid extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
buildLayout() {
|
||||
const layout = [];
|
||||
const layout: ReactGridLayout.Layout[] = [];
|
||||
this.panelMap = {};
|
||||
|
||||
for (const panel of this.props.dashboard.panels) {
|
||||
@ -66,7 +66,7 @@ export class DashboardGrid extends PureComponent<Props, State> {
|
||||
continue;
|
||||
}
|
||||
|
||||
const panelPos: any = {
|
||||
const panelPos: ReactGridLayout.Layout = {
|
||||
i: panel.key,
|
||||
x: panel.gridPos.x,
|
||||
y: panel.gridPos.y,
|
||||
@ -176,7 +176,7 @@ export class DashboardGrid extends PureComponent<Props, State> {
|
||||
return panelElements;
|
||||
}
|
||||
|
||||
renderPanel(panel: PanelModel, width: any, height: any) {
|
||||
renderPanel(panel: PanelModel, width: number, height: number) {
|
||||
if (panel.type === 'row') {
|
||||
return <DashboardRow key={panel.key} panel={panel} dashboard={this.props.dashboard} />;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { Icon, toIconName, useStyles2 } from '@grafana/ui';
|
||||
|
||||
interface Props {
|
||||
children?: any;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export const PanelHeaderMenuItem: FC<Props & PanelMenuItem> = (props) => {
|
||||
|
@ -90,7 +90,7 @@ export class DashboardSrv {
|
||||
);
|
||||
}
|
||||
|
||||
starDashboard(dashboardId: string, isStarred: any) {
|
||||
starDashboard(dashboardId: string, isStarred: boolean) {
|
||||
const backendSrv = getBackendSrv();
|
||||
let promise;
|
||||
|
||||
|
@ -100,7 +100,7 @@ export class PublicDashboardDataSource extends DataSourceApi<DataQuery, DataSour
|
||||
|
||||
// Its a datasource query
|
||||
else {
|
||||
const body: any = { intervalMs, maxDataPoints };
|
||||
const body = { intervalMs, maxDataPoints };
|
||||
|
||||
return getBackendSrv()
|
||||
.fetch<BackendDataSourceResponse>({
|
||||
@ -135,7 +135,7 @@ export class PublicDashboardDataSource extends DataSourceApi<DataQuery, DataSour
|
||||
return { data: [toDataFrame(annotations)] };
|
||||
}
|
||||
|
||||
testDatasource(): Promise<any> {
|
||||
testDatasource(): Promise<null> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user