11import { DataSourcePluginOptionsEditorProps } from '@grafana/data' ;
22import { DataSourceHttpSettings , InlineSwitch , LegacyForms } from '@grafana/ui' ;
3- import React , { ChangeEvent , Fragment , PureComponent } from 'react' ;
3+ import React , { ChangeEvent , Fragment , PureComponent } from 'react' ;
44
55import { MyDataSourceOptions } from './types' ;
66import { DataSourceSettings } from '@grafana/data/types/datasource' ;
@@ -88,13 +88,13 @@ export class ConfigEditor extends PureComponent<DataSourcePluginOptionsEditorPro
8888 } ;
8989
9090 onApiKeyEnableChange = ( event : any ) => {
91- const { onOptionsChange, options} = this . props ;
91+ const { onOptionsChange, options } = this . props ;
9292 const jsonData = {
9393 ...options . jsonData ,
9494 apiKeyEnable : event . target . checked ,
9595 } ;
96- onOptionsChange ( { ...options , jsonData} ) ;
97- }
96+ onOptionsChange ( { ...options , jsonData } ) ;
97+ } ;
9898
9999 render ( ) {
100100 const { options } = this . props ;
@@ -137,9 +137,10 @@ export class ConfigEditor extends PureComponent<DataSourcePluginOptionsEditorPro
137137 < InlineSwitch
138138 disabled = { false }
139139 value = { options . jsonData . apiKeyEnable }
140- onChange = { this . onApiKeyEnableChange } />
140+ onChange = { this . onApiKeyEnableChange }
141+ />
141142 </ div >
142- { options . jsonData . apiKeyEnable &&
143+ { options . jsonData . apiKeyEnable && (
143144 < Fragment >
144145 < div className = "gf-form" >
145146 < FormField
@@ -162,7 +163,7 @@ export class ConfigEditor extends PureComponent<DataSourcePluginOptionsEditorPro
162163 />
163164 </ div >
164165 </ Fragment >
165- }
166+ ) }
166167 </ div >
167168 </ div >
168169 </ div >
0 commit comments