@openshift-assisted/ui-lib 2.17.1-cim → 2.17.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 (381) hide show
  1. package/build/@types/cim/components/Agent/BMHStatusInfo.d.ts.map +1 -1
  2. package/build/@types/cim/components/Agent/MinimalHWRequirements.d.ts.map +1 -1
  3. package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.d.ts.map +1 -1
  4. package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.d.ts +0 -1
  5. package/build/@types/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.d.ts.map +1 -1
  6. package/build/@types/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
  7. package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
  8. package/build/@types/cim/components/Hypershift/DetailsPage/ConditionsTable.d.ts.map +1 -1
  9. package/build/@types/cim/components/Hypershift/DetailsPage/HostedClusterProgress.d.ts.map +1 -1
  10. package/build/@types/cim/components/Hypershift/DetailsPage/NodePoolsProgress.d.ts.map +1 -1
  11. package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.d.ts.map +1 -1
  12. package/build/@types/cim/components/Hypershift/utils/status.d.ts +2 -2
  13. package/build/@types/cim/components/Hypershift/utils/status.d.ts.map +1 -1
  14. package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
  15. package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
  16. package/build/@types/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.d.ts.map +1 -1
  17. package/build/@types/cim/components/helpers/agentStatus.d.ts +1 -1
  18. package/build/@types/cim/components/helpers/agentStatus.d.ts.map +1 -1
  19. package/build/@types/cim/components/helpers/versions.d.ts +1 -1
  20. package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
  21. package/build/@types/cim/components/modals/CimConfiguration/CimConfigurationFormFields.d.ts.map +1 -1
  22. package/build/@types/cim/components/modals/CimConfiguration/CimConfigurationModal.d.ts.map +1 -1
  23. package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts.map +1 -1
  24. package/build/@types/cim/components/modals/CimConfiguration/types.d.ts +1 -1
  25. package/build/@types/cim/components/modals/EditProxyModal.d.ts.map +1 -1
  26. package/build/@types/cim/components/modals/EditSSHKeyModal.d.ts.map +1 -1
  27. package/build/@types/cim/components/modals/MassDeleteAgentModal.d.ts.map +1 -1
  28. package/build/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
  29. package/build/@types/common/components/clusterConfiguration/DiscoveryTroubleshootingModal.d.ts.map +1 -1
  30. package/build/@types/common/components/clusterDetail/FinalizingProgress.d.ts +1 -1
  31. package/build/@types/common/components/clusterDetail/FinalizingProgress.d.ts.map +1 -1
  32. package/build/@types/common/components/clusterDetail/OperatorsProgressItem.d.ts.map +1 -1
  33. package/build/@types/common/components/clusterDetail/ProgressBarTexts.d.ts.map +1 -1
  34. package/build/@types/common/components/clusterWizard/ReviewValidations.d.ts.map +1 -1
  35. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  36. package/build/@types/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.d.ts.map +1 -1
  37. package/build/@types/common/components/hosts/AdditionalNTPSourcesDialog.d.ts.map +1 -1
  38. package/build/@types/common/components/hosts/EditHostForm.d.ts.map +1 -1
  39. package/build/@types/common/components/hosts/HostPropertyValidationPopover.d.ts.map +1 -1
  40. package/build/@types/common/components/hosts/HostStatus.d.ts.map +1 -1
  41. package/build/@types/common/components/hosts/HostValidationGroups.d.ts.map +1 -1
  42. package/build/@types/common/components/hosts/Hostname.d.ts.map +1 -1
  43. package/build/@types/common/components/hosts/MassChangeHostnameModal.d.ts.map +1 -1
  44. package/build/@types/common/components/hosts/VMRebootConfigurationInfo.d.ts.map +1 -1
  45. package/build/@types/common/components/hosts/status.d.ts.map +1 -1
  46. package/build/@types/common/components/storage/DisksTable.d.ts.map +1 -1
  47. package/build/@types/common/components/storage/StorageUtils.d.ts +1 -1
  48. package/build/@types/common/components/storage/StorageUtils.d.ts.map +1 -1
  49. package/build/@types/common/components/ui/WizardNavItem.d.ts.map +1 -1
  50. package/build/@types/common/components/ui/formik/RemovableField.d.ts.map +1 -1
  51. package/build/@types/common/components/ui/formik/RichInputField.d.ts.map +1 -1
  52. package/build/@types/common/components/ui/formik/index.d.ts +0 -2
  53. package/build/@types/common/components/ui/formik/index.d.ts.map +1 -1
  54. package/build/@types/common/components/ui/index.d.ts +0 -1
  55. package/build/@types/common/components/ui/index.d.ts.map +1 -1
  56. package/build/@types/common/index.d.ts +1 -0
  57. package/build/@types/common/index.d.ts.map +1 -1
  58. package/build/@types/common/utils.d.ts +2 -2
  59. package/build/@types/common/utils.d.ts.map +1 -1
  60. package/build/@types/common/validationSchemas/addressValidation.d.ts +18 -0
  61. package/build/@types/common/validationSchemas/addressValidation.d.ts.map +1 -0
  62. package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts +8 -0
  63. package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts.map +1 -0
  64. package/build/@types/common/{components/ui/formik → validationSchemas}/constants.d.ts +1 -3
  65. package/build/@types/common/validationSchemas/constants.d.ts.map +1 -0
  66. package/build/@types/common/validationSchemas/hostnameValidation.d.ts +4 -0
  67. package/build/@types/common/validationSchemas/hostnameValidation.d.ts.map +1 -0
  68. package/build/@types/common/validationSchemas/index.d.ts +11 -0
  69. package/build/@types/common/validationSchemas/index.d.ts.map +1 -0
  70. package/build/@types/common/validationSchemas/networkingValidation.d.ts +18 -0
  71. package/build/@types/common/validationSchemas/networkingValidation.d.ts.map +1 -0
  72. package/build/@types/common/validationSchemas/ntpValidation.d.ts +4 -0
  73. package/build/@types/common/validationSchemas/ntpValidation.d.ts.map +1 -0
  74. package/build/@types/common/validationSchemas/proxyValidation.d.ts +11 -0
  75. package/build/@types/common/validationSchemas/proxyValidation.d.ts.map +1 -0
  76. package/build/@types/common/validationSchemas/pullSecretValidation.d.ts +4 -0
  77. package/build/@types/common/validationSchemas/pullSecretValidation.d.ts.map +1 -0
  78. package/build/@types/common/validationSchemas/regexes.d.ts +14 -0
  79. package/build/@types/common/validationSchemas/regexes.d.ts.map +1 -0
  80. package/build/@types/common/validationSchemas/sshValidation.d.ts +5 -0
  81. package/build/@types/common/validationSchemas/sshValidation.d.ts.map +1 -0
  82. package/build/@types/common/validationSchemas/utils.d.ts +7 -0
  83. package/build/@types/common/validationSchemas/utils.d.ts.map +1 -0
  84. package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
  85. package/build/@types/ocm/components/clusterConfiguration/OcmOperatorProgressItem.d.ts.map +1 -1
  86. package/build/@types/ocm/components/clusterConfiguration/OpenshiftVersionHelperText.d.ts.map +1 -1
  87. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifests.d.ts.map +1 -1
  88. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.d.ts +2 -1
  89. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.d.ts.map +1 -1
  90. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
  91. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts +2 -1
  92. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
  93. package/build/@types/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegrationNote.d.ts.map +1 -1
  94. package/build/@types/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.d.ts.map +1 -1
  95. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHosts.d.ts.map +1 -1
  96. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.d.ts +2 -1
  97. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.d.ts.map +1 -1
  98. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlView.d.ts.map +1 -1
  99. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.d.ts +2 -1
  100. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.d.ts.map +1 -1
  101. package/build/@types/ocm/components/clusterDetail/HostInventoryExpandable.d.ts +1 -1
  102. package/build/@types/ocm/components/clusterDetail/HostInventoryExpandable.d.ts.map +1 -1
  103. package/build/@types/ocm/components/clusterDetail/OpenShiftVersionDetail.d.ts.map +1 -1
  104. package/build/@types/ocm/components/clusterDetail/ResetClusterModal.d.ts.map +1 -1
  105. package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map +1 -1
  106. package/build/@types/ocm/components/clusters/ClusterStatus.d.ts.map +1 -1
  107. package/build/@types/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.d.ts.map +1 -1
  108. package/build/@types/ocm/components/hosts/UpdateDay2ApiVipForm.d.ts.map +1 -1
  109. package/build/@types/ocm/components/ui/InfoLinkWithModal.d.ts.map +1 -1
  110. package/build/cjs/cim/components/Agent/BMCForm.js +3 -3
  111. package/build/cjs/cim/components/Agent/BMCForm.js.map +1 -1
  112. package/build/cjs/cim/components/Agent/BMHStatusInfo.js +4 -4
  113. package/build/cjs/cim/components/Agent/BMHStatusInfo.js.map +1 -1
  114. package/build/cjs/cim/components/Agent/MinimalHWRequirements.js +2 -2
  115. package/build/cjs/cim/components/Agent/MinimalHWRequirements.js.map +1 -1
  116. package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.js +9 -15
  117. package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.js.map +1 -1
  118. package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.js +8 -6
  119. package/build/cjs/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.js.map +1 -1
  120. package/build/cjs/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.js +1 -3
  121. package/build/cjs/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.js.map +1 -1
  122. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +16 -15
  123. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
  124. package/build/cjs/cim/components/Hypershift/DetailsPage/ConditionsTable.js +7 -6
  125. package/build/cjs/cim/components/Hypershift/DetailsPage/ConditionsTable.js.map +1 -1
  126. package/build/cjs/cim/components/Hypershift/DetailsPage/HostedClusterProgress.js +3 -2
  127. package/build/cjs/cim/components/Hypershift/DetailsPage/HostedClusterProgress.js.map +1 -1
  128. package/build/cjs/cim/components/Hypershift/DetailsPage/NodePoolsProgress.js +2 -2
  129. package/build/cjs/cim/components/Hypershift/DetailsPage/NodePoolsProgress.js.map +1 -1
  130. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/DetailsStep/DetailsStep.js +2 -2
  131. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/DetailsStep/DetailsStep.js.map +1 -1
  132. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js +2 -11
  133. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js.map +1 -1
  134. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js +8 -8
  135. package/build/cjs/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js.map +1 -1
  136. package/build/cjs/cim/components/Hypershift/utils/status.js +8 -7
  137. package/build/cjs/cim/components/Hypershift/utils/status.js.map +1 -1
  138. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +4 -4
  139. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
  140. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js +8 -6
  141. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
  142. package/build/cjs/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.js +3 -3
  143. package/build/cjs/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.js.map +1 -1
  144. package/build/cjs/cim/components/helpers/agentStatus.js +3 -2
  145. package/build/cjs/cim/components/helpers/agentStatus.js.map +1 -1
  146. package/build/cjs/cim/components/helpers/versions.js +42 -27
  147. package/build/cjs/cim/components/helpers/versions.js.map +1 -1
  148. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationFormFields.js +7 -3
  149. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationFormFields.js.map +1 -1
  150. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js +13 -6
  151. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js.map +1 -1
  152. package/build/cjs/cim/components/modals/CimConfiguration/persist.js +7 -0
  153. package/build/cjs/cim/components/modals/CimConfiguration/persist.js.map +1 -1
  154. package/build/cjs/cim/components/modals/EditProxyModal.js +5 -3
  155. package/build/cjs/cim/components/modals/EditProxyModal.js.map +1 -1
  156. package/build/cjs/cim/components/modals/EditPullSecretModal.js +1 -1
  157. package/build/cjs/cim/components/modals/EditPullSecretModal.js.map +1 -1
  158. package/build/cjs/cim/components/modals/EditSSHKeyModal.js +3 -3
  159. package/build/cjs/cim/components/modals/EditSSHKeyModal.js.map +1 -1
  160. package/build/cjs/cim/components/modals/MassDeleteAgentModal.js +2 -2
  161. package/build/cjs/cim/components/modals/MassDeleteAgentModal.js.map +1 -1
  162. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +7 -6
  163. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
  164. package/build/cjs/common/components/clusterConfiguration/DiscoveryTroubleshootingModal.js +2 -1
  165. package/build/cjs/common/components/clusterConfiguration/DiscoveryTroubleshootingModal.js.map +1 -1
  166. package/build/cjs/common/components/clusterDetail/FinalizingProgress.js +8 -7
  167. package/build/cjs/common/components/clusterDetail/FinalizingProgress.js.map +1 -1
  168. package/build/cjs/common/components/clusterDetail/OperatorsProgressItem.js +4 -4
  169. package/build/cjs/common/components/clusterDetail/OperatorsProgressItem.js.map +1 -1
  170. package/build/cjs/common/components/clusterDetail/ProgressBarTexts.js +5 -4
  171. package/build/cjs/common/components/clusterDetail/ProgressBarTexts.js.map +1 -1
  172. package/build/cjs/common/components/clusterWizard/ReviewValidations.js +7 -6
  173. package/build/cjs/common/components/clusterWizard/ReviewValidations.js.map +1 -1
  174. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +8 -8
  175. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  176. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +2 -2
  177. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
  178. package/build/cjs/common/components/hosts/AdditionalNTPSourcesDialog.js +2 -1
  179. package/build/cjs/common/components/hosts/AdditionalNTPSourcesDialog.js.map +1 -1
  180. package/build/cjs/common/components/hosts/EditHostForm.js +3 -2
  181. package/build/cjs/common/components/hosts/EditHostForm.js.map +1 -1
  182. package/build/cjs/common/components/hosts/HostPropertyValidationPopover.js +6 -6
  183. package/build/cjs/common/components/hosts/HostPropertyValidationPopover.js.map +1 -1
  184. package/build/cjs/common/components/hosts/HostStatus.js +2 -1
  185. package/build/cjs/common/components/hosts/HostStatus.js.map +1 -1
  186. package/build/cjs/common/components/hosts/HostValidationGroups.js +6 -6
  187. package/build/cjs/common/components/hosts/HostValidationGroups.js.map +1 -1
  188. package/build/cjs/common/components/hosts/Hostname.js +4 -3
  189. package/build/cjs/common/components/hosts/Hostname.js.map +1 -1
  190. package/build/cjs/common/components/hosts/MassChangeHostnameModal.js +8 -7
  191. package/build/cjs/common/components/hosts/MassChangeHostnameModal.js.map +1 -1
  192. package/build/cjs/common/components/hosts/VMRebootConfigurationInfo.js +2 -1
  193. package/build/cjs/common/components/hosts/VMRebootConfigurationInfo.js.map +1 -1
  194. package/build/cjs/common/components/hosts/status.js +19 -13
  195. package/build/cjs/common/components/hosts/status.js.map +1 -1
  196. package/build/cjs/common/components/storage/DisksTable.js +4 -2
  197. package/build/cjs/common/components/storage/DisksTable.js.map +1 -1
  198. package/build/cjs/common/components/storage/StorageUtils.js +3 -2
  199. package/build/cjs/common/components/storage/StorageUtils.js.map +1 -1
  200. package/build/cjs/common/components/ui/WizardNavItem.js +2 -2
  201. package/build/cjs/common/components/ui/WizardNavItem.js.map +1 -1
  202. package/build/cjs/common/components/ui/formik/RemovableField.js +3 -3
  203. package/build/cjs/common/components/ui/formik/RemovableField.js.map +1 -1
  204. package/build/cjs/common/components/ui/formik/RichInputField.js +4 -4
  205. package/build/cjs/common/components/ui/formik/RichInputField.js.map +1 -1
  206. package/build/cjs/common/components/ui/formik/index.js +0 -2
  207. package/build/cjs/common/components/ui/formik/index.js.map +1 -1
  208. package/build/cjs/common/components/ui/index.js +1 -3
  209. package/build/cjs/common/components/ui/index.js.map +1 -1
  210. package/build/cjs/common/config/docs_links.js +1 -1
  211. package/build/cjs/common/index.js +1 -0
  212. package/build/cjs/common/index.js.map +1 -1
  213. package/build/cjs/common/utils.js +5 -3
  214. package/build/cjs/common/utils.js.map +1 -1
  215. package/build/cjs/common/validationSchemas/addressValidation.js +258 -0
  216. package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -0
  217. package/build/cjs/common/validationSchemas/clusterDetailsValidation.js +104 -0
  218. package/build/cjs/common/validationSchemas/clusterDetailsValidation.js.map +1 -0
  219. package/build/cjs/common/{components/ui/formik → validationSchemas}/constants.js +3 -5
  220. package/build/cjs/common/validationSchemas/constants.js.map +1 -0
  221. package/build/cjs/common/validationSchemas/hostnameValidation.js +36 -0
  222. package/build/cjs/common/validationSchemas/hostnameValidation.js.map +1 -0
  223. package/build/cjs/common/validationSchemas/index.js +17 -0
  224. package/build/cjs/common/validationSchemas/index.js.map +1 -0
  225. package/build/cjs/common/validationSchemas/networkingValidation.js +74 -0
  226. package/build/cjs/common/validationSchemas/networkingValidation.js.map +1 -0
  227. package/build/cjs/common/validationSchemas/ntpValidation.js +25 -0
  228. package/build/cjs/common/validationSchemas/ntpValidation.js.map +1 -0
  229. package/build/cjs/common/validationSchemas/proxyValidation.js +43 -0
  230. package/build/cjs/common/validationSchemas/proxyValidation.js.map +1 -0
  231. package/build/cjs/common/validationSchemas/pullSecretValidation.js +21 -0
  232. package/build/cjs/common/validationSchemas/pullSecretValidation.js.map +1 -0
  233. package/build/cjs/common/validationSchemas/regexes.js +17 -0
  234. package/build/cjs/common/validationSchemas/regexes.js.map +1 -0
  235. package/build/cjs/common/validationSchemas/sshValidation.js +32 -0
  236. package/build/cjs/common/validationSchemas/sshValidation.js.map +1 -0
  237. package/build/cjs/common/validationSchemas/utils.js +40 -0
  238. package/build/cjs/common/validationSchemas/utils.js.map +1 -0
  239. package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +7 -6
  240. package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
  241. package/build/cjs/ocm/components/clusterConfiguration/OcmOperatorProgressItem.js +4 -4
  242. package/build/cjs/ocm/components/clusterConfiguration/OcmOperatorProgressItem.js.map +1 -1
  243. package/build/cjs/ocm/components/clusterConfiguration/OpenshiftVersionHelperText.js +5 -2
  244. package/build/cjs/ocm/components/clusterConfiguration/OpenshiftVersionHelperText.js.map +1 -1
  245. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifests.js +4 -2
  246. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifests.js.map +1 -1
  247. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.js +7 -6
  248. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.js.map +1 -1
  249. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +7 -3
  250. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
  251. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +11 -11
  252. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
  253. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegrationNote.js +5 -3
  254. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegrationNote.js.map +1 -1
  255. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js +11 -7
  256. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js.map +1 -1
  257. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHosts.js +3 -1
  258. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHosts.js.map +1 -1
  259. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.js +6 -6
  260. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.js.map +1 -1
  261. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlView.js +3 -1
  262. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlView.js.map +1 -1
  263. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.js +12 -12
  264. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.js.map +1 -1
  265. package/build/cjs/ocm/components/clusterDetail/HostInventoryExpandable.js +5 -4
  266. package/build/cjs/ocm/components/clusterDetail/HostInventoryExpandable.js.map +1 -1
  267. package/build/cjs/ocm/components/clusterDetail/OpenShiftVersionDetail.js +4 -3
  268. package/build/cjs/ocm/components/clusterDetail/OpenShiftVersionDetail.js.map +1 -1
  269. package/build/cjs/ocm/components/clusterDetail/ResetClusterModal.js +4 -2
  270. package/build/cjs/ocm/components/clusterDetail/ResetClusterModal.js.map +1 -1
  271. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js +4 -3
  272. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map +1 -1
  273. package/build/cjs/ocm/components/clusters/ClusterStatus.js +13 -7
  274. package/build/cjs/ocm/components/clusters/ClusterStatus.js.map +1 -1
  275. package/build/cjs/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.js +7 -6
  276. package/build/cjs/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.js.map +1 -1
  277. package/build/cjs/ocm/components/hosts/UpdateDay2ApiVipForm.js +2 -1
  278. package/build/cjs/ocm/components/hosts/UpdateDay2ApiVipForm.js.map +1 -1
  279. package/build/cjs/ocm/components/ui/InfoLinkWithModal.js +2 -2
  280. package/build/cjs/ocm/components/ui/InfoLinkWithModal.js.map +1 -1
  281. package/lib/cim/components/Agent/BMCForm.tsx +3 -3
  282. package/lib/cim/components/Agent/BMHStatusInfo.tsx +12 -4
  283. package/lib/cim/components/Agent/MinimalHWRequirements.tsx +4 -2
  284. package/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.tsx +8 -18
  285. package/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDetailsFormFields.tsx +7 -10
  286. package/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.tsx +1 -3
  287. package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +19 -15
  288. package/lib/cim/components/Hypershift/DetailsPage/ConditionsTable.tsx +13 -7
  289. package/lib/cim/components/Hypershift/DetailsPage/HostedClusterProgress.tsx +8 -4
  290. package/lib/cim/components/Hypershift/DetailsPage/NodePoolsProgress.tsx +6 -2
  291. package/lib/cim/components/Hypershift/HostedClusterWizard/DetailsStep/DetailsStep.tsx +2 -2
  292. package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.tsx +2 -13
  293. package/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx +8 -8
  294. package/lib/cim/components/Hypershift/utils/status.tsx +20 -9
  295. package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +11 -4
  296. package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +8 -6
  297. package/lib/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.tsx +4 -6
  298. package/lib/cim/components/helpers/agentStatus.tsx +7 -3
  299. package/lib/cim/components/helpers/versions.ts +51 -34
  300. package/lib/cim/components/modals/CimConfiguration/CimConfigurationFormFields.tsx +7 -5
  301. package/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx +13 -6
  302. package/lib/cim/components/modals/CimConfiguration/persist.ts +11 -0
  303. package/lib/cim/components/modals/CimConfiguration/types.ts +1 -1
  304. package/lib/cim/components/modals/EditProxyModal.tsx +6 -3
  305. package/lib/cim/components/modals/EditPullSecretModal.tsx +1 -1
  306. package/lib/cim/components/modals/EditSSHKeyModal.tsx +8 -6
  307. package/lib/cim/components/modals/MassDeleteAgentModal.tsx +12 -5
  308. package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +9 -8
  309. package/lib/common/components/clusterConfiguration/DiscoveryTroubleshootingModal.tsx +5 -2
  310. package/lib/common/components/clusterDetail/FinalizingProgress.tsx +21 -10
  311. package/lib/common/components/clusterDetail/OperatorsProgressItem.tsx +11 -5
  312. package/lib/common/components/clusterDetail/ProgressBarTexts.tsx +17 -5
  313. package/lib/common/components/clusterWizard/ReviewValidations.tsx +15 -6
  314. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +21 -11
  315. package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +0 -2
  316. package/lib/common/components/hosts/AdditionalNTPSourcesDialog.tsx +3 -6
  317. package/lib/common/components/hosts/EditHostForm.tsx +2 -8
  318. package/lib/common/components/hosts/HostPropertyValidationPopover.tsx +9 -5
  319. package/lib/common/components/hosts/HostStatus.tsx +14 -3
  320. package/lib/common/components/hosts/HostValidationGroups.tsx +9 -5
  321. package/lib/common/components/hosts/Hostname.tsx +7 -4
  322. package/lib/common/components/hosts/MassChangeHostnameModal.tsx +10 -8
  323. package/lib/common/components/hosts/VMRebootConfigurationInfo.tsx +12 -3
  324. package/lib/common/components/hosts/status.tsx +46 -13
  325. package/lib/common/components/storage/DisksTable.tsx +15 -4
  326. package/lib/common/components/storage/StorageUtils.tsx +6 -4
  327. package/lib/common/components/ui/WizardNavItem.tsx +4 -7
  328. package/lib/common/components/ui/formik/RemovableField.tsx +8 -4
  329. package/lib/common/components/ui/formik/RichInputField.tsx +10 -6
  330. package/lib/common/components/ui/formik/index.tsx +0 -2
  331. package/lib/common/components/ui/index.ts +0 -2
  332. package/lib/common/config/docs_links.ts +1 -1
  333. package/lib/common/index.ts +2 -0
  334. package/lib/common/utils.ts +5 -7
  335. package/lib/common/{components/ui/formik → validationSchemas}/_validationSchemas.test.ts +51 -39
  336. package/lib/common/validationSchemas/addressValidation.tsx +354 -0
  337. package/lib/common/validationSchemas/clusterDetailsValidation.tsx +168 -0
  338. package/lib/common/{components/ui/formik → validationSchemas}/constants.tsx +3 -6
  339. package/lib/common/validationSchemas/hostnameValidation.tsx +46 -0
  340. package/lib/common/validationSchemas/index.tsx +11 -0
  341. package/lib/common/validationSchemas/networkingValidation.tsx +113 -0
  342. package/lib/common/validationSchemas/ntpValidation.tsx +30 -0
  343. package/lib/common/validationSchemas/proxyValidation.tsx +67 -0
  344. package/lib/common/validationSchemas/pullSecretValidation.tsx +24 -0
  345. package/lib/common/validationSchemas/regexes.tsx +22 -0
  346. package/lib/common/validationSchemas/sshValidation.tsx +46 -0
  347. package/lib/common/validationSchemas/utils.tsx +36 -0
  348. package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +17 -15
  349. package/lib/ocm/components/clusterConfiguration/OcmOperatorProgressItem.tsx +11 -5
  350. package/lib/ocm/components/clusterConfiguration/OpenshiftVersionHelperText.tsx +8 -7
  351. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifests.tsx +4 -2
  352. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/customManifestsValidationSchema.tsx +31 -31
  353. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +15 -5
  354. package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +14 -16
  355. package/lib/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegrationNote.tsx +6 -3
  356. package/lib/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.tsx +28 -15
  357. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHosts.tsx +3 -1
  358. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.tsx +11 -6
  359. package/lib/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlView.tsx +5 -1
  360. package/lib/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.tsx +33 -28
  361. package/lib/ocm/components/clusterDetail/HostInventoryExpandable.tsx +11 -5
  362. package/lib/ocm/components/clusterDetail/OpenShiftVersionDetail.tsx +8 -5
  363. package/lib/ocm/components/clusterDetail/ResetClusterModal.tsx +6 -3
  364. package/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +5 -3
  365. package/lib/ocm/components/clusters/ClusterStatus.tsx +30 -8
  366. package/lib/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.tsx +12 -8
  367. package/lib/ocm/components/hosts/UpdateDay2ApiVipForm.tsx +3 -7
  368. package/lib/ocm/components/ui/InfoLinkWithModal.tsx +4 -2
  369. package/package.json +3 -3
  370. package/build/@types/common/components/ui/UiIcon.d.ts +0 -11
  371. package/build/@types/common/components/ui/UiIcon.d.ts.map +0 -1
  372. package/build/@types/common/components/ui/formik/constants.d.ts.map +0 -1
  373. package/build/@types/common/components/ui/formik/validationSchemas.d.ts +0 -50
  374. package/build/@types/common/components/ui/formik/validationSchemas.d.ts.map +0 -1
  375. package/build/cjs/common/components/ui/UiIcon.js +0 -11
  376. package/build/cjs/common/components/ui/UiIcon.js.map +0 -1
  377. package/build/cjs/common/components/ui/formik/constants.js.map +0 -1
  378. package/build/cjs/common/components/ui/formik/validationSchemas.js +0 -553
  379. package/build/cjs/common/components/ui/formik/validationSchemas.js.map +0 -1
  380. package/lib/common/components/ui/UiIcon.tsx +0 -21
  381. package/lib/common/components/ui/formik/validationSchemas.ts +0 -803
