Skip to content

Commit d4833e4

Browse files
authored
Remove error helper duplicated in SecurityFields in Networking Page (#2518)
1 parent cf07898 commit d4833e4

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

libs/ui-lib/lib/common/components/clusterConfiguration/SecurityFields.tsx

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import * as React from 'react';
22
import { useFormikContext } from 'formik';
3-
import {
4-
Checkbox,
5-
FormGroup,
6-
FormHelperText,
7-
HelperText,
8-
HelperTextItem,
9-
} from '@patternfly/react-core';
3+
import { Checkbox, FormGroup, HelperText, HelperTextItem } from '@patternfly/react-core';
104

115
import { RenderIf } from '../ui/RenderIf';
126
import { getFieldId, TextAreaField, trimSshPublicKey, ExternalLink } from '../ui';
@@ -46,11 +40,9 @@ const SecurityFields = ({
4640
//clusterSshKey updating causes the textarea to disappear when the user clears it to edit it
4741
const defaultShareSshKey = !!imageSshKey && (clusterSshKey === imageSshKey || !clusterSshKey);
4842
const [shareSshKey, setShareSshKey] = React.useState(defaultShareSshKey);
49-
const { values, setFieldValue, errors, touched } =
43+
const { values, setFieldValue } =
5044
useFormikContext<Pick<NetworkConfigurationValues, 'sshPublicKey'>>();
5145

52-
const errorMsg = errors.sshPublicKey;
53-
5446
const handleSshKeyBlur = () => {
5547
if (values.sshPublicKey) {
5648
setFieldValue('sshPublicKey', trimSshPublicKey(values.sshPublicKey));
@@ -90,18 +82,6 @@ const SecurityFields = ({
9082
isDisabled={isDisabled}
9183
/>
9284
</RenderIf>
93-
{errorMsg && (
94-
<FormHelperText>
95-
<HelperText>
96-
<HelperTextItem
97-
variant={touched && errorMsg ? 'error' : 'default'}
98-
id={errorMsg ? `${fieldId}-helper-error` : `${fieldId}-helper`}
99-
>
100-
{errorMsg ? errorMsg : ''}
101-
</HelperTextItem>
102-
</HelperText>
103-
</FormHelperText>
104-
)}
10585
</FormGroup>
10686
</>
10787
);

0 commit comments

Comments
 (0)