@openshift-assisted/ui-lib 2.51.0 → 2.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +0 -4
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/ui/OpenShiftVersionModal.d.ts.map +1 -1
- package/build/@types/common/components/ui/formik/PullSecretField.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts +0 -7
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/types/index.d.ts +1 -0
- package/build/@types/common/types/index.d.ts.map +1 -1
- package/build/@types/common/types/networkType.d.ts +12 -0
- package/build/@types/common/types/networkType.d.ts.map +1 -0
- package/build/@types/common/validationSchemas/addressValidation.d.ts.map +1 -1
- package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts +0 -5
- package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/Routes.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts +2 -2
- package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts +1 -2
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts +0 -22
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetailsForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts +0 -3
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts +1 -2
- package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/NewClusterWizard.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/constants.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/BasicStep.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/ReviewStep.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/index.d.ts +0 -1
- package/build/@types/ocm/components/clusterWizard/index.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts +1 -1
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
- package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
- package/build/@types/ocm/components/utils.d.ts +0 -1
- package/build/@types/ocm/components/utils.d.ts.map +1 -1
- package/build/@types/ocm/services/ClustersService.d.ts +0 -4
- package/build/@types/ocm/services/ClustersService.d.ts.map +1 -1
- package/build/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
- package/build/@types/ocm/store/slices/clusters/selectors.d.ts +1 -2
- package/build/@types/ocm/store/slices/clusters/selectors.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +3 -3
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/common/api/assisted-service/ClustersAPI.js +0 -3
- package/build/cjs/common/api/assisted-service/ClustersAPI.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +8 -17
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +3 -3
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +3 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +2 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
- package/build/cjs/common/components/ui/OpenShiftVersionModal.js +1 -3
- package/build/cjs/common/components/ui/OpenShiftVersionModal.js.map +1 -1
- package/build/cjs/common/components/ui/WizardFooter.js +1 -1
- package/build/cjs/common/components/ui/WizardFooter.js.map +1 -1
- package/build/cjs/common/components/ui/formik/PullSecretField.js.map +1 -1
- package/build/cjs/common/config/constants.js +2 -21
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/types/index.js +1 -0
- package/build/cjs/common/types/index.js.map +1 -1
- package/build/cjs/common/types/networkType.js +28 -0
- package/build/cjs/common/types/networkType.js.map +1 -0
- package/build/cjs/common/validationSchemas/addressValidation.js +1 -3
- package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -1
- package/build/cjs/common/validationSchemas/clusterDetailsValidation.js +2 -31
- package/build/cjs/common/validationSchemas/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/ocm/components/Routes.js +1 -2
- package/build/cjs/ocm/components/Routes.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js +0 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js +7 -5
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js +4 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +1 -4
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +22 -29
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js +2 -5
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js +3 -31
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +1 -2
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +1 -2
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContext.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +9 -62
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js +6 -21
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js +1 -11
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/constants.js +0 -1
- package/build/cjs/ocm/components/clusterWizard/constants.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js +19 -96
- package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js +7 -11
- package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/index.js +1 -3
- package/build/cjs/ocm/components/clusterWizard/index.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.js +0 -3
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.js.map +1 -1
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +13 -4
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
- package/build/cjs/ocm/components/utils.js +1 -4
- package/build/cjs/ocm/components/utils.js.map +1 -1
- package/build/cjs/ocm/hooks/useInfraEnvId.js +2 -2
- package/build/cjs/ocm/hooks/useInfraEnvId.js.map +1 -1
- package/build/cjs/ocm/services/ClustersService.js +0 -6
- package/build/cjs/ocm/services/ClustersService.js.map +1 -1
- package/build/cjs/ocm/services/InfraEnvsService.js +1 -4
- package/build/cjs/ocm/services/InfraEnvsService.js.map +1 -1
- package/build/cjs/ocm/store/slices/clusters/selectors.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +1 -1
- package/lib/common/api/assisted-service/ClustersAPI.ts +0 -6
- package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +9 -19
- package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +1 -1
- package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +5 -6
- package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +2 -2
- package/lib/common/components/ui/OpenShiftVersionModal.tsx +1 -3
- package/lib/common/components/ui/WizardFooter.tsx +1 -1
- package/lib/common/components/ui/formik/PullSecretField.tsx +0 -1
- package/lib/common/config/constants.ts +0 -21
- package/lib/common/types/index.ts +1 -0
- package/lib/common/types/networkType.ts +37 -0
- package/lib/common/validationSchemas/addressValidation.tsx +1 -4
- package/lib/common/validationSchemas/clusterDetailsValidation.tsx +15 -47
- package/lib/ocm/components/Routes.tsx +1 -3
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx +0 -1
- package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +3 -2
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +10 -5
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.tsx +5 -1
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +0 -5
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +32 -47
- package/lib/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.tsx +2 -8
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.tsx +0 -1
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.tsx +2 -2
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.tsx +24 -63
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +1 -2
- package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +2 -1
- package/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx +0 -3
- package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +27 -91
- package/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx +5 -26
- package/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +3 -14
- package/lib/ocm/components/clusterWizard/constants.ts +0 -1
- package/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx +39 -139
- package/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +9 -19
- package/lib/ocm/components/clusterWizard/index.ts +0 -1
- package/lib/ocm/components/clusterWizard/wizardTransition.ts +1 -5
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +15 -4
- package/lib/ocm/components/utils.ts +0 -4
- package/lib/ocm/hooks/useInfraEnvId.ts +2 -2
- package/lib/ocm/services/ClustersService.ts +0 -6
- package/lib/ocm/services/InfraEnvsService.ts +1 -4
- package/lib/ocm/store/slices/clusters/selectors.tsx +2 -1
- package/package.json +3 -3
- package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts +0 -4
- package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts +0 -4
- package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map +0 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js +0 -48
- package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js.map +0 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js +0 -182
- package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map +0 -1
- package/lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx +0 -78
- package/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +0 -364
|
@@ -20,7 +20,6 @@ export const discoveryImageTypes: Record<DiscoveryImageType, string> = {
|
|
|
20
20
|
'minimal-iso': 'Minimal image file - Download an ISO that fetches content on boot',
|
|
21
21
|
'full-iso': 'Full image file - Download a self-contained ISO',
|
|
22
22
|
'discovery-image-ipxe': 'iPXE - Provision from your network server',
|
|
23
|
-
'disconnected-iso': 'Disconnected ISO - Provision from a local file',
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
type DiscoveryImageTypeDropdownProps = {
|
|
@@ -16,6 +16,7 @@ import { Formik, FormikHelpers } from 'formik';
|
|
|
16
16
|
import { TFunction } from 'i18next';
|
|
17
17
|
import {
|
|
18
18
|
HostStaticNetworkConfig,
|
|
19
|
+
ImageType,
|
|
19
20
|
InfraEnv,
|
|
20
21
|
Proxy,
|
|
21
22
|
} from '@openshift-assisted/types/assisted-installer-service';
|
|
@@ -71,7 +72,7 @@ type OcmDiscoveryImageConfigFormProps = Proxy & {
|
|
|
71
72
|
formikActions: FormikHelpers<OcmDiscoveryImageFormValues>,
|
|
72
73
|
) => Promise<void>;
|
|
73
74
|
sshPublicKey?: string;
|
|
74
|
-
imageType?:
|
|
75
|
+
imageType?: ImageType;
|
|
75
76
|
isIpxeSelected?: boolean;
|
|
76
77
|
enableCertificate?: boolean;
|
|
77
78
|
trustBundle?: InfraEnv['additionalTrustBundle'];
|
|
@@ -105,7 +106,7 @@ export const OcmDiscoveryImageConfigForm = ({
|
|
|
105
106
|
httpsProxy: httpsProxy || '',
|
|
106
107
|
noProxy: noProxy || '',
|
|
107
108
|
enableProxy: !!(httpProxy || httpsProxy || noProxy),
|
|
108
|
-
imageType:
|
|
109
|
+
imageType: imageTypeValue as ImageType,
|
|
109
110
|
enableCertificate: enableCertificate || false,
|
|
110
111
|
trustBundle: trustBundle || '',
|
|
111
112
|
};
|
package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx
CHANGED
|
@@ -15,8 +15,9 @@ import {
|
|
|
15
15
|
import { CustomManifests } from './components/CustomManifests';
|
|
16
16
|
import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
|
|
17
17
|
import { CustomManifestFormState } from './components/propTypes';
|
|
18
|
-
import { ClustersAPI, ClusterWizardStepHeader } from '../../../../common';
|
|
19
|
-
import {
|
|
18
|
+
import { ClustersAPI, ClusterWizardStepHeader, isThirdPartyCNI } from '../../../../common';
|
|
19
|
+
import { getFieldId } from '../../../../common/components/ui/formik';
|
|
20
|
+
import { isOciPlatformType } from '../../utils';
|
|
20
21
|
import DeleteCustomManifestModal from './DeleteCustomManifestModal';
|
|
21
22
|
import { ClustersService } from '../../../services';
|
|
22
23
|
import { useClusterWizardContext } from '../../clusterWizard/ClusterWizardContext';
|
|
@@ -80,6 +81,8 @@ export const CustomManifestsPage = ({
|
|
|
80
81
|
await clusterWizardContext.updateUISettings({ customManifestsAdded: false });
|
|
81
82
|
}, [cluster.id, clusterWizardContext]);
|
|
82
83
|
|
|
84
|
+
const fieldId = getFieldId('use-custom-manifests', 'switch');
|
|
85
|
+
|
|
83
86
|
const tooltipWhenDisabled = isRequired
|
|
84
87
|
? 'Custom manifests are required when using a third-party CNI or Oracle Cloud Infrastructure.'
|
|
85
88
|
: '';
|
|
@@ -133,11 +136,13 @@ export const CustomManifestsPage = ({
|
|
|
133
136
|
configuration of the cluster.
|
|
134
137
|
</Content>
|
|
135
138
|
</Content>
|
|
136
|
-
<FormGroup fieldId=
|
|
139
|
+
<FormGroup fieldId={fieldId} label="">
|
|
137
140
|
<Tooltip content={tooltipWhenDisabled} hidden={!isRequired}>
|
|
138
141
|
<span style={{ display: 'inline-block', cursor: isRequired ? 'not-allowed' : undefined }}>
|
|
139
142
|
<Switch
|
|
140
|
-
id=
|
|
143
|
+
id={fieldId}
|
|
144
|
+
data-testid={fieldId}
|
|
145
|
+
data-checked={useCustomManifests}
|
|
141
146
|
isChecked={useCustomManifests}
|
|
142
147
|
isDisabled={isRequired}
|
|
143
148
|
onChange={handleSwitchChange}
|
|
@@ -146,7 +151,7 @@ export const CustomManifestsPage = ({
|
|
|
146
151
|
</span>
|
|
147
152
|
</Tooltip>
|
|
148
153
|
</FormGroup>
|
|
149
|
-
{!useCustomManifests && <div style={{ minHeight: '
|
|
154
|
+
{!useCustomManifests && <div style={{ minHeight: '250px' }} aria-hidden="true" />}
|
|
150
155
|
{useCustomManifests && (
|
|
151
156
|
<>
|
|
152
157
|
{reminderAlerts}
|
|
@@ -12,6 +12,7 @@ import { CustomManifest } from './CustomManifest';
|
|
|
12
12
|
import { getEmptyManifest, getManifestName } from './utils';
|
|
13
13
|
import { CustomManifestValues } from '../data/dataTypes';
|
|
14
14
|
import { selectCurrentClusterPermissionsState } from '../../../../store/slices/current-cluster/selectors';
|
|
15
|
+
import { useClusterWizardContext } from '../../../clusterWizard/ClusterWizardContext';
|
|
15
16
|
|
|
16
17
|
const fieldName = 'manifests';
|
|
17
18
|
|
|
@@ -40,6 +41,8 @@ export const CustomManifestsArray = ({
|
|
|
40
41
|
clusterId,
|
|
41
42
|
...props
|
|
42
43
|
}: CustomManifestsArrayProps) => {
|
|
44
|
+
const { updateUISettings } = useClusterWizardContext();
|
|
45
|
+
|
|
43
46
|
const [field, { error }] = useField<CustomManifestValues[]>({
|
|
44
47
|
name: fieldName,
|
|
45
48
|
});
|
|
@@ -67,6 +70,7 @@ export const CustomManifestsArray = ({
|
|
|
67
70
|
manifestToRemove['folder'] as string,
|
|
68
71
|
manifestToRemove['filename'],
|
|
69
72
|
);
|
|
73
|
+
await updateUISettings({ customManifestsUpdated: true });
|
|
70
74
|
} catch (e) {
|
|
71
75
|
handleApiError(e, () =>
|
|
72
76
|
addAlert({
|
|
@@ -77,7 +81,7 @@ export const CustomManifestsArray = ({
|
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
},
|
|
80
|
-
[addAlert, field.value],
|
|
84
|
+
[addAlert, field.value, updateUISettings],
|
|
81
85
|
);
|
|
82
86
|
|
|
83
87
|
const onConfirm = React.useCallback(async (): Promise<void> => {
|
package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx
CHANGED
|
@@ -4,7 +4,6 @@ import { useSelector } from 'react-redux';
|
|
|
4
4
|
import { Stack, StackItem, Tooltip } from '@patternfly/react-core';
|
|
5
5
|
import {
|
|
6
6
|
canBeDualStack,
|
|
7
|
-
canSelectNetworkTypeSDN,
|
|
8
7
|
CpuArchitecture,
|
|
9
8
|
DUAL_STACK,
|
|
10
9
|
HostSubnets,
|
|
@@ -144,9 +143,6 @@ const NetworkConfiguration = ({
|
|
|
144
143
|
const isDualStack = values.stackType === DUAL_STACK;
|
|
145
144
|
|
|
146
145
|
const isDualStackSelectable = React.useMemo(() => canBeDualStack(hostSubnets), [hostSubnets]);
|
|
147
|
-
const isSDNSelectable = React.useMemo(() => {
|
|
148
|
-
return canSelectNetworkTypeSDN(isSNOCluster, isDualStack);
|
|
149
|
-
}, [isSNOCluster, isDualStack]);
|
|
150
146
|
|
|
151
147
|
const [isAdvanced, setAdvanced] = React.useState(
|
|
152
148
|
isDualStack || isAdvNetworkConf(cluster, defaultNetworkSettings),
|
|
@@ -262,7 +258,6 @@ const NetworkConfiguration = ({
|
|
|
262
258
|
<StackItem>
|
|
263
259
|
<NetworkTypeDropDown
|
|
264
260
|
isDisabled={isViewerMode}
|
|
265
|
-
isSDNSelectable={isSDNSelectable}
|
|
266
261
|
featureSupportLevelData={featureSupportLevelData}
|
|
267
262
|
/>
|
|
268
263
|
</StackItem>
|
package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
CHANGED
|
@@ -12,82 +12,71 @@ import {
|
|
|
12
12
|
StackItem,
|
|
13
13
|
Tooltip,
|
|
14
14
|
} from '@patternfly/react-core';
|
|
15
|
-
import {
|
|
16
|
-
NETWORK_TYPE_CALICO,
|
|
17
|
-
NETWORK_TYPE_CILIUM,
|
|
18
|
-
NETWORK_TYPE_CISCO_ACI,
|
|
19
|
-
NETWORK_TYPE_LABELS,
|
|
20
|
-
NETWORK_TYPE_NONE,
|
|
21
|
-
NETWORK_TYPE_OVN,
|
|
22
|
-
NETWORK_TYPE_SDN,
|
|
23
|
-
} from '../../../../common/config';
|
|
24
15
|
import { getFieldId, ExternalLink } from '../../../../common/components/ui';
|
|
25
16
|
import {
|
|
26
17
|
NewFeatureSupportLevelMap,
|
|
27
18
|
useNewFeatureSupportLevel,
|
|
28
19
|
} from '../../../../common/components/newFeatureSupportLevels';
|
|
29
|
-
import
|
|
20
|
+
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
|
|
30
21
|
import type { NetworkConfigurationValues } from '../../../../common/types/clusters';
|
|
31
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
NETWORK_TYPE_OVN,
|
|
24
|
+
NETWORK_TYPE_LABELS,
|
|
25
|
+
NETWORK_TYPE_FEATURE_IDS,
|
|
26
|
+
isThirdPartyCNI,
|
|
27
|
+
} from '../../../../common/types/networkType';
|
|
32
28
|
import { RED_HAT_CNI_SUPPORT_MATRIX_LINK } from '../../../../common/config/docs_links';
|
|
33
29
|
|
|
34
30
|
export interface NetworkTypeDropDownProps {
|
|
35
31
|
isDisabled?: boolean;
|
|
36
|
-
isSDNSelectable: boolean;
|
|
37
32
|
featureSupportLevelData: NewFeatureSupportLevelMap | null;
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
export const NetworkTypeDropDown = ({
|
|
41
36
|
isDisabled = false,
|
|
42
|
-
isSDNSelectable,
|
|
43
37
|
featureSupportLevelData,
|
|
44
38
|
}: NetworkTypeDropDownProps) => {
|
|
45
39
|
const [field, , { setValue }] = useField<string>('networkType');
|
|
46
40
|
const [isOpen, setOpen] = React.useState(false);
|
|
47
41
|
const { values } = useFormikContext<NetworkConfigurationValues>();
|
|
48
|
-
const { getFeatureDisabledReason } = useNewFeatureSupportLevel();
|
|
42
|
+
const { getFeatureDisabledReason, getFeatureSupportLevel } = useNewFeatureSupportLevel();
|
|
49
43
|
const fieldId = getFieldId('networkType', 'input');
|
|
50
44
|
const showThirdPartyBanner = isThirdPartyCNI(values.networkType);
|
|
51
45
|
|
|
52
|
-
const sdnDisabledReason = React.useMemo(() => {
|
|
53
|
-
if (!isSDNSelectable) {
|
|
54
|
-
return 'SDN is not supported for SNO clusters or when IPv6 is detected.';
|
|
55
|
-
}
|
|
56
|
-
return getFeatureDisabledReason('SDN_NETWORK_TYPE', featureSupportLevelData ?? undefined);
|
|
57
|
-
}, [isSDNSelectable, featureSupportLevelData, getFeatureDisabledReason]);
|
|
58
|
-
|
|
59
46
|
React.useEffect(() => {
|
|
60
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
getFeatureDisabledReason(
|
|
49
|
+
NETWORK_TYPE_FEATURE_IDS[field.value],
|
|
50
|
+
featureSupportLevelData ?? undefined,
|
|
51
|
+
) !== undefined
|
|
52
|
+
) {
|
|
61
53
|
setValue(NETWORK_TYPE_OVN);
|
|
62
54
|
}
|
|
63
|
-
}, [
|
|
55
|
+
}, [field.value, setValue, featureSupportLevelData, getFeatureDisabledReason]);
|
|
64
56
|
|
|
65
57
|
const currentDisplayValue = NETWORK_TYPE_LABELS[field.value];
|
|
66
58
|
|
|
67
59
|
const dropdownItems = Object.entries(NETWORK_TYPE_LABELS).map(([value, label]) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
const disabledReason = getFeatureDisabledReason(
|
|
61
|
+
NETWORK_TYPE_FEATURE_IDS[value],
|
|
62
|
+
featureSupportLevelData ?? undefined,
|
|
63
|
+
);
|
|
64
|
+
const featureId = NETWORK_TYPE_FEATURE_IDS[value];
|
|
65
|
+
const supportLevel = featureId
|
|
66
|
+
? getFeatureSupportLevel(featureId, featureSupportLevelData ?? undefined)
|
|
67
|
+
: undefined;
|
|
68
|
+
const shouldDisable =
|
|
69
|
+
supportLevel === 'unavailable' ||
|
|
70
|
+
supportLevel === 'unsupported' ||
|
|
71
|
+
disabledReason !== undefined;
|
|
76
72
|
return (
|
|
77
|
-
<DropdownItem
|
|
78
|
-
key={value}
|
|
79
|
-
id={value}
|
|
80
|
-
value={value}
|
|
81
|
-
isAriaDisabled={disabledReason !== undefined}
|
|
82
|
-
>
|
|
73
|
+
<DropdownItem key={value} id={value} value={value} isAriaDisabled={shouldDisable}>
|
|
83
74
|
<Tooltip hidden={!disabledReason} content={disabledReason} position="top">
|
|
84
75
|
<div>
|
|
85
76
|
{label}
|
|
86
|
-
{
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
</span>
|
|
90
|
-
)}
|
|
77
|
+
<span onClick={(event) => event.stopPropagation()}>
|
|
78
|
+
<NewFeatureSupportLevelBadge featureId={featureId} supportLevel={supportLevel} />
|
|
79
|
+
</span>
|
|
91
80
|
</div>
|
|
92
81
|
</Tooltip>
|
|
93
82
|
</DropdownItem>
|
|
@@ -132,11 +121,7 @@ export const NetworkTypeDropDown = ({
|
|
|
132
121
|
</StackItem>
|
|
133
122
|
{showThirdPartyBanner && (
|
|
134
123
|
<StackItem>
|
|
135
|
-
<Alert
|
|
136
|
-
variant={AlertVariant.warning}
|
|
137
|
-
isInline
|
|
138
|
-
title="Third-party CNI (Technology Preview)"
|
|
139
|
-
>
|
|
124
|
+
<Alert variant={AlertVariant.warning} isInline title="Third-party CNI">
|
|
140
125
|
<Stack hasGutter>
|
|
141
126
|
<StackItem>
|
|
142
127
|
Third-party CNIs require uploading CNI manifests. Please verify you have the
|
|
@@ -92,17 +92,11 @@ export const getIpAddressValidationSchema = (protocolVersion: ProtocolVersion) =
|
|
|
92
92
|
const protocolVersionLabel = protocolVersion === ProtocolVersion.ipv4 ? 'IPv4' : 'IPv6';
|
|
93
93
|
return Yup.string().test(
|
|
94
94
|
protocolVersion,
|
|
95
|
-
|
|
96
|
-
`Value "${
|
|
97
|
-
params?.value !== undefined ? String(params.value) : ''
|
|
98
|
-
}" is not a valid ${protocolVersionLabel} address`,
|
|
95
|
+
`Value \${value} is not a valid ${protocolVersionLabel} address`,
|
|
99
96
|
(value?: string) => {
|
|
100
|
-
if (value
|
|
97
|
+
if (!value) {
|
|
101
98
|
return true;
|
|
102
99
|
}
|
|
103
|
-
if (typeof value !== 'string') {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
100
|
return isValidAddress(value, protocolVersion);
|
|
107
101
|
},
|
|
108
102
|
);
|
|
@@ -96,7 +96,6 @@ const getExpandedHostComponent = (protocolType: StaticProtocolType) => {
|
|
|
96
96
|
label={`IP address (${getProtocolVersionLabel(protocolVersion)})`}
|
|
97
97
|
fieldId={getFieldId(`${fieldName}.ips.${protocolVersion}`, 'input')}
|
|
98
98
|
key={protocolVersion}
|
|
99
|
-
isRequired
|
|
100
99
|
>
|
|
101
100
|
<OcmInputField
|
|
102
101
|
name={`${fieldName}.ips.${protocolVersion}`}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StaticIpForm } from '../StaticIpForm';
|
|
3
3
|
import { StaticIpFormProps, StaticIpViewProps } from '../propTypes';
|
|
4
4
|
import { FormViewHost, FormViewNetworkWideValues } from '../../data/dataTypes';
|
|
5
|
-
import {
|
|
5
|
+
import { networkWideValidationSchema } from './formViewNetworkWideValidationSchema';
|
|
6
6
|
import { networkWideToInfraEnvField } from '../../data/formDataToInfraEnvField';
|
|
7
7
|
import { FormViewNetworkWideFields } from './FormViewNetworkWideFields';
|
|
8
8
|
import { getFormData, getFormViewNetworkWideValues } from '../../data/fromInfraEnv';
|
|
@@ -22,7 +22,7 @@ export const FormViewNetworkWide: React.FC<StaticIpViewProps> = ({ infraEnv, ...
|
|
|
22
22
|
setFormProps({
|
|
23
23
|
infraEnv,
|
|
24
24
|
...props,
|
|
25
|
-
validationSchema:
|
|
25
|
+
validationSchema: networkWideValidationSchema,
|
|
26
26
|
getInitialValues: (infraEnv: InfraEnv) => {
|
|
27
27
|
return getFormViewNetworkWideValues(infraEnv);
|
|
28
28
|
},
|
|
@@ -95,71 +95,32 @@ const getAddressDataValidationSchema = (protocolVersion: ProtocolVersion, ipConf
|
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
'rendezvous-ip-in-subnet',
|
|
105
|
-
'Rendezvous IP must be within the IPv4 subnet.',
|
|
106
|
-
(value: unknown, context: Yup.TestContext) => {
|
|
107
|
-
const values = value as FormViewNetworkWideValues | undefined;
|
|
108
|
-
const machineNetwork = values?.ipConfigs?.ipv4?.machineNetwork;
|
|
109
|
-
if (
|
|
110
|
-
!rendezvousIp?.trim() ||
|
|
111
|
-
!machineNetwork?.ip?.trim() ||
|
|
112
|
-
machineNetwork.prefixLength === '' ||
|
|
113
|
-
typeof machineNetwork.prefixLength !== 'number'
|
|
114
|
-
) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
const inSubnetSchema = getInMachineNetworkValidationSchema(
|
|
118
|
-
ProtocolVersion.ipv4,
|
|
119
|
-
machineNetwork,
|
|
120
|
-
);
|
|
121
|
-
if (!inSubnetSchema.isValidSync(rendezvousIp)) {
|
|
122
|
-
return context.createError({
|
|
123
|
-
path: 'ipConfigs.ipv4.machineNetwork.ip',
|
|
124
|
-
message: 'Rendezvous IP must be within the IPv4 subnet.',
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
return true;
|
|
128
|
-
},
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const getNetworkWideValidationSchema = (rendezvousIp?: string) =>
|
|
133
|
-
Yup.lazy((values: FormViewNetworkWideValues) => {
|
|
134
|
-
const ipConfigsValidationSchemas = Yup.object({
|
|
135
|
-
ipv4: getAddressDataValidationSchema(ProtocolVersion.ipv4, values.ipConfigs.ipv4),
|
|
136
|
-
ipv6: showProtocolVersion(values.protocolType, ProtocolVersion.ipv6)
|
|
137
|
-
? getAddressDataValidationSchema(ProtocolVersion.ipv6, values.ipConfigs.ipv6)
|
|
138
|
-
: Yup.object<IpConfig>(),
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
const baseSchema = Yup.object({
|
|
142
|
-
useVlan: Yup.boolean(),
|
|
143
|
-
vlanId: Yup.mixed().when('useVlan', {
|
|
144
|
-
is: (useVlan: boolean) => useVlan,
|
|
145
|
-
then: () =>
|
|
146
|
-
Yup.number()
|
|
147
|
-
.required(MUST_BE_A_NUMBER)
|
|
148
|
-
.min(1, `Must be more than or equal to 1`)
|
|
149
|
-
.max(MAX_VLAN_ID, `Must be less than or equal to ${MAX_VLAN_ID}`)
|
|
150
|
-
.test('not-number', MUST_BE_A_NUMBER, () => validateNumber(values.vlanId))
|
|
151
|
-
.nullable()
|
|
152
|
-
.transform(transformNumber) as Yup.NumberSchema,
|
|
153
|
-
}),
|
|
154
|
-
protocolType: Yup.string(),
|
|
155
|
-
dns: getDNSValidationSchema(values.protocolType),
|
|
156
|
-
ipConfigs: ipConfigsValidationSchemas,
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
return baseSchema.concat(getRendezvousIpCoherenceTest(rendezvousIp));
|
|
98
|
+
export const networkWideValidationSchema = Yup.lazy((values: FormViewNetworkWideValues) => {
|
|
99
|
+
const ipConfigsValidationSchemas = Yup.object({
|
|
100
|
+
ipv4: getAddressDataValidationSchema(ProtocolVersion.ipv4, values.ipConfigs.ipv4),
|
|
101
|
+
ipv6: showProtocolVersion(values.protocolType, ProtocolVersion.ipv6)
|
|
102
|
+
? getAddressDataValidationSchema(ProtocolVersion.ipv6, values.ipConfigs.ipv6)
|
|
103
|
+
: Yup.object<IpConfig>(),
|
|
160
104
|
});
|
|
161
105
|
|
|
162
|
-
|
|
106
|
+
return Yup.object({
|
|
107
|
+
useVlan: Yup.boolean(),
|
|
108
|
+
vlanId: Yup.mixed().when('useVlan', {
|
|
109
|
+
is: (useVlan: boolean) => useVlan,
|
|
110
|
+
then: () =>
|
|
111
|
+
Yup.number()
|
|
112
|
+
.required(MUST_BE_A_NUMBER)
|
|
113
|
+
.min(1, `Must be more than or equal to 1`)
|
|
114
|
+
.max(MAX_VLAN_ID, `Must be less than or equal to ${MAX_VLAN_ID}`)
|
|
115
|
+
.test('not-number', MUST_BE_A_NUMBER, () => validateNumber(values.vlanId))
|
|
116
|
+
.nullable()
|
|
117
|
+
.transform(transformNumber) as Yup.NumberSchema,
|
|
118
|
+
}),
|
|
119
|
+
protocolType: Yup.string(),
|
|
120
|
+
dns: getDNSValidationSchema(values.protocolType),
|
|
121
|
+
ipConfigs: ipConfigsValidationSchemas,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
163
124
|
|
|
164
125
|
export const validateNumber = (vlanId: FormViewNetworkWideValues['vlanId']) => {
|
|
165
126
|
//We need to validate that value is a number(without letters) and is not an exponential number (ex: 1e2)
|
|
@@ -39,6 +39,7 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
|
|
|
39
39
|
const navigate = useNavigate();
|
|
40
40
|
const dispatch = useDispatch();
|
|
41
41
|
const { usedClusterNames } = useUsedClusterNames(cluster?.id || '');
|
|
42
|
+
const pullSecret = usePullSecret();
|
|
42
43
|
const {
|
|
43
44
|
error: errorOCPVersions,
|
|
44
45
|
loading: loadingOCPVersions,
|
|
@@ -46,8 +47,6 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
|
|
|
46
47
|
} = useOpenShiftVersionsContext();
|
|
47
48
|
const location = useLocation();
|
|
48
49
|
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
|
|
49
|
-
const defaultPullSecret = usePullSecret();
|
|
50
|
-
const pullSecret = isSingleClusterFeatureEnabled ? infraEnv?.pullSecret || '' : defaultPullSecret;
|
|
51
50
|
|
|
52
51
|
const handleClusterUpdate = React.useCallback(
|
|
53
52
|
async (clusterId: Cluster['id'], params: ClusterDetailsUpdateParams) => {
|
|
@@ -11,9 +11,10 @@ import {
|
|
|
11
11
|
getRichTextValidation,
|
|
12
12
|
useAlerts,
|
|
13
13
|
TechnologyPreview,
|
|
14
|
+
OpenshiftVersionOptionType,
|
|
15
|
+
getFormikErrorFields,
|
|
14
16
|
} from '../../../common';
|
|
15
17
|
import { canNextClusterDetails } from './wizardTransition';
|
|
16
|
-
import { OpenshiftVersionOptionType, getFormikErrorFields } from '../../../common';
|
|
17
18
|
import ClusterWizardFooter from './ClusterWizardFooter';
|
|
18
19
|
import { isInOcm } from '../../../common/api';
|
|
19
20
|
import {
|
|
@@ -3,7 +3,6 @@ import { HostsNetworkConfigurationType } from '../../services';
|
|
|
3
3
|
import { StaticIpView } from '../clusterConfiguration/staticIp/data/dataTypes';
|
|
4
4
|
import { ClusterWizardStepsType } from './wizardTransition';
|
|
5
5
|
import { UISettingsValues } from '../../../common';
|
|
6
|
-
import { InfraEnv } from '@openshift-assisted/types/assisted-installer-service';
|
|
7
6
|
|
|
8
7
|
export type ClusterWizardContextType = {
|
|
9
8
|
currentStepId: ClusterWizardStepsType;
|
|
@@ -19,8 +18,6 @@ export type ClusterWizardContextType = {
|
|
|
19
18
|
uiSettings?: UISettingsValues;
|
|
20
19
|
installDisconnected: boolean;
|
|
21
20
|
setInstallDisconnected: (enabled: boolean) => void;
|
|
22
|
-
disconnectedInfraEnv?: InfraEnv;
|
|
23
|
-
setDisconnectedInfraEnv: (infraEnv: InfraEnv | undefined) => void;
|
|
24
21
|
};
|
|
25
22
|
|
|
26
23
|
export const ClusterWizardContext = React.createContext<ClusterWizardContextType | null>(null);
|
|
@@ -13,13 +13,17 @@ import { HostsNetworkConfigurationType } from '../../services';
|
|
|
13
13
|
import { defaultWizardSteps, staticIpFormViewSubSteps } from './constants';
|
|
14
14
|
import { StaticIpView } from '../clusterConfiguration/staticIp/data/dataTypes';
|
|
15
15
|
import { getStaticIpInfo } from '../clusterConfiguration/staticIp/data/fromInfraEnv';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
AssistedInstallerOCMPermissionTypesListType,
|
|
18
|
+
useAlerts,
|
|
19
|
+
isThirdPartyCNI,
|
|
20
|
+
} from '../../../common';
|
|
17
21
|
import useSetClusterPermissions from '../../hooks/useSetClusterPermissions';
|
|
18
22
|
import { Cluster, InfraEnv } from '@openshift-assisted/types/assisted-installer-service';
|
|
19
23
|
import { useUISettings } from '../../hooks';
|
|
20
24
|
import { AlertVariant } from '@patternfly/react-core';
|
|
21
25
|
import { useFeature } from '../../hooks/use-feature';
|
|
22
|
-
import { isOciPlatformType
|
|
26
|
+
import { isOciPlatformType } from '../utils';
|
|
23
27
|
|
|
24
28
|
const addStepToClusterWizard = (
|
|
25
29
|
wizardStepIds: ClusterWizardStepsType[],
|
|
@@ -72,33 +76,6 @@ const getWizardStepIds = (
|
|
|
72
76
|
return stepsCopy;
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
// Same logic as getWizardStepIds but for disconnected flow
|
|
76
|
-
// Adds static IP steps after 'disconnected-optional-configurations' instead of 'cluster-details'
|
|
77
|
-
const getDisconnectedWizardStepIds = (
|
|
78
|
-
wizardStepIds: ClusterWizardStepsType[] | undefined,
|
|
79
|
-
staticIpView?: StaticIpView | 'dhcp-selected',
|
|
80
|
-
): ClusterWizardStepsType[] => {
|
|
81
|
-
let stepsCopy = wizardStepIds ? [...wizardStepIds] : [...disconnectedSteps];
|
|
82
|
-
if (staticIpView === StaticIpView.YAML) {
|
|
83
|
-
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
|
|
84
|
-
stepsCopy = addStepToClusterWizard(stepsCopy, 'disconnected-optional-configurations', [
|
|
85
|
-
'static-ip-yaml-view',
|
|
86
|
-
]);
|
|
87
|
-
} else if (staticIpView === StaticIpView.FORM) {
|
|
88
|
-
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-yaml-view', 1);
|
|
89
|
-
stepsCopy = addStepToClusterWizard(
|
|
90
|
-
stepsCopy,
|
|
91
|
-
'disconnected-optional-configurations',
|
|
92
|
-
staticIpFormViewSubSteps,
|
|
93
|
-
);
|
|
94
|
-
} else if (staticIpView === 'dhcp-selected') {
|
|
95
|
-
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
|
|
96
|
-
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-yaml-view', 1);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return stepsCopy;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
79
|
const ClusterWizardContextProvider = ({
|
|
103
80
|
children,
|
|
104
81
|
cluster,
|
|
@@ -112,13 +89,8 @@ const ClusterWizardContextProvider = ({
|
|
|
112
89
|
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
|
|
113
90
|
const [currentStepId, setCurrentStepId] = React.useState<ClusterWizardStepsType>();
|
|
114
91
|
const [connectedWizardStepIds, setWizardStepIds] = React.useState<ClusterWizardStepsType[]>();
|
|
115
|
-
const [disconnectedWizardStepIds, setDisconnectedWizardStepIds] =
|
|
116
|
-
React.useState<ClusterWizardStepsType[]>(disconnectedSteps);
|
|
117
92
|
const [wizardPerPage, setWizardPerPage] = React.useState(10);
|
|
118
93
|
const [installDisconnected, setInstallDisconnected] = React.useState(false);
|
|
119
|
-
const [disconnectedInfraEnv, setDisconnectedInfraEnv] = React.useState<InfraEnv | undefined>(
|
|
120
|
-
infraEnv,
|
|
121
|
-
);
|
|
122
94
|
const location = useLocation();
|
|
123
95
|
const locationState = location.state as ClusterWizardFlowStateType | undefined;
|
|
124
96
|
const {
|
|
@@ -130,7 +102,7 @@ const ClusterWizardContextProvider = ({
|
|
|
130
102
|
const { clearAlerts, addAlert, alerts } = useAlerts();
|
|
131
103
|
const setClusterPermissions = useSetClusterPermissions();
|
|
132
104
|
|
|
133
|
-
const wizardStepIds = installDisconnected ?
|
|
105
|
+
const wizardStepIds = installDisconnected ? disconnectedSteps : connectedWizardStepIds;
|
|
134
106
|
|
|
135
107
|
React.useEffect(() => {
|
|
136
108
|
if (!UISettingsLoading) {
|
|
@@ -190,29 +162,18 @@ const ClusterWizardContextProvider = ({
|
|
|
190
162
|
|
|
191
163
|
const handleMoveFromStaticIp = () => {
|
|
192
164
|
//if static ip view change wasn't persisted, moving from static ip step should change the wizard steps to match the view in the infra env
|
|
193
|
-
const
|
|
194
|
-
const staticIpInfo = currentInfraEnv ? getStaticIpInfo(currentInfraEnv) : undefined;
|
|
165
|
+
const staticIpInfo = infraEnv ? getStaticIpInfo(infraEnv) : undefined;
|
|
195
166
|
if (!staticIpInfo) {
|
|
196
167
|
throw `Wizard step is currently ${currentStepId}, but no static ip info is defined`;
|
|
197
168
|
}
|
|
198
169
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
disconnectedWizardStepIds,
|
|
203
|
-
staticIpInfo.view,
|
|
204
|
-
);
|
|
205
|
-
setDisconnectedWizardStepIds(newStepIds);
|
|
206
|
-
} else {
|
|
207
|
-
// For connected wizard, update wizard steps directly
|
|
208
|
-
const newStepIds = getWizardStepIds(
|
|
209
|
-
wizardStepIds,
|
|
210
|
-
staticIpInfo.view,
|
|
170
|
+
const newStepIds = getWizardStepIds(
|
|
171
|
+
wizardStepIds,
|
|
172
|
+
staticIpInfo.view,
|
|
211
173
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
174
|
+
isSingleClusterFeatureEnabled,
|
|
175
|
+
);
|
|
176
|
+
setWizardStepIds(newStepIds);
|
|
216
177
|
};
|
|
217
178
|
|
|
218
179
|
const onSetCurrentStepId = (stepId: ClusterWizardStepsType) => {
|
|
@@ -244,43 +205,22 @@ const ClusterWizardContextProvider = ({
|
|
|
244
205
|
} else {
|
|
245
206
|
setCurrentStepId('static-ip-network-wide-configurations');
|
|
246
207
|
}
|
|
247
|
-
|
|
248
|
-
// For disconnected wizard, update wizard steps (same pattern as connected)
|
|
249
|
-
setDisconnectedWizardStepIds(
|
|
250
|
-
getDisconnectedWizardStepIds(disconnectedWizardStepIds, view),
|
|
251
|
-
);
|
|
252
|
-
} else {
|
|
253
|
-
setWizardStepIds(getWizardStepIds(wizardStepIds, view, isSingleClusterFeatureEnabled));
|
|
254
|
-
}
|
|
208
|
+
setWizardStepIds(getWizardStepIds(wizardStepIds, view, isSingleClusterFeatureEnabled));
|
|
255
209
|
},
|
|
256
210
|
onUpdateHostNetworkConfigType(type: HostsNetworkConfigurationType): void {
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
);
|
|
263
|
-
} else {
|
|
264
|
-
setDisconnectedWizardStepIds(
|
|
265
|
-
getDisconnectedWizardStepIds(disconnectedWizardStepIds, 'dhcp-selected'),
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
// For connected wizard, update wizard steps directly
|
|
270
|
-
if (type === HostsNetworkConfigurationType.STATIC) {
|
|
271
|
-
setWizardStepIds(
|
|
272
|
-
getWizardStepIds(
|
|
273
|
-
wizardStepIds,
|
|
274
|
-
StaticIpView.FORM,
|
|
211
|
+
if (type === HostsNetworkConfigurationType.STATIC) {
|
|
212
|
+
setWizardStepIds(
|
|
213
|
+
getWizardStepIds(
|
|
214
|
+
wizardStepIds,
|
|
215
|
+
StaticIpView.FORM,
|
|
275
216
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
217
|
+
isSingleClusterFeatureEnabled,
|
|
218
|
+
),
|
|
219
|
+
);
|
|
220
|
+
} else {
|
|
221
|
+
setWizardStepIds(
|
|
222
|
+
getWizardStepIds(wizardStepIds, 'dhcp-selected', isSingleClusterFeatureEnabled),
|
|
223
|
+
);
|
|
284
224
|
}
|
|
285
225
|
},
|
|
286
226
|
wizardStepIds: wizardStepIds,
|
|
@@ -299,8 +239,6 @@ const ClusterWizardContextProvider = ({
|
|
|
299
239
|
connectedWizardStepIds?.length && onSetCurrentStepId(connectedWizardStepIds[0]);
|
|
300
240
|
}
|
|
301
241
|
},
|
|
302
|
-
disconnectedInfraEnv,
|
|
303
|
-
setDisconnectedInfraEnv,
|
|
304
242
|
};
|
|
305
243
|
}, [
|
|
306
244
|
wizardStepIds,
|
|
@@ -313,8 +251,6 @@ const ClusterWizardContextProvider = ({
|
|
|
313
251
|
updateUISettings,
|
|
314
252
|
installDisconnected,
|
|
315
253
|
connectedWizardStepIds,
|
|
316
|
-
disconnectedWizardStepIds,
|
|
317
|
-
disconnectedInfraEnv,
|
|
318
254
|
]);
|
|
319
255
|
|
|
320
256
|
if (!contextValue) {
|