@openshift-assisted/ui-lib 2.51.0 → 2.51.2

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.
Files changed (190) hide show
  1. package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +0 -4
  2. package/build/@types/common/api/assisted-service/ClustersAPI.d.ts.map +1 -1
  3. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  4. package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts.map +1 -1
  5. package/build/@types/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.d.ts.map +1 -1
  6. package/build/@types/common/components/ui/OpenShiftVersionModal.d.ts.map +1 -1
  7. package/build/@types/common/components/ui/formik/PullSecretField.d.ts.map +1 -1
  8. package/build/@types/common/config/constants.d.ts +0 -7
  9. package/build/@types/common/config/constants.d.ts.map +1 -1
  10. package/build/@types/common/types/index.d.ts +1 -0
  11. package/build/@types/common/types/index.d.ts.map +1 -1
  12. package/build/@types/common/types/networkType.d.ts +12 -0
  13. package/build/@types/common/types/networkType.d.ts.map +1 -0
  14. package/build/@types/common/validationSchemas/addressValidation.d.ts.map +1 -1
  15. package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts +0 -5
  16. package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts.map +1 -1
  17. package/build/@types/ocm/components/Routes.d.ts.map +1 -1
  18. package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.d.ts.map +1 -1
  19. package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts +2 -2
  20. package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
  21. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
  22. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.d.ts.map +1 -1
  23. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
  24. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts +1 -2
  25. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
  26. package/build/@types/ocm/components/clusterConfiguration/review/ReviewStep.d.ts.map +1 -1
  27. package/build/@types/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts.map +1 -1
  28. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.d.ts.map +1 -1
  29. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts +0 -22
  30. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts.map +1 -1
  31. package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
  32. package/build/@types/ocm/components/clusterWizard/ClusterDetailsForm.d.ts.map +1 -1
  33. package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts +0 -3
  34. package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts.map +1 -1
  35. package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
  36. package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts +1 -2
  37. package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts.map +1 -1
  38. package/build/@types/ocm/components/clusterWizard/NewClusterWizard.d.ts.map +1 -1
  39. package/build/@types/ocm/components/clusterWizard/constants.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusterWizard/disconnected/BasicStep.d.ts.map +1 -1
  41. package/build/@types/ocm/components/clusterWizard/disconnected/ReviewStep.d.ts.map +1 -1
  42. package/build/@types/ocm/components/clusterWizard/index.d.ts +0 -1
  43. package/build/@types/ocm/components/clusterWizard/index.d.ts.map +1 -1
  44. package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts +1 -1
  45. package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
  46. package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
  47. package/build/@types/ocm/components/utils.d.ts +0 -1
  48. package/build/@types/ocm/components/utils.d.ts.map +1 -1
  49. package/build/@types/ocm/services/ClustersService.d.ts +0 -4
  50. package/build/@types/ocm/services/ClustersService.d.ts.map +1 -1
  51. package/build/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
  52. package/build/@types/ocm/store/slices/clusters/selectors.d.ts +1 -2
  53. package/build/@types/ocm/store/slices/clusters/selectors.d.ts.map +1 -1
  54. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +3 -3
  55. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
  56. package/build/cjs/common/api/assisted-service/ClustersAPI.js +0 -3
  57. package/build/cjs/common/api/assisted-service/ClustersAPI.js.map +1 -1
  58. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +8 -17
  59. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  60. package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +3 -3
  61. package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +1 -1
  62. package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +3 -2
  63. package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
  64. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +2 -1
  65. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
  66. package/build/cjs/common/components/ui/OpenShiftVersionModal.js +1 -3
  67. package/build/cjs/common/components/ui/OpenShiftVersionModal.js.map +1 -1
  68. package/build/cjs/common/components/ui/WizardFooter.js +1 -1
  69. package/build/cjs/common/components/ui/WizardFooter.js.map +1 -1
  70. package/build/cjs/common/components/ui/formik/PullSecretField.js.map +1 -1
  71. package/build/cjs/common/config/constants.js +2 -21
  72. package/build/cjs/common/config/constants.js.map +1 -1
  73. package/build/cjs/common/types/index.js +1 -0
  74. package/build/cjs/common/types/index.js.map +1 -1
  75. package/build/cjs/common/types/networkType.js +28 -0
  76. package/build/cjs/common/types/networkType.js.map +1 -0
  77. package/build/cjs/common/validationSchemas/addressValidation.js +1 -3
  78. package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -1
  79. package/build/cjs/common/validationSchemas/clusterDetailsValidation.js +2 -31
  80. package/build/cjs/common/validationSchemas/clusterDetailsValidation.js.map +1 -1
  81. package/build/cjs/ocm/components/Routes.js +1 -2
  82. package/build/cjs/ocm/components/Routes.js.map +1 -1
  83. package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js +0 -1
  84. package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js.map +1 -1
  85. package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +1 -1
  86. package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
  87. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js +11 -6
  88. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
  89. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js +4 -1
  90. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js.map +1 -1
  91. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +1 -4
  92. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
  93. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +22 -29
  94. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
  95. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewStep.js +8 -14
  96. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewStep.js.map +1 -1
  97. package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js +2 -5
  98. package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js.map +1 -1
  99. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js +1 -1
  100. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js.map +1 -1
  101. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js +1 -1
  102. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js.map +1 -1
  103. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js +3 -31
  104. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js.map +1 -1
  105. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +1 -2
  106. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
  107. package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +1 -2
  108. package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
  109. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContext.js.map +1 -1
  110. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +9 -62
  111. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
  112. package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js +6 -21
  113. package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js.map +1 -1
  114. package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js +1 -11
  115. package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js.map +1 -1
  116. package/build/cjs/ocm/components/clusterWizard/constants.js +0 -1
  117. package/build/cjs/ocm/components/clusterWizard/constants.js.map +1 -1
  118. package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js +18 -96
  119. package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js.map +1 -1
  120. package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js +7 -11
  121. package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js.map +1 -1
  122. package/build/cjs/ocm/components/clusterWizard/index.js +1 -3
  123. package/build/cjs/ocm/components/clusterWizard/index.js.map +1 -1
  124. package/build/cjs/ocm/components/clusterWizard/wizardTransition.js +0 -3
  125. package/build/cjs/ocm/components/clusterWizard/wizardTransition.js.map +1 -1
  126. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +13 -4
  127. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
  128. package/build/cjs/ocm/components/utils.js +1 -4
  129. package/build/cjs/ocm/components/utils.js.map +1 -1
  130. package/build/cjs/ocm/hooks/useInfraEnvId.js +2 -2
  131. package/build/cjs/ocm/hooks/useInfraEnvId.js.map +1 -1
  132. package/build/cjs/ocm/services/ClustersService.js +0 -6
  133. package/build/cjs/ocm/services/ClustersService.js.map +1 -1
  134. package/build/cjs/ocm/services/InfraEnvsService.js +1 -4
  135. package/build/cjs/ocm/services/InfraEnvsService.js.map +1 -1
  136. package/build/cjs/ocm/store/slices/clusters/selectors.js.map +1 -1
  137. package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +1 -1
  138. package/lib/common/api/assisted-service/ClustersAPI.ts +0 -6
  139. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +9 -19
  140. package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +1 -1
  141. package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +5 -6
  142. package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +2 -2
  143. package/lib/common/components/ui/OpenShiftVersionModal.tsx +1 -3
  144. package/lib/common/components/ui/WizardFooter.tsx +1 -1
  145. package/lib/common/components/ui/formik/PullSecretField.tsx +0 -1
  146. package/lib/common/config/constants.ts +0 -21
  147. package/lib/common/types/index.ts +1 -0
  148. package/lib/common/types/networkType.ts +37 -0
  149. package/lib/common/validationSchemas/addressValidation.tsx +1 -4
  150. package/lib/common/validationSchemas/clusterDetailsValidation.tsx +15 -47
  151. package/lib/ocm/components/Routes.tsx +1 -3
  152. package/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx +0 -1
  153. package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +3 -2
  154. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +14 -6
  155. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.tsx +5 -1
  156. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +0 -5
  157. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +32 -47
  158. package/lib/ocm/components/clusterConfiguration/review/ReviewStep.tsx +10 -12
  159. package/lib/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.tsx +2 -8
  160. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.tsx +0 -1
  161. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.tsx +2 -2
  162. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.tsx +24 -63
  163. package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +1 -2
  164. package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +2 -1
  165. package/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx +0 -3
  166. package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +27 -91
  167. package/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx +5 -26
  168. package/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +3 -14
  169. package/lib/ocm/components/clusterWizard/constants.ts +0 -1
  170. package/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx +37 -138
  171. package/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +9 -19
  172. package/lib/ocm/components/clusterWizard/index.ts +0 -1
  173. package/lib/ocm/components/clusterWizard/wizardTransition.ts +1 -5
  174. package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +15 -4
  175. package/lib/ocm/components/utils.ts +0 -4
  176. package/lib/ocm/hooks/useInfraEnvId.ts +2 -2
  177. package/lib/ocm/services/ClustersService.ts +0 -6
  178. package/lib/ocm/services/InfraEnvsService.ts +1 -4
  179. package/lib/ocm/store/slices/clusters/selectors.tsx +2 -1
  180. package/package.json +3 -3
  181. package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts +0 -4
  182. package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts.map +0 -1
  183. package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts +0 -4
  184. package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map +0 -1
  185. package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js +0 -48
  186. package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js.map +0 -1
  187. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js +0 -182
  188. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map +0 -1
  189. package/lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx +0 -78
  190. package/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +0 -364
