@openshift-assisted/ui-lib 2.53.1 → 2.54.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/cim/components/ClusterDeployment/clusterDetails/ACMClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsStep.d.ts +0 -17
- package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/clusterDetails/useDetailsFormik.d.ts +19 -0
- package/build/@types/cim/components/ClusterDeployment/clusterDetails/useDetailsFormik.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/wizardTransition.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/wizardTransition.d.ts.map +1 -1
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.d.ts +2 -1
- package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/ExternalPlatformsDropdown.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/ReviewValidations.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/validationsInfoUtils.d.ts +0 -1
- package/build/@types/common/components/clusterWizard/validationsInfoUtils.d.ts.map +1 -1
- package/build/@types/common/components/hosts/utils.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/selectors/clusterSelectors.d.ts +1 -1
- package/build/@types/common/selectors/clusterSelectors.d.ts.map +1 -1
- package/build/@types/common/types/clusters.d.ts +2 -2
- package/build/@types/common/types/clusters.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageModal.d.ts +0 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageModal.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.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/CustomManifestsForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/utils.d.ts +4 -0
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/utils.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/operators/OperatorCheckbox.d.ts +3 -1
- package/build/@types/ocm/components/clusterConfiguration/operators/OperatorCheckbox.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/operators/bundleSpecs.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/operators/utils.d.ts +3 -6
- package/build/@types/ocm/components/clusterConfiguration/operators/utils.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewOperatorsTable.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewSummary.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/TableSummaryExpandable.d.ts +1 -0
- package/build/@types/ocm/components/clusterConfiguration/review/TableSummaryExpandable.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/StaticIpForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/NewClusterWizard.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/Operators.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/OperatorsBundle.d.ts +3 -3
- package/build/@types/ocm/components/clusterWizard/OperatorsBundle.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/OperatorsSelect.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/OptionalOperatorsDropdown.d.ts +13 -0
- package/build/@types/ocm/components/clusterWizard/OptionalOperatorsDropdown.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts +3 -4
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
- package/build/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +2 -0
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ACMClusterDeploymentDetailsStep.js +4 -2
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ACMClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsStep.js +5 -31
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.js +1 -11
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/useDetailsFormik.js +41 -0
- package/build/cjs/cim/components/ClusterDeployment/clusterDetails/useDetailsFormik.js.map +1 -0
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +1 -1
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js +9 -3
- package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/ExternalPlatformsDropdown.js +1 -1
- package/build/cjs/common/components/clusterConfiguration/ExternalPlatformsDropdown.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/ReviewValidations.js +16 -0
- package/build/cjs/common/components/clusterWizard/ReviewValidations.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/validationsInfoUtils.js +1 -17
- package/build/cjs/common/components/clusterWizard/validationsInfoUtils.js.map +1 -1
- package/build/cjs/common/components/hosts/utils.js +6 -1
- package/build/cjs/common/components/hosts/utils.js.map +1 -1
- package/build/cjs/common/config/constants.js +4 -0
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/selectors/clusterSelectors.js +7 -8
- package/build/cjs/common/selectors/clusterSelectors.js.map +1 -1
- package/build/cjs/common/types/clusters.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageForm.js +5 -2
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageModal.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageModal.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +6 -2
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.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 +3 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.js +3 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/utils.js +11 -8
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/utils.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/operators/OperatorCheckbox.js +39 -21
- package/build/cjs/ocm/components/clusterConfiguration/operators/OperatorCheckbox.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/operators/bundleSpecs.js +1 -2
- package/build/cjs/ocm/components/clusterConfiguration/operators/bundleSpecs.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js +7 -25
- package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewOperatorsTable.js +75 -20
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewOperatorsTable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/TableSummaryExpandable.css +3 -0
- package/build/cjs/ocm/components/clusterConfiguration/review/TableSummaryExpandable.js +2 -3
- package/build/cjs/ocm/components/clusterConfiguration/review/TableSummaryExpandable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpForm.js +10 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.js +5 -5
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +2 -9
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +4 -4
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js +6 -3
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/Operators.js +36 -8
- package/build/cjs/ocm/components/clusterWizard/Operators.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js +34 -15
- package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js +18 -4
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.test.js +11 -5
- package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.test.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsStep.js +1 -1
- package/build/cjs/ocm/components/clusterWizard/OperatorsStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/OptionalOperatorsDropdown.js +34 -0
- package/build/cjs/ocm/components/clusterWizard/OptionalOperatorsDropdown.js.map +1 -0
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.js +69 -29
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.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/InfraEnvsService.js +4 -1
- package/build/cjs/ocm/services/InfraEnvsService.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/clusterDetails/ACMClusterDeploymentDetailsStep.tsx +3 -1
- package/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsStep.tsx +5 -86
- package/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.tsx +1 -12
- package/lib/cim/components/ClusterDeployment/clusterDetails/useDetailsFormik.tsx +97 -0
- package/lib/cim/components/common/CpuArchitectureDropdown.tsx +2 -1
- package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.tsx +18 -8
- package/lib/common/components/clusterConfiguration/ExternalPlatformsDropdown.tsx +3 -1
- package/lib/common/components/clusterWizard/ReviewValidations.tsx +24 -0
- package/lib/common/components/clusterWizard/validationsInfoUtils.ts +0 -20
- package/lib/common/components/hosts/utils.ts +8 -1
- package/lib/common/config/constants.ts +4 -0
- package/lib/common/selectors/clusterSelectors.ts +9 -9
- package/lib/common/types/clusters.ts +3 -1
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageForm.tsx +11 -2
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageModal.tsx +13 -3
- package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +9 -1
- package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +1 -1
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +8 -1
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.tsx +3 -1
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/utils.tsx +12 -6
- package/lib/ocm/components/clusterConfiguration/operators/OperatorCheckbox.tsx +48 -34
- package/lib/ocm/components/clusterConfiguration/operators/bundleSpecs.tsx +2 -3
- package/lib/ocm/components/clusterConfiguration/operators/utils.tsx +6 -37
- package/lib/ocm/components/clusterConfiguration/review/ReviewOperatorsTable.tsx +114 -24
- package/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx +1 -4
- package/lib/ocm/components/clusterConfiguration/review/TableSummaryExpandable.css +3 -0
- package/lib/ocm/components/clusterConfiguration/review/TableSummaryExpandable.tsx +1 -1
- package/lib/ocm/components/clusterConfiguration/staticIp/components/StaticIpForm.tsx +10 -1
- package/lib/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.tsx +9 -6
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +2 -14
- package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +5 -13
- package/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +7 -3
- package/lib/ocm/components/clusterWizard/Operators.tsx +45 -10
- package/lib/ocm/components/clusterWizard/OperatorsBundle.tsx +72 -26
- package/lib/ocm/components/clusterWizard/OperatorsSelect.test.ts +11 -5
- package/lib/ocm/components/clusterWizard/OperatorsSelect.tsx +21 -4
- package/lib/ocm/components/clusterWizard/OperatorsStep.tsx +1 -1
- package/lib/ocm/components/clusterWizard/OptionalOperatorsDropdown.tsx +106 -0
- package/lib/ocm/components/clusterWizard/wizardTransition.ts +92 -37
- package/lib/ocm/hooks/useInfraEnvId.ts +2 -2
- package/lib/ocm/services/InfraEnvsService.ts +4 -1
- package/package.json +11 -11
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageModal.css +0 -3
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageModal.css +0 -3
|
@@ -145,7 +145,7 @@ export const OcmDiscoveryImageConfigForm = ({
|
|
|
145
145
|
{({ submitForm, isSubmitting, status, setStatus }) => {
|
|
146
146
|
return (
|
|
147
147
|
<>
|
|
148
|
-
<ModalBody>
|
|
148
|
+
<ModalBody style={{ maxHeight: '611px' }}>
|
|
149
149
|
<Stack hasGutter>
|
|
150
150
|
<StackItem>
|
|
151
151
|
<Alert variant={AlertVariant.info} isInline title={alertDiscoveryText} />
|
package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx
CHANGED
|
@@ -22,6 +22,7 @@ import { getFieldId } from '../../../../common/components/ui/formik';
|
|
|
22
22
|
import { isOciPlatformType } from '../../utils';
|
|
23
23
|
import DeleteCustomManifestModal from './DeleteCustomManifestModal';
|
|
24
24
|
import { ClustersService } from '../../../services';
|
|
25
|
+
import { userProvidedManifests } from './components/utils';
|
|
25
26
|
import { useClusterWizardContext } from '../../clusterWizard/ClusterWizardContext';
|
|
26
27
|
|
|
27
28
|
export const CustomManifestsPage = ({
|
|
@@ -77,7 +78,13 @@ export const CustomManifestsPage = ({
|
|
|
77
78
|
const cleanCustomManifests = React.useCallback(async () => {
|
|
78
79
|
if (!clusterWizardContext.uiSettings?.customManifestsAdded || !cluster.id) return;
|
|
79
80
|
const { data: manifests } = await ClustersAPI.getManifests(cluster.id);
|
|
80
|
-
|
|
81
|
+
const manifestsToRemove = userProvidedManifests(manifests).map((manifest) => ({
|
|
82
|
+
...manifest,
|
|
83
|
+
folder: manifest.folder || 'manifests',
|
|
84
|
+
fileName: manifest.fileName || '',
|
|
85
|
+
yamlContent: '',
|
|
86
|
+
}));
|
|
87
|
+
await ClustersService.removeClusterManifests(manifestsToRemove, cluster.id);
|
|
81
88
|
setUseCustomManifests(false);
|
|
82
89
|
setDeleteModalOpen(false);
|
|
83
90
|
await clusterWizardContext.updateUISettings({
|
|
@@ -23,6 +23,7 @@ import { CustomManifestValues, ManifestFormData } from '../data/dataTypes';
|
|
|
23
23
|
import useClusterCustomManifests from '../../../../hooks/useClusterCustomManifests';
|
|
24
24
|
import { ClustersService } from '../../../../services';
|
|
25
25
|
import { CustomManifestsArray } from './CustomManifestsArray';
|
|
26
|
+
import { userProvidedManifests } from './utils';
|
|
26
27
|
import { selectCurrentClusterPermissionsState } from '../../../../store/slices/current-cluster/selectors';
|
|
27
28
|
import { useClusterWizardContext } from '../../../clusterWizard/ClusterWizardContext';
|
|
28
29
|
import { ClustersAPI } from '../../../../services/apis';
|
|
@@ -70,7 +71,8 @@ export const CustomManifestsForm = ({
|
|
|
70
71
|
if (customManifests && !customManifestsLocalRef.current.length) {
|
|
71
72
|
const initValues = getInitialValues(customManifests);
|
|
72
73
|
setInitialValues(initValues);
|
|
73
|
-
customManifestsLocalRef.current =
|
|
74
|
+
customManifestsLocalRef.current =
|
|
75
|
+
userProvidedManifests(customManifests).length > 0 ? initValues.manifests : [];
|
|
74
76
|
}
|
|
75
77
|
}, [customManifests, getInitialValues]);
|
|
76
78
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CustomManifestValues, ListManifestsExtended, ManifestFormData } from '../data/dataTypes';
|
|
2
2
|
|
|
3
|
+
/** Manifests created by the installer (e.g. OVE defaults); not editable in the wizard. */
|
|
4
|
+
export const userProvidedManifests = <T extends { manifestSource?: string }>(
|
|
5
|
+
manifests: T[] | undefined,
|
|
6
|
+
): T[] => (manifests ?? []).filter((m) => m.manifestSource !== 'system');
|
|
7
|
+
|
|
3
8
|
export const getManifestName = (manifestIdx: number) => `Custom manifest ${manifestIdx + 1}`;
|
|
4
9
|
|
|
5
10
|
export const getFormData = (manifests: ListManifestsExtended): ManifestFormData => {
|
|
@@ -18,11 +23,11 @@ export const getEmptyManifest = (): CustomManifestValues => {
|
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
export const getManifestValues = (manifests: ListManifestsExtended): ManifestFormData => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return getEmptyManifestsValues();
|
|
26
|
+
const userManifests = userProvidedManifests(manifests);
|
|
27
|
+
if (userManifests.length > 0) {
|
|
28
|
+
return getFormData(userManifests);
|
|
25
29
|
}
|
|
30
|
+
return getEmptyManifestsValues();
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
export const getEmptyManifestsValues = (): ManifestFormData => {
|
|
@@ -32,8 +37,9 @@ export const getEmptyManifestsValues = (): ManifestFormData => {
|
|
|
32
37
|
export const getClusterCustomManifests = (
|
|
33
38
|
customManifests: ListManifestsExtended,
|
|
34
39
|
): CustomManifestValues[] => {
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
const userManifests = userProvidedManifests(customManifests);
|
|
41
|
+
if (userManifests.length > 0) {
|
|
42
|
+
return userManifests.map((manifest) => ({
|
|
37
43
|
folder: manifest.folder || 'manifests',
|
|
38
44
|
filename: manifest.fileName || '',
|
|
39
45
|
manifestYaml: manifest.yamlContent || '',
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
|
|
25
25
|
import { getFieldId, OperatorsValues, PopoverIcon } from '../../../../common';
|
|
26
26
|
import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels';
|
|
27
|
-
import { getNewOperators } from './utils';
|
|
28
27
|
import {
|
|
29
28
|
highlightMatch,
|
|
30
29
|
OperatorSpec,
|
|
@@ -110,8 +109,10 @@ const OperatorRequirements = ({
|
|
|
110
109
|
|
|
111
110
|
const OperatorCheckbox = ({
|
|
112
111
|
bundles,
|
|
112
|
+
checkedOperatorIds,
|
|
113
113
|
cluster,
|
|
114
114
|
operatorId,
|
|
115
|
+
isChecked,
|
|
115
116
|
title,
|
|
116
117
|
featureId,
|
|
117
118
|
notStandalone,
|
|
@@ -122,8 +123,10 @@ const OperatorCheckbox = ({
|
|
|
122
123
|
searchTerm,
|
|
123
124
|
}: {
|
|
124
125
|
bundles: Bundle[];
|
|
126
|
+
checkedOperatorIds: Set<string>;
|
|
125
127
|
cluster: Cluster;
|
|
126
128
|
operatorId: string;
|
|
129
|
+
isChecked: boolean;
|
|
127
130
|
openshiftVersion?: string;
|
|
128
131
|
preflightRequirements: PreflightHardwareRequirements | undefined;
|
|
129
132
|
searchTerm?: string;
|
|
@@ -135,32 +138,54 @@ const OperatorCheckbox = ({
|
|
|
135
138
|
const { values, setFieldValue } = useFormikContext<OperatorsValues>();
|
|
136
139
|
const fieldId = getFieldId(operatorId, 'input');
|
|
137
140
|
const supportLevel = getFeatureSupportLevel(featureId);
|
|
141
|
+
const getDisabledReason = (): string | undefined => {
|
|
142
|
+
const featureDisabledReason = getFeatureDisabledReason(featureId);
|
|
143
|
+
if (featureDisabledReason) {
|
|
144
|
+
return featureDisabledReason;
|
|
145
|
+
}
|
|
138
146
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
const isRequiredByBundle = values.selectedBundles.some(
|
|
148
|
+
(selectedBundle) =>
|
|
149
|
+
!!bundles
|
|
150
|
+
.find((bundle) => bundle.id === selectedBundle.id)
|
|
151
|
+
?.operators?.includes(operatorId),
|
|
152
|
+
);
|
|
153
|
+
if (isRequiredByBundle) {
|
|
154
|
+
return 'This operator is part of a selected bundle and cannot be deselected.';
|
|
155
|
+
}
|
|
142
156
|
|
|
143
|
-
|
|
157
|
+
const isOptionallySelectedForBundle = values.selectedBundles.some((selectedBundle) =>
|
|
158
|
+
selectedBundle.optionalOperators?.includes(operatorId),
|
|
159
|
+
);
|
|
160
|
+
if (isOptionallySelectedForBundle) {
|
|
161
|
+
return 'This optional operator is selected through a bundle. Use the bundle card to change it.';
|
|
162
|
+
}
|
|
144
163
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
164
|
+
const parentOperator = preflightRequirements?.operators?.find(
|
|
165
|
+
({ operatorName, dependencies }) =>
|
|
166
|
+
!!operatorName &&
|
|
167
|
+
dependencies?.includes(operatorId) &&
|
|
168
|
+
checkedOperatorIds.has(operatorName),
|
|
169
|
+
);
|
|
170
|
+
if (parentOperator?.operatorName) {
|
|
171
|
+
const parentName = opSpecs[parentOperator.operatorName]?.title || parentOperator.operatorName;
|
|
172
|
+
return `This operator is required by ${parentName}`;
|
|
173
|
+
}
|
|
148
174
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
175
|
+
if (notStandalone && !checkedOperatorIds.has(operatorId)) {
|
|
176
|
+
return 'This operator cannot be installed as a standalone';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return undefined;
|
|
180
|
+
};
|
|
156
181
|
|
|
157
|
-
const disabledReason =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
const disabledReason = getDisabledReason();
|
|
183
|
+
const handleClick = (_: React.FormEvent, checked: boolean) => {
|
|
184
|
+
const next = checked
|
|
185
|
+
? [...values.selectedOperators, operatorId]
|
|
186
|
+
: values.selectedOperators.filter((op) => op !== operatorId);
|
|
187
|
+
setFieldValue('selectedOperators', next);
|
|
188
|
+
};
|
|
164
189
|
|
|
165
190
|
return (
|
|
166
191
|
<FormGroup fieldId={fieldId} id={`form-control__${fieldId}`}>
|
|
@@ -182,18 +207,7 @@ const OperatorCheckbox = ({
|
|
|
182
207
|
}
|
|
183
208
|
aria-describedby={`${fieldId}-helper`}
|
|
184
209
|
isChecked={isChecked}
|
|
185
|
-
onChange={
|
|
186
|
-
setFieldValue(
|
|
187
|
-
'selectedOperators',
|
|
188
|
-
getNewOperators(
|
|
189
|
-
values.selectedOperators,
|
|
190
|
-
operatorId,
|
|
191
|
-
preflightRequirements,
|
|
192
|
-
checked,
|
|
193
|
-
opSpecs,
|
|
194
|
-
),
|
|
195
|
-
);
|
|
196
|
-
}}
|
|
210
|
+
onChange={handleClick}
|
|
197
211
|
isDisabled={isViewerMode || !!disabledReason}
|
|
198
212
|
description={
|
|
199
213
|
!!Description && (
|
|
@@ -31,10 +31,9 @@ export const bundleSpecs: { [key: string]: BundleSpec } = {
|
|
|
31
31
|
incompatibleBundles: [],
|
|
32
32
|
Description: () => (
|
|
33
33
|
<List>
|
|
34
|
-
<ListItem>GPUs are recommended for optimal AI/ML workload performance.</ListItem>
|
|
35
34
|
<ListItem>
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
GPUs are recommended for optimal AI/ML workload performance. Please select the GPU
|
|
36
|
+
operators you want to install.
|
|
38
37
|
</ListItem>
|
|
39
38
|
</List>
|
|
40
39
|
),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BundleCreateParams,
|
|
2
3
|
Bundle,
|
|
3
4
|
PreflightHardwareRequirements,
|
|
4
5
|
} from '@openshift-assisted/types/assisted-installer-service';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const getOperatorDependencies = (
|
|
6
|
+
export const getOperatorDependencies = (
|
|
8
7
|
operatorId: string,
|
|
9
8
|
preflightRequirements: PreflightHardwareRequirements | undefined,
|
|
10
9
|
dependencies: Set<string> = new Set(),
|
|
@@ -25,36 +24,6 @@ const getOperatorDependencies = (
|
|
|
25
24
|
return [...dependencies];
|
|
26
25
|
};
|
|
27
26
|
|
|
28
|
-
export const getNewOperators = (
|
|
29
|
-
currentOperators: string[],
|
|
30
|
-
operatorId: string,
|
|
31
|
-
preflightRequirements: PreflightHardwareRequirements | undefined,
|
|
32
|
-
add: boolean,
|
|
33
|
-
opSpecs: { [key: string]: OperatorSpec },
|
|
34
|
-
): string[] => {
|
|
35
|
-
const dependencies = getOperatorDependencies(operatorId, preflightRequirements);
|
|
36
|
-
|
|
37
|
-
if (add) {
|
|
38
|
-
const uniqueOps = new Set([...currentOperators, ...dependencies, operatorId]);
|
|
39
|
-
return Array.from(uniqueOps);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const newOperators = currentOperators.filter((op) => op !== operatorId);
|
|
43
|
-
const notStandaloneDeps = dependencies
|
|
44
|
-
.filter((dep) => opSpecs[dep]?.notStandalone)
|
|
45
|
-
.filter((dep) => {
|
|
46
|
-
const hasDependency = newOperators.some((op) =>
|
|
47
|
-
getOperatorDependencies(op, preflightRequirements).includes(dep),
|
|
48
|
-
);
|
|
49
|
-
if (!hasDependency) {
|
|
50
|
-
newOperators.splice(newOperators.indexOf(dep), 1);
|
|
51
|
-
}
|
|
52
|
-
return !hasDependency;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
return currentOperators.filter((op) => op !== operatorId && !notStandaloneDeps.includes(op));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
27
|
const getBundleOperators = (
|
|
59
28
|
bundle: Bundle,
|
|
60
29
|
preflightRequirements: PreflightHardwareRequirements | undefined,
|
|
@@ -68,7 +37,7 @@ const getBundleOperators = (
|
|
|
68
37
|
|
|
69
38
|
export const getNewBundleOperators = (
|
|
70
39
|
currentOperators: string[],
|
|
71
|
-
currentBundles:
|
|
40
|
+
currentBundles: BundleCreateParams[],
|
|
72
41
|
allBundles: Bundle[],
|
|
73
42
|
newBundle: Bundle,
|
|
74
43
|
preflightRequirements: PreflightHardwareRequirements | undefined,
|
|
@@ -81,10 +50,10 @@ export const getNewBundleOperators = (
|
|
|
81
50
|
return Array.from(new Set(combined));
|
|
82
51
|
}
|
|
83
52
|
|
|
84
|
-
const newBundles = currentBundles.filter((
|
|
53
|
+
const newBundles = currentBundles.filter((bundle) => bundle.id !== newBundle.id);
|
|
85
54
|
const operatorsToKeep = [
|
|
86
|
-
...newBundles.reduce((acc,
|
|
87
|
-
const bundle = allBundles.find(({ id }) => id ===
|
|
55
|
+
...newBundles.reduce((acc, selectedBundle) => {
|
|
56
|
+
const bundle = allBundles.find(({ id }) => id === selectedBundle.id);
|
|
88
57
|
if (bundle) {
|
|
89
58
|
const bundleOperators = getBundleOperators(bundle, preflightRequirements);
|
|
90
59
|
bundleOperators.forEach((op) => {
|
|
@@ -1,17 +1,75 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Title } from '@patternfly/react-core';
|
|
2
3
|
import { Table, TableVariant, Tbody, Td, Tr } from '@patternfly/react-table';
|
|
3
|
-
import { genericTableRowKey } from '../../../../common';
|
|
4
|
-
import {
|
|
4
|
+
import { genericTableRowKey, selectAllOlmOperators } from '../../../../common';
|
|
5
|
+
import { useStateSafely } from '../../../../common/hooks';
|
|
6
|
+
import { Bundle, Cluster } from '@openshift-assisted/types/assisted-installer-service';
|
|
5
7
|
import { TableSummaryExpandable } from './TableSummaryExpandable';
|
|
6
8
|
import { useOperatorSpecs } from '../../../../common/components/operators/operatorSpecs';
|
|
9
|
+
import BundleService from '../../../services/BundleService';
|
|
10
|
+
|
|
11
|
+
const fetchBundles = async (
|
|
12
|
+
openshiftVersion: string,
|
|
13
|
+
cpuArchitecture: string,
|
|
14
|
+
platformType: string,
|
|
15
|
+
): Promise<Bundle[]> => {
|
|
16
|
+
try {
|
|
17
|
+
return await BundleService.listBundles(
|
|
18
|
+
openshiftVersion,
|
|
19
|
+
cpuArchitecture,
|
|
20
|
+
platformType,
|
|
21
|
+
undefined,
|
|
22
|
+
);
|
|
23
|
+
} catch (_e) {
|
|
24
|
+
return [] as Bundle[];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
7
27
|
|
|
8
28
|
export const ReviewOperatorsTable = ({ cluster }: { cluster: Cluster }) => {
|
|
9
29
|
const { byKey: opSpecs } = useOperatorSpecs();
|
|
30
|
+
const selectedBundles = cluster.operatorBundles || [];
|
|
31
|
+
const [bundleTitlesById, setBundleTitlesById] = useStateSafely<Record<string, string>>({});
|
|
32
|
+
const hasFetchedBundles = React.useRef(false);
|
|
33
|
+
const hasSelectedBundles = selectedBundles.length > 0;
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (!hasFetchedBundles.current && hasSelectedBundles) {
|
|
36
|
+
hasFetchedBundles.current = true;
|
|
37
|
+
void (async () => {
|
|
38
|
+
const bundles = await fetchBundles(
|
|
39
|
+
cluster.openshiftVersion || '',
|
|
40
|
+
cluster.cpuArchitecture || '',
|
|
41
|
+
cluster.platform?.type || '',
|
|
42
|
+
);
|
|
43
|
+
const titlesById = Object.fromEntries(
|
|
44
|
+
bundles
|
|
45
|
+
.filter((bundle) => !!bundle.id && !!bundle.title)
|
|
46
|
+
.map((bundle) => [bundle.id, bundle.title]),
|
|
47
|
+
) as Record<string, string>;
|
|
48
|
+
setBundleTitlesById(titlesById);
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
51
|
+
}, [
|
|
52
|
+
cluster.cpuArchitecture,
|
|
53
|
+
cluster.openshiftVersion,
|
|
54
|
+
cluster.platform?.type,
|
|
55
|
+
hasSelectedBundles,
|
|
56
|
+
setBundleTitlesById,
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
const bundleRows = selectedBundles.map((bundle) => ({
|
|
60
|
+
rowId: `bundle-${bundle.id}`,
|
|
61
|
+
cells: [
|
|
62
|
+
{
|
|
63
|
+
title: bundleTitlesById[bundle.id] || bundle.id,
|
|
64
|
+
props: { 'data-testid': `bundle-${bundle.id}` },
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}));
|
|
10
68
|
|
|
11
69
|
const rows = React.useMemo(
|
|
12
70
|
() =>
|
|
13
|
-
cluster
|
|
14
|
-
|
|
71
|
+
selectAllOlmOperators(cluster)
|
|
72
|
+
.filter(({ name }) => !!name && !!opSpecs[name])
|
|
15
73
|
.map((op) => {
|
|
16
74
|
const opId = op.name as string;
|
|
17
75
|
return {
|
|
@@ -25,33 +83,65 @@ export const ReviewOperatorsTable = ({ cluster }: { cluster: Cluster }) => {
|
|
|
25
83
|
],
|
|
26
84
|
};
|
|
27
85
|
}),
|
|
28
|
-
[cluster
|
|
86
|
+
[cluster, opSpecs],
|
|
29
87
|
);
|
|
30
88
|
|
|
31
|
-
if (!rows?.length) {
|
|
89
|
+
if (!rows?.length && selectedBundles.length === 0) {
|
|
32
90
|
return null;
|
|
33
91
|
}
|
|
34
92
|
|
|
35
93
|
return (
|
|
36
|
-
<TableSummaryExpandable title={'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
94
|
+
<TableSummaryExpandable title={'Bundles and operators'} id={'operators-expandable'}>
|
|
95
|
+
{bundleRows.length > 0 && (
|
|
96
|
+
<>
|
|
97
|
+
<Title headingLevel="h4" size="md" className="pf-v6-u-mb-sm">
|
|
98
|
+
Bundles ({bundleRows.length})
|
|
99
|
+
</Title>
|
|
100
|
+
<Table
|
|
101
|
+
variant={TableVariant.compact}
|
|
102
|
+
borders={false}
|
|
103
|
+
aria-label={'Bundles review table'}
|
|
104
|
+
className="review-table pf-v6-u-mb-md"
|
|
105
|
+
>
|
|
106
|
+
<Tbody>
|
|
107
|
+
{bundleRows.map((row, i) => (
|
|
108
|
+
<Tr key={genericTableRowKey(row.rowId)}>
|
|
109
|
+
{row.cells.map((cell, j) => (
|
|
110
|
+
<Td key={`bundle-cell-${i}-${j}`} {...cell.props}>
|
|
111
|
+
{cell.title}
|
|
112
|
+
</Td>
|
|
113
|
+
))}
|
|
114
|
+
</Tr>
|
|
115
|
+
))}
|
|
116
|
+
</Tbody>
|
|
117
|
+
</Table>
|
|
118
|
+
</>
|
|
119
|
+
)}
|
|
120
|
+
{rows.length > 0 && (
|
|
121
|
+
<>
|
|
122
|
+
<Title headingLevel="h4" size="md" className="pf-v6-u-mb-sm">
|
|
123
|
+
Operators ({rows.length})
|
|
124
|
+
</Title>
|
|
125
|
+
<Table
|
|
126
|
+
variant={TableVariant.compact}
|
|
127
|
+
borders={false}
|
|
128
|
+
aria-label={'Operators review table'}
|
|
129
|
+
className="review-table"
|
|
130
|
+
>
|
|
131
|
+
<Tbody>
|
|
132
|
+
{rows.map((row, i) => (
|
|
133
|
+
<Tr key={genericTableRowKey(row.rowId)}>
|
|
134
|
+
{row.cells.map((cell, j) => (
|
|
135
|
+
<Td key={`cell-${i}-${j}`} {...cell.props}>
|
|
136
|
+
{cell.title}
|
|
137
|
+
</Td>
|
|
138
|
+
))}
|
|
139
|
+
</Tr>
|
|
50
140
|
))}
|
|
51
|
-
</
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
141
|
+
</Tbody>
|
|
142
|
+
</Table>
|
|
143
|
+
</>
|
|
144
|
+
)}
|
|
55
145
|
</TableSummaryExpandable>
|
|
56
146
|
);
|
|
57
147
|
};
|
|
@@ -19,10 +19,7 @@ import { ReviewCustomManifestsTable } from './ReviewCustomManifestsTable';
|
|
|
19
19
|
import PlatformIntegrationNote from '../platformIntegration/PlatformIntegrationNote';
|
|
20
20
|
import useClusterCustomManifests from '../../../hooks/useClusterCustomManifests';
|
|
21
21
|
import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
const userProvidedManifests = (manifests: ListManifestsExtended | undefined) =>
|
|
25
|
-
(manifests ?? []).filter((m) => m.manifestSource !== 'system');
|
|
22
|
+
import { userProvidedManifests } from '../manifestsConfiguration/components/utils';
|
|
26
23
|
|
|
27
24
|
export const ReviewSummaryContent = ({ cluster }: { cluster: Cluster }) => {
|
|
28
25
|
const { customManifests } = useClusterCustomManifests(cluster.id, false);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExpandableSection, Content } from '@patternfly/react-core';
|
|
3
|
+
import './TableSummaryExpandable.css';
|
|
3
4
|
|
|
4
5
|
export const TableSummaryExpandable = ({
|
|
5
6
|
title,
|
|
@@ -20,7 +21,6 @@ export const TableSummaryExpandable = ({
|
|
|
20
21
|
id={id ? id : title}
|
|
21
22
|
>
|
|
22
23
|
{children}
|
|
23
|
-
<br />
|
|
24
24
|
</ExpandableSection>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
@@ -8,6 +8,8 @@ import { useErrorMonitor } from '../../../../../common/components/ErrorHandling/
|
|
|
8
8
|
import { getApiErrorMessage } from '../../../../../common/api';
|
|
9
9
|
import { StaticIpFormProps } from './propTypes';
|
|
10
10
|
import { selectCurrentClusterPermissionsState } from '../../../../store/slices/current-cluster/selectors';
|
|
11
|
+
import { useFeature } from '../../../../hooks/use-feature';
|
|
12
|
+
import { getStaticNetworkConfig } from '../data/fromInfraEnv';
|
|
11
13
|
|
|
12
14
|
/** Reports form state and triggers save on every value change (useFormikAutoSave) */
|
|
13
15
|
const AutosaveWithParentUpdate = <StaticIpFormValues extends object>({
|
|
@@ -69,7 +71,14 @@ export const StaticIpForm = <StaticIpFormValues extends object>({
|
|
|
69
71
|
const { clearAlerts, addAlert } = useAlerts();
|
|
70
72
|
const { captureException } = useErrorMonitor();
|
|
71
73
|
const { isViewerMode } = useSelector(selectCurrentClusterPermissionsState);
|
|
72
|
-
const
|
|
74
|
+
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
|
|
75
|
+
const prefillFromInfraEnv = isSingleClusterFeatureEnabled && !!getStaticNetworkConfig(infraEnv);
|
|
76
|
+
const initialValues = React.useMemo(() => {
|
|
77
|
+
if (showEmptyValues && !prefillFromInfraEnv) {
|
|
78
|
+
return getEmptyValues();
|
|
79
|
+
}
|
|
80
|
+
return getInitialValues(infraEnv);
|
|
81
|
+
}, [showEmptyValues, prefillFromInfraEnv, infraEnv, getInitialValues, getEmptyValues]);
|
|
73
82
|
|
|
74
83
|
const handleSubmit = async (values: StaticIpFormValues) => {
|
|
75
84
|
clearAlerts();
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
} from '@patternfly/react-core';
|
|
10
10
|
import { StaticIpInfo, StaticIpView } from '../data/dataTypes';
|
|
11
11
|
import StaticIpViewRadioGroup from './StaticIpViewRadioGroup';
|
|
12
|
-
import { getStaticIpInfo } from '../data/fromInfraEnv';
|
|
12
|
+
import { getStaticIpInfo, getStaticNetworkConfig } from '../data/fromInfraEnv';
|
|
13
|
+
import { useFeature } from '../../../../hooks/use-feature';
|
|
13
14
|
import { StaticIpFormState, StaticIpPageProps, StaticIpViewProps } from './propTypes';
|
|
14
15
|
import { YamlView } from './YamlView/YamlView';
|
|
15
16
|
import { useClusterWizardContext } from '../../../clusterWizard/ClusterWizardContext';
|
|
@@ -34,6 +35,8 @@ export const StaticIpPage: React.FC<StaticIpPageProps> = ({
|
|
|
34
35
|
onFormStateChange: onFormStateChangeParent,
|
|
35
36
|
}) => {
|
|
36
37
|
const clusterWizardContext = useClusterWizardContext();
|
|
38
|
+
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
|
|
39
|
+
const prefillFromInfraEnv = isSingleClusterFeatureEnabled && !!getStaticNetworkConfig(infraEnv);
|
|
37
40
|
const [confirmOnChangeView, setConfirmOnChangeView] = React.useState<boolean>(false);
|
|
38
41
|
const [viewChanged, setViewChanged] = React.useState<boolean>(false);
|
|
39
42
|
|
|
@@ -45,10 +48,10 @@ export const StaticIpPage: React.FC<StaticIpPageProps> = ({
|
|
|
45
48
|
[clusterWizardContext],
|
|
46
49
|
);
|
|
47
50
|
|
|
48
|
-
const initialStaticIpInfo = React.useMemo<StaticIpInfo | undefined>(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
const initialStaticIpInfo = React.useMemo<StaticIpInfo | undefined>(
|
|
52
|
+
() => getStaticIpInfo(infraEnv),
|
|
53
|
+
[infraEnv],
|
|
54
|
+
);
|
|
52
55
|
|
|
53
56
|
const onFormStateChange = React.useCallback(
|
|
54
57
|
(formState: StaticIpFormState) => {
|
|
@@ -65,7 +68,7 @@ export const StaticIpPage: React.FC<StaticIpPageProps> = ({
|
|
|
65
68
|
onFormStateChange,
|
|
66
69
|
infraEnv,
|
|
67
70
|
updateInfraEnv,
|
|
68
|
-
showEmptyValues: viewChanged,
|
|
71
|
+
showEmptyValues: viewChanged && !prefillFromInfraEnv,
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
const content = (() => {
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
UISettingService,
|
|
25
25
|
} from '../../services';
|
|
26
26
|
import { Cluster, InfraEnv } from '@openshift-assisted/types/assisted-installer-service';
|
|
27
|
-
import BundleService from '../../services/BundleService';
|
|
28
27
|
import { useFeature } from '../../hooks/use-feature';
|
|
29
28
|
|
|
30
29
|
type ClusterDetailsProps = {
|
|
@@ -80,21 +79,10 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
|
|
|
80
79
|
try {
|
|
81
80
|
const searchParams = new URLSearchParams(location.search);
|
|
82
81
|
const isAssistedMigration = searchParams.get('source') === 'assisted_migration';
|
|
83
|
-
//For Assisted Migration we need
|
|
82
|
+
// For Assisted Migration we need LVM as standalone and the virtualization bundle.
|
|
84
83
|
if (isAssistedMigration) {
|
|
85
84
|
params.olmOperators = [{ name: 'lvm' }];
|
|
86
|
-
|
|
87
|
-
await BundleService.listBundles(
|
|
88
|
-
params.openshiftVersion,
|
|
89
|
-
params.cpuArchitecture,
|
|
90
|
-
params.platform?.type,
|
|
91
|
-
)
|
|
92
|
-
).find((b) => b.id === 'virtualization');
|
|
93
|
-
const virtOperators = selectedBundle?.operators;
|
|
94
|
-
params.olmOperators = [
|
|
95
|
-
...params.olmOperators,
|
|
96
|
-
...(virtOperators ? virtOperators.map((op) => ({ name: op })) : []),
|
|
97
|
-
];
|
|
85
|
+
params.operatorBundles = [{ id: 'virtualization', optionalOperators: [] }];
|
|
98
86
|
}
|
|
99
87
|
const cluster = await ClustersService.create(
|
|
100
88
|
params,
|
|
@@ -66,8 +66,8 @@ const getWizardStepIds = (
|
|
|
66
66
|
stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
if (isSingleClusterFeatureEnabled) {
|
|
70
|
-
stepsCopy = addStepToClusterWizard(stepsCopy, '
|
|
69
|
+
if (isSingleClusterFeatureEnabled && !stepsCopy.includes('credentials-download')) {
|
|
70
|
+
stepsCopy = addStepToClusterWizard(stepsCopy, 'custom-manifests', ['credentials-download']);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
return stepsCopy;
|
|
@@ -116,13 +116,11 @@ const ClusterWizardContextProvider = ({
|
|
|
116
116
|
locationState,
|
|
117
117
|
staticIpInfo,
|
|
118
118
|
cluster?.status,
|
|
119
|
-
cluster
|
|
120
|
-
customManifestsStepNeedsToBeFilled,
|
|
119
|
+
cluster,
|
|
121
120
|
);
|
|
122
121
|
const firstStepIds = getWizardStepIds(
|
|
123
122
|
wizardStepIds,
|
|
124
123
|
staticIpInfo?.view,
|
|
125
|
-
|
|
126
124
|
isSingleClusterFeatureEnabled,
|
|
127
125
|
);
|
|
128
126
|
|
|
@@ -150,7 +148,7 @@ const ClusterWizardContextProvider = ({
|
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
153
|
-
}, [uiSettings, UISettingsLoading, UISettingsError]);
|
|
151
|
+
}, [uiSettings, UISettingsLoading, UISettingsError, isSingleClusterFeatureEnabled]);
|
|
154
152
|
|
|
155
153
|
const contextValue = React.useMemo<ClusterWizardContextType | null>(() => {
|
|
156
154
|
if (!wizardStepIds || !currentStepId) {
|
|
@@ -167,7 +165,6 @@ const ClusterWizardContextProvider = ({
|
|
|
167
165
|
const newStepIds = getWizardStepIds(
|
|
168
166
|
wizardStepIds,
|
|
169
167
|
staticIpInfo.view,
|
|
170
|
-
|
|
171
168
|
isSingleClusterFeatureEnabled,
|
|
172
169
|
);
|
|
173
170
|
setWizardStepIds(newStepIds);
|
|
@@ -207,12 +204,7 @@ const ClusterWizardContextProvider = ({
|
|
|
207
204
|
onUpdateHostNetworkConfigType(type: HostsNetworkConfigurationType): void {
|
|
208
205
|
if (type === HostsNetworkConfigurationType.STATIC) {
|
|
209
206
|
setWizardStepIds(
|
|
210
|
-
getWizardStepIds(
|
|
211
|
-
wizardStepIds,
|
|
212
|
-
StaticIpView.FORM,
|
|
213
|
-
|
|
214
|
-
isSingleClusterFeatureEnabled,
|
|
215
|
-
),
|
|
207
|
+
getWizardStepIds(wizardStepIds, StaticIpView.FORM, isSingleClusterFeatureEnabled),
|
|
216
208
|
);
|
|
217
209
|
} else {
|
|
218
210
|
setWizardStepIds(
|