File tree 3 files changed +12
-4
lines changed
common/components/ui/formik
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
101
101
const fieldId = getFieldId ( props . name , 'input' , idPostfix ) ;
102
102
const isValid = ! ( touched && error ?. length ) ;
103
103
104
+ const errorMessage = isValid ? '' : error [ 0 ] ;
104
105
return (
105
106
< FormGroup
106
107
id = { `form-control__${ fieldId } ` }
@@ -163,14 +164,15 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
163
164
</ Popover >
164
165
</ InputGroupItem >
165
166
</ InputGroup >
166
- { helperText && (
167
+ { ( errorMessage || helperText ) && (
167
168
< FormHelperText >
168
169
< HelperText >
169
170
< HelperTextItem
171
+ icon = { errorMessage && < ExclamationCircleIcon /> }
170
172
variant = { isValid ? 'default' : 'error' }
171
173
id = { isValid ? `${ fieldId } -helper` : `${ fieldId } -helper-error` }
172
174
>
173
- { helperText }
175
+ { errorMessage ? errorMessage : helperText }
174
176
</ HelperTextItem >
175
177
</ HelperText >
176
178
</ FormHelperText >
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ export const OcmClusterDetailsFormFields = ({
144
144
) : (
145
145
< OcmOpenShiftVersionSelect versions = { versions } />
146
146
) }
147
- { clusterExists ? (
147
+ { clusterExists || isSingleClusterFeatureEnabled ? (
148
148
< StaticTextField name = "cpuArchitecture" label = "CPU architecture" isRequired >
149
149
{ cpuArchitecture }
150
150
</ StaticTextField >
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import {
31
31
InfraEnv ,
32
32
ManagedDomain ,
33
33
} from '@openshift-assisted/types/assisted-installer-service' ;
34
+ import { useFeature } from '../../hooks/use-feature' ;
34
35
35
36
type ClusterDetailsFormProps = {
36
37
cluster ?: Cluster ;
@@ -67,6 +68,7 @@ const ClusterDetailsForm = (props: ClusterDetailsFormProps) => {
67
68
const { search } = useLocation ( ) ;
68
69
const { isViewerMode } = useSelector ( selectCurrentClusterPermissionsState ) ;
69
70
const { clearAlerts } = useAlerts ( ) ;
71
+ const isSingleClusterFeatureEnabled = useFeature ( 'ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE' ) ;
70
72
71
73
const handleSubmit = React . useCallback (
72
74
async ( values : OcmClusterDetailsValues ) => {
@@ -175,7 +177,11 @@ const ClusterDetailsForm = (props: ClusterDetailsFormProps) => {
175
177
< GridItem span = { 12 } lg = { 10 } xl = { 9 } xl2 = { 7 } >
176
178
< OcmClusterDetailsFormFields
177
179
versions = { ocpVersions }
178
- forceOpenshiftVersion = { cluster ?. openshiftVersion }
180
+ forceOpenshiftVersion = {
181
+ isSingleClusterFeatureEnabled
182
+ ? ocpVersions [ 0 ] . version
183
+ : cluster ?. openshiftVersion
184
+ }
179
185
isPullSecretSet = { ! ! cluster ?. pullSecretSet }
180
186
defaultPullSecret = { pullSecret }
181
187
isOcm = { isInOcm }
You can’t perform that action at this time.
0 commit comments