@openshift-assisted/ui-lib 2.8.2-cim → 2.8.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.
Files changed (307) hide show
  1. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetails.d.ts.map +1 -1
  2. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +6 -1
  3. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
  4. package/@types/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
  5. package/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts.map +1 -1
  6. package/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.d.ts.map +1 -1
  7. package/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts.map +1 -1
  8. package/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  9. package/@types/cim/components/ClusterDeployment/helpers.d.ts +1 -1
  10. package/@types/cim/components/ClusterDeployment/helpers.d.ts.map +1 -1
  11. package/@types/cim/components/ClusterDeployment/validationSchemas.d.ts.map +1 -1
  12. package/@types/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.d.ts +0 -1
  13. package/@types/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.d.ts.map +1 -1
  14. package/@types/cim/components/Hypershift/modals/ManageHostsModal.d.ts.map +1 -1
  15. package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +2 -0
  16. package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
  17. package/@types/cim/components/helpers/versions.d.ts +1 -0
  18. package/@types/cim/components/helpers/versions.d.ts.map +1 -1
  19. package/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
  20. package/@types/cim/components/modals/EditProxyModal.d.ts.map +1 -1
  21. package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts +5 -1
  22. package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
  23. package/@types/common/components/clusterConfiguration/DownloadIso.d.ts +2 -1
  24. package/@types/common/components/clusterConfiguration/DownloadIso.d.ts.map +1 -1
  25. package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts +2 -0
  26. package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts.map +1 -1
  27. package/@types/common/components/clusterWizard/ClusterWizardStep.d.ts +1 -1
  28. package/@types/common/components/clusterWizard/ClusterWizardStep.d.ts.map +1 -1
  29. package/@types/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.d.ts.map +1 -1
  30. package/@types/common/components/fetching/EventListFetch.d.ts +1 -1
  31. package/@types/common/components/fetching/EventListFetch.d.ts.map +1 -1
  32. package/@types/common/components/hosts/TableToolbar.d.ts.map +1 -1
  33. package/@types/common/components/ui/ClusterEventsToolbar.d.ts.map +1 -1
  34. package/@types/common/components/ui/StaticTextField.d.ts +1 -1
  35. package/@types/common/components/ui/StaticTextField.d.ts.map +1 -1
  36. package/@types/common/components/ui/eventsModal.d.ts +4 -8
  37. package/@types/common/components/ui/eventsModal.d.ts.map +1 -1
  38. package/@types/common/components/ui/formik/UploadField.d.ts.map +1 -1
  39. package/@types/common/components/ui/formik/types.d.ts +2 -2
  40. package/@types/common/components/ui/formik/types.d.ts.map +1 -1
  41. package/@types/common/components/ui/formik/validationSchemas.d.ts +5 -1
  42. package/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
  43. package/@types/common/config/constants.d.ts +2 -1
  44. package/@types/common/config/constants.d.ts.map +1 -1
  45. package/@types/common/types/events.d.ts +9 -2
  46. package/@types/common/types/events.d.ts.map +1 -1
  47. package/@types/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.d.ts.map +1 -1
  48. package/@types/ocm/components/AddHosts/day2Wizard/Day2StaticIP.d.ts.map +1 -1
  49. package/@types/ocm/components/AddHosts/day2Wizard/Day2Wizard.d.ts.map +1 -1
  50. package/@types/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.d.ts.map +1 -1
  51. package/@types/ocm/components/HostsClusterDetailTab/types.d.ts +5 -0
  52. package/@types/ocm/components/HostsClusterDetailTab/types.d.ts.map +1 -1
  53. package/@types/ocm/components/HostsClusterDetailTab/utils.d.ts +2 -7
  54. package/@types/ocm/components/HostsClusterDetailTab/utils.d.ts.map +1 -1
  55. package/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts +2 -1
  56. package/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
  57. package/@types/ocm/components/clusterConfiguration/DiscoveryImageForm.d.ts.map +1 -1
  58. package/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
  59. package/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.d.ts.map +1 -1
  60. package/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.d.ts.map +1 -1
  61. package/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.d.ts +1 -0
  62. package/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.d.ts.map +1 -1
  63. package/@types/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.d.ts.map +1 -1
  64. package/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
  65. package/@types/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.d.ts.map +1 -1
  66. package/@types/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.d.ts.map +1 -1
  67. package/@types/ocm/components/clusterDetail/AssistedInstallerDetailCard.d.ts.map +1 -1
  68. package/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts.map +1 -1
  69. package/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
  70. package/@types/ocm/components/clusterWizard/wizardTransition.d.ts +2 -1
  71. package/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
  72. package/@types/ocm/components/clusters/ClusterPage.d.ts.map +1 -1
  73. package/@types/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.d.ts.map +1 -1
  74. package/@types/ocm/components/fetching/fetchEvents.d.ts.map +1 -1
  75. package/@types/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.d.ts.map +1 -1
  76. package/@types/ocm/components/ui/OcmFormFields.d.ts +1 -1
  77. package/@types/ocm/hooks/useClusterCustomManifests.d.ts +1 -1
  78. package/@types/ocm/hooks/useClusterCustomManifests.d.ts.map +1 -1
  79. package/@types/ocm/hooks/useInfraEnv.d.ts +1 -1
  80. package/@types/ocm/hooks/useInfraEnv.d.ts.map +1 -1
  81. package/@types/ocm/hooks/useInfraEnvId.d.ts +1 -1
  82. package/@types/ocm/hooks/useInfraEnvId.d.ts.map +1 -1
  83. package/@types/ocm/selectors/clusters.d.ts +3 -3
  84. package/@types/ocm/services/Day2ClusterService.d.ts +3 -3
  85. package/@types/ocm/services/Day2ClusterService.d.ts.map +1 -1
  86. package/@types/ocm/services/InfraEnvIdsCacheService.d.ts +1 -1
  87. package/@types/ocm/services/InfraEnvIdsCacheService.d.ts.map +1 -1
  88. package/@types/ocm/services/InfraEnvsService.d.ts +4 -3
  89. package/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
  90. package/@types/ocm/services/apis/EventsAPI.d.ts +1 -0
  91. package/@types/ocm/services/apis/EventsAPI.d.ts.map +1 -1
  92. package/@types/ocm/store/slices/infraEnvs/selectors.d.ts +1 -1
  93. package/build/build.json +1 -1
  94. package/build/cim/components/Agent/BMCForm.js +2 -2
  95. package/build/cim/components/Agent/BMCForm.js.map +1 -1
  96. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js +59 -56
  97. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js.map +1 -1
  98. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +10 -6
  99. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
  100. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js +1 -9
  101. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js.map +1 -1
  102. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js +1 -2
  103. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js.map +1 -1
  104. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.js +3 -10
  105. package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.js.map +1 -1
  106. package/build/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js +2 -2
  107. package/build/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js.map +1 -1
  108. package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +6 -2
  109. package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  110. package/build/cim/components/ClusterDeployment/helpers.js +46 -7
  111. package/build/cim/components/ClusterDeployment/helpers.js.map +1 -1
  112. package/build/cim/components/ClusterDeployment/use-networking-formik.js +2 -2
  113. package/build/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
  114. package/build/cim/components/ClusterDeployment/validationSchemas.js +0 -1
  115. package/build/cim/components/ClusterDeployment/validationSchemas.js.map +1 -1
  116. package/build/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js +2 -2
  117. package/build/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js.map +1 -1
  118. package/build/cim/components/Hypershift/modals/ManageHostsModal.js +1 -6
  119. package/build/cim/components/Hypershift/modals/ManageHostsModal.js.map +1 -1
  120. package/build/cim/components/Hypershift/utils/nodepool.js +5 -5
  121. package/build/cim/components/Hypershift/utils/nodepool.js.map +1 -1
  122. package/build/cim/components/InfraEnv/InfraEnvFormPage.js +13 -5
  123. package/build/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
  124. package/build/cim/components/helpers/versions.js +1 -0
  125. package/build/cim/components/helpers/versions.js.map +1 -1
  126. package/build/cim/components/modals/AddHostModal.js +4 -4
  127. package/build/cim/components/modals/AddHostModal.js.map +1 -1
  128. package/build/cim/components/modals/EditProxyModal.js +18 -7
  129. package/build/cim/components/modals/EditProxyModal.js.map +1 -1
  130. package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +9 -9
  131. package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
  132. package/build/common/components/clusterConfiguration/DownloadIso.js +2 -2
  133. package/build/common/components/clusterConfiguration/DownloadIso.js.map +1 -1
  134. package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js +2 -2
  135. package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js.map +1 -1
  136. package/build/common/components/clusterWizard/ClusterWizardStep.js +1 -1
  137. package/build/common/components/clusterWizard/ClusterWizardStep.js.map +1 -1
  138. package/build/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js +5 -2
  139. package/build/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js.map +1 -1
  140. package/build/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +1 -1
  141. package/build/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +1 -1
  142. package/build/common/components/fetching/EventListFetch.js +14 -25
  143. package/build/common/components/fetching/EventListFetch.js.map +1 -1
  144. package/build/common/components/hosts/TableToolbar.js +3 -3
  145. package/build/common/components/hosts/TableToolbar.js.map +1 -1
  146. package/build/common/components/hosts/status.js +1 -1
  147. package/build/common/components/hosts/status.js.map +1 -1
  148. package/build/common/components/ui/ClusterEventsToolbar.js +1 -1
  149. package/build/common/components/ui/ClusterEventsToolbar.js.map +1 -1
  150. package/build/common/components/ui/eventsModal.js +12 -6
  151. package/build/common/components/ui/eventsModal.js.map +1 -1
  152. package/build/common/components/ui/formik/CodeField.js +1 -1
  153. package/build/common/components/ui/formik/CodeField.js.map +1 -1
  154. package/build/common/components/ui/formik/SelectField.js +1 -1
  155. package/build/common/components/ui/formik/SelectField.js.map +1 -1
  156. package/build/common/components/ui/formik/UploadField.js +1 -2
  157. package/build/common/components/ui/formik/UploadField.js.map +1 -1
  158. package/build/common/components/ui/formik/validationSchemas.js +20 -13
  159. package/build/common/components/ui/formik/validationSchemas.js.map +1 -1
  160. package/build/common/config/constants.js +3 -1
  161. package/build/common/config/constants.js.map +1 -1
  162. package/build/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.js +94 -20
  163. package/build/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.js.map +1 -1
  164. package/build/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.js +1 -1
  165. package/build/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.js.map +1 -1
  166. package/build/ocm/components/AddHosts/day2Wizard/Day2StaticIP.js +16 -9
  167. package/build/ocm/components/AddHosts/day2Wizard/Day2StaticIP.js.map +1 -1
  168. package/build/ocm/components/AddHosts/day2Wizard/Day2Wizard.js +1 -1
  169. package/build/ocm/components/AddHosts/day2Wizard/Day2Wizard.js.map +1 -1
  170. package/build/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.js +5 -2
  171. package/build/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.js.map +1 -1
  172. package/build/ocm/components/HostsClusterDetailTab/utils.js +35 -29
  173. package/build/ocm/components/HostsClusterDetailTab/utils.js.map +1 -1
  174. package/build/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +5 -4
  175. package/build/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
  176. package/build/ocm/components/clusterConfiguration/DiscoveryImageForm.js +3 -1
  177. package/build/ocm/components/clusterConfiguration/DiscoveryImageForm.js.map +1 -1
  178. package/build/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +11 -8
  179. package/build/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
  180. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.js +49 -21
  181. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.js.map +1 -1
  182. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js +3 -9
  183. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js.map +1 -1
  184. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.js +37 -2
  185. package/build/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.js.map +1 -1
  186. package/build/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js +16 -5
  187. package/build/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js.map +1 -1
  188. package/build/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +5 -2
  189. package/build/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
  190. package/build/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js +1 -2
  191. package/build/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js.map +1 -1
  192. package/build/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js +27 -16
  193. package/build/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js.map +1 -1
  194. package/build/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.js +1 -1
  195. package/build/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.js.map +1 -1
  196. package/build/ocm/components/clusterDetail/AssistedInstallerDetailCard.js +7 -2
  197. package/build/ocm/components/clusterDetail/AssistedInstallerDetailCard.js.map +1 -1
  198. package/build/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js +7 -2
  199. package/build/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js.map +1 -1
  200. package/build/ocm/components/clusterWizard/ClusterWizardContextProvider.js +13 -3
  201. package/build/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
  202. package/build/ocm/components/clusterWizard/wizardTransition.js +10 -2
  203. package/build/ocm/components/clusterWizard/wizardTransition.js.map +1 -1
  204. package/build/ocm/components/clusters/ClusterPage.js +10 -4
  205. package/build/ocm/components/clusters/ClusterPage.js.map +1 -1
  206. package/build/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.js +5 -2
  207. package/build/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.js.map +1 -1
  208. package/build/ocm/components/fetching/fetchEvents.js +25 -4
  209. package/build/ocm/components/fetching/fetchEvents.js.map +1 -1
  210. package/build/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.js +5 -2
  211. package/build/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.js.map +1 -1
  212. package/build/ocm/hooks/useClusterCustomManifests.js +5 -3
  213. package/build/ocm/hooks/useClusterCustomManifests.js.map +1 -1
  214. package/build/ocm/hooks/useInfraEnv.js +2 -2
  215. package/build/ocm/hooks/useInfraEnv.js.map +1 -1
  216. package/build/ocm/hooks/useInfraEnvId.js +18 -3
  217. package/build/ocm/hooks/useInfraEnvId.js.map +1 -1
  218. package/build/ocm/hooks/useInfraEnvImageUrl.js +1 -1
  219. package/build/ocm/hooks/useInfraEnvImageUrl.js.map +1 -1
  220. package/build/ocm/hooks/useInfraEnvIpxeImageUrl.js +1 -1
  221. package/build/ocm/hooks/useInfraEnvIpxeImageUrl.js.map +1 -1
  222. package/build/ocm/services/ClustersService.js +2 -2
  223. package/build/ocm/services/ClustersService.js.map +1 -1
  224. package/build/ocm/services/Day2ClusterService.js +11 -20
  225. package/build/ocm/services/Day2ClusterService.js.map +1 -1
  226. package/build/ocm/services/InfraEnvIdsCacheService.js +5 -4
  227. package/build/ocm/services/InfraEnvIdsCacheService.js.map +1 -1
  228. package/build/ocm/services/InfraEnvsService.js +7 -4
  229. package/build/ocm/services/InfraEnvsService.js.map +1 -1
  230. package/build/ocm/services/apis/EventsAPI.js +13 -1
  231. package/build/ocm/services/apis/EventsAPI.js.map +1 -1
  232. package/lib/cim/components/Agent/BMCForm.tsx +2 -2
  233. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetails.tsx +112 -101
  234. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +17 -5
  235. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.tsx +1 -12
  236. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.tsx +1 -2
  237. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.tsx +2 -10
  238. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.tsx +7 -2
  239. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +9 -2
  240. package/lib/cim/components/ClusterDeployment/helpers.ts +65 -15
  241. package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +2 -2
  242. package/lib/cim/components/ClusterDeployment/validationSchemas.ts +0 -1
  243. package/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx +2 -2
  244. package/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.ts +0 -1
  245. package/lib/cim/components/Hypershift/modals/ManageHostsModal.tsx +1 -6
  246. package/lib/cim/components/Hypershift/utils/nodepool.ts +1 -1
  247. package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +21 -4
  248. package/lib/cim/components/helpers/versions.ts +5 -0
  249. package/lib/cim/components/modals/AddHostModal.tsx +6 -0
  250. package/lib/cim/components/modals/EditProxyModal.tsx +15 -3
  251. package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +18 -13
  252. package/lib/common/components/clusterConfiguration/DownloadIso.tsx +3 -1
  253. package/lib/common/components/clusterConfiguration/OpenShiftVersionSelect.tsx +4 -1
  254. package/lib/common/components/clusterWizard/ClusterWizardStep.tsx +5 -1
  255. package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx +11 -2
  256. package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +1 -1
  257. package/lib/common/components/fetching/EventListFetch.tsx +31 -41
  258. package/lib/common/components/hosts/TableToolbar.tsx +3 -3
  259. package/lib/common/components/hosts/status.tsx +1 -1
  260. package/lib/common/components/ui/ClusterEventsToolbar.tsx +3 -0
  261. package/lib/common/components/ui/StaticTextField.tsx +1 -1
  262. package/lib/common/components/ui/eventsModal.tsx +28 -23
  263. package/lib/common/components/ui/formik/CodeField.tsx +1 -1
  264. package/lib/common/components/ui/formik/SelectField.tsx +1 -1
  265. package/lib/common/components/ui/formik/UploadField.tsx +2 -3
  266. package/lib/common/components/ui/formik/types.ts +2 -1
  267. package/lib/common/components/ui/formik/validationSchemas.test.ts +6 -0
  268. package/lib/common/components/ui/formik/validationSchemas.ts +33 -15
  269. package/lib/common/config/constants.ts +6 -2
  270. package/lib/common/types/events.ts +10 -3
  271. package/lib/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.tsx +129 -21
  272. package/lib/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.tsx +1 -1
  273. package/lib/ocm/components/AddHosts/day2Wizard/Day2StaticIP.tsx +15 -10
  274. package/lib/ocm/components/AddHosts/day2Wizard/Day2Wizard.tsx +1 -0
  275. package/lib/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.tsx +7 -3
  276. package/lib/ocm/components/HostsClusterDetailTab/types.ts +6 -0
  277. package/lib/ocm/components/HostsClusterDetailTab/utils.ts +43 -37
  278. package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +6 -3
  279. package/lib/ocm/components/clusterConfiguration/DiscoveryImageForm.tsx +9 -1
  280. package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +25 -16
  281. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsForm.tsx +69 -32
  282. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.tsx +3 -14
  283. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.tsx +59 -24
  284. package/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx +29 -8
  285. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +11 -2
  286. package/lib/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.tsx +6 -13
  287. package/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx +30 -32
  288. package/lib/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.tsx +1 -1
  289. package/lib/ocm/components/clusterDetail/AssistedInstallerDetailCard.tsx +14 -2
  290. package/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx +11 -2
  291. package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +20 -2
  292. package/lib/ocm/components/clusterWizard/wizardTransition.ts +13 -1
  293. package/lib/ocm/components/clusters/ClusterPage.tsx +19 -5
  294. package/lib/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.tsx +8 -2
  295. package/lib/ocm/components/fetching/fetchEvents.ts +31 -5
  296. package/lib/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.tsx +8 -2
  297. package/lib/ocm/hooks/useClusterCustomManifests.ts +9 -3
  298. package/lib/ocm/hooks/useInfraEnv.ts +10 -1
  299. package/lib/ocm/hooks/useInfraEnvId.ts +24 -4
  300. package/lib/ocm/hooks/useInfraEnvImageUrl.ts +1 -1
  301. package/lib/ocm/hooks/useInfraEnvIpxeImageUrl.ts +1 -1
  302. package/lib/ocm/services/ClustersService.ts +2 -2
  303. package/lib/ocm/services/Day2ClusterService.ts +12 -42
  304. package/lib/ocm/services/InfraEnvIdsCacheService.ts +9 -6
  305. package/lib/ocm/services/InfraEnvsService.ts +12 -13
  306. package/lib/ocm/services/apis/EventsAPI.ts +15 -1
  307. package/package.json +1 -1