@@ -0,0 +1,354 @@
1
+ import * as Yup from 'yup';
2
+ import { Address4, Address6 } from 'ip-address';
3
+ import isCIDR from 'is-cidr';
4
+ import { isInSubnet } from 'is-in-subnet';
5
+
6
+ import { getAddress } from '../components/ui/formik/utils';
7
+ import { getSubnet } from '../components/clusterConfiguration/utils';
8
+ import { HostSubnets, NetworkConfigurationValues } from '../types';
9
+ import { IP_V4_ZERO, IP_V6_ZERO, MAC_REGEX } from './regexes';
10
+ import { getArrayIndexFromPath, isIPorDN, isIPv4Address, isIPv6Address } from './utils';
11
+ import { NO_SUBNET_SET } from '../config';
12
+ import { overlap } from 'cidr-tools';
13
+ import parseUrl from 'parse-url';
14
+ import { TFunction } from 'i18next';
15
+
16
+ export const ipValidationSchema = (t: TFunction) =>
17
+ Yup.string().test(
18
+ 'ip-validation',
19
+ t('ai:Not a valid IP address'),
20
+ (value?: string) => Address4.isValid(value || '') || Address6.isValid(value || ''),
21
+ );
22
+
23
+ export const ipNoSuffixValidationSchema = (t: TFunction) =>
24
+ Yup.string().test('ip-validation-no-suffix', t('ai:Not a valid IP address'), (value?: string) => {
25
+ if (!value) return true;
26
+ const address = getAddress(value || '');
27
+ return !!address && address.address === address.addressMinusSuffix;
28
+ });
29
+
30
+ export const macAddressValidationSchema = (t: TFunction) =>
31
+ Yup.string().matches(MAC_REGEX, {
32
+ message: (value) => t('ai:Value "{{value}}" is not valid MAC address.', { value }),
33
+ excludeEmptyString: true,
34
+ });
35
+
36
+ export const vipRangeValidationSchema = (
37
+ hostSubnets: HostSubnets,
38
+ { machineNetworks }: NetworkConfigurationValues,
39
+ allowSuffix: boolean,
40
+ t: TFunction,
41
+ ) =>
42
+ Yup.string().test('vip-validation', t('ai:IP Address is outside of selected subnet'), (value) => {
43
+ if (!value) {
44
+ return true;
45
+ }
46
+
47
+ try {
48
+ const validator = allowSuffix ? ipValidationSchema : ipNoSuffixValidationSchema;
49
+ validator(t).validateSync(value);
50
+ } catch (err) {
51
+ return true;
52
+ }
53
+ // Find host subnets that match the selected machine networks
54
+ const cidrs = machineNetworks?.map((network) => network.cidr) ?? [];
55
+ const matchingSubnets = hostSubnets.filter((hostSubnet) => cidrs.includes(hostSubnet.subnet));
56
+
57
+ for (const hostSubnet of matchingSubnets) {
58
+ if (hostSubnet?.subnet) {
59
+ // Workaround for bug in CIM backend. hostIDs are empty
60
+ if (!hostSubnet.hostIDs.length) {
61
+ return true;
62
+ } else if (isInSubnet(value, hostSubnet.subnet)) {
63
+ return true;
64
+ }
65
+ }
66
+ }
67
+ return false;
68
+ });
69
+
70
+ const vipBroadcastValidationSchema = (
71
+ { machineNetworks }: NetworkConfigurationValues,
72
+ t: TFunction,
73
+ ) =>
74
+ Yup.string().test(
75
+ 'vip-no-broadcast',
76
+ t('ai:The IP address cannot be a network or broadcast address'),
77
+ function (value?: string) {
78
+ if (!value) {
79
+ return true;
80
+ }
81
+
82
+ const vipAddress = getAddress(value)?.address;
83
+ if (!vipAddress) {
84
+ return true;
85
+ }
86
+
87
+ const index = getArrayIndexFromPath(this.path || '');
88
+ const machineNetworkCidr = machineNetworks?.[index]?.cidr ?? machineNetworks?.[0]?.cidr ?? '';
89
+ if (!machineNetworkCidr) {
90
+ return true;
91
+ }
92
+
93
+ const machineNetwork = getAddress(machineNetworkCidr);
94
+ if (!machineNetwork) {
95
+ return true;
96
+ }
97
+
98
+ const machineNetworkBroadcast = machineNetwork.endAddress().address;
99
+ const machineNetworkAddress = machineNetwork.startAddress().address;
100
+
101
+ return vipAddress !== machineNetworkBroadcast && vipAddress !== machineNetworkAddress;
102
+ },
103
+ );
104
+
105
+ export const hostSubnetValidationSchema = Yup.string().when(['managedNetworkingType'], {
106
+ is: (managedNetworkingType: NetworkConfigurationValues['managedNetworkingType']) =>
107
+ managedNetworkingType === 'clusterManaged',
108
+ then: () => Yup.string().notOneOf([NO_SUBNET_SET], 'Host subnet must be selected.'),
109
+ });
110
+
111
+ export const vipNoSuffixValidationSchema = (
112
+ hostSubnets: HostSubnets,
113
+ values: NetworkConfigurationValues,
114
+ t: TFunction,
115
+ ) =>
116
+ Yup.mixed().when(['vipDhcpAllocation', 'managedNetworkingType'], {
117
+ is: (
118
+ vipDhcpAllocation: NetworkConfigurationValues['vipDhcpAllocation'],
119
+ managedNetworkingType: NetworkConfigurationValues['managedNetworkingType'],
120
+ ) => !vipDhcpAllocation && managedNetworkingType !== 'userManaged',
121
+ then: () => {
122
+ // Per-item schema for VIPs (apiVips[*].ip / ingressVips[*].ip)
123
+ // 1) Require value once set
124
+ // 2) Validate IP without suffix
125
+ // 3) Ensure VIP family matches machineNetworks[idx] family
126
+ // 4) Validate range vs selected subnets
127
+ // 5) No broadcast/network address
128
+ // 6) Uniqueness across API/Ingress
129
+ const vipFamilyMatchSchema = Yup.string().test(
130
+ 'vip-family-match-machine-network',
131
+ t('ai:IP family must match the corresponding machine network family.'),
132
+ function (value?: string) {
133
+ if (!value) {
134
+ return true;
135
+ }
136
+ const index = getArrayIndexFromPath(this.path || '');
137
+ if (Number.isNaN(index)) {
138
+ return true;
139
+ }
140
+ const cidr = values.machineNetworks?.[index]?.cidr || '';
141
+ const mnIsV4 = isCIDR.v4(cidr);
142
+ const mnIsV6 = isCIDR.v6(cidr);
143
+ // If machine network at index is not selected/valid, don't block validation here
144
+ if (!mnIsV4 && !mnIsV6) {
145
+ return true;
146
+ }
147
+ const ipIsV4 = isIPv4Address(value);
148
+ const ipIsV6 = isIPv6Address(value);
149
+ if (!ipIsV4 && !ipIsV6) {
150
+ return true;
151
+ }
152
+ return mnIsV4 ? ipIsV4 : ipIsV6;
153
+ },
154
+ );
155
+ // Ensure API and Ingress VIPs at the same index are not the same
156
+ const vipUniqueSchema = Yup.string().test('vip-uniqueness', function (value?: string) {
157
+ if (!value) {
158
+ return true;
159
+ }
160
+ const index = getArrayIndexFromPath(this.path || '');
161
+ if (Number.isNaN(index)) {
162
+ return true;
163
+ }
164
+ const apiVip = values.apiVips?.[index]?.ip;
165
+ const ingressVip = values.ingressVips?.[index]?.ip;
166
+ if (!apiVip || !ingressVip) {
167
+ return true;
168
+ }
169
+ if (apiVip === ingressVip) {
170
+ return this.createError({
171
+ message:
172
+ index === 0
173
+ ? t('ai:The primary Ingress and API IP addresses cannot be the same.')
174
+ : t('ai:The secondary Ingress and API IP addresses cannot be the same.'),
175
+ });
176
+ }
177
+ return true;
178
+ });
179
+ const requiredField = (message: string) =>
180
+ Yup.string().test('required-field', message, function (value?: string) {
181
+ const index = getArrayIndexFromPath(this.path || '');
182
+ const api1 = (values.apiVips?.[1]?.ip ?? '').toString().trim();
183
+ const ingress1 = (values.ingressVips?.[1]?.ip ?? '').toString().trim();
184
+ // Dual-stack: secondary VIPs (index 1) are optional; skip required when both are empty
185
+ if (index === 1 && api1 === '' && ingress1 === '') return true;
186
+ return !!value;
187
+ });
188
+
189
+ return requiredField(t('ai:Required field'))
190
+ .concat(ipNoSuffixValidationSchema(t))
191
+ .concat(vipFamilyMatchSchema)
192
+ .concat(vipRangeValidationSchema(hostSubnets, values, false, t))
193
+ .concat(vipBroadcastValidationSchema(values, t))
194
+ .concat(vipUniqueSchema);
195
+ },
196
+ });
197
+
198
+ export const vipArrayValidationSchema = <T extends Yup.Maybe<Yup.AnyObject>>(
199
+ hostSubnets: HostSubnets,
200
+ values: NetworkConfigurationValues,
201
+ t: TFunction,
202
+ ) =>
203
+ values.managedNetworkingType === 'clusterManaged'
204
+ ? Yup.array<T>().of(
205
+ Yup.object({
206
+ clusterId: Yup.string(),
207
+ ip: vipNoSuffixValidationSchema(hostSubnets, values, t),
208
+ }),
209
+ )
210
+ : Yup.array<T>();
211
+
212
+ export const ipBlockValidationSchema = (
213
+ reservedCidrs: string | string[] | undefined,
214
+ t: TFunction,
215
+ ) =>
216
+ Yup.string()
217
+ .required('A value is required.')
218
+ .test(
219
+ 'valid-ip-address',
220
+ t(
221
+ 'ai:Invalid IP address block. Expected value is a network expressed in CIDR notation (IP/netmask). For example: 123.123.123.0/24, 2055:d7a::/116',
222
+ ),
223
+ (value?: string): boolean => !!value && (isCIDR.v4(value) || isCIDR.v6(value)),
224
+ )
225
+ .test(
226
+ 'valid-netmask',
227
+ t(
228
+ 'ai:IPv4 netmask must be between 1-25 and include at least 128 addresses.\nIPv6 netmask must be between 8-128 and include at least 256 addresses.',
229
+ ),
230
+ (value?: string) => {
231
+ const suffix = parseInt((value || '').split('/')[1]);
232
+
233
+ return (
234
+ (isCIDR.v4(value || '') && 0 < suffix && suffix < 26) ||
235
+ (isCIDR.v6(value || '') && 7 < suffix && suffix < 129)
236
+ );
237
+ },
238
+ )
239
+ .test(
240
+ 'cidr-is-not-unspecified',
241
+ t(
242
+ 'ai:The specified CIDR is invalid because its resulting routing prefix matches the unspecified address.',
243
+ ),
244
+ (cidr: string) => {
245
+ const ip = getSubnet(cidr);
246
+ if (ip === null) {
247
+ return false;
248
+ }
249
+
250
+ // The first address is used to represent the network
251
+ const startAddress = ip.startAddress().address;
252
+
253
+ return startAddress !== IP_V4_ZERO && startAddress !== IP_V6_ZERO;
254
+ },
255
+ )
256
+ .test(
257
+ 'valid-cidr-base-address',
258
+ ({ value }) => t('ai:{{value}} is not a valid CIDR', { value: value as string }),
259
+ (cidr: string) => {
260
+ const ip = getSubnet(cidr);
261
+ if (ip === null) {
262
+ return false;
263
+ }
264
+
265
+ const networkAddress = ip.startAddress().parsedAddress;
266
+ const ipAddress = ip.parsedAddress;
267
+ const result = ipAddress.every((part, idx) => part === networkAddress[idx]);
268
+
269
+ return result;
270
+ },
271
+ )
272
+ .test('cidrs-can-not-overlap', t('ai:Provided CIDRs can not overlap.'), (cidr: string) => {
273
+ try {
274
+ if (cidr && reservedCidrs && reservedCidrs.length > 0) {
275
+ return !overlap(cidr, reservedCidrs);
276
+ }
277
+ } catch {
278
+ return false;
279
+ }
280
+ // passing by default
281
+ return true;
282
+ });
283
+
284
+ export const hostPrefixValidationSchema = (
285
+ clusterNetworkCidr: NetworkConfigurationValues['clusterNetworkCidr'],
286
+ t: TFunction,
287
+ ) => {
288
+ const requiredText = t('ai:Required field');
289
+ const minMaxText = t(
290
+ 'ai:The host prefix is a number between 1 and 32 for IPv4 and between 8 and 128 for IPv6.',
291
+ );
292
+ const netBlock = (clusterNetworkCidr || '').split('/')[1];
293
+ if (!netBlock) {
294
+ return Yup.number().required(requiredText).min(1, minMaxText).max(32, minMaxText);
295
+ }
296
+
297
+ let netBlockNumber = parseInt(netBlock);
298
+ if (isNaN(netBlockNumber)) {
299
+ netBlockNumber = 1;
300
+ }
301
+
302
+ const errorMsgPrefix = t(
303
+ 'ai:The host prefix is a number between size of the cluster network CIDR range',
304
+ );
305
+ const errorMsgIPv4 = t('ai:{{errorMsgPrefix}} ({{netBlockNumber}}) and 25.', {
306
+ errorMsgPrefix,
307
+ netBlockNumber,
308
+ });
309
+ const errorMsgIPv6 = t('ai:{{errorMsgPrefix}} (8) and 128.', { errorMsgPrefix });
310
+
311
+ if (isCIDR.v6(clusterNetworkCidr || '')) {
312
+ return Yup.number().required(requiredText).min(8, errorMsgIPv6).max(128, errorMsgIPv6);
313
+ }
314
+
315
+ if (isCIDR.v4(clusterNetworkCidr || '')) {
316
+ return Yup.number()
317
+ .required(requiredText)
318
+ .min(netBlockNumber, errorMsgIPv4)
319
+ .max(25, errorMsgIPv4);
320
+ }
321
+
322
+ return Yup.number().required(requiredText);
323
+ };
324
+
325
+ export const day2ApiVipValidationSchema = (t: TFunction) =>
326
+ Yup.string().test(
327
+ 'day2-api-vip',
328
+ t('ai:Provide a valid DNS name or IP Address'),
329
+ (value?: string) => {
330
+ if (!value) {
331
+ return true;
332
+ }
333
+ return isIPorDN(value);
334
+ },
335
+ );
336
+
337
+ export const bmcAddressValidationSchema = (t: TFunction) => {
338
+ return Yup.string()
339
+ .required()
340
+ .test(
341
+ 'valid-bmc-address',
342
+ t(
343
+ 'ai:The Value is not valid BMC address, supported protocols are redfish-virtualmedia or idrac-virtualmedia.',
344
+ ),
345
+ (val) => {
346
+ try {
347
+ const url = parseUrl(val);
348
+ return ['redfish-virtualmedia', 'idrac-virtualmedia'].includes(url.protocol as string);
349
+ } catch (error) {
350
+ return false;
351
+ }
352
+ },
353
+ );
354
+ };
@@ -0,0 +1,168 @@
1
+ import { TFunction } from 'i18next';
2
+ import * as Yup from 'yup';
3
+
4
+ import {
5
+ CLUSTER_NAME_MAX_LENGTH,
6
+ clusterNameValidationMessages,
7
+ FORBIDDEN_HOSTNAMES,
8
+ hostnameValidationMessages,
9
+ locationValidationMessages,
10
+ nameValidationMessages,
11
+ } from './constants';
12
+ import { ClusterDetailsValues } from '../components';
13
+ import {
14
+ ALPHANUMERIC_REGEX,
15
+ CLUSTER_NAME_START_END_REGEX,
16
+ CLUSTER_NAME_VALID_CHARS_REGEX,
17
+ DNS_NAME_REGEX,
18
+ HOST_NAME_REGEX,
19
+ LOCATION_CHARS_REGEX,
20
+ NAME_CHARS_REGEX,
21
+ NAME_START_END_REGEX,
22
+ } from './regexes';
23
+
24
+ export const nameValidationSchema = (
25
+ t: TFunction,
26
+ usedClusterNames: string[],
27
+ baseDnsDomain = '',
28
+ validateUniqueName?: boolean,
29
+ isOcm = false,
30
+ ) => {
31
+ const clusterNameValidationMessagesList = clusterNameValidationMessages(t);
32
+ return Yup.string()
33
+ .required(t('ai:Required field'))
34
+ .matches(CLUSTER_NAME_VALID_CHARS_REGEX, {
35
+ message: clusterNameValidationMessagesList.INVALID_VALUE,
36
+ excludeEmptyString: true,
37
+ })
38
+ .matches(CLUSTER_NAME_START_END_REGEX, {
39
+ message: clusterNameValidationMessagesList.INVALID_START_END,
40
+ excludeEmptyString: true,
41
+ })
42
+ .min(
43
+ isOcm ? 1 : 2,
44
+ isOcm
45
+ ? clusterNameValidationMessagesList.INVALID_LENGTH_OCM
46
+ : clusterNameValidationMessagesList.INVALID_LENGTH_ACM,
47
+ )
48
+ .max(
49
+ CLUSTER_NAME_MAX_LENGTH,
50
+ isOcm
51
+ ? clusterNameValidationMessagesList.INVALID_LENGTH_OCM
52
+ : clusterNameValidationMessagesList.INVALID_LENGTH_ACM,
53
+ )
54
+ .when('useRedHatDnsService', {
55
+ is: (useRedHatDnsService: ClusterDetailsValues['useRedHatDnsService']) =>
56
+ useRedHatDnsService === true,
57
+ then: (schema) =>
58
+ schema.test(
59
+ 'is-name-unique',
60
+ clusterNameValidationMessagesList.NOT_UNIQUE,
61
+ (value?: string) => {
62
+ const clusterFullName = `${value || ''}.${baseDnsDomain}`;
63
+ return !value || !usedClusterNames.includes(clusterFullName);
64
+ },
65
+ ),
66
+ otherwise: (schema) =>
67
+ schema.test(
68
+ 'is-name-unique',
69
+ clusterNameValidationMessagesList.NOT_UNIQUE,
70
+ (value?: string) => {
71
+ // in CIM cluster name is ClusterDeployment CR name which must be unique
72
+ return validateUniqueName ? !value || !usedClusterNames.includes(value) : true;
73
+ },
74
+ ),
75
+ });
76
+ };
77
+
78
+ export const richNameValidationSchema = (t: TFunction, usedNames: string[], origName?: string) => {
79
+ const nameValidationMessagesList = nameValidationMessages(t);
80
+ return Yup.string()
81
+ .min(1, nameValidationMessagesList.INVALID_LENGTH)
82
+ .max(253, nameValidationMessagesList.INVALID_LENGTH)
83
+ .test(
84
+ nameValidationMessagesList.INVALID_START_END,
85
+ nameValidationMessagesList.INVALID_START_END,
86
+ (value?: string) => {
87
+ const trimmed = value?.trim();
88
+ if (!trimmed) {
89
+ return true;
90
+ }
91
+ return (
92
+ !!trimmed[0].match(NAME_START_END_REGEX) &&
93
+ (trimmed[trimmed.length - 1]
94
+ ? !!trimmed[trimmed.length - 1].match(NAME_START_END_REGEX)
95
+ : true)
96
+ );
97
+ },
98
+ )
99
+ .matches(HOST_NAME_REGEX, nameValidationMessagesList.INVALID_FORMAT)
100
+ .matches(NAME_CHARS_REGEX, {
101
+ message: nameValidationMessagesList.INVALID_VALUE,
102
+ excludeEmptyString: true,
103
+ })
104
+ .test(nameValidationMessagesList.NOT_UNIQUE, nameValidationMessagesList.NOT_UNIQUE, (value) => {
105
+ if (!value || value === origName) {
106
+ return true;
107
+ }
108
+ return !usedNames.find((n) => n === value);
109
+ })
110
+ .notOneOf(FORBIDDEN_HOSTNAMES, hostnameValidationMessages(t).LOCALHOST_ERR);
111
+ };
112
+
113
+ export const dnsNameValidationSchema = (t: TFunction) =>
114
+ Yup.string()
115
+ .test(
116
+ 'dns-name-label-length',
117
+ t('ai:Single label of the DNS name can not be longer than 63 characters.'),
118
+ (value?: string) => (value || '').split('.').every((label: string) => label.length <= 63),
119
+ )
120
+ .matches(DNS_NAME_REGEX, {
121
+ message: (value) =>
122
+ t('ai:Value "{{value}}" is not valid DNS name. Example: basedomain.example.com', { value }),
123
+ excludeEmptyString: true,
124
+ });
125
+
126
+ export const baseDomainValidationSchema = (t: TFunction) =>
127
+ Yup.string().test(
128
+ 'dns-name-label-length',
129
+ t(
130
+ 'ai:Every single host component in the base domain name cannot contain more than 63 characters and must not contain spaces.',
131
+ ),
132
+ (value?: string) => {
133
+ // Check if the value contains any spaces
134
+ if (/\s/.test(value as string)) {
135
+ return false; // Value contains spaces, validation fails
136
+ }
137
+
138
+ // Check the label lengths
139
+ const labels = (value || '').split('.');
140
+ return labels.every((label: string) => label.length <= 63);
141
+ },
142
+ );
143
+
144
+ export const locationValidationSchema = (t: TFunction) =>
145
+ Yup.string()
146
+ .min(1, locationValidationMessages(t).INVALID_LENGTH)
147
+ .max(63, locationValidationMessages(t).INVALID_LENGTH)
148
+ .test(
149
+ locationValidationMessages(t).INVALID_START_END,
150
+ locationValidationMessages(t).INVALID_START_END,
151
+ (value?: string) => {
152
+ const trimmed = value?.trim();
153
+ if (!trimmed) {
154
+ return true;
155
+ }
156
+ return (
157
+ !!trimmed[0].match(ALPHANUMERIC_REGEX) &&
158
+ (trimmed[trimmed.length - 1]
159
+ ? !!trimmed[trimmed.length - 1].match(ALPHANUMERIC_REGEX)
160
+ : true)
161
+ );
162
+ },
163
+ )
164
+ .matches(LOCATION_CHARS_REGEX, {
165
+ message: locationValidationMessages(t).INVALID_VALUE,
166
+ excludeEmptyString: true,
167
+ })
168
+ .required(t('ai:Location is a required field.'));
@@ -57,12 +57,6 @@ export const locationValidationMessages = (t: TFunction) => ({
57
57
  INVALID_START_END: t('ai:Must start and end with an alphanumeric character'),
58
58
  });
