Merge pull request #1750 from grafana/gareth/config-password-reset

fix reset bug in config page
This commit is contained in:
Gareth Dawson
2023-11-20 10:07:11 +00:00
committed by GitHub

View File

@@ -151,7 +151,7 @@ export const ConfigEditor = (props: Props) => {
width={40} width={40}
placeholder="Password" placeholder="Password"
isConfigured={options.secureJsonFields && options.secureJsonFields.password} isConfigured={options.secureJsonFields && options.secureJsonFields.password}
onReset={() => resetSecureJsonField('password', options, onOptionsChange)} onReset={resetSecureJsonField('password', options, onOptionsChange)}
onBlur={secureJsonDataChangeHandler('password', options, onOptionsChange)} onBlur={secureJsonDataChangeHandler('password', options, onOptionsChange)}
/> />
</Field> </Field>
@@ -465,7 +465,7 @@ const resetSecureJsonField =
value: DataSourceSettings<ZabbixDSOptions, ZabbixSecureJSONData>, value: DataSourceSettings<ZabbixDSOptions, ZabbixSecureJSONData>,
onChange: Props['onOptionsChange'] onChange: Props['onOptionsChange']
) => ) =>
(event: React.SyntheticEvent<HTMLButtonElement>) => { () => {
onChange({ onChange({
...value, ...value,
secureJsonFields: { secureJsonFields: {