mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
Chore: Improve typings in OptionsUI and Explore (#76245)
This commit is contained in:
parent
50504ba008
commit
5f6fea33f2
@ -1331,11 +1331,11 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "18"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "19"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "20"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "21"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "22"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "24"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "21"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "22"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "23"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "24"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "25"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "26"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "27"],
|
||||
@ -1386,20 +1386,10 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "72"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "73"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "74"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "75"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "76"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "77"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "78"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "79"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "80"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "81"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "82"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "83"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "84"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "85"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "86"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "87"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "88"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "75"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "76"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "77"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "78"]
|
||||
],
|
||||
"public/app/core/components/OptionsUI/slider.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
@ -3811,9 +3801,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/explore/ExplorePaneContainer.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
"public/app/features/explore/ExploreQueryInspector.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/explore/FeatureTogglePage.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
@ -3994,11 +3981,7 @@ exports[`better eslint`] = {
|
||||
"public/app/features/explore/TraceView/TraceView.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
],
|
||||
"public/app/features/explore/TraceView/components/TracePageHeader/Actions/ActionButton.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
|
@ -69,7 +69,7 @@ export const getAllOptionEditors = () => {
|
||||
id: 'text',
|
||||
name: 'Text',
|
||||
description: 'Allows string values input',
|
||||
editor: StringValueEditor as any,
|
||||
editor: StringValueEditor,
|
||||
};
|
||||
|
||||
const strings: StandardEditorsRegistryItem<string[]> = {
|
||||
@ -155,28 +155,28 @@ export const getAllOptionEditors = () => {
|
||||
id: 'timezone',
|
||||
name: 'Time zone',
|
||||
description: 'Time zone selection',
|
||||
editor: TimeZonePicker as any,
|
||||
editor: TimeZonePicker,
|
||||
};
|
||||
|
||||
const fieldName: StandardEditorsRegistryItem<string, FieldNamePickerConfigSettings> = {
|
||||
id: 'field-name',
|
||||
name: 'Field name',
|
||||
description: 'Allows selecting a field name from a data frame',
|
||||
editor: FieldNamePicker as any,
|
||||
editor: FieldNamePicker,
|
||||
};
|
||||
|
||||
const dashboardPicker: StandardEditorsRegistryItem<string, DashboardPickerOptions> = {
|
||||
id: 'dashboard-uid',
|
||||
name: 'Dashboard',
|
||||
description: 'Select dashboard',
|
||||
editor: DashboardPicker as any,
|
||||
editor: DashboardPicker,
|
||||
};
|
||||
|
||||
const mappings: StandardEditorsRegistryItem<ValueMapping[]> = {
|
||||
id: 'mappings',
|
||||
name: 'Mappings',
|
||||
description: 'Allows defining value mappings',
|
||||
editor: ValueMappingsEditor as any,
|
||||
editor: ValueMappingsEditor,
|
||||
};
|
||||
|
||||
const thresholds: StandardEditorsRegistryItem<ThresholdsConfig> = {
|
||||
|
@ -3,6 +3,7 @@ import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { CoreApp, LoadingState, TimeZone } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime/src';
|
||||
import { defaultTimeZone } from '@grafana/schema';
|
||||
import { TabbedContainer, TabConfig } from '@grafana/ui';
|
||||
import { ExploreDrawer } from 'app/features/explore/ExploreDrawer';
|
||||
import { InspectDataTab } from 'app/features/inspector/InspectDataTab';
|
||||
@ -39,7 +40,7 @@ export function ExploreQueryInspector(props: Props) {
|
||||
label: 'Stats',
|
||||
value: 'stats',
|
||||
icon: 'chart-line',
|
||||
content: <InspectStatsTab data={queryResponse!} timeZone={queryResponse?.request?.timezone as TimeZone} />,
|
||||
content: <InspectStatsTab data={queryResponse!} timeZone={queryResponse?.request?.timezone ?? defaultTimeZone} />,
|
||||
};
|
||||
|
||||
const jsonTab: TabConfig = {
|
||||
|
@ -18,7 +18,7 @@ import {
|
||||
import { getTemplateSrv } from '@grafana/runtime';
|
||||
import { DataQuery } from '@grafana/schema';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { getTraceToLogsOptions, TraceToLogsData } from 'app/core/components/TraceToLogs/TraceToLogsSettings';
|
||||
import { getTraceToLogsOptions } from 'app/core/components/TraceToLogs/TraceToLogsSettings';
|
||||
import { TraceToMetricsData } from 'app/core/components/TraceToMetrics/TraceToMetricsSettings';
|
||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
import { getTimeZone } from 'app/features/profile/state/selectors';
|
||||
@ -112,8 +112,9 @@ export function TraceView(props: Props) {
|
||||
);
|
||||
|
||||
const instanceSettings = getDatasourceSrv().getInstanceSettings(datasource?.name);
|
||||
const traceToLogsOptions = getTraceToLogsOptions(instanceSettings?.jsonData as TraceToLogsData);
|
||||
const traceToMetricsOptions = (instanceSettings?.jsonData as TraceToMetricsData)?.tracesToMetrics;
|
||||
const traceToLogsOptions = getTraceToLogsOptions(instanceSettings?.jsonData);
|
||||
const traceToMetrics: TraceToMetricsData | undefined = instanceSettings?.jsonData;
|
||||
const traceToMetricsOptions = traceToMetrics?.tracesToMetrics;
|
||||
const spanBarOptions: SpanBarOptionsData | undefined = instanceSettings?.jsonData;
|
||||
|
||||
const createSpanLink = useMemo(
|
||||
@ -261,7 +262,6 @@ function useFocusSpanLink(options: {
|
||||
link,
|
||||
internalLink: link.internal!,
|
||||
scopedVars: {},
|
||||
range: {} as any,
|
||||
field: {} as Field,
|
||||
onClickFn: sameTrace
|
||||
? () => setFocusedSpanId(focusedSpanId === spanId ? undefined : spanId)
|
||||
|
Loading…
Reference in New Issue
Block a user