59
59
 
60
- export const bmcAddressValidationMessages = (t: TFunction) => ({
61
- INVALID_VALUE: t(
62
- 'ai:The Value is not valid BMC address, supported protocols are redfish-virtualmedia or idrac-virtualmedia.',
63
- ),
64
- });
65
-
66
60
  export const FORBIDDEN_HOSTNAMES = [
67
61
  'localhost',
68
62
  'localhost.localdomain',
@@ -71,3 +65,6 @@ export const FORBIDDEN_HOSTNAMES = [
71
65
  'localhost6',
72
66
  'localhost6.localdomain6',
73
67
  ];
68
+
69
+ export const getIncorrectFileTypeMessage = (t: TFunction) =>
70
+ t('ai:File type is not supported. File type must be yaml, yml, json, yaml.patch. or yml.patch.');
@@ -0,0 +1,46 @@
1
+ import * as Yup from 'yup';
2
+ import { TFunction } from 'i18next';
3
+ import { FORBIDDEN_HOSTNAMES, hostnameValidationMessages } from './constants';
4
+ import { NAME_START_END_REGEX, NAME_CHARS_REGEX } from './regexes';
5
+
6
+ export const richHostnameValidationSchema = (
7
+ t: TFunction,
8
+ usedNames: string[],
9
+ origName?: string,
10
+ ) => {
11
+ const hostnameValidationMessagesList = hostnameValidationMessages(t);
12
+ return Yup.string()
13
+ .min(1, hostnameValidationMessagesList.INVALID_LENGTH)
14
+ .max(63, hostnameValidationMessagesList.INVALID_LENGTH)
15
+ .test(
16
+ hostnameValidationMessagesList.INVALID_START_END,
17
+ hostnameValidationMessagesList.INVALID_START_END,
18
+ (value?: string) => {
19
+ const trimmed = value?.trim();
20
+ if (!trimmed) {
21
+ return true;
22
+ }
23
+ return (
24
+ !!trimmed[0].match(NAME_START_END_REGEX) &&
25
+ (trimmed[trimmed.length - 1]
26
+ ? !!trimmed[trimmed.length - 1].match(NAME_START_END_REGEX)
27
+ : true)
28
+ );
29
+ },
30
+ )
31
+ .matches(NAME_CHARS_REGEX, {
32
+ message: hostnameValidationMessagesList.INVALID_VALUE,
33
+ excludeEmptyString: true,
34
+ })
35
+ .test(
36
+ hostnameValidationMessagesList.NOT_UNIQUE,
37
+ hostnameValidationMessagesList.NOT_UNIQUE,
38
+ (value) => {
39
+ if (!value || value === origName) {
40
+ return true;
41
+ }
42
+ return !usedNames.find((n) => n === value);
43
+ },
44
+ )
45
+ .notOneOf(FORBIDDEN_HOSTNAMES, hostnameValidationMessagesList.LOCALHOST_ERR);
46
+ };
@@ -0,0 +1,11 @@
1
+ export * from './addressValidation';
2
+ export * from './clusterDetailsValidation';
3
+ export * from './hostnameValidation';
4
+ export * from './networkingValidation';
5
+ export * from './ntpValidation';
6
+ export * from './proxyValidation';
7
+ export * from './pullSecretValidation';
8
+ export * from './sshValidation';
9
+
10
+ export * from './constants';
11
+ export { ALPHANUMERIC_REGEX, LOCATION_CHARS_REGEX } from './regexes';