@@ -171,11 +171,5 @@ const ClustersService = {
171
171
  this.getUpdateManifestParams(existingManifest, updatedManifest),
172
172
  );
173
173
  },
174
- registerDisconnected(params: { name: string; openshiftVersion: string }) {
175
- return ClustersAPI.registerDisconnected({
176
- name: params.name,
177
- openshiftVersion: params.openshiftVersion,
178
- });
179
- },
180
174
  };
181
175
  export default ClustersService;
@@ -21,10 +21,7 @@ const InfraEnvsService = {
21
21
  const { data: infraEnvs } = await InfraEnvsAPI.list(
22
22
  !isSingleClusterFeatureEnabled ? clusterId : '',
23
23
  );
24
- if (isSingleClusterFeatureEnabled) {
25
- return infraEnvs[0].id;
26
- }
27
- if (infraEnvs.length > 0 && clusterId) {
24
+ if (infraEnvs.length > 0) {
28
25
  InfraEnvCache.updateInfraEnvs(clusterId, infraEnvs);
29
26
  infraEnvId = InfraEnvCache.getInfraEnvId(clusterId, cpuArchitecture);
30
27
  }
@@ -11,8 +11,9 @@ import {
11
11
  getTotalHostCount,
12
12
  HostsCount,
13
13
  ResourceUIState,
14
+ type ClusterTableRows,
15
+ type HumanizedSortable,
14
16
  } from '../../../../common';
15
- import type { ClusterTableRows, HumanizedSortable } from '../../../../common';
16
17
  import ClusterStatus, { getClusterStatusText } from '../../../components/clusters/ClusterStatus';
17
18
  import { RootStateDay1 } from '../../store-day1';
18
19
  import type { Cluster } from '@openshift-assisted/types/assisted-installer-service';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.51.0",
4
- "@openshift-assisted/types": "2.51.0",
3
+ "@openshift-assisted/locales": "2.51.2",
4
+ "@openshift-assisted/types": "2.51.2",
5
5
  "@openshift-console/dynamic-plugin-sdk": "1.0.0",
6
6
  "@patternfly/patternfly": "6.4.0",
7
7
  "@patternfly/react-code-editor": "6.4.0",
@@ -136,5 +136,5 @@
136
136
  ]
137
137
  }
