mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore(76107): Remove legacy form from InfluxConfigEditor (#76382)
Remove legacy form from InfluxConfigEditor With this commit, legacy form components are remvoed from influxdb config eidtor page. Form is now using FieldSet instead.
This commit is contained in:
parent
cb1dfbeeb4
commit
2442532f57
@ -8,7 +8,7 @@ import {
|
||||
updateDatasourcePluginJsonDataOption,
|
||||
updateDatasourcePluginResetOption,
|
||||
} from '@grafana/data/src';
|
||||
import { Alert, DataSourceHttpSettings, InlineField, LegacyForms, Select } from '@grafana/ui/src';
|
||||
import { Alert, DataSourceHttpSettings, InlineField, Select, Field, Input, FieldSet } from '@grafana/ui/src';
|
||||
import { config } from 'app/core/config';
|
||||
|
||||
import { BROWSER_MODE_DISABLED_MESSAGE } from '../../../constants';
|
||||
@ -18,8 +18,6 @@ import { InfluxFluxConfig } from './InfluxFluxConfig';
|
||||
import { InfluxInfluxQLConfig } from './InfluxInfluxQLConfig';
|
||||
import { InfluxSqlConfig } from './InfluxSQLConfig';
|
||||
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
const versions: Array<SelectableValue<InfluxVersion>> = [
|
||||
{
|
||||
label: 'InfluxQL',
|
||||
@ -132,10 +130,9 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
||||
|
||||
return (
|
||||
<>
|
||||
<h3 className="page-heading">Query Language</h3>
|
||||
<div className="gf-form-group">
|
||||
<div className="gf-form-inline">
|
||||
<div className="gf-form">
|
||||
<FieldSet>
|
||||
<h3 className="page-heading">Query language</h3>
|
||||
<Field>
|
||||
<Select
|
||||
aria-label="Query language"
|
||||
className="width-30"
|
||||
@ -144,9 +141,8 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
||||
defaultValue={versions[0]}
|
||||
onChange={this.onVersionChanged}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Field>
|
||||
</FieldSet>
|
||||
|
||||
{options.jsonData.version !== InfluxVersion.InfluxQL && (
|
||||
<Alert severity="info" title={this.versionNotice[options.jsonData.version!]}>
|
||||
@ -172,13 +168,9 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
||||
onChange={onOptionsChange}
|
||||
secureSocksDSProxyEnabled={config.secureSocksDSProxyEnabled}
|
||||
/>
|
||||
|
||||
<div className="gf-form-group">
|
||||
<div>
|
||||
<FieldSet>
|
||||
<h3 className="page-heading">InfluxDB Details</h3>
|
||||
</div>
|
||||
{this.renderJsonDataOptions()}
|
||||
<div className="gf-form-inline">
|
||||
<InlineField
|
||||
labelWidth={20}
|
||||
label="Max series"
|
||||
@ -189,7 +181,7 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
||||
type="number"
|
||||
className="width-20"
|
||||
value={this.state.maxSeries}
|
||||
onChange={(event) => {
|
||||
onChange={(event: { currentTarget: { value: string } }) => {
|
||||
// We duplicate this state so that we allow to write freely inside the input. We don't have
|
||||
// any influence over saving so this seems to be only way to do this.
|
||||
this.setState({ maxSeries: event.currentTarget.value });
|
||||
@ -198,8 +190,7 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
||||
}}
|
||||
/>
|
||||
</InlineField>
|
||||
</div>
|
||||
</div>
|
||||
</FieldSet>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user