@openshift-assisted/ui-lib 2.14.2-cim → 2.14.4-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/ClusterDeploymentDetailsForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts +4 -2
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/types.d.ts +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.d.ts +7 -0
- package/build/@types/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.d.ts.map +1 -0
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts +2 -1
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts +2 -2
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +2 -2
- package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
- package/build/@types/common/components/ui/{OpenshiftSelectWithSearch.d.ts → OpenShiftSelectWithSearch.d.ts} +3 -3
- package/build/@types/common/components/ui/OpenShiftSelectWithSearch.d.ts.map +1 -0
- package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts +2 -2
- package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts.map +1 -1
- package/build/@types/common/components/ui/OpenShiftVersionModal.d.ts +12 -0
- package/build/@types/common/components/ui/OpenShiftVersionModal.d.ts.map +1 -0
- package/build/@types/common/components/ui/formik/RichInputField.d.ts.map +1 -1
- package/build/@types/common/components/ui/index.d.ts +2 -0
- package/build/@types/common/components/ui/index.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmOpenShiftVersionSelect.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/{OpenshiftVersionsContext.d.ts → OpenShiftVersionsContext.d.ts} +4 -4
- package/build/@types/ocm/components/clusterWizard/{OpenshiftVersionsContext.d.ts.map → OpenShiftVersionsContext.d.ts.map} +1 -1
- package/build/@types/ocm/components/clusterWizard/index.d.ts +1 -0
- package/build/@types/ocm/components/clusterWizard/index.d.ts.map +1 -1
- package/build/@types/ocm/services/OperatorsService.d.ts +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +17 -16
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +24 -9
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.js +2 -2
- package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js +2 -2
- package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/{OpenshiftVersionDropdown.js → InfraEnvOpenShiftVersionDropdown.js} +3 -3
- package/build/cjs/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.js.map +1 -0
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +14 -19
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +19 -11
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +11 -9
- package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
- package/build/cjs/common/components/ui/{OpenshiftSelectWithSearch.js → OpenShiftSelectWithSearch.js} +6 -6
- package/build/cjs/common/components/ui/{OpenshiftSelectWithSearch.js.map → OpenShiftSelectWithSearch.js.map} +1 -1
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.css +9 -0
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js +2 -2
- package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js.map +1 -1
- package/build/cjs/{ocm/components/clusterConfiguration → common/components/ui}/OpenShiftVersionModal.js +4 -6
- package/build/cjs/common/components/ui/OpenShiftVersionModal.js.map +1 -0
- package/build/cjs/common/components/ui/formik/RichInputField.js +3 -2
- package/build/cjs/common/components/ui/formik/RichInputField.js.map +1 -1
- package/build/cjs/common/components/ui/index.js +2 -0
- package/build/cjs/common/components/ui/index.js.map +1 -1
- package/build/cjs/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.js +2 -2
- package/build/cjs/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.js +2 -2
- package/build/cjs/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/OcmOpenShiftVersion.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmOpenShiftVersionSelect.js +5 -6
- package/build/cjs/ocm/components/clusterConfiguration/OcmOpenShiftVersionSelect.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js +2 -2
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerDetailCard.js +2 -2
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js +2 -2
- package/build/cjs/ocm/components/clusterDetail/OpenShiftVersionDetail.js +2 -2
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +2 -2
- package/build/cjs/ocm/components/clusterWizard/{OpenshiftVersionsContext.js → OpenShiftVersionsContext.js} +10 -10
- package/build/cjs/ocm/components/clusterWizard/{OpenshiftVersionsContext.js.map → OpenShiftVersionsContext.js.map} +1 -1
- package/build/cjs/ocm/components/clusterWizard/index.js +3 -1
- package/build/cjs/ocm/components/clusterWizard/index.js.map +1 -1
- package/build/cjs/ocm/components/clusters/ClusterPage.js +3 -3
- package/build/cjs/ocm/components/clusters/NewClusterPage.js +2 -2
- package/build/cjs/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.js +2 -2
- package/build/cjs/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.js +2 -2
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -1
- package/build/cjs/ocm/services/OperatorsService.js +2 -2
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +35 -29
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +54 -13
- package/lib/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.tsx +2 -2
- package/lib/cim/components/Hypershift/types.ts +1 -1
- package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +2 -2
- package/lib/cim/components/InfraEnv/{OpenshiftVersionDropdown.tsx → InfraEnvOpenShiftVersionDropdown.tsx} +2 -2
- package/lib/cim/components/common/CpuArchitectureDropdown.tsx +51 -40
- package/lib/cim/components/helpers/versions.ts +20 -6
- package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +14 -14
- package/lib/common/components/ui/{OpenshiftSelectWithSearch.tsx → OpenShiftSelectWithSearch.tsx} +4 -4
- package/lib/common/components/ui/OpenShiftVersionDropdown.css +9 -0
- package/lib/common/components/ui/OpenShiftVersionDropdown.tsx +3 -3
- package/lib/{ocm/components/clusterConfiguration → common/components/ui}/OpenShiftVersionModal.tsx +9 -9
- package/lib/common/components/ui/formik/RichInputField.tsx +4 -2
- package/lib/common/components/ui/index.ts +3 -0
- package/lib/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.tsx +2 -2
- package/lib/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.tsx +3 -3
- package/lib/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.tsx +3 -3
- package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +2 -2
- package/lib/ocm/components/clusterConfiguration/OcmOpenShiftVersion.tsx +1 -1
- package/lib/ocm/components/clusterConfiguration/OcmOpenShiftVersionSelect.tsx +9 -5
- package/lib/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.tsx +2 -2
- package/lib/ocm/components/clusterDetail/AssistedInstallerDetailCard.tsx +3 -3
- package/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx +3 -3
- package/lib/ocm/components/clusterDetail/OpenShiftVersionDetail.tsx +2 -2
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +2 -2
- package/lib/ocm/components/clusterWizard/{OpenshiftVersionsContext.tsx → OpenShiftVersionsContext.tsx} +8 -8
- package/lib/ocm/components/clusterWizard/index.ts +1 -0
- package/lib/ocm/components/clusters/ClusterPage.tsx +5 -5
- package/lib/ocm/components/clusters/NewClusterPage.tsx +3 -3
- package/lib/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.tsx +2 -2
- package/lib/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.tsx +2 -2
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
- package/lib/ocm/services/OperatorsService.tsx +2 -2
- package/package.json +3 -3
- package/build/@types/cim/components/InfraEnv/OpenshiftVersionDropdown.d.ts +0 -7
- package/build/@types/cim/components/InfraEnv/OpenshiftVersionDropdown.d.ts.map +0 -1
- package/build/@types/common/components/ui/OpenshiftSelectWithSearch.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterConfiguration/OpenShiftVersionModal.d.ts +0 -10
- package/build/@types/ocm/components/clusterConfiguration/OpenShiftVersionModal.d.ts.map +0 -1
- package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js.map +0 -1
- package/build/cjs/common/components/ui/OpenshiftVersionDropdown.css +0 -4
- package/build/cjs/ocm/components/clusterConfiguration/OpenShiftVersionModal.js.map +0 -1
- package/lib/common/components/ui/OpenshiftVersionDropdown.css +0 -4
- /package/build/cjs/{ocm/components/clusterConfiguration/OpenshiftVersionModal.css → common/components/ui/OpenShiftVersionModal.css} +0 -0
- /package/lib/{ocm/components/clusterConfiguration/OpenshiftVersionModal.css → common/components/ui/OpenShiftVersionModal.css} +0 -0
|
@@ -13,7 +13,7 @@ const useInfraEnv_1 = tslib_1.__importDefault(require("../../hooks/useInfraEnv")
|
|
|
13
13
|
const hooks_1 = require("../../hooks");
|
|
14
14
|
const selectors_1 = require("../../store/slices/current-cluster/selectors");
|
|
15
15
|
const use_feature_detection_1 = require("../../hooks/use-feature-detection");
|
|
16
|
-
const
|
|
16
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
17
17
|
const AssistedInstallerExtraDetailCard = ({ allEnabledFeatures, }) => {
|
|
18
18
|
var _a;
|
|
19
19
|
(0, use_feature_detection_1.useFeatureDetection)(allEnabledFeatures);
|
|
@@ -33,7 +33,7 @@ const AssistedInstallerExtraDetailCard = ({ allEnabledFeatures, }) => {
|
|
|
33
33
|
const Wrapper = (props) => {
|
|
34
34
|
return (react_1.default.createElement(react_redux_1.Provider, { store: store_1.storeDay1 },
|
|
35
35
|
react_1.default.createElement(common_1.AlertsContextProvider, null,
|
|
36
|
-
react_1.default.createElement(
|
|
36
|
+
react_1.default.createElement(OpenShiftVersionsContext_1.OpenShiftVersionsContextProvider, null,
|
|
37
37
|
react_1.default.createElement(AssistedInstallerExtraDetailCard, Object.assign({}, props))))));
|
|
38
38
|
};
|
|
39
39
|
exports.default = Wrapper;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const common_1 = require("../../../common");
|
|
6
|
-
const
|
|
6
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
7
7
|
const exclamation_triangle_icon_1 = require("@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon");
|
|
8
8
|
const react_core_1 = require("@patternfly/react-core");
|
|
9
9
|
const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
|
|
@@ -19,7 +19,7 @@ const UnsupportedVersion = ({ version }) => {
|
|
|
19
19
|
};
|
|
20
20
|
const OpenShiftVersionDetail = ({ cluster }) => {
|
|
21
21
|
const { openshiftVersion } = cluster;
|
|
22
|
-
const { isSupportedOpenShiftVersion, latestVersions: versions } = (0,
|
|
22
|
+
const { isSupportedOpenShiftVersion, latestVersions: versions } = (0, OpenShiftVersionsContext_1.useOpenShiftVersionsContext)();
|
|
23
23
|
const isSupported = isSupportedOpenShiftVersion(openshiftVersion);
|
|
24
24
|
const version = react_1.default.useMemo(() => {
|
|
25
25
|
return (0, common_1.getOpenshiftVersionText)({
|
|
@@ -11,7 +11,7 @@ const slice_1 = require("../../store/slices/current-cluster/slice");
|
|
|
11
11
|
const ClusterWizardContext_1 = require("./ClusterWizardContext");
|
|
12
12
|
const wizardTransition_1 = require("./wizardTransition");
|
|
13
13
|
const hooks_2 = require("../../hooks");
|
|
14
|
-
const
|
|
14
|
+
const OpenShiftVersionsContext_1 = require("./OpenShiftVersionsContext");
|
|
15
15
|
const ClusterDetailsForm_1 = tslib_1.__importDefault(require("./ClusterDetailsForm"));
|
|
16
16
|
const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("./ClusterWizardNavigation"));
|
|
17
17
|
const services_1 = require("../../services");
|
|
@@ -23,7 +23,7 @@ const ClusterDetails = ({ cluster, infraEnv }) => {
|
|
|
23
23
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
24
24
|
const { usedClusterNames } = (0, hooks_2.useUsedClusterNames)((cluster === null || cluster === void 0 ? void 0 : cluster.id) || '');
|
|
25
25
|
const pullSecret = (0, hooks_1.usePullSecret)();
|
|
26
|
-
const { error: errorOCPVersions, loading: loadingOCPVersions, latestVersions: versions, } = (0,
|
|
26
|
+
const { error: errorOCPVersions, loading: loadingOCPVersions, latestVersions: versions, } = (0, OpenShiftVersionsContext_1.useOpenShiftVersionsContext)();
|
|
27
27
|
const location = (0, react_router_dom_v5_compat_1.useLocation)();
|
|
28
28
|
const handleClusterUpdate = react_1.default.useCallback((clusterId, params, addCustomManifests) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
clearAlerts();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useOpenShiftVersionsContext = exports.OpenShiftVersionsContextProvider = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const api_1 = require("../../../common/api");
|
|
7
7
|
const apis_1 = require("../../services/apis");
|
|
8
8
|
const utils_1 = require("../../../common/utils");
|
|
9
9
|
const supportedVersionLevels = ['production', 'maintenance'];
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const OpenShiftVersionsContext = (0, react_1.createContext)(null);
|
|
11
|
+
const OpenShiftVersionsContextProvider = ({ children }) => {
|
|
12
12
|
const [allVersions, setAllVersions] = react_1.default.useState([]);
|
|
13
13
|
const [latestVersions, setLatestVersions] = react_1.default.useState([]);
|
|
14
14
|
const [error, setError] = react_1.default.useState();
|
|
@@ -72,7 +72,7 @@ const OpenshiftVersionsContextProvider = ({ children }) => {
|
|
|
72
72
|
const matchingVersion = findVersionItemByVersion(version);
|
|
73
73
|
return (_a = matchingVersion === null || matchingVersion === void 0 ? void 0 : matchingVersion.cpuArchitectures) !== null && _a !== void 0 ? _a : [];
|
|
74
74
|
}, [findVersionItemByVersion]);
|
|
75
|
-
return (react_1.default.createElement(
|
|
75
|
+
return (react_1.default.createElement(OpenShiftVersionsContext.Provider, { value: {
|
|
76
76
|
allVersions,
|
|
77
77
|
latestVersions,
|
|
78
78
|
loading: !error && ((allVersions === null || allVersions === void 0 ? void 0 : allVersions.length) === 0 || (latestVersions === null || latestVersions === void 0 ? void 0 : latestVersions.length) === 0),
|
|
@@ -81,13 +81,13 @@ const OpenshiftVersionsContextProvider = ({ children }) => {
|
|
|
81
81
|
getCpuArchitectures,
|
|
82
82
|
} }, children));
|
|
83
83
|
};
|
|
84
|
-
exports.
|
|
85
|
-
const
|
|
86
|
-
const context = react_1.default.useContext(
|
|
84
|
+
exports.OpenShiftVersionsContextProvider = OpenShiftVersionsContextProvider;
|
|
85
|
+
const useOpenShiftVersionsContext = () => {
|
|
86
|
+
const context = react_1.default.useContext(OpenShiftVersionsContext);
|
|
87
87
|
if (!context) {
|
|
88
|
-
throw new Error('
|
|
88
|
+
throw new Error('useOpenShiftVersionsContext must be used within OpenShiftVersionsContext');
|
|
89
89
|
}
|
|
90
90
|
return context;
|
|
91
91
|
};
|
|
92
|
-
exports.
|
|
93
|
-
//# sourceMappingURL=
|
|
92
|
+
exports.useOpenShiftVersionsContext = useOpenShiftVersionsContext;
|
|
93
|
+
//# sourceMappingURL=OpenShiftVersionsContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"OpenShiftVersionsContext.js","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterWizard/OpenShiftVersionsContext.tsx"],"names":[],"mappings":"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"}
|
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ClusterWizardContextProvider = exports.NewClusterWizard = exports.ClusterDetailsForm = void 0;
|
|
6
|
+
exports.OpenShiftVersionsContextProvider = exports.ClusterWizardContextProvider = exports.NewClusterWizard = exports.ClusterDetailsForm = void 0;
|
|
7
7
|
var ClusterDetailsForm_1 = require("./ClusterDetailsForm");
|
|
8
8
|
Object.defineProperty(exports, "ClusterDetailsForm", { enumerable: true, get: function () { return __importDefault(ClusterDetailsForm_1).default; } });
|
|
9
9
|
var NewClusterWizard_1 = require("./NewClusterWizard");
|
|
10
10
|
Object.defineProperty(exports, "NewClusterWizard", { enumerable: true, get: function () { return __importDefault(NewClusterWizard_1).default; } });
|
|
11
11
|
var ClusterWizardContextProvider_1 = require("./ClusterWizardContextProvider");
|
|
12
12
|
Object.defineProperty(exports, "ClusterWizardContextProvider", { enumerable: true, get: function () { return __importDefault(ClusterWizardContextProvider_1).default; } });
|
|
13
|
+
var OpenShiftVersionsContext_1 = require("./OpenShiftVersionsContext");
|
|
14
|
+
Object.defineProperty(exports, "OpenShiftVersionsContextProvider", { enumerable: true, get: function () { return OpenShiftVersionsContext_1.OpenShiftVersionsContextProvider; } });
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterWizard/index.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterWizard/index.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,uEAA8E;AAArE,4IAAA,gCAAgC,OAAA"}
|
|
@@ -30,7 +30,7 @@ const BackButton_1 = require("../ui/Buttons/BackButton");
|
|
|
30
30
|
const featureSupportLevels_1 = require("../featureSupportLevels");
|
|
31
31
|
const hooks_1 = require("../../hooks");
|
|
32
32
|
const AssistedInstallerHeader_1 = require("./AssistedInstallerHeader");
|
|
33
|
-
const
|
|
33
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
34
34
|
const ClusterPageGeneric = ({ clusterId, showBreadcrumbs = false, }) => {
|
|
35
35
|
var _a;
|
|
36
36
|
if (!clusterId) {
|
|
@@ -50,7 +50,7 @@ const ClusterPageGeneric = ({ clusterId, showBreadcrumbs = false, }) => {
|
|
|
50
50
|
return Promise.resolve();
|
|
51
51
|
});
|
|
52
52
|
return (react_1.default.createElement(common_1.AddHostsContextProvider, { cluster: cluster, resetCluster: onReset },
|
|
53
|
-
react_1.default.createElement(
|
|
53
|
+
react_1.default.createElement(OpenShiftVersionsContext_1.OpenShiftVersionsContextProvider, null,
|
|
54
54
|
react_1.default.createElement(AddHosts_1.AddHosts, null))));
|
|
55
55
|
}
|
|
56
56
|
else if ([
|
|
@@ -100,7 +100,7 @@ const ClusterPageGeneric = ({ clusterId, showBreadcrumbs = false, }) => {
|
|
|
100
100
|
react_1.default.createElement(SentryErrorMonitorContextProvider_1.SentryErrorMonitorContextProvider, null,
|
|
101
101
|
react_1.default.createElement(ModalDialogsContext_1.ModalDialogsContextProvider, null,
|
|
102
102
|
react_1.default.createElement(ClusterDefaultConfigurationContext_1.ClusterDefaultConfigurationProvider, { loadingUI: react_1.default.createElement(ClusterLoading_1.default, null), errorUI: react_1.default.createElement(ClusterPageErrors_1.ClusterUiError, null) },
|
|
103
|
-
react_1.default.createElement(
|
|
103
|
+
react_1.default.createElement(OpenShiftVersionsContext_1.OpenShiftVersionsContextProvider, null,
|
|
104
104
|
react_1.default.createElement(featureSupportLevels_1.NewFeatureSupportLevelProvider, { loadingUi: react_1.default.createElement(ClusterLoading_1.default, null), cluster: cluster, cpuArchitecture: infraEnv.cpuArchitecture, openshiftVersion: cluster.openshiftVersion, platformType: (_a = cluster.platform) === null || _a === void 0 ? void 0 : _a.type },
|
|
105
105
|
getContent(cluster, infraEnv),
|
|
106
106
|
uiState === common_1.ResourceUIState.POLLING_ERROR && react_1.default.createElement(ClusterPollingErrorModal_1.default, null),
|
|
@@ -15,13 +15,13 @@ const ClusterPageErrors_1 = require("./ClusterPageErrors");
|
|
|
15
15
|
const featureSupportLevels_1 = require("../featureSupportLevels");
|
|
16
16
|
const AssistedInstallerHeader_1 = require("./AssistedInstallerHeader");
|
|
17
17
|
const ModalDialogsContext_1 = require("../hosts/ModalDialogsContext");
|
|
18
|
-
const
|
|
18
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
19
19
|
const NewClusterPageGeneric = ({ pageTitleSection }) => {
|
|
20
20
|
return (react_1.default.createElement(common_1.AlertsContextProvider, null,
|
|
21
21
|
react_1.default.createElement(SentryErrorMonitorContextProvider_1.SentryErrorMonitorContextProvider, null,
|
|
22
22
|
react_1.default.createElement(ModalDialogsContext_1.ModalDialogsContextProvider, null,
|
|
23
23
|
react_1.default.createElement(ClusterDefaultConfigurationContext_1.ClusterDefaultConfigurationProvider, { loadingUI: react_1.default.createElement(ClusterLoading_1.default, null), errorUI: react_1.default.createElement(ClusterPageErrors_1.ClusterUiError, null) },
|
|
24
|
-
react_1.default.createElement(
|
|
24
|
+
react_1.default.createElement(OpenShiftVersionsContext_1.OpenShiftVersionsContextProvider, null,
|
|
25
25
|
react_1.default.createElement(featureSupportLevels_1.NewFeatureSupportLevelProvider, { loadingUi: react_1.default.createElement(ClusterLoading_1.default, null) },
|
|
26
26
|
pageTitleSection,
|
|
27
27
|
react_1.default.createElement(react_core_1.PageSection, { variant: react_core_1.PageSectionVariants.light, isFilled: true },
|
|
@@ -9,13 +9,13 @@ const featureStateUtils_1 = require("./featureStateUtils");
|
|
|
9
9
|
const useInfraEnv_1 = tslib_1.__importDefault(require("../../hooks/useInfraEnv"));
|
|
10
10
|
const newFeatureSupportLevels_1 = require("../../../common/components/newFeatureSupportLevels");
|
|
11
11
|
const useSupportLevelsAPI_1 = tslib_1.__importDefault(require("../../hooks/useSupportLevelsAPI"));
|
|
12
|
-
const
|
|
12
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
13
13
|
const getFeatureSupported = (featureSupportLevels, featureId) => {
|
|
14
14
|
return featureSupportLevels && (0, featureStateUtils_1.isFeatureSupportedAndAvailable)(featureSupportLevels[featureId]);
|
|
15
15
|
};
|
|
16
16
|
exports.getFeatureSupported = getFeatureSupported;
|
|
17
17
|
const NewFeatureSupportLevelProvider = ({ cluster, children, loadingUi, cpuArchitecture, openshiftVersion, platformType, }) => {
|
|
18
|
-
const { loading: loadingOCPVersions } = (0,
|
|
18
|
+
const { loading: loadingOCPVersions } = (0, OpenShiftVersionsContext_1.useOpenShiftVersionsContext)();
|
|
19
19
|
const pullSecret = (0, hooks_1.usePullSecret)();
|
|
20
20
|
const { infraEnv, isLoading: isInfraEnvLoading } = (0, useInfraEnv_1.default)((cluster === null || cluster === void 0 ? void 0 : cluster.id) || '', (cluster === null || cluster === void 0 ? void 0 : cluster.cpuArchitecture)
|
|
21
21
|
? cluster.cpuArchitecture
|
|
@@ -14,7 +14,7 @@ const common_1 = require("../../../common");
|
|
|
14
14
|
const utils_1 = require("../../../common/components/newFeatureSupportLevels/utils");
|
|
15
15
|
const WithErrorBoundary_1 = require("../../../common/components/ErrorHandling/WithErrorBoundary");
|
|
16
16
|
const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
|
|
17
|
-
const
|
|
17
|
+
const OpenShiftVersionsContext_1 = require("../clusterWizard/OpenShiftVersionsContext");
|
|
18
18
|
const newFeatureSupportLevels_1 = require("../../../common/components/newFeatureSupportLevels");
|
|
19
19
|
const getFeatureReviewText = (featureId) => {
|
|
20
20
|
switch (featureId) {
|
|
@@ -93,7 +93,7 @@ exports.getSupportLevelInfo = getSupportLevelInfo;
|
|
|
93
93
|
const SupportLevel = ({ cluster }) => {
|
|
94
94
|
const { t } = (0, use_translation_wrapper_1.useTranslation)();
|
|
95
95
|
const featureSupportLevelData = (0, newFeatureSupportLevels_1.useNewFeatureSupportLevel)();
|
|
96
|
-
const { isSupportedOpenShiftVersion } = (0,
|
|
96
|
+
const { isSupportedOpenShiftVersion } = (0, OpenShiftVersionsContext_1.useOpenShiftVersionsContext)();
|
|
97
97
|
const { limitedClusterFeatures, hasSupportedVersion, isFullySupported } = react_1.default.useMemo(() => (0, exports.getSupportLevelInfo)(cluster, featureSupportLevelData, isSupportedOpenShiftVersion, t), [cluster, featureSupportLevelData, t, isSupportedOpenShiftVersion]);
|
|
98
98
|
if (!limitedClusterFeatures) {
|
|
99
99
|
return null;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getLvmsIncompatibleWithOdfReason = exports.getOpenShiftAIIncompatibleWithLvmsReason = exports.getOdfIncompatibleWithLvmsReason = exports.hostsNetworkConfigurationDisabledReason = exports.isFeatureSupportedAndAvailable = exports.getNewFeatureDisabledReason = exports.getLvmIncompatibleWithCnvReason = exports.getCnvIncompatibleWithLvmReason = exports.clusterExistsReason = void 0;
|
|
4
4
|
const common_1 = require("../../../common");
|
|
5
5
|
const constants_1 = require("../clusterConfiguration/platformIntegration/constants");
|
|
6
|
-
const CNV_OPERATOR_LABEL = '
|
|
6
|
+
const CNV_OPERATOR_LABEL = 'OpenShift Virtualization';
|
|
7
7
|
const LVMS_OPERATOR_LABEL = 'Logical Volume Manager Storage';
|
|
8
8
|
const LVM_OPERATOR_LABEL = 'Logical Volume Manager';
|
|
9
9
|
const ODF_OPERATOR_LABEL = 'OpenShift Data Foundation';
|
|
@@ -31,13 +31,13 @@ const OperatorsService = {
|
|
|
31
31
|
return Object.values(enabledOlmOperatorsByName);
|
|
32
32
|
},
|
|
33
33
|
/**
|
|
34
|
-
* Depending on the
|
|
34
|
+
* Depending on the OpenShift version and certain selected operators, the
|
|
35
35
|
* Backend can activate some other operators.
|
|
36
36
|
* We need to synchronise them back to the form
|
|
37
37
|
*/
|
|
38
38
|
syncOperators(uiOperators, updatedOperators) {
|
|
39
39
|
const updates = {};
|
|
40
|
-
// LVM operator can be automatically selected depending on
|
|
40
|
+
// LVM operator can be automatically selected depending on OpenShift version + other operators
|
|
41
41
|
const lvmPrevInactive = (uiOperators === null || uiOperators === void 0 ? void 0 : uiOperators.find((op) => op.name === common_1.OPERATOR_NAME_LVM)) === undefined;
|
|
42
42
|
const lvmNowActive = (updatedOperators === null || updatedOperators === void 0 ? void 0 : updatedOperators.find((op) => op.name === common_1.OPERATOR_NAME_LVM)) !== undefined;
|
|
43
43
|
if (lvmPrevInactive && lvmNowActive) {
|
|
@@ -20,6 +20,7 @@ import { useFormikContext } from 'formik';
|
|
|
20
20
|
import { ClusterDetailsValues, CpuArchitecture, SupportedCpuArchitecture } from '../../../common';
|
|
21
21
|
import { ClusterDeploymentWizardContext } from './ClusterDeploymentWizardContext';
|
|
22
22
|
import { ValidationSection } from './components/ValidationSection';
|
|
23
|
+
import { toNumber } from 'lodash-es';
|
|
23
24
|
|
|
24
25
|
type ClusterDeploymentDetailsFormProps = {
|
|
25
26
|
clusterImages: ClusterImageSetK8sResource[];
|
|
@@ -41,25 +42,28 @@ export const ClusterDeploymentDetailsFormWrapper = ({
|
|
|
41
42
|
useFormikContext<ClusterDetailsValues>();
|
|
42
43
|
const { t } = useTranslation();
|
|
43
44
|
|
|
44
|
-
const handleOnNext = () => {
|
|
45
|
+
const handleOnNext = React.useCallback(() => {
|
|
45
46
|
if (dirty) {
|
|
46
47
|
void submitForm();
|
|
47
48
|
} else {
|
|
48
49
|
void goToNextStep();
|
|
49
50
|
}
|
|
50
|
-
};
|
|
51
|
+
}, [dirty, goToNextStep, submitForm]);
|
|
51
52
|
|
|
52
|
-
const footer = (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
const footer = React.useMemo(
|
|
54
|
+
() => (
|
|
55
|
+
<WizardFooter
|
|
56
|
+
activeStep={activeStep}
|
|
57
|
+
onNext={handleOnNext}
|
|
58
|
+
isNextDisabled={!isValid || isValidating || isSubmitting}
|
|
59
|
+
nextButtonProps={{ isLoading: isSubmitting }}
|
|
60
|
+
nextButtonText={t('ai:Next')}
|
|
61
|
+
onBack={goToPrevStep}
|
|
62
|
+
onClose={close}
|
|
63
|
+
isBackHidden
|
|
64
|
+
/>
|
|
65
|
+
),
|
|
66
|
+
[activeStep, close, goToPrevStep, handleOnNext, isSubmitting, isValid, isValidating, t],
|
|
63
67
|
);
|
|
64
68
|
|
|
65
69
|
useWizardFooter(footer);
|
|
@@ -89,11 +93,16 @@ const ClusterDeploymentDetailsForm: React.FC<ClusterDeploymentDetailsFormProps>
|
|
|
89
93
|
osImages,
|
|
90
94
|
}) => {
|
|
91
95
|
const { t } = useTranslation();
|
|
92
|
-
const
|
|
96
|
+
const versions = React.useMemo(
|
|
93
97
|
() => getOCPVersions(clusterImages, isNutanix, osImages),
|
|
94
98
|
[clusterImages, isNutanix, osImages],
|
|
95
99
|
);
|
|
96
100
|
|
|
101
|
+
const allVersions = React.useMemo(
|
|
102
|
+
() => getOCPVersions(clusterImages, isNutanix, osImages, true),
|
|
103
|
+
[clusterImages, isNutanix, osImages],
|
|
104
|
+
);
|
|
105
|
+
|
|
97
106
|
const forceOpenshiftVersion = agentClusterInstall
|
|
98
107
|
? getSelectedVersion(clusterImages, agentClusterInstall)
|
|
99
108
|
: undefined;
|
|
@@ -101,22 +110,17 @@ const ClusterDeploymentDetailsForm: React.FC<ClusterDeploymentDetailsFormProps>
|
|
|
101
110
|
|
|
102
111
|
const { values } = useFormikContext<ClusterDetailsValues>();
|
|
103
112
|
|
|
104
|
-
const cpuArchitectures = React.useMemo(() => {
|
|
113
|
+
const [cpuArchitectures, allowHighlyAvailable] = React.useMemo(() => {
|
|
105
114
|
const cpuArchitectures = [CpuArchitecture.x86, CpuArchitecture.ARM, CpuArchitecture.s390x];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const openshiftVersion = ocpVersions
|
|
111
|
-
.find((ver) => ver.value === values.openshiftVersion)
|
|
112
|
-
?.version.split('.')
|
|
113
|
-
.slice(0, 2)
|
|
114
|
-
.join('.');
|
|
115
|
+
const version = allVersions.find((ver) => ver.value === values.openshiftVersion);
|
|
116
|
+
const isMulti = version?.cpuArchitectures?.[0] === CpuArchitecture.MULTI;
|
|
115
117
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
const highlyAvailableSupported = toNumber(version?.version?.split('.')?.[1]) >= 18;
|
|
119
|
+
return [
|
|
120
|
+
(isMulti ? cpuArchitectures : version?.cpuArchitectures) as SupportedCpuArchitecture[],
|
|
121
|
+
highlyAvailableSupported && !isMulti,
|
|
122
|
+
];
|
|
123
|
+
}, [allVersions, values.openshiftVersion]);
|
|
120
124
|
|
|
121
125
|
return (
|
|
122
126
|
<>
|
|
@@ -131,12 +135,14 @@ const ClusterDeploymentDetailsForm: React.FC<ClusterDeploymentDetailsFormProps>
|
|
|
131
135
|
)}
|
|
132
136
|
<StackItem>
|
|
133
137
|
<ClusterDetailsFormFields
|
|
134
|
-
versions={
|
|
138
|
+
versions={versions}
|
|
139
|
+
allVersions={allVersions}
|
|
135
140
|
isEditFlow={isEditFlow}
|
|
136
141
|
forceOpenshiftVersion={forceOpenshiftVersion}
|
|
137
142
|
extensionAfter={extensionAfter}
|
|
138
143
|
isNutanix={isNutanix}
|
|
139
144
|
cpuArchitectures={cpuArchitectures}
|
|
145
|
+
allowHighlyAvailable={allowHighlyAvailable}
|
|
140
146
|
/>
|
|
141
147
|
</StackItem>
|
|
142
148
|
</>
|
|
@@ -2,10 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { Alert, AlertVariant, FlexItem, Form } from '@patternfly/react-core';
|
|
3
3
|
import { useFormikContext } from 'formik';
|
|
4
4
|
|
|
5
|
+
import { OpenShiftVersionDropdown, OpenShiftVersionModal } from '../../../common';
|
|
5
6
|
import { StaticTextField } from '../../../common/components/ui/StaticTextField';
|
|
6
|
-
import OpenShiftVersionSelect from '../../../common/components/clusterConfiguration/OpenShiftVersionSelect';
|
|
7
7
|
import { PullSecret } from '../../../common/components/clusters';
|
|
8
|
-
import { OpenshiftVersionOptionType } from '../../../common/types';
|
|
8
|
+
import { OpenshiftVersionOptionType, SupportedCpuArchitecture } from '../../../common/types';
|
|
9
9
|
import {
|
|
10
10
|
InputField,
|
|
11
11
|
RichInputField,
|
|
@@ -14,15 +14,17 @@ import {
|
|
|
14
14
|
import { ClusterDetailsValues } from '../../../common/components/clusterWizard/types';
|
|
15
15
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
16
16
|
import CpuArchitectureDropdown from '../common/CpuArchitectureDropdown';
|
|
17
|
-
import { getNetworkType } from '../helpers';
|
|
18
17
|
import ControlPlaneNodesDropdown from '../../../common/components/clusterConfiguration/ControlPlaneNodesDropdown';
|
|
18
|
+
|
|
19
19
|
export type ClusterDetailsFormFieldsProps = {
|
|
20
20
|
isEditFlow: boolean;
|
|
21
21
|
forceOpenshiftVersion?: string;
|
|
22
22
|
extensionAfter?: { [key: string]: React.ReactElement };
|
|
23
23
|
versions: OpenshiftVersionOptionType[];
|
|
24
|
+
allVersions: OpenshiftVersionOptionType[];
|
|
24
25
|
isNutanix?: boolean;
|
|
25
|
-
cpuArchitectures?:
|
|
26
|
+
cpuArchitectures?: SupportedCpuArchitecture[];
|
|
27
|
+
allowHighlyAvailable?: boolean;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
export const BaseDnsHelperText: React.FC<{ name?: string; baseDnsDomain?: string }> = ({
|
|
@@ -46,13 +48,40 @@ export const BaseDnsHelperText: React.FC<{ name?: string; baseDnsDomain?: string
|
|
|
46
48
|
export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> = ({
|
|
47
49
|
isEditFlow,
|
|
48
50
|
versions,
|
|
51
|
+
allVersions,
|
|
49
52
|
forceOpenshiftVersion,
|
|
50
53
|
extensionAfter,
|
|
51
54
|
isNutanix,
|
|
52
55
|
cpuArchitectures,
|
|
56
|
+
allowHighlyAvailable,
|
|
53
57
|
}) => {
|
|
54
|
-
const { values
|
|
58
|
+
const { values } = useFormikContext<ClusterDetailsValues>();
|
|
55
59
|
const { name, baseDnsDomain } = values;
|
|
60
|
+
const [openshiftVersionModalOpen, setOpenshiftVersionModalOpen] = React.useState(false);
|
|
61
|
+
|
|
62
|
+
const selectOptions = React.useMemo(
|
|
63
|
+
() =>
|
|
64
|
+
versions.map((version) => ({
|
|
65
|
+
label: version.label,
|
|
66
|
+
value: version.value,
|
|
67
|
+
})),
|
|
68
|
+
[versions],
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const additionalSelectOptions = React.useMemo(() => {
|
|
72
|
+
if (
|
|
73
|
+
values.customOpenshiftSelect &&
|
|
74
|
+
!selectOptions.some((option) => option.value === values.customOpenshiftSelect?.value)
|
|
75
|
+
) {
|
|
76
|
+
return [
|
|
77
|
+
{
|
|
78
|
+
value: values.customOpenshiftSelect.value,
|
|
79
|
+
label: values.customOpenshiftSelect.label,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}, [selectOptions, values.customOpenshiftSelect]);
|
|
56
85
|
|
|
57
86
|
const nameInputRef = React.useRef<HTMLInputElement>();
|
|
58
87
|
React.useEffect(() => {
|
|
@@ -102,15 +131,27 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
|
|
|
102
131
|
{t('ai:OpenShift')} {forceOpenshiftVersion}
|
|
103
132
|
</StaticTextField>
|
|
104
133
|
) : (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
134
|
+
<>
|
|
135
|
+
<OpenShiftVersionDropdown
|
|
136
|
+
name="openshiftVersion"
|
|
137
|
+
items={selectOptions}
|
|
138
|
+
versions={versions}
|
|
139
|
+
showReleasesLink={false}
|
|
140
|
+
showOpenshiftVersionModal={() => setOpenshiftVersionModalOpen(true)}
|
|
141
|
+
customItems={additionalSelectOptions}
|
|
142
|
+
/>
|
|
143
|
+
{openshiftVersionModalOpen && (
|
|
144
|
+
<OpenShiftVersionModal
|
|
145
|
+
allVersions={allVersions}
|
|
146
|
+
setOpenshiftVersionModalOpen={setOpenshiftVersionModalOpen}
|
|
147
|
+
/>
|
|
148
|
+
)}
|
|
149
|
+
</>
|
|
112
150
|
)}
|
|
113
|
-
<ControlPlaneNodesDropdown
|
|
151
|
+
<ControlPlaneNodesDropdown
|
|
152
|
+
isDisabled={isEditFlow}
|
|
153
|
+
allowHighlyAvailable={allowHighlyAvailable}
|
|
154
|
+
/>
|
|
114
155
|
{!isNutanix && (
|
|
115
156
|
<CpuArchitectureDropdown cpuArchitectures={cpuArchitectures} isDisabled={isEditFlow} />
|
|
116
157
|
)}
|
|
@@ -15,8 +15,8 @@ const HypershiftKubeconfigDownload = ({
|
|
|
15
15
|
fetchSecret,
|
|
16
16
|
}: HypershiftKubeconfigDownloadProps) => {
|
|
17
17
|
const { t } = useTranslation();
|
|
18
|
-
const kubeconfigSecretName = hostedCluster.status?.
|
|
19
|
-
? hostedCluster.status.
|
|
18
|
+
const kubeconfigSecretName = hostedCluster.status?.customKubeconfig
|
|
19
|
+
? hostedCluster.status.customKubeconfig?.name
|
|
20
20
|
: hostedCluster.status?.kubeconfig?.name;
|
|
21
21
|
const handleKubeconfigDownload = async () => {
|
|
22
22
|
const kubeconfigSecretNamespace = hostedCluster.metadata?.namespace;
|
|
@@ -49,7 +49,7 @@ import { getErrorMessage } from '../../../common/utils';
|
|
|
49
49
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
50
50
|
import { TFunction } from 'i18next';
|
|
51
51
|
import CpuArchitectureDropdown from '../common/CpuArchitectureDropdown';
|
|
52
|
-
import
|
|
52
|
+
import InfraEnvOpenShiftVersionDropdown from './InfraEnvOpenShiftVersionDropdown';
|
|
53
53
|
import { OsImage } from '../../types';
|
|
54
54
|
|
|
55
55
|
export type EnvironmentStepFormValues = {
|
|
@@ -228,7 +228,7 @@ const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
|
|
|
228
228
|
</Flex>
|
|
229
229
|
</FormGroup>
|
|
230
230
|
<CpuArchitectureDropdown />
|
|
231
|
-
{!!osImages && <
|
|
231
|
+
{!!osImages && <InfraEnvOpenShiftVersionDropdown osImages={osImages} />}
|
|
232
232
|
<RichInputField
|
|
233
233
|
label={t('ai:Location')}
|
|
234
234
|
name="location"
|
|
@@ -6,7 +6,7 @@ import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
|
6
6
|
import { architectureData, getFieldId, SupportedCpuArchitecture } from '../../../common';
|
|
7
7
|
import { OsImage } from '../../types';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const InfraEnvOpenShiftVersionDropdown = ({ osImages }: { osImages: OsImage[] }) => {
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const [{ name, value }, , { setValue }] = useField<string>('osImageVersion');
|
|
12
12
|
const [{ value: cpuArchitecture }] = useField<string>('cpuArchitecture');
|
|
@@ -69,4 +69,4 @@ const OpenshiftVersionDropdown = ({ osImages }: { osImages: OsImage[] }) => {
|
|
|
69
69
|
);
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export default
|
|
72
|
+
export default InfraEnvOpenShiftVersionDropdown;
|