138
138
  },
139
- "version": "2.51.0"
139
+ "version": "2.51.2"
140
140
  }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const DisconnectedStaticIp: React.FC;
3
- export default DisconnectedStaticIp;
4
- //# sourceMappingURL=DisconnectedStaticIp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DisconnectedStaticIp.d.ts","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsB1B,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAqDjC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- declare const OptionalConfigurationsStep: () => React.JSX.Element;
3
- export default OptionalConfigurationsStep;
4
- //# sourceMappingURL=OptionalConfigurationsStep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OptionalConfigurationsStep.d.ts","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0J/B,QAAA,MAAM,0BAA0B,yBA+M/B,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
- const common_1 = require("../../../../common");
6
- const ClusterWizardContext_1 = require("../ClusterWizardContext");
7
- const ClusterWizardFooter_1 = tslib_1.__importDefault(require("../ClusterWizardFooter"));
8
- const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("../ClusterWizardNavigation"));
9
- const StaticIpPage_1 = require("../../clusterConfiguration/staticIp/components/StaticIpPage");
10
- const WithErrorBoundary_1 = require("../../../../common/components/ErrorHandling/WithErrorBoundary");
11
- const apis_1 = require("../../../services/apis");
12
- const getInitialFormStateProps = () => {
13
- return {
14
- isValid: true,
15
- isSubmitting: false,
16
- isAutoSaveRunning: false,
17
- errors: {},
18
- touched: {},
19
- isEmpty: true,
20
- };
21
- };
22
- const DisconnectedStaticIp = () => {
23
- const { moveNext, moveBack, disconnectedInfraEnv, setDisconnectedInfraEnv } = (0, ClusterWizardContext_1.useClusterWizardContext)();
24
- const { alerts } = (0, common_1.useAlerts)();
25
- const [formState, setFormStateProps] = react_1.default.useState(getInitialFormStateProps());
26
- const onFormStateChange = (formState) => {
27
- setFormStateProps(formState);
28
- };
29
- const updateInfraEnv = (params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- if (!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id)) {
31
- throw new Error('No disconnected infraEnv available');
32
- }
33
- const { data: updatedInfraEnv } = yield apis_1.InfraEnvsAPI.update(disconnectedInfraEnv.id, params);
34
- setDisconnectedInfraEnv(updatedInfraEnv);
35
- return updatedInfraEnv;
36
- });
37
- const isNextDisabled = formState.isAutoSaveRunning || !formState.isValid || !!alerts.length || formState.isSubmitting;
38
- const errorFields = (0, common_1.getFormikErrorFields)(formState.errors, formState.touched);
39
- const footer = (react_1.default.createElement(ClusterWizardFooter_1.default, { alertTitle: "Static IP configuration contains missing or invalid fields", alertContent: null, errorFields: errorFields, isSubmitting: formState.isSubmitting, onNext: () => moveNext(), onBack: () => moveBack(), isNextDisabled: isNextDisabled, isBackDisabled: formState.isSubmitting || formState.isAutoSaveRunning }));
40
- if (!disconnectedInfraEnv) {
41
- return null;
42
- }
43
- return (react_1.default.createElement(common_1.ClusterWizardStep, { navigation: react_1.default.createElement(ClusterWizardNavigation_1.default, null), footer: footer },
44
- react_1.default.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Static IP step" },
45
- react_1.default.createElement(StaticIpPage_1.StaticIpPage, { infraEnv: disconnectedInfraEnv, updateInfraEnv: updateInfraEnv, onFormStateChange: onFormStateChange }))));
46
- };
47
- exports.default = DisconnectedStaticIp;
48
- //# sourceMappingURL=DisconnectedStaticIp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DisconnectedSta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OAAO,eAAe,CAAC;IACzB,CAAC,CAAA,CAAC;IAEF,MAAM,cAAc,GAClB,SAAS,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,YAAY,CAAC;IACjG,MAAM,WAAW,GAAG,IAAA,6BAAoB,EAAS,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtF,MAAM,MAAM,GAAG,CACb,8BAAC,6BAAmB,IAClB,UAAU,EAAC,4DAA4D,EACvE,YAAY,EAAE,IAAI,EAClB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,SAAS,CAAC,YAAY,EACpC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EACxB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EACxB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,iBAAiB,GACrE,CACH,CAAC;IAEF,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,0BAAiB,IAAC,UAAU,EAAE,8BAAC,iCAAuB,OAAG,EAAE,MAAM,EAAE,MAAM;QACxE,8BAAC,qCAAiB,IAAC,KAAK,EAAC,+BAA+B;YACtD,8BAAC,2BAAY,IACX,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,GACpC,CACgB,CACF,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
@@ -1,182 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const React = tslib_1.__importStar(require("react"));
5
- const formik_1 = require("formik");
6
- const Yup = tslib_1.__importStar(require("yup"));
7
- const common_1 = require("../../../../common");
8
- const react_core_1 = require("@patternfly/react-core");
9
- const ClusterWizardContext_1 = require("../ClusterWizardContext");
10
- const ClusterWizardFooter_1 = tslib_1.__importDefault(require("../ClusterWizardFooter"));
11
- const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("../ClusterWizardNavigation"));
12
- const WithErrorBoundary_1 = require("../../../../common/components/ErrorHandling/WithErrorBoundary");
13
- const UploadSSH_1 = tslib_1.__importDefault(require("../../../../common/components/clusterConfiguration/UploadSSH"));
14
- const ProxyFields_1 = require("../../../../common/components/clusterConfiguration/ProxyFields");
15
- const api_1 = require("../../../../common/api");
16
- const AlertsContextProvider_1 = require("../../../../common/components/AlertsContextProvider");
17
- const react_core_2 = require("@patternfly/react-core");
18
- const InfraEnvsService_1 = tslib_1.__importDefault(require("../../../services/InfraEnvsService"));
19
- const apis_1 = require("../../../services/apis");
20
- const usePullSecret_1 = tslib_1.__importDefault(require("../../../hooks/usePullSecret"));
21
- const react_router_dom_v5_compat_1 = require("react-router-dom-v5-compat");
22
- const ClustersService_1 = tslib_1.__importDefault(require("../../../services/ClustersService"));
23
- const HostsNetworkConfigurationControlGroup_1 = require("../../clusterConfiguration/HostsNetworkConfigurationControlGroup");
24
- const types_1 = require("../../../services/types");
25
- const use_translation_wrapper_1 = require("../../../../common/hooks/use-translation-wrapper");
26
- const dummyData_1 = require("../../clusterConfiguration/staticIp/data/dummyData");
27
- const ntpValidation_1 = require("../../../../common/validationSchemas/ntpValidation");
28
- const api_2 = require("../../../../common/api");
29
- const DEFAULT_CPU_ARCHITECTURE = 'x86_64';
30
- const DISCONNECTED_IMAGE_TYPE = 'disconnected-iso';
31
- const DEFAULT_INITIAL_VALUES = {
32
- sshPublicKey: '',
33
- enableProxy: false,
34
- httpProxy: '',
35
- httpsProxy: '',
36
- noProxy: '',
37
- enableNtpSources: false,
38
- additionalNtpSources: '',
39
- hostsNetworkConfigurationType: types_1.HostsNetworkConfigurationType.DHCP,
40
- rendezvousIp: '',
41
- pullSecret: '',
42
- };
43
- /**
44
- * Rehydrate form values from infraEnv when navigating back to this step.
45
- */
46
- const infraEnvToFormValues = (infraEnv) => {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
48
- return (Object.assign(Object.assign({}, DEFAULT_INITIAL_VALUES), { sshPublicKey: (_a = infraEnv.sshAuthorizedKey) !== null && _a !== void 0 ? _a : '', enableProxy: !!(((_b = infraEnv.proxy) === null || _b === void 0 ? void 0 : _b.httpProxy) || ((_c = infraEnv.proxy) === null || _c === void 0 ? void 0 : _c.httpsProxy)), httpProxy: (_e = (_d = infraEnv.proxy) === null || _d === void 0 ? void 0 : _d.httpProxy) !== null && _e !== void 0 ? _e : '', httpsProxy: (_g = (_f = infraEnv.proxy) === null || _f === void 0 ? void 0 : _f.httpsProxy) !== null && _g !== void 0 ? _g : '', noProxy: (_j = (_h = infraEnv.proxy) === null || _h === void 0 ? void 0 : _h.noProxy) !== null && _j !== void 0 ? _j : '', enableNtpSources: !!infraEnv.additionalNtpSources, additionalNtpSources: (_k = infraEnv.additionalNtpSources) !== null && _k !== void 0 ? _k : '', hostsNetworkConfigurationType: ((_m = (_l = infraEnv.staticNetworkConfig) === null || _l === void 0 ? void 0 : _l.length) !== null && _m !== void 0 ? _m : 0) > 0
49
- ? types_1.HostsNetworkConfigurationType.STATIC
50
- : types_1.HostsNetworkConfigurationType.DHCP, rendezvousIp: (_o = infraEnv.rendezvousIp) !== null && _o !== void 0 ? _o : '' }));
51
- };
52
- /**
53
- * Builds common infrastructure environment params from form values
54
- */
55
- const buildInfraEnvParams = (values) => {
56
- // Build proxy object - only include fields that have values
57
- const proxy = Object.assign(Object.assign(Object.assign({}, (values.httpProxy && { httpProxy: values.httpProxy })), (values.httpsProxy && { httpsProxy: values.httpsProxy })), (values.noProxy && { noProxy: values.noProxy }));
58
- const hasProxy = Object.keys(proxy).length > 0;
59
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey })), (hasProxy && { proxy })), (values.additionalNtpSources && {
60
- additionalNtpSources: values.additionalNtpSources,
61
- })), (values.rendezvousIp && { rendezvousIp: values.rendezvousIp })), (values.hostsNetworkConfigurationType === types_1.HostsNetworkConfigurationType.STATIC && {
62
- staticNetworkConfig: (0, dummyData_1.getDummyInfraEnvField)(),
63
- }));
64
- };
65
- const getValidationSchema = (t, requirePullSecret) => Yup.lazy((values) => Yup.object().shape(Object.assign({ sshPublicKey: (0, common_1.sshPublicKeyValidationSchema)(t), enableProxy: Yup.boolean().required(), httpProxy: (0, common_1.httpProxyValidationSchema)({
66
- values,
67
- pairValueName: 'httpsProxy',
68
- allowEmpty: true,
69
- t,
70
- }), httpsProxy: (0, common_1.httpProxyValidationSchema)({
71
- values,
72
- pairValueName: 'httpProxy',
73
- allowEmpty: true,
74
- t,
75
- }), noProxy: (0, common_1.noProxyValidationSchema)(t), enableNtpSources: Yup.boolean().required(), additionalNtpSources: (0, ntpValidation_1.ntpSourceValidationSchema)(t), hostsNetworkConfigurationType: Yup.string()
76
- .oneOf(Object.values(types_1.HostsNetworkConfigurationType))
77
- .required(), rendezvousIp: Yup.string()
78
- .max(45, 'IP address must be at most 45 characters')
79
- .test('ip-validation', 'Not a valid IP address', (value) => !value || (0, common_1.ipValidationSchema)(t).isValidSync(value)) }, (requirePullSecret && {
80
- pullSecret: (0, common_1.pullSecretValidationSchema)(t).required(t('ai:Required field')),
81
- }))));
82
- const OptionalConfigurationsStep = () => {
83
- const { clusterId } = (0, react_router_dom_v5_compat_1.useParams)();
84
- const [cluster, setCluster] = React.useState(null);
85
- const { t } = (0, use_translation_wrapper_1.useTranslation)();
86
- const defaultPullSecret = (0, usePullSecret_1.default)();
87
- const { moveNext, moveBack, setDisconnectedInfraEnv, disconnectedInfraEnv } = (0, ClusterWizardContext_1.useClusterWizardContext)();
88
- const { addAlert, clearAlerts } = (0, AlertsContextProvider_1.useAlerts)();
89
- React.useEffect(() => {
90
- const fetchCluster = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
91
- if (!clusterId) {
92
- return;
93
- }
94
- try {
95
- const fetchedCluster = yield ClustersService_1.default.get(clusterId);
96
- setCluster(fetchedCluster);
97
- }
98
- catch (error) {
99
- (0, api_1.handleApiError)(error, () => {
100
- addAlert({
101
- title: t('ai:Failed to fetch cluster'),
102
- message: (0, api_1.getApiErrorMessage)(error),
103
- variant: react_core_2.AlertVariant.danger,
104
- });
105
- });
106
- }
107
- });
108
- void fetchCluster();
109
- }, [clusterId, addAlert, t]);
110
- const initialValues = disconnectedInfraEnv
111
- ? infraEnvToFormValues(disconnectedInfraEnv)
112
- : DEFAULT_INITIAL_VALUES;
113
- return (React.createElement(formik_1.Formik, { initialValues: initialValues, validateOnMount: true, validationSchema: getValidationSchema(t, !api_2.isInOcm), onSubmit: (values) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
114
- clearAlerts();
115
- if (!(cluster === null || cluster === void 0 ? void 0 : cluster.id)) {
116
- addAlert({
117
- title: t('ai:Missing cluster'),
118
- message: t('ai:Cluster must be created before configuring infrastructure environment'),
119
- variant: react_core_2.AlertVariant.danger,
120
- });
121
- return;
122
- }
123
- const commonParams = buildInfraEnvParams(values);
124
- // Default pull secret only exists in OCM; when !isInOcm the user must provide it via the field
125
- const pullSecretToUse = api_2.isInOcm ? defaultPullSecret : values.pullSecret;
126
- try {
127
- if (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id) {
128
- // Update existing infraEnv
129
- const updateParams = Object.assign(Object.assign({}, commonParams), { imageType: DISCONNECTED_IMAGE_TYPE, pullSecret: pullSecretToUse });
130
- const { data: updatedInfraEnv } = yield apis_1.InfraEnvsAPI.update(disconnectedInfraEnv.id, updateParams);
131
- setDisconnectedInfraEnv(Object.assign(Object.assign({}, updatedInfraEnv), {
132
- // infraEnv does not return the whole OCP version
133
- openshiftVersion: cluster.openshiftVersion }));
134
- }
135
- else {
136
- // Create new infraEnv
137
- const createParams = Object.assign({ name: InfraEnvsService_1.default.makeInfraEnvName(DEFAULT_CPU_ARCHITECTURE, cluster.name), clusterId: cluster.id, openshiftVersion: cluster.openshiftVersion, cpuArchitecture: DEFAULT_CPU_ARCHITECTURE, imageType: DISCONNECTED_IMAGE_TYPE, pullSecret: pullSecretToUse !== null && pullSecretToUse !== void 0 ? pullSecretToUse : '' }, commonParams);
138
- const createdInfraEnv = yield InfraEnvsService_1.default.create(createParams);
139
- setDisconnectedInfraEnv(Object.assign(Object.assign({}, createdInfraEnv), {
140
- // infraEnv does not return the whole OCP version
141
- openshiftVersion: cluster.openshiftVersion }));
142
- }
143
- moveNext();
144
- }
145
- catch (error) {
146
- (0, api_1.handleApiError)(error, () => {
147
- addAlert({
148
- title: (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id)
149
- ? t('ai:Failed to update infrastructure environment')
150
- : t('ai:Failed to create infrastructure environment'),
151
- message: (0, api_1.getApiErrorMessage)(error),
152
- variant: react_core_2.AlertVariant.danger,
153
- });
154
- });
155
- }
156
- }) }, ({ submitForm, isValid, errors, touched, isSubmitting, values }) => {
157
- const errorFields = (0, common_1.getFormikErrorFields)(errors, touched);
158
- const handleNext = () => {
159
- void submitForm(); // This will trigger onSubmit
160
- };
161
- return (React.createElement(common_1.ClusterWizardStep, { navigation: React.createElement(ClusterWizardNavigation_1.default, null), footer: React.createElement(ClusterWizardFooter_1.default, { disconnectedClusterId: clusterId, onNext: handleNext, onBack: moveBack, isNextDisabled: !isValid || !cluster, errorFields: errorFields, isSubmitting: isSubmitting }) },
162
- React.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Optional Configurations step" },
163
- React.createElement(react_core_1.Grid, { hasGutter: true },
164
- React.createElement(react_core_1.GridItem, null,
165
- React.createElement(react_core_1.Split, null,
166
- React.createElement(react_core_1.SplitItem, null,
167
- React.createElement(react_core_1.Content, { component: "h2" }, t('ai:Optional configurations'))),
168
- React.createElement(react_core_1.SplitItem, null,
169
- React.createElement(common_1.TechnologyPreview, null)))),
170
- React.createElement(react_core_1.GridItem, null,
171
- React.createElement(react_core_1.Form, { id: "wizard-cluster-optional-configurations__form" },
172
- !api_2.isInOcm && React.createElement(common_1.PullSecret, { defaultPullSecret: defaultPullSecret, isOcm: false }),
173
- React.createElement(common_1.InputField, { label: t('ai:Rendezvous IP'), name: "rendezvousIp", helperText: t('ai:The IP address that hosts will use to communicate with the bootstrap node during installation.'), placeholder: "e.g., 192.168.1.10", maxLength: 45 }),
174
- React.createElement(UploadSSH_1.default, null),
175
- React.createElement(common_1.CheckboxField, { label: t('ai:Configure proxy settings'), name: "enableProxy", helperText: React.createElement("p", null, t('ai:If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.')), body: values.enableProxy && React.createElement(ProxyFields_1.ProxyInputFields, null) }),
176
- React.createElement(common_1.CheckboxField, { label: t('ai:Add your own NTP (Network Time Protocol) sources'), name: "enableNtpSources", helperText: React.createElement("p", null, t('ai:Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.')), body: values.enableNtpSources && (React.createElement(react_core_1.Grid, { hasGutter: true },
177
- React.createElement(common_1.AdditionalNTPSourcesField, { name: "additionalNtpSources", helperText: t('ai:A comma separated list of IP or domain names of the NTP pools or servers.') }))) }),
178
- React.createElement(HostsNetworkConfigurationControlGroup_1.HostsNetworkConfigurationControlGroup, { clusterExists: false, isDisabled: false })))))));
179
- }));
180
- };
181
- exports.default = OptionalConfigurationsStep;
182
- //# sourceMappingURL=OptionalConfigurationsStep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OptionalConfigurationsStep.js","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAAgC;AAEhC,iDAA2B;AAC3B,+CAc4B;AAC5B,uDAAyF;AACzF,kEAAkE;AAClE,yFAAyD;AACzD,iGAAiE;AACjE,qGAAkG;AAClG,q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I,CACrI,CACC,EAEN,IAAI,EACF,MAAM,CAAC,gBAAgB,IAAI,CACzB,oBAAC,iBAAI,IAAC,SAAS;oCACb,oBAAC,kCAAyB,IACxB,IAAI,EAAC,sBAAsB,EAC3B,UAAU,EAAE,CAAC,CACX,8EAA8E,CAC/E,GACD,CACG,CACR,GAEH;4BAGF,oBAAC,6EAAqC,IACpC,aAAa,EAAE,KAAK,EACpB,UAAU,EAAE,KAAK,GACjB,CACG,CACE,CACN,CACW,CACF,CACrB,CAAC;IACJ,CAAC,CACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,0BAA0B,CAAC"}
@@ -1,78 +0,0 @@
1
- import React from 'react';
2
- import { ClusterWizardStep, getFormikErrorFields, useAlerts } from '../../../../common';
3
- import { useClusterWizardContext } from '../ClusterWizardContext';
4
- import ClusterWizardFooter from '../ClusterWizardFooter';
5
- import ClusterWizardNavigation from '../ClusterWizardNavigation';
6
- import { StaticIpFormState } from '../../clusterConfiguration/staticIp/components/propTypes';
7
- import { StaticIpPage } from '../../clusterConfiguration/staticIp/components/StaticIpPage';
8
- import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
9
- import { InfraEnvsAPI } from '../../../services/apis';
10
- import { InfraEnvUpdateParams } from '@openshift-assisted/types/assisted-installer-service';
11
-
12
- const getInitialFormStateProps = (): StaticIpFormState => {
13
- return {
14
- isValid: true,
15
- isSubmitting: false,
16
- isAutoSaveRunning: false,
17
- errors: {},
18
- touched: {},
19
- isEmpty: true,
20
- };
21
- };
22
-
23
- const DisconnectedStaticIp: React.FC = () => {
24
- const { moveNext, moveBack, disconnectedInfraEnv, setDisconnectedInfraEnv } =
25
- useClusterWizardContext();
26
- const { alerts } = useAlerts();
27
- const [formState, setFormStateProps] = React.useState<StaticIpFormState>(
28
- getInitialFormStateProps(),
29
- );
30
-
31
- const onFormStateChange = (formState: StaticIpFormState) => {
32
- setFormStateProps(formState);
33
- };
34
-
35
- const updateInfraEnv = async (params: InfraEnvUpdateParams) => {
36
- if (!disconnectedInfraEnv?.id) {
37
- throw new Error('No disconnected infraEnv available');
38
- }
39
- const { data: updatedInfraEnv } = await InfraEnvsAPI.update(disconnectedInfraEnv.id, params);
40
- setDisconnectedInfraEnv(updatedInfraEnv);
41
- return updatedInfraEnv;
42
- };
43
-
44
- const isNextDisabled =
45
- formState.isAutoSaveRunning || !formState.isValid || !!alerts.length || formState.isSubmitting;
46
- const errorFields = getFormikErrorFields<object>(formState.errors, formState.touched);
47
-
48
- const footer = (
49
- <ClusterWizardFooter
50
- alertTitle="Static IP configuration contains missing or invalid fields"
51
- alertContent={null}
52
- errorFields={errorFields}
53
- isSubmitting={formState.isSubmitting}
54
- onNext={() => moveNext()}
55
- onBack={() => moveBack()}
56
- isNextDisabled={isNextDisabled}
57
- isBackDisabled={formState.isSubmitting || formState.isAutoSaveRunning}
58
- />
59
- );
60
-
61
- if (!disconnectedInfraEnv) {
62
- return null;
63
- }
64
-
65
- return (
66
- <ClusterWizardStep navigation={<ClusterWizardNavigation />} footer={footer}>
67
- <WithErrorBoundary title="Failed to load Static IP step">
68
- <StaticIpPage
69
- infraEnv={disconnectedInfraEnv}
70
- updateInfraEnv={updateInfraEnv}
71
- onFormStateChange={onFormStateChange}
72
- />
73
- </WithErrorBoundary>
74
- </ClusterWizardStep>
75
- );
76
- };
77
-
78
- export default DisconnectedStaticIp;