|
1 | 1 | import * as React from 'react';
|
2 | 2 | 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'; |
10 | 4 |
|
11 | 5 | import { RenderIf } from '../ui/RenderIf';
|
12 | 6 | import { getFieldId, TextAreaField, trimSshPublicKey, ExternalLink } from '../ui';
|
@@ -46,11 +40,9 @@ const SecurityFields = ({
|
46 | 40 | //clusterSshKey updating causes the textarea to disappear when the user clears it to edit it
|
47 | 41 | const defaultShareSshKey = !!imageSshKey && (clusterSshKey === imageSshKey || !clusterSshKey);
|
48 | 42 | const [shareSshKey, setShareSshKey] = React.useState(defaultShareSshKey);
|
49 |
| - const { values, setFieldValue, errors, touched } = |
| 43 | + const { values, setFieldValue } = |
50 | 44 | useFormikContext<Pick<NetworkConfigurationValues, 'sshPublicKey'>>();
|
51 | 45 |
|
52 |
| - const errorMsg = errors.sshPublicKey; |
53 |
| - |
54 | 46 | const handleSshKeyBlur = () => {
|
55 | 47 | if (values.sshPublicKey) {
|
56 | 48 | setFieldValue('sshPublicKey', trimSshPublicKey(values.sshPublicKey));
|
@@ -90,18 +82,6 @@ const SecurityFields = ({
|
90 | 82 | isDisabled={isDisabled}
|
91 | 83 | />
|
92 | 84 | </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 |
| - )} |
105 | 85 | </FormGroup>
|
106 | 86 | </>
|
107 | 87 | );
|
|
0 commit comments