Skip to content

Commit 35bd14c

Browse files
committed
Remove change from this PR
1 parent 336b382 commit 35bd14c

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/views/config-v2/TLSSSLSettingsSection.tsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
1+
import { DataSourcePluginOptionsEditorProps, onUpdateDatasourceJsonDataOption } from '@grafana/data';
22
import { Box, CollapsableSection, CertificationKey, Text, useStyles2, Checkbox, Stack, Badge } from '@grafana/ui';
33
import React from 'react';
44
import { CHConfig, CHSecureConfig } from 'types/config';
@@ -46,19 +46,6 @@ export const TLSSSLSettingsSection = (props: Props) => {
4646
});
4747
};
4848

49-
const onTLSSettingsChange = (
50-
key: keyof Pick<CHConfig, 'tlsSkipVerify' | 'tlsAuth' | 'tlsAuthWithCACert'>,
51-
value: boolean
52-
) => {
53-
onOptionsChange({
54-
...options,
55-
jsonData: {
56-
...options.jsonData,
57-
[key]: value,
58-
},
59-
});
60-
};
61-
6249
return (
6350
<Box
6451
borderStyle="solid"
@@ -92,7 +79,7 @@ export const TLSSSLSettingsSection = (props: Props) => {
9279
value={jsonData.tlsSkipVerify || false}
9380
onChange={(e) => {
9481
trackClickhouseConfigV2SkipTLSVerifyToggleClicked({ skipTlsVerifyToggle: e.currentTarget.checked });
95-
onTLSSettingsChange('tlsSkipVerify', e.currentTarget.checked);
82+
onUpdateDatasourceJsonDataOption(props, 'tlsSkipVerify')(e);
9683
}}
9784
/>
9885
<Checkbox
@@ -101,7 +88,7 @@ export const TLSSSLSettingsSection = (props: Props) => {
10188
value={jsonData.tlsAuth || false}
10289
onChange={(e) => {
10390
trackClickhouseConfigV2TLSClientAuthToggleClicked({ clientAuthToggle: e.currentTarget.checked });
104-
onTLSSettingsChange('tlsAuth', e.currentTarget.checked);
91+
onUpdateDatasourceJsonDataOption(props, 'tlsAuth')(e);
10592
}}
10693
/>
10794
{jsonData.tlsAuth && (
@@ -129,7 +116,7 @@ export const TLSSSLSettingsSection = (props: Props) => {
129116
value={jsonData.tlsAuthWithCACert || false}
130117
onChange={(e) => {
131118
trackClickhouseConfigV2WithCACertToggleClicked({ caCertToggle: e.currentTarget.checked });
132-
onTLSSettingsChange('tlsAuthWithCACert', e.currentTarget.checked);
119+
onUpdateDatasourceJsonDataOption(props, 'tlsAuthWithCACert')(e);
133120
}}
134121
/>
135122
<div className={styles.certsSection}>

0 commit comments

Comments
 (0)