@openshift-assisted/ui-lib 2.14.0-cim → 2.14.2-cim
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/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts +2 -3
- package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +3 -0
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts +15 -2
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.d.ts +1 -2
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts +1 -2
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.d.ts +8 -7
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.d.ts +17 -0
- package/build/@types/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.d.ts +8 -0
- package/build/@types/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/components/ValidationSection.d.ts +16 -0
- package/build/@types/cim/components/ClusterDeployment/components/ValidationSection.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/constants.d.ts +2 -0
- package/build/@types/cim/components/ClusterDeployment/constants.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/index.d.ts +1 -2
- package/build/@types/cim/components/ClusterDeployment/index.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +1 -11
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/types.d.ts +7 -9
- package/build/@types/cim/components/ClusterDeployment/types.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts +8 -2
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/types.d.ts +6 -3
- package/build/@types/cim/components/Hypershift/types.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvAgentTable.d.ts.map +1 -1
- package/build/@types/cim/components/common/constants.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/agents.d.ts +3 -0
- package/build/@types/cim/components/helpers/agents.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/toAssisted.d.ts.map +1 -1
- package/build/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
- package/build/@types/cim/components/modals/EditAgentModal.d.ts.map +1 -1
- package/build/@types/cim/components/modals/ScaleUpModal.d.ts +3 -0
- package/build/@types/cim/components/modals/ScaleUpModal.d.ts.map +1 -1
- package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +1 -0
- package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +7 -0
- package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -0
- package/build/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
- package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
- package/build/@types/common/components/hosts/EditHostForm.d.ts.map +1 -1
- package/build/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -0
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js +9 -7
- package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +26 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +13 -29
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js +2 -12
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js +50 -26
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js +3 -3
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js +39 -21
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js +58 -27
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.js +24 -24
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js +26 -42
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.js +12 -8
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +4 -5
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js +5 -5
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.js +50 -0
- package/build/cjs/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.js.map +1 -0
- package/build/cjs/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.js +24 -0
- package/build/cjs/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.js.map +1 -0
- package/build/cjs/cim/components/ClusterDeployment/components/ValidationSection.js +17 -0
- package/build/cjs/cim/components/ClusterDeployment/components/ValidationSection.js.map +1 -0
- package/build/cjs/cim/components/ClusterDeployment/constants.js +2 -0
- package/build/cjs/cim/components/ClusterDeployment/constants.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/index.js +2 -5
- package/build/cjs/cim/components/ClusterDeployment/index.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +1 -14
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.js +6 -4
- package/build/cjs/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js +2 -12
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js +1 -1
- package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js.map +1 -1
- package/build/cjs/cim/components/common/constants.js +1 -1
- package/build/cjs/cim/components/common/constants.js.map +1 -1
- package/build/cjs/cim/components/helpers/agents.js +19 -1
- package/build/cjs/cim/components/helpers/agents.js.map +1 -1
- package/build/cjs/cim/components/helpers/toAssisted.js +25 -22
- package/build/cjs/cim/components/helpers/toAssisted.js.map +1 -1
- package/build/cjs/cim/components/modals/AddHostModal.js +4 -5
- package/build/cjs/cim/components/modals/AddHostModal.js.map +1 -1
- package/build/cjs/cim/components/modals/EditAgentModal.js +2 -2
- package/build/cjs/cim/components/modals/EditAgentModal.js.map +1 -1
- package/build/cjs/cim/components/modals/ScaleUpModal.js +3 -2
- package/build/cjs/cim/components/modals/ScaleUpModal.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +41 -0
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -0
- package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +4 -5
- package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js +5 -5
- package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -0
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js +14 -18
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +4 -4
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
- package/build/cjs/common/components/hosts/EditHostForm.js +3 -3
- package/build/cjs/common/components/hosts/EditHostForm.js.map +1 -1
- package/build/cjs/common/components/ui/formik/validationSchemas.js +18 -15
- package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
- package/build/cjs/common/config/constants.js +1 -1
- package/build/cjs/common/config/constants.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.tsx +11 -9
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +63 -3
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +25 -53
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.tsx +7 -16
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.tsx +102 -59
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.tsx +16 -10
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.tsx +84 -48
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.tsx +106 -54
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.tsx +96 -85
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizard.tsx +109 -119
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.tsx +27 -14
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +4 -6
- package/lib/cim/components/ClusterDeployment/NetworkConfiguration.tsx +5 -5
- package/lib/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.tsx +107 -0
- package/lib/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.tsx +49 -0
- package/lib/cim/components/ClusterDeployment/components/ValidationSection.tsx +41 -0
- package/lib/cim/components/ClusterDeployment/constants.ts +3 -1
- package/lib/cim/components/ClusterDeployment/index.ts +1 -3
- package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +1 -26
- package/lib/cim/components/ClusterDeployment/types.ts +7 -10
- package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +3 -3
- package/lib/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.tsx +4 -2
- package/lib/cim/components/Hypershift/types.ts +6 -3
- package/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx +7 -16
- package/lib/cim/components/InfraEnv/OpenshiftVersionDropdown.tsx +1 -1
- package/lib/cim/components/common/constants.ts +1 -2
- package/lib/cim/components/helpers/agents.ts +30 -1
- package/lib/cim/components/helpers/toAssisted.ts +13 -8
- package/lib/cim/components/modals/AddHostModal.tsx +4 -5
- package/lib/cim/components/modals/EditAgentModal.tsx +2 -1
- package/lib/cim/components/modals/ScaleUpModal.tsx +12 -2
- package/lib/cim/types/k8s/infra-env-k8s-resource.ts +1 -0
- package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +93 -0
- package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +10 -12
- package/lib/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.tsx +9 -9
- package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -0
- package/lib/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.tsx +50 -61
- package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +4 -4
- package/lib/common/components/clusterWizard/types.ts +1 -0
- package/lib/common/components/hosts/EditHostForm.tsx +16 -6
- package/lib/common/components/ui/formik/validationSchemas.ts +13 -10
- package/lib/common/config/constants.ts +1 -1
- package/package.json +4 -3
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.d.ts +0 -10
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.d.ts.map +0 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.d.ts +0 -13
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.d.ts.map +0 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts +0 -4
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts.map +0 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.d.ts +0 -7
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.d.ts.map +0 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.js +0 -31
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.js.map +0 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.js +0 -50
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.js.map +0 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js +0 -35
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js.map +0 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.js +0 -9
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.js.map +0 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.tsx +0 -79
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.tsx +0 -128
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.tsx +0 -81
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.tsx +0 -13
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Formik, useFormikContext } from 'formik';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
AlertVariant,
|
|
6
|
+
Grid,
|
|
7
|
+
GridItem,
|
|
8
|
+
useWizardContext,
|
|
9
|
+
useWizardFooter,
|
|
10
|
+
WizardFooter,
|
|
11
|
+
} from '@patternfly/react-core';
|
|
4
12
|
|
|
5
13
|
import {
|
|
6
14
|
useAlerts,
|
|
@@ -8,6 +16,7 @@ import {
|
|
|
8
16
|
FormikAutoSave,
|
|
9
17
|
getFormikErrorFields,
|
|
10
18
|
clusterFieldLabels,
|
|
19
|
+
Alerts,
|
|
11
20
|
} from '../../../common';
|
|
12
21
|
|
|
13
22
|
import {
|
|
@@ -15,20 +24,18 @@ import {
|
|
|
15
24
|
AgentTableActions,
|
|
16
25
|
ClusterDeploymentNetworkingValues,
|
|
17
26
|
} from './types';
|
|
18
|
-
import ClusterDeploymentWizardFooter from './ClusterDeploymentWizardFooter';
|
|
19
|
-
import ClusterDeploymentWizardStep from './ClusterDeploymentWizardStep';
|
|
20
|
-
import ClusterDeploymentWizardContext from './ClusterDeploymentWizardContext';
|
|
21
27
|
import ClusterDeploymentNetworkingForm from './ClusterDeploymentNetworkingForm';
|
|
22
|
-
import { isAgentOfCluster
|
|
28
|
+
import { isAgentOfCluster } from './helpers';
|
|
23
29
|
import { useInfraEnvProxies, useNetworkingFormik } from './use-networking-formik';
|
|
24
30
|
import { canNextFromNetworkingStep } from './wizardTransition';
|
|
25
31
|
import { AgentK8sResource } from '../../types';
|
|
26
32
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
33
|
+
import { ValidationSection } from './components/ValidationSection';
|
|
34
|
+
import { ClusterDeploymentWizardContext } from './ClusterDeploymentWizardContext';
|
|
27
35
|
|
|
28
36
|
type NetworkingFormProps = {
|
|
29
37
|
clusterDeployment: ClusterDeploymentDetailsNetworkingProps['clusterDeployment'];
|
|
30
38
|
agentClusterInstall: ClusterDeploymentDetailsNetworkingProps['agentClusterInstall'];
|
|
31
|
-
onClose: ClusterDeploymentDetailsNetworkingProps['onClose'];
|
|
32
39
|
agents: AgentK8sResource[];
|
|
33
40
|
fetchInfraEnv: ClusterDeploymentDetailsNetworkingProps['fetchInfraEnv'];
|
|
34
41
|
onEditHost: AgentTableActions['onEditHost'];
|
|
@@ -38,18 +45,21 @@ type NetworkingFormProps = {
|
|
|
38
45
|
isNutanix: ClusterDeploymentDetailsNetworkingProps['isNutanix'];
|
|
39
46
|
};
|
|
40
47
|
|
|
41
|
-
const NetworkingForm
|
|
48
|
+
export const NetworkingForm = ({
|
|
42
49
|
clusterDeployment,
|
|
43
50
|
agentClusterInstall,
|
|
44
51
|
agents,
|
|
45
|
-
onClose,
|
|
46
52
|
fetchInfraEnv,
|
|
47
53
|
onEditHost,
|
|
48
54
|
onEditRole,
|
|
49
55
|
isPreviewOpen,
|
|
50
56
|
onSetInstallationDiskId,
|
|
51
57
|
isNutanix,
|
|
52
|
-
}) => {
|
|
58
|
+
}: NetworkingFormProps) => {
|
|
59
|
+
const { t } = useTranslation();
|
|
60
|
+
const { activeStep, goToPrevStep, goToNextStep, close } = useWizardContext();
|
|
61
|
+
const { syncError } = React.useContext(ClusterDeploymentWizardContext);
|
|
62
|
+
const { alerts } = useAlerts();
|
|
53
63
|
const [showFormErrors, setShowFormErrors] = React.useState(false);
|
|
54
64
|
const [showClusterErrors, setShowClusterErrors] = React.useState(false);
|
|
55
65
|
const [nextRequested, setNextRequested] = React.useState(false);
|
|
@@ -59,16 +69,13 @@ const NetworkingForm: React.FC<NetworkingFormProps> = ({
|
|
|
59
69
|
});
|
|
60
70
|
const { isValid, isValidating, isSubmitting, validateForm, setTouched, errors, touched, values } =
|
|
61
71
|
useFormikContext<ClusterDeploymentNetworkingValues>();
|
|
62
|
-
const { setCurrentStepId } = React.useContext(ClusterDeploymentWizardContext);
|
|
63
|
-
|
|
64
|
-
const canContinue = canNextFromNetworkingStep(agentClusterInstall, agents);
|
|
65
72
|
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
const canContinue = React.useMemo(
|
|
74
|
+
() => canNextFromNetworkingStep(agentClusterInstall, agents),
|
|
75
|
+
[agentClusterInstall, agents],
|
|
76
|
+
);
|
|
70
77
|
|
|
71
|
-
const onNext = async () => {
|
|
78
|
+
const onNext = React.useCallback(async () => {
|
|
72
79
|
if (!showFormErrors) {
|
|
73
80
|
const errors = await validateForm();
|
|
74
81
|
setTouched(
|
|
@@ -83,57 +90,72 @@ const NetworkingForm: React.FC<NetworkingFormProps> = ({
|
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
92
|
setNextRequested(true);
|
|
86
|
-
};
|
|
93
|
+
}, [setTouched, showFormErrors, validateForm]);
|
|
87
94
|
|
|
88
95
|
React.useEffect(() => {
|
|
89
96
|
setNextRequested(false);
|
|
90
97
|
setShowClusterErrors(false);
|
|
91
|
-
}, [values.
|
|
98
|
+
}, [values.apiVips, values.ingressVips]);
|
|
92
99
|
|
|
93
100
|
React.useEffect(() => {
|
|
94
101
|
if (nextRequested) {
|
|
95
102
|
setShowClusterErrors(true);
|
|
96
103
|
if (canContinue) {
|
|
97
|
-
|
|
104
|
+
void goToNextStep();
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
|
-
}, [nextRequested, canContinue,
|
|
107
|
+
}, [nextRequested, canContinue, goToNextStep]);
|
|
101
108
|
|
|
102
|
-
|
|
109
|
+
React.useEffect(() => {
|
|
110
|
+
if (syncError) {
|
|
111
|
+
setNextRequested(false);
|
|
112
|
+
}
|
|
113
|
+
}, [syncError]);
|
|
103
114
|
|
|
104
115
|
const errorFields = getFormikErrorFields(errors, touched);
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
116
|
+
|
|
117
|
+
const submittingText = React.useMemo(() => {
|
|
118
|
+
if (isSubmitting) {
|
|
119
|
+
return t('ai:Saving changes...');
|
|
120
|
+
} else if (isValidating || nextRequested) {
|
|
121
|
+
return t('ai:Validating...');
|
|
122
|
+
}
|
|
123
|
+
return undefined;
|
|
124
|
+
}, [isSubmitting, isValidating, nextRequested, t]);
|
|
125
|
+
|
|
126
|
+
const footer = React.useMemo(
|
|
127
|
+
() => (
|
|
128
|
+
<WizardFooter
|
|
129
|
+
activeStep={activeStep}
|
|
130
|
+
onNext={onNext}
|
|
131
|
+
isNextDisabled={
|
|
132
|
+
nextRequested || isSubmitting || (showFormErrors ? !isValid || isValidating : false)
|
|
133
|
+
}
|
|
134
|
+
nextButtonProps={{ isLoading: !!submittingText }}
|
|
135
|
+
nextButtonText={submittingText || t('ai:Next')}
|
|
136
|
+
onBack={goToPrevStep}
|
|
137
|
+
onClose={close}
|
|
138
|
+
/>
|
|
139
|
+
),
|
|
140
|
+
[
|
|
141
|
+
activeStep,
|
|
142
|
+
onNext,
|
|
143
|
+
nextRequested,
|
|
144
|
+
isSubmitting,
|
|
145
|
+
showFormErrors,
|
|
146
|
+
isValid,
|
|
147
|
+
isValidating,
|
|
148
|
+
submittingText,
|
|
149
|
+
goToPrevStep,
|
|
150
|
+
close,
|
|
151
|
+
t,
|
|
152
|
+
],
|
|
133
153
|
);
|
|
134
154
|
|
|
155
|
+
useWizardFooter(footer);
|
|
156
|
+
|
|
135
157
|
return (
|
|
136
|
-
|
|
158
|
+
<>
|
|
137
159
|
<Grid hasGutter>
|
|
138
160
|
<GridItem>
|
|
139
161
|
<ClusterWizardStepHeader>{t('ai:Networking')}</ClusterWizardStepHeader>
|
|
@@ -154,19 +176,49 @@ const NetworkingForm: React.FC<NetworkingFormProps> = ({
|
|
|
154
176
|
isNutanix={isNutanix}
|
|
155
177
|
/>
|
|
156
178
|
</GridItem>
|
|
179
|
+
|
|
180
|
+
{showFormErrors && !!errorFields.length && (
|
|
181
|
+
<GridItem>
|
|
182
|
+
<Alert
|
|
183
|
+
variant={AlertVariant.danger}
|
|
184
|
+
title={t('ai:Provided cluster configuration is not valid')}
|
|
185
|
+
isInline
|
|
186
|
+
>
|
|
187
|
+
{t('ai:The following fields are invalid or missing')}:{' '}
|
|
188
|
+
{errorFields.map((field: string) => clusterFieldLabels(t)[field] || field).join(', ')}
|
|
189
|
+
.
|
|
190
|
+
</Alert>
|
|
191
|
+
</GridItem>
|
|
192
|
+
)}
|
|
193
|
+
|
|
194
|
+
{(showClusterErrors || showFormErrors) && !!alerts.length && (
|
|
195
|
+
<GridItem>
|
|
196
|
+
<Alerts />
|
|
197
|
+
</GridItem>
|
|
198
|
+
)}
|
|
199
|
+
|
|
200
|
+
{syncError && (
|
|
201
|
+
<GridItem>
|
|
202
|
+
<ValidationSection currentStepId={'networking'} hosts={[]}>
|
|
203
|
+
<Alert variant={AlertVariant.danger} title={t('ai:An error occured')} isInline>
|
|
204
|
+
{syncError}
|
|
205
|
+
</Alert>
|
|
206
|
+
</ValidationSection>
|
|
207
|
+
</GridItem>
|
|
208
|
+
)}
|
|
157
209
|
</Grid>
|
|
158
210
|
<FormikAutoSave />
|
|
159
|
-
|
|
211
|
+
</>
|
|
160
212
|
);
|
|
161
213
|
};
|
|
162
214
|
|
|
163
|
-
const ClusterDeploymentNetworkingStep
|
|
215
|
+
const ClusterDeploymentNetworkingStep = ({
|
|
164
216
|
clusterDeployment,
|
|
165
217
|
agentClusterInstall,
|
|
166
218
|
agents,
|
|
167
219
|
onSaveNetworking,
|
|
168
220
|
...rest
|
|
169
|
-
}) => {
|
|
221
|
+
}: ClusterDeploymentDetailsNetworkingProps) => {
|
|
170
222
|
const { addAlert } = useAlerts();
|
|
171
223
|
|
|
172
224
|
const cdName = clusterDeployment?.metadata?.name;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
AlertVariant,
|
|
4
|
+
Grid,
|
|
5
|
+
GridItem,
|
|
6
|
+
useWizardContext,
|
|
7
|
+
useWizardFooter,
|
|
8
|
+
WizardFooter,
|
|
9
|
+
} from '@patternfly/react-core';
|
|
2
10
|
import * as React from 'react';
|
|
3
11
|
import { canNextFromReviewStep } from './wizardTransition';
|
|
4
12
|
import {
|
|
@@ -17,9 +25,6 @@ import {
|
|
|
17
25
|
HostsValidations,
|
|
18
26
|
useAlerts,
|
|
19
27
|
} from '../../../common';
|
|
20
|
-
import ClusterDeploymentWizardContext from './ClusterDeploymentWizardContext';
|
|
21
|
-
import ClusterDeploymentWizardFooter from './ClusterDeploymentWizardFooter';
|
|
22
|
-
import ClusterDeploymentWizardStep from './ClusterDeploymentWizardStep';
|
|
23
28
|
import { getSelectedVersion, getAICluster, getClusterDeploymentCpuArchitecture } from '../helpers';
|
|
24
29
|
import { isAgentOfCluster } from './helpers';
|
|
25
30
|
import { wizardStepNames } from './constants';
|
|
@@ -29,31 +34,31 @@ import {
|
|
|
29
34
|
allClusterWizardSoftValidationIds,
|
|
30
35
|
} from './wizardTransition';
|
|
31
36
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
37
|
+
import { ClusterDeploymentWizardContext } from './ClusterDeploymentWizardContext';
|
|
38
|
+
import { ValidationSection } from './components/ValidationSection';
|
|
32
39
|
|
|
33
40
|
type ClusterDeploymentReviewStepProps = {
|
|
34
41
|
clusterDeployment: ClusterDeploymentK8sResource;
|
|
35
42
|
agentClusterInstall: AgentClusterInstallK8sResource;
|
|
36
43
|
agents: AgentK8sResource[];
|
|
37
|
-
onClose: VoidFunction;
|
|
38
44
|
// eslint-disable-next-line
|
|
39
45
|
onFinish: () => Promise<any>;
|
|
40
46
|
clusterImages: ClusterImageSetK8sResource[];
|
|
41
47
|
infraEnv?: InfraEnvK8sResource;
|
|
42
48
|
};
|
|
43
49
|
|
|
44
|
-
const ClusterDeploymentReviewStep
|
|
50
|
+
const ClusterDeploymentReviewStep = ({
|
|
45
51
|
agentClusterInstall,
|
|
46
52
|
agents,
|
|
47
|
-
onClose,
|
|
48
53
|
onFinish,
|
|
49
54
|
clusterDeployment,
|
|
50
55
|
clusterImages,
|
|
51
56
|
infraEnv,
|
|
52
|
-
}) => {
|
|
57
|
+
}: ClusterDeploymentReviewStepProps) => {
|
|
53
58
|
const { addAlert, clearAlerts } = useAlerts();
|
|
54
|
-
const {
|
|
59
|
+
const { activeStep, goToPrevStep, goToStepByName, close } = useWizardContext();
|
|
60
|
+
const { syncError } = React.useContext(ClusterDeploymentWizardContext);
|
|
55
61
|
const [isSubmitting, setSubmitting] = React.useState(false);
|
|
56
|
-
const onBack = () => setCurrentStepId('networking');
|
|
57
62
|
const cdName = clusterDeployment.metadata?.name;
|
|
58
63
|
const cdNamespace = clusterDeployment.metadata?.namespace;
|
|
59
64
|
const cpuArchitecture = getClusterDeploymentCpuArchitecture(clusterDeployment, infraEnv);
|
|
@@ -79,18 +84,17 @@ const ClusterDeploymentReviewStep: React.FC<ClusterDeploymentReviewStepProps> =
|
|
|
79
84
|
};
|
|
80
85
|
|
|
81
86
|
const footer = (
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
agents={clusterAgents}
|
|
85
|
-
isSubmitting={isSubmitting}
|
|
86
|
-
isNextDisabled={isSubmitting || !canContinue}
|
|
87
|
-
onBack={onBack}
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
87
|
+
<WizardFooter
|
|
88
|
+
activeStep={activeStep}
|
|
89
89
|
onNext={onNext}
|
|
90
|
-
|
|
90
|
+
isNextDisabled={isSubmitting || !canContinue || !!syncError}
|
|
91
91
|
nextButtonText={t('ai:Install cluster')}
|
|
92
|
+
nextButtonProps={{ isLoading: isSubmitting }}
|
|
93
|
+
onBack={goToPrevStep}
|
|
94
|
+
onClose={close}
|
|
92
95
|
/>
|
|
93
96
|
);
|
|
97
|
+
useWizardFooter(footer);
|
|
94
98
|
|
|
95
99
|
const openShiftVersion = getSelectedVersion(clusterImages, agentClusterInstall);
|
|
96
100
|
|
|
@@ -100,75 +104,82 @@ const ClusterDeploymentReviewStep: React.FC<ClusterDeploymentReviewStepProps> =
|
|
|
100
104
|
);
|
|
101
105
|
|
|
102
106
|
return (
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/>
|
|
107
|
+
<Grid hasGutter>
|
|
108
|
+
<GridItem>
|
|
109
|
+
<ClusterWizardStepHeader>Review and create</ClusterWizardStepHeader>
|
|
110
|
+
</GridItem>
|
|
111
|
+
<GridItem>
|
|
112
|
+
<DetailList>
|
|
113
|
+
<DetailItem
|
|
114
|
+
title={t('ai:Cluster address')}
|
|
115
|
+
value={`${clusterDeployment.metadata?.name || ''}.${
|
|
116
|
+
clusterDeployment.spec?.baseDomain || ''
|
|
117
|
+
}`}
|
|
118
|
+
testId="cluster-address"
|
|
119
|
+
/>
|
|
120
|
+
<DetailItem
|
|
121
|
+
title={t('ai:OpenShift version')}
|
|
122
|
+
value={openShiftVersion}
|
|
123
|
+
testId="openshift-version"
|
|
124
|
+
/>
|
|
125
|
+
<DetailItem
|
|
126
|
+
title={t('ai:CPU architecture')}
|
|
127
|
+
value={cpuArchitecture}
|
|
128
|
+
testId="cpu-architecture"
|
|
129
|
+
/>
|
|
130
|
+
<DetailItem
|
|
131
|
+
title={t('ai:API IP')}
|
|
132
|
+
value={agentClusterInstall?.status?.apiVIP || agentClusterInstall?.spec?.apiVIP}
|
|
133
|
+
testId="api-vip"
|
|
134
|
+
/>
|
|
135
|
+
<DetailItem
|
|
136
|
+
title={t('ai:Ingress IP')}
|
|
137
|
+
value={agentClusterInstall?.status?.ingressVIP || agentClusterInstall?.spec?.ingressVIP}
|
|
138
|
+
testId="ingress-vip"
|
|
139
|
+
/>
|
|
140
|
+
<DetailItem
|
|
141
|
+
title={t('ai:Cluster summary')}
|
|
142
|
+
testId="cluster-summary"
|
|
143
|
+
value={<ReviewHostsInventory hosts={cluster.hosts} />}
|
|
144
|
+
/>
|
|
142
145
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
146
|
+
<DetailItem
|
|
147
|
+
title={t('ai:Cluster validations')}
|
|
148
|
+
value={
|
|
149
|
+
<ClusterValidations<ClusterWizardStepsType>
|
|
150
|
+
validationsInfo={cluster.validationsInfo}
|
|
151
|
+
setCurrentStepId={goToStepByName}
|
|
152
|
+
wizardStepNames={wizardStepNames(t)}
|
|
153
|
+
wizardStepsValidationsMap={wizardStepsValidationsMap}
|
|
154
|
+
/>
|
|
155
|
+
}
|
|
156
|
+
testId="cluster-validations"
|
|
157
|
+
/>
|
|
158
|
+
<DetailItem
|
|
159
|
+
title={t('ai:Host validations')}
|
|
160
|
+
value={
|
|
161
|
+
<HostsValidations<ClusterWizardStepsType, typeof allClusterWizardSoftValidationIds>
|
|
162
|
+
hosts={cluster.hosts}
|
|
163
|
+
setCurrentStepId={goToStepByName}
|
|
164
|
+
wizardStepNames={wizardStepNames(t)}
|
|
165
|
+
allClusterWizardSoftValidationIds={allClusterWizardSoftValidationIds}
|
|
166
|
+
wizardStepsValidationsMap={wizardStepsValidationsMap}
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
169
|
+
testId="host-validations"
|
|
170
|
+
/>
|
|
171
|
+
</DetailList>
|
|
172
|
+
</GridItem>
|
|
173
|
+
{syncError && (
|
|
174
|
+
<GridItem>
|
|
175
|
+
<ValidationSection currentStepId={'review'} hosts={[]}>
|
|
176
|
+
<Alert variant={AlertVariant.danger} title={t('ai:An error occured')} isInline>
|
|
177
|
+
{syncError}
|
|
178
|
+
</Alert>
|
|
179
|
+
</ValidationSection>
|
|
169
180
|
</GridItem>
|
|
170
|
-
|
|
171
|
-
</
|
|
181
|
+
)}
|
|
182
|
+
</Grid>
|
|
172
183
|
);
|
|
173
184
|
};
|
|
174
185
|
|