Chore: Remove gf-form usage in grafana datasource (#79640)

This commit is contained in:
Tobias Skarhed 2023-12-29 13:37:44 +01:00 committed by GitHub
parent 1892ae5ca8
commit 99582b48d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 21 deletions

View File

@ -7346,10 +7346,6 @@ exports[`no gf-form usage`] = {
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
],
"public/app/plugins/datasource/grafana/components/QueryEditor.tsx:5381": [
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
],
"public/app/plugins/datasource/graphite/components/AnnotationsEditor.tsx:5381": [
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],

View File

@ -29,6 +29,7 @@ import {
DropzoneFile,
Themeable2,
withTheme2,
Stack,
} from '@grafana/ui';
import { hasAlphaPanels } from 'app/core/config';
import * as DFImport from 'app/features/dataframe-import';
@ -277,23 +278,22 @@ export class UnthemedQueryEditor extends PureComponent<Props, State> {
return (
<>
<div className="gf-form">
<InlineField label="Channel" grow={true} labelWidth={labelWidth}>
<Select
options={channels}
value={currentChannel || ''}
onChange={this.onChannelChange}
allowCustomValue={true}
backspaceRemovesValue={true}
placeholder="Select measurements channel"
isClearable={true}
noOptionsMessage="Enter channel name"
formatCreateLabel={(input: string) => `Connect to: ${input}`}
/>
</InlineField>
</div>
<InlineField label="Channel" grow={true} labelWidth={labelWidth}>
<Select
options={channels}
value={currentChannel || ''}
onChange={this.onChannelChange}
allowCustomValue={true}
backspaceRemovesValue={true}
placeholder="Select measurements channel"
isClearable={true}
noOptionsMessage="Enter channel name"
formatCreateLabel={(input: string) => `Connect to: ${input}`}
/>
</InlineField>
{channel && (
<div className="gf-form">
<Stack direction="row" gap={0}>
<InlineField label="Fields" grow={true} labelWidth={labelWidth}>
<Select
options={fields}
@ -319,7 +319,7 @@ export class UnthemedQueryEditor extends PureComponent<Props, State> {
spellCheck={false}
/>
</InlineField>
</div>
</Stack>
)}
<Alert title="Grafana Live - Measurements" severity="info">