@@ -14,6 +14,7 @@ import { selectCurrentClusterState } from '../../selectors';
14
14
  import { Grid } from '@patternfly/react-core';
15
15
  import { NewFeatureSupportLevelProvider } from '../newFeatureSupportLevels';
16
16
  import useInfraEnv from '../../hooks/useInfraEnv';
17
+ import { usePullSecret } from '../../hooks';
17
18
 
18
19
  type AssistedInstallerExtraDetailCardProps = {
19
20
  allEnabledFeatures: FeatureListType;
@@ -23,9 +24,15 @@ const AssistedInstallerExtraDetailCard: React.FC<AssistedInstallerExtraDetailCar
23
24
  allEnabledFeatures,
24
25
  }) => {
25
26
  const { data: cluster } = useSelector(selectCurrentClusterState);
27
+ const pullSecret = usePullSecret();
26
28
  const { infraEnv } = useInfraEnv(
27
29
  cluster?.id ? cluster?.id : '',
28
- CpuArchitecture.USE_DAY1_ARCHITECTURE,
30
+ cluster?.cpuArchitecture
31
+ ? (cluster.cpuArchitecture as CpuArchitecture)
32
+ : CpuArchitecture.USE_DAY1_ARCHITECTURE,
33
+ cluster?.name,
34
+ pullSecret,
35
+ cluster?.openshiftVersion,
29
36
  );
30
37
 
31
38
  if (!cluster || cluster.status === 'adding-hosts') {
@@ -52,7 +59,9 @@ const AssistedInstallerExtraDetailCard: React.FC<AssistedInstallerExtraDetailCar
52
59
 
53
60
  const Wrapper: React.FC<AssistedInstallerExtraDetailCardProps> = (props) => (
54
61
  <Provider store={store}>
55
- <AssistedInstallerExtraDetailCard {...props} />
62
+ <AlertsContextProvider>
63
+ <AssistedInstallerExtraDetailCard {...props} />
64
+ </AlertsContextProvider>
56
65
  </Provider>
57
66
  );
58
67
 
@@ -16,9 +16,11 @@ import {
16
16
  InfraEnv,
17
17
  AssistedInstallerOCMPermissionTypesListType,
18
18
  useFeature,
19
+ useAlerts,
19
20
  } from '../../../common';
20
21
  import useSetClusterPermissions from '../../hooks/useSetClusterPermissions';
21
22
  import useClusterCustomManifests from '../../hooks/useClusterCustomManifests';
23
+ import { ListManifestsExtended } from '../clusterConfiguration/manifestsConfiguration/data/dataTypes';
22
24
 
23
25
  const addStepToClusterWizard = (
24
26
  wizardStepIds: ClusterWizardStepsType[],
@@ -77,6 +79,15 @@ const getWizardStepIds = (
77
79
  return stepsCopy;
78
80
  };
79
81
 
82
+ const validateIfCustomsManifestsNeedsToBeFilled = (
83
+ customManifests: ListManifestsExtended,
84
+ ): boolean => {
85
+ const customManifestsEmpty = customManifests.filter(
86
+ (customManifest) => customManifest.yamlContent === '',
87
+ );
88
+ return customManifestsEmpty.length > 0;
89
+ };
90
+
80
91
  const ClusterWizardContextProvider = ({
81
92
  children,
82
93
  cluster,
@@ -91,18 +102,23 @@ const ClusterWizardContextProvider = ({
91
102
  const [wizardStepIds, setWizardStepIds] = React.useState<ClusterWizardStepsType[]>();
92
103
  const [addCustomManifests, setAddCustomManifests] = React.useState<boolean>(false);
93
104
  const { state: locationState } = useLocation<ClusterWizardFlowStateType>();
94
- const { customManifests } = useClusterCustomManifests(cluster?.id || '', false);
105
+ const { customManifests } = useClusterCustomManifests(cluster?.id || '', true);
95
106
  const setClusterPermissions = useSetClusterPermissions();
96
107
  const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
97
-
108
+ const { clearAlerts } = useAlerts();
98
109
  React.useEffect(() => {
99
110
  const staticIpInfo = infraEnv ? getStaticIpInfo(infraEnv) : undefined;
111
+ const customManifestsStepNeedsToBeFilled =
112
+ customManifests && customManifests.length > 0
113
+ ? validateIfCustomsManifestsNeedsToBeFilled(customManifests)
114
+ : false;
100
115
  const firstStep = getClusterWizardFirstStep(
101
116
  locationState,
102
117
  staticIpInfo,
103
118
  cluster?.status,
104
119
  cluster?.hosts,
105
120
  isSingleClusterFeatureEnabled,
121
+ customManifestsStepNeedsToBeFilled,
106
122
  );
107
123
  const firstStepIds = getWizardStepIds(
108
124
  wizardStepIds,
@@ -156,6 +172,7 @@ const ClusterWizardContextProvider = ({
156
172
  };
157
173
  return {
158
174
  moveBack(): void {
175
+ clearAlerts();
159
176
  const currentStepIdx = wizardStepIds.indexOf(currentStepId);
160
177
  let nextStepId = wizardStepIds[currentStepIdx - 1];
161
178
  if (nextStepId === 'static-ip-host-configurations') {
@@ -213,6 +230,7 @@ const ClusterWizardContextProvider = ({
213
230
  addCustomManifests,
214
231
  customManifests,
215
232
  isSingleClusterFeatureEnabled,
233
+ clearAlerts,
216
234
  ]);
217
235
  if (!contextValue) {
218
236
  return null;
@@ -32,12 +32,23 @@ export type ClusterWizardStepsType =
32
32
  export const ClusterWizardFlowStateNew = 'new';
33
33
  export type ClusterWizardFlowStateType = Cluster['status'] | typeof ClusterWizardFlowStateNew;
34
34
 
35
+ export const getLastStepForWizard = (
36
+ customManifestsStepNeedsToBeFilled: boolean,
37
+ ): ClusterWizardStepsType => {
38
+ if (customManifestsStepNeedsToBeFilled) {
39
+ return 'custom-manifests';
40
+ } else {
41
+ return 'review';
42
+ }
43
+ };
44
+
35
45
  export const getClusterWizardFirstStep = (
36
46
  locationState: ClusterWizardFlowStateType | undefined,
37
47
  staticIpInfo: StaticIpInfo | undefined,
38
48
  state?: ClusterWizardFlowStateType,
39
49
  hosts?: Host[] | undefined,
40
50
  isSingleClusterFeatureEnabled?: boolean,
51
+ customManifestsStepNeedsToBeFilled?: boolean,
41
52
  ): ClusterWizardStepsType => {
42
53
  // Just for the first time when the cluster is created
43
54
  if (locationState === ClusterWizardFlowStateNew && !staticIpInfo) {
@@ -53,9 +64,10 @@ export const getClusterWizardFirstStep = (
53
64
  }
54
65
  return 'static-ip-network-wide-configurations';
55
66
  }
67
+
56
68
  switch (state) {
57
69
  case 'ready':
58
- return 'review';
70
+ return getLastStepForWizard(customManifestsStepNeedsToBeFilled || false);
59
71
  case 'pending-for-input':
60
72
  case 'adding-hosts':
61
73
  case 'insufficient':
@@ -32,14 +32,15 @@ import ClusterPollingErrorModal from '../clusterDetail/ClusterPollingErrorModal'
32
32
  import ClusterUpdateErrorModal from '../clusterDetail/ClusterUpdateErrorModal';
33
33
  import { BackButton } from '../ui/Buttons/BackButton';
34
34
  import { NewFeatureSupportLevelProvider } from '../newFeatureSupportLevels';
35
+ import { usePullSecret } from '../../hooks';
35
36
 
36
37
  type MatchParams = {
37
38
  clusterId: string;
38
39
  };
39
40
 
40
- const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs: boolean }> = ({
41
+ const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs?: boolean }> = ({
41
42
  clusterId,
42
- showBreadcrumbs,
43
+ showBreadcrumbs = false,
43
44
  }) => {
44
45
  if (!clusterId) {
45
46
  console.error('ClusterPageGeneric: missing clusterId');
@@ -47,12 +48,21 @@ const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs: boolean
47
48
  const fetchCluster = useFetchCluster(clusterId);
48
49
  const dispatch = useDispatch();
49
50
  const { cluster, uiState, errorDetail } = useClusterPolling(clusterId);
51
+ const pullSecret = usePullSecret();
50
52
  const {
51
53
  infraEnv,
52
54
  isLoading: infraEnvLoading,
53
55
  error: infraEnvError,
54
56
  updateInfraEnv,
55
- } = useInfraEnv(clusterId, CpuArchitecture.USE_DAY1_ARCHITECTURE);
57
+ } = useInfraEnv(
58
+ clusterId,
59
+ cluster?.cpuArchitecture
60
+ ? (cluster.cpuArchitecture as CpuArchitecture)
61
+ : CpuArchitecture.USE_DAY1_ARCHITECTURE,
62
+ cluster?.name,
63
+ pullSecret,
64
+ cluster?.openshiftVersion,
65
+ );
56
66
 
57
67
  const getContent = (cluster: Cluster, infraEnv: InfraEnv) => {
58
68
  if (cluster.status === 'adding-hosts') {
@@ -188,8 +198,12 @@ const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs: boolean
188
198
  };
189
199
 
190
200
  export const SingleClusterPage: React.FC<{ clusterId: string }> = ({ clusterId }) => (
191
- <ClusterPageGeneric clusterId={clusterId} showBreadcrumbs={false} />
201
+ <AlertsContextProvider>
202
+ <ClusterPageGeneric clusterId={clusterId} />
203
+ </AlertsContextProvider>
192
204
  );
193
205
  export const ClusterPage: React.FC<RouteComponentProps<MatchParams>> = ({ match }) => (
194
- <ClusterPageGeneric clusterId={match.params.clusterId} showBreadcrumbs />
206
+ <AlertsContextProvider>
207
+ <ClusterPageGeneric clusterId={match.params.clusterId} showBreadcrumbs />
208
+ </AlertsContextProvider>
195
209
  );
@@ -17,7 +17,7 @@ import {
17
17
  import { handleApiError } from '../../api';
18
18
  import { FeatureSupportLevelsAPI } from '../../services/apis';
19
19
  import { captureException } from '../../sentry';
20
- import { useOpenshiftVersions } from '../../hooks';
20
+ import { useOpenshiftVersions, usePullSecret } from '../../hooks';
21
21
  import { getFeatureDisabledReason, isFeatureSupported } from './featureStateUtils';
22
22
  import useInfraEnv from '../../hooks/useInfraEnv';
23
23
  import { isFeatureSupportedAndAvailable } from '../newFeatureSupportLevels/newFeatureStateUtils';
@@ -88,9 +88,15 @@ export const FeatureSupportLevelProvider: React.FC<SupportLevelProviderProps> =
88
88
  loadingUi,
89
89
  }) => {
90
90
  const { loading: loadingOCPVersions, versions: versionOptions } = useOpenshiftVersions();
91
+ const pullSecret = usePullSecret();
91
92
  const { infraEnv, isLoading: isInfraEnvLoading } = useInfraEnv(
92
93
  cluster?.id || '',
93
- CpuArchitecture.USE_DAY1_ARCHITECTURE,
94
+ cluster?.cpuArchitecture
95
+ ? (cluster.cpuArchitecture as CpuArchitecture)
96
+ : CpuArchitecture.USE_DAY1_ARCHITECTURE,
97
+ cluster?.name,
98
+ pullSecret,
99
+ cluster?.openshiftVersion,
94
100
  );
95
101
  const fetcher = () => FeatureSupportLevelsAPI.list().then((res) => res.data);
96
102
  const { data: featureSupportLevels, error } = useSWR<FeatureSupportLevels, unknown>(
@@ -1,6 +1,25 @@
1
- import { EventListFetchProps } from '../../../common';
1
+ import { AxiosError, AxiosResponseHeaders } from 'axios';
2
+ import { EVENT_SEVERITIES, Event, EventListFetchProps } from '../../../common';
2
3
  import { handleApiError } from '../../api';
3
4
  import { EventsAPI } from '../../services/apis';
5
+ import { SeverityCountsType } from '../../../common/components/ui/ClusterEventsToolbar';
6
+
7
+ const parseHeaders = (headers: AxiosResponseHeaders) => {
8
+ const severities: Record<Event['severity'], number> = {
9
+ error: 0,
10
+ info: 0,
11
+ warning: 0,
12
+ critical: 0,
13
+ };
14
+ EVENT_SEVERITIES.forEach((severity) => {
15
+ const count = Number(headers[`severity-count-${severity}`]);
16
+ severities[severity] = count;
17
+ });
18
+ return {
19
+ totalEvents: Number(headers['event-count']),
20
+ severities: severities as SeverityCountsType,
21
+ };
22
+ };
4
23
 
5
24
  export const onFetchEvents: EventListFetchProps['onFetchEvents'] = async (
6
25
  props,
@@ -8,11 +27,18 @@ export const onFetchEvents: EventListFetchProps['onFetchEvents'] = async (
8
27
  onError,
9
28
  ) => {
10
29
  try {
30
+ EventsAPI.abort();
11
31
  const response = await EventsAPI.list(props);
12
- onSuccess(response);
13
- } catch (error) {
14
- handleApiError(error, () => {
15
- onError('Failed to load events');
32
+ onSuccess({
33
+ data: response.data,
34
+ ...parseHeaders(response.headers),
16
35
  });
36
+ } catch (error) {
37
+ const { code } = error as AxiosError;
38
+ if (!code || code !== 'ERR_CANCELED') {
39
+ handleApiError(error, () => {
40
+ onError('Failed to load events');
41
+ });
42
+ }
17
43
  }
18
44
  };
@@ -8,7 +8,7 @@ import {
8
8
  SupportLevel,
9
9
  SupportLevels,
10
10
  } from '../../../common';
11
- import { useOpenshiftVersions } from '../../hooks';
11
+ import { useOpenshiftVersions, usePullSecret } from '../../hooks';
12
12
  import {
13
13
  getNewFeatureDisabledReason,
14
14
  isFeatureSupportedAndAvailable,
@@ -42,9 +42,15 @@ export const NewFeatureSupportLevelProvider: React.FC<NewSupportLevelProviderPro
42
42
  openshiftVersion,
43
43
  }) => {
44
44
  const { loading: loadingOCPVersions } = useOpenshiftVersions();
45
+ const pullSecret = usePullSecret();
45
46
  const { infraEnv, isLoading: isInfraEnvLoading } = useInfraEnv(
46
47
  cluster?.id || '',
47
- CpuArchitecture.USE_DAY1_ARCHITECTURE,
48
+ cluster?.cpuArchitecture
49
+ ? (cluster.cpuArchitecture as CpuArchitecture)
50
+ : CpuArchitecture.USE_DAY1_ARCHITECTURE,
51
+ cluster?.name,
52
+ pullSecret,
53
+ cluster?.openshiftVersion,
48
54
  );
49
55
  const featureSupportLevels = useSupportLevelsAPI('features', openshiftVersion, cpuArchitecture);
50
56
 
@@ -45,7 +45,11 @@ const getManifestsInfo = async (customManifests: ListManifests, clusterId: strin
45
45
  return manifestsExtended;
46
46
  };
47
47
 
48
- const useClusterCustomManifests = (clusterId: Cluster['id'], extendedVersion: boolean) => {
48
+ const useClusterCustomManifests = (
49
+ clusterId: Cluster['id'],
50
+ extendedVersion: boolean,
51
+ refresh = true,
52
+ ) => {
49
53
  const [customManifests, setCustomManifests] = React.useState<ListManifestsExtended>();
50
54
  const [error, setError] = React.useState('');
51
55
  const [extendedManifestsLoaded, setExtendedManifestsLoaded] = React.useState<boolean>(false);
@@ -81,8 +85,10 @@ const useClusterCustomManifests = (clusterId: Cluster['id'], extendedVersion: bo
81
85
  }, [clusterId, extendedVersion]);
82
86
 
83
87
  React.useEffect(() => {
84
- void fetchCustomManifests();
85
- }, [fetchCustomManifests]);
88
+ if (refresh) {
89
+ void fetchCustomManifests();
90
+ }
91
+ }, [fetchCustomManifests, refresh]);
86
92
 
87
93
  return {
88
94
  customManifests,
@@ -8,6 +8,9 @@ import InfraEnvIdsCacheService from '../services/InfraEnvIdsCacheService';
8
8
  export default function useInfraEnv(
9
9
  clusterId: Cluster['id'],
10
10
  cpuArchitecture: CpuArchitecture,
11
+ clusterName?: string,
12
+ pullSecret?: string,
13
+ openshiftVersion?: string,
11
14
  ): {
12
15
  infraEnv?: InfraEnv;
13
16
  error?: string;
@@ -16,7 +19,13 @@ export default function useInfraEnv(
16
19
  } {
17
20
  const [infraEnv, setInfraEnv] = React.useState<InfraEnv>();
18
21
  const [error, setError] = React.useState('');
19
- const { infraEnvId, error: infraEnvIdError } = useInfraEnvId(clusterId, cpuArchitecture);
22
+ const { infraEnvId, error: infraEnvIdError } = useInfraEnvId(
23
+ clusterId,
24
+ cpuArchitecture,
25
+ clusterName,
26
+ pullSecret,
27
+ openshiftVersion,
28
+ );
20
29
 
21
30
  const getInfraEnv = React.useCallback(async () => {
22
31
  try {
@@ -1,20 +1,40 @@
1
1
  import React from 'react';
2
- import { Cluster, CpuArchitecture, InfraEnv } from '../../common';
2
+ import { Cluster, ClusterCpuArchitecture, CpuArchitecture, InfraEnv } from '../../common';
3
3
  import { getErrorMessage } from '../../common/utils';
4
4
  import { InfraEnvsService } from '../services';
5
5
 
6
- export default function useInfraEnvId(clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture) {
6
+ export default function useInfraEnvId(
7
+ clusterId: Cluster['id'],
8
+ cpuArchitecture: CpuArchitecture,
9
+ clusterName?: string,
10
+ pullSecret?: string,
11
+ openshiftVersion?: string,
12
+ ) {
7
13
  const [infraEnvId, setInfraEnv] = React.useState<InfraEnv['id']>();
8
14
  const [error, setError] = React.useState('');
9
15
 
10
16
  const findInfraEnvId = React.useCallback(async () => {
11
17
  try {
12
18
  const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
13
- setInfraEnv(infraEnvId);
19
+ if (infraEnvId && !(infraEnvId instanceof Error)) {
20
+ setInfraEnv(infraEnvId);
21
+ } else {
22
+ //If infraEnv doesn't exist create a new one
23
+ if (pullSecret) {
24
+ const infraEnv = await InfraEnvsService.create({
25
+ name: InfraEnvsService.makeInfraEnvName(cpuArchitecture, clusterName),
26
+ pullSecret,
27
+ clusterId: clusterId,
28
+ openshiftVersion,
29
+ cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
30
+ });
31
+ setInfraEnv(infraEnv.id);
32
+ }
33
+ }
14
34
  } catch (e) {
15
35
  setError(getErrorMessage(e));
16
36
  }
17
- }, [clusterId, cpuArchitecture]);
37
+ }, [clusterId, cpuArchitecture, clusterName, pullSecret, openshiftVersion]);
18
38
 
19
39
  React.useEffect(() => {
20
40
  if (!clusterId) {
@@ -14,7 +14,7 @@ export default function useInfraEnvImageUrl() {
14
14
  async (clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture): Promise<ImgUrl> => {
15
15
  try {
16
16
  const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
17
- if (!infraEnvId) {
17
+ if (!infraEnvId || infraEnvId instanceof Error) {
18
18
  return { url: '', error: `Failed to retrieve the infraEnv for ${clusterId}` };
19
19
  }
20
20
 
@@ -14,7 +14,7 @@ export default function useInfraEnvIpxeImageUrl() {
14
14
  async (clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture): Promise<ImgUrl> => {
15
15
  try {
16
16
  const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
17
- if (!infraEnvId) {
17
+ if (!infraEnvId || infraEnvId instanceof Error) {
18
18
  return { url: '', error: `Failed to retrieve the infraEnv for ${clusterId}` };
19
19
  }
20
20
 
@@ -96,7 +96,7 @@ const ClustersService = {
96
96
  return {
97
97
  folder: manifest.folder,
98
98
  fileName: manifest.filename,
99
- content: Buffer.from(manifest.manifestYaml).toString('base64'),
99
+ content: window.btoa(manifest.manifestYaml),
100
100
  };
101
101
  },
102
102
 
@@ -109,7 +109,7 @@ const ClustersService = {
109
109
  fileName: existingManifest.filename,
110
110
  updatedFolder: updatedManifest.folder,
111
111
  updatedFileName: updatedManifest.filename,
112
- updatedContent: Buffer.from(updatedManifest.manifestYaml).toString('base64'),
112
+ updatedContent: window.btoa(updatedManifest.manifestYaml),
113
113
  };
114
114
  },
115
115
 
@@ -1,18 +1,8 @@
1
1
  import { InfraEnvsService } from '.';
2
2
  import { ClustersAPI } from './apis';
3
- import {
4
- Cluster,
5
- ClusterCpuArchitecture,
6
- CpuArchitecture,
7
- getSupportedCpuArchitectures,
8
- OcmCpuArchitecture,
9
- SupportedCpuArchitecture,
10
- } from '../../common';
3
+ import { Cluster, ClusterCpuArchitecture, CpuArchitecture } from '../../common';
11
4
  import { OcmClusterType } from '../components/AddHosts/types';
12
- import {
13
- mapOcmArchToCpuArchitecture,
14
- mapClusterCpuArchToInfraEnvCpuArch,
15
- } from './CpuArchitectureService';
5
+ import { mapOcmArchToCpuArchitecture } from './CpuArchitectureService';
16
6
 
17
7
  export const getApiVipDnsName = (ocmCluster: OcmClusterType) => {
18
8
  let apiVipDnsname = '';
@@ -44,13 +34,7 @@ const Day2ClusterService = {
44
34
  return ocmCluster && ocmCluster.external_id;
45
35
  },
46
36
 
47
- async fetchCluster(
48
- ocmCluster: OcmClusterType,
49
- pullSecret: string,
50
- openshiftVersion: string,
51
- cpuArchitecturesByVersionImage: CpuArchitecture[],
52
- canSelectCpuArch?: boolean,
53
- ) {
37
+ async fetchCluster(ocmCluster: OcmClusterType, pullSecret: string, openshiftVersion: string) {
54
38
  const openshiftClusterId = Day2ClusterService.getOpenshiftClusterId(ocmCluster);
55
39
 
56
40
  if (!openshiftClusterId) {
@@ -63,24 +47,13 @@ const Day2ClusterService = {
63
47
  return Day2ClusterService.fetchClusterById(day2ClusterId);
64
48
  }
65
49
 
66
- // The first time the user accesses "Add hosts" tab, the infraEnv(s) need to be created
67
- const createMultipleInfraEnvs =
68
- ocmCluster.cpu_architecture === OcmCpuArchitecture.MULTI || canSelectCpuArch;
69
- const cpuArchitectures = createMultipleInfraEnvs
70
- ? getSupportedCpuArchitectures(
71
- canSelectCpuArch ? canSelectCpuArch : false,
72
- cpuArchitecturesByVersionImage,
73
- mapClusterCpuArchToInfraEnvCpuArch(ocmCluster.cpu_architecture),
74
- )
75
- : ([mapOcmArchToCpuArchitecture(ocmCluster.cpu_architecture)] as SupportedCpuArchitecture[]);
76
-
77
50
  return Day2ClusterService.createCluster(
78
51
  openshiftClusterId,
79
52
  ocmCluster.display_name || ocmCluster.name || openshiftClusterId,
80
53
  getApiVipDnsName(ocmCluster).apiVipDnsname,
81
54
  pullSecret,
82
55
  openshiftVersion,
83
- cpuArchitectures,
56
+ mapOcmArchToCpuArchitecture(ocmCluster.cpu_architecture) as CpuArchitecture,
84
57
  );
85
58
  },
86
59
 
@@ -104,7 +77,7 @@ const Day2ClusterService = {
104
77
  apiVipDnsname: string,
105
78
  pullSecret: string,
106
79
  openshiftVersion: string,
107
- cpuArchitectures: SupportedCpuArchitecture[],
80
+ cpuArchitecture: CpuArchitecture,
108
81
  ) {
109
82
  const { data: day2Cluster } = await ClustersAPI.registerAddHosts({
110
83
  openshiftClusterId, // used to both match OpenShift Cluster and as an assisted-installer ID
@@ -113,17 +86,14 @@ const Day2ClusterService = {
113
86
  openshiftVersion,
114
87
  });
115
88
 
116
- // Create the infraEnvs for each cpuArchitecture
117
- const infraEnvsToCreate = cpuArchitectures.map((cpuArchitecture) => {
118
- return InfraEnvsService.create({
119
- name: `${day2Cluster.name || ''}_infra-env-${cpuArchitecture}`,
120
- pullSecret,
121
- clusterId: day2Cluster.id,
122
- openshiftVersion,
123
- cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
124
- });
89
+ // Create only the infraenv for the day1 cpu architecture
90
+ await InfraEnvsService.create({
91
+ name: InfraEnvsService.makeInfraEnvName(cpuArchitecture, day2Cluster.name),
92
+ pullSecret,
93
+ clusterId: day2Cluster.id,
94
+ openshiftVersion,
95
+ cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
125
96
  });
126
- await Promise.all(infraEnvsToCreate);
127
97
 
128
98
  return day2Cluster;
129
99
  },
@@ -21,7 +21,7 @@ const read = (): InfraEnvCache => {
21
21
  };
22
22
 
23
23
  type InfraEnvStorage = Omit<Storage, 'getItem' | 'removeItem' | 'setItem'> & {
24
- getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | null;
24
+ getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | Error;
25
25
  removeInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): void;
26
26
  removeInfraEnvs(clusterId: string): void;
27
27
  updateInfraEnvs(clusterId: string, infraEnvs: InfraEnv[]): void;
@@ -42,18 +42,21 @@ const InfraEnvIdsCacheService: InfraEnvStorage = {
42
42
  localStorage.removeItem(CACHE_KEY);
43
43
  },
44
44
 
45
- getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | null {
45
+ getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | Error {
46
46
  if (!clusterId || !cpuArchitecture) {
47
- return null;
47
+ return new Error(`clusterId or cpuArchitecture are missing`);
48
48
  }
49
49
 
50
50
  const cache = read();
51
51
  const clusterInfraEnvs = cache[clusterId];
52
52
  if (!clusterInfraEnvs) {
53
- return null;
53
+ return new Error(`Not infraEnvs found for this cluster ${clusterId}`);
54
54
  }
55
- if (cpuArchitecture !== CpuArchitecture.USE_DAY1_ARCHITECTURE) {
56
- return clusterInfraEnvs[cpuArchitecture] || null;
55
+ if (
56
+ cpuArchitecture !== CpuArchitecture.USE_DAY1_ARCHITECTURE &&
57
+ cpuArchitecture !== CpuArchitecture.MULTI
58
+ ) {
59
+ return clusterInfraEnvs[cpuArchitecture] || new Error(`InfraEnv can't be found`);
57
60
  }
58
61
 
59
62
  const architectures = getAllCpuArchitectures().filter((arch) => {
@@ -11,9 +11,12 @@ import InfraEnvCache from './InfraEnvIdsCacheService';
11
11
  import { getDummyInfraEnvField } from '../components/clusterConfiguration/staticIp/data/dummyData';
12
12
 
13
13
  const InfraEnvsService = {
14
- async getInfraEnvId(clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture): Promise<string> {
14
+ async getInfraEnvId(
15
+ clusterId: Cluster['id'],
16
+ cpuArchitecture: CpuArchitecture,
17
+ ): Promise<string | Error> {
15
18
  let infraEnvId = InfraEnvCache.getInfraEnvId(clusterId, cpuArchitecture);
16
- if (infraEnvId === null) {
19
+ if (infraEnvId instanceof Error) {
17
20
  const { data: infraEnvs } = await InfraEnvsAPI.list(clusterId);
18
21
  if (infraEnvs.length > 0) {
19
22
  InfraEnvCache.updateInfraEnvs(clusterId, infraEnvs);
@@ -21,11 +24,6 @@ const InfraEnvsService = {
21
24
  }
22
25
  if (!infraEnvId) {
23
26
  InfraEnvCache.removeInfraEnvId(clusterId, cpuArchitecture);
24
- throw new Error(
25
- `No InfraEnv could be found for clusterId: ${clusterId} and architecture ${
26
- cpuArchitecture || ''
27
- }`,
28
- );
29
27
  }
30
28
  }
31
29
  return infraEnvId;
@@ -33,15 +31,11 @@ const InfraEnvsService = {
33
31
 
34
32
  async getInfraEnv(clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture) {
35
33
  const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
36
- if (infraEnvId) {
34
+ if (infraEnvId && !(infraEnvId instanceof Error)) {
37
35
  const { data } = await InfraEnvsAPI.get(infraEnvId);
38
36
  return data;
39
37
  } else {
40
- throw new Error(
41
- `No InfraEnv could be found for clusterId: ${clusterId} and architecture ${
42
- cpuArchitecture || ''
43
- }`,
44
- );
38
+ return new Error(`Failed to retrieve the infraEnv for ${clusterId}`);
45
39
  }
46
40
  },
47
41
 
@@ -67,6 +61,7 @@ const InfraEnvsService = {
67
61
  }
68
62
 
69
63
  InfraEnvCache.updateInfraEnvs(params.clusterId, [infraEnv]);
64
+ return infraEnv;
70
65
  },
71
66
 
72
67
  async removeAll(clusterId: Cluster['id']) {
@@ -126,6 +121,10 @@ const InfraEnvsService = {
126
121
  return updatedInfraEnv;
127
122
  });
128
123
  },
124
+
125
+ makeInfraEnvName(cpuArchitecture: string, name?: string) {
126
+ return `${name || ''}_infra-env-${cpuArchitecture}`;
127
+ },
129
128
  };
130
129
 
131
130
  export default InfraEnvsService;
@@ -1,11 +1,23 @@
1
1
  import { EventList, V2Events } from '../../../common';
2
2
  import { client } from '../../api';
3
3
 
4
+ let _getRequestAbortController = new AbortController();
5
+
4
6
  const EventsAPI = {
5
7
  makeBaseURI() {
6
8
  return '/v2/events';
7
9
  },
8
10
 
11
+ abort() {
12
+ _getRequestAbortController.abort();
13
+ /*
14
+ * The AbortController.signal can only be aborted once per instance.
15
+ * Therefore in order for other requests to be also abortable we need
16
+ * to create a new instance when this event occurs
17
+ */
18
+ _getRequestAbortController = new AbortController();
19
+ },
20
+
9
21
  createParams({
10
22
  clusterId,
11
23
  hostIds,
@@ -36,7 +48,9 @@ const EventsAPI = {
36
48
  },
37
49
 
38
50
  list(options: V2Events) {
39
- return client.get<EventList>(`${EventsAPI.makeBaseURI()}${EventsAPI.createParams(options)}`);
51
+ return client.get<EventList>(`${EventsAPI.makeBaseURI()}${EventsAPI.createParams(options)}`, {
52
+ signal: _getRequestAbortController.signal,
53
+ });
40
54
  },
41
55
  };
42
56