Skip to content

Commit ac34646

Browse files
Limit of 63 characters for spoke cluster name should be verified on the Cluster details page (#2872)
Signed-off-by: Elay Aharoni <elayaha@gmail.com> Co-authored-by: Elay Aharoni <elayaha@gmail.com>
1 parent 4c9f0e4 commit ac34646

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: libs/ui-lib/lib/common/components/ui/formik/RichInputField.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
101101
const fieldId = getFieldId(props.name, 'input', idPostfix);
102102
const isValid = !(touched && error?.length);
103103

104+
const errorMessage = isValid ? '' : error[0];
104105
return (
105106
<FormGroup
106107
id={`form-control__${fieldId}`}
@@ -163,14 +164,15 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
163164
</Popover>
164165
</InputGroupItem>
165166
</InputGroup>
166-
{helperText && (
167+
{(errorMessage || helperText) && (
167168
<FormHelperText>
168169
<HelperText>
169170
<HelperTextItem
171+
icon={errorMessage && <ExclamationCircleIcon />}
170172
variant={isValid ? 'default' : 'error'}
171173
id={isValid ? `${fieldId}-helper` : `${fieldId}-helper-error`}
172174
>
173-
{helperText}
175+
{errorMessage ? errorMessage : helperText}
174176
</HelperTextItem>
175177
</HelperText>
176178
</FormHelperText>

0 commit comments

Comments
 (0)