@openshift-assisted/ui-lib 2.14.0-cim → 2.14.2-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 (199) hide show
  1. package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts +2 -3
  2. package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts.map +1 -1
  3. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +3 -0
  4. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
  5. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
  6. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.d.ts.map +1 -1
  7. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
  8. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.d.ts.map +1 -1
  9. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts +1 -1
  10. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts.map +1 -1
  11. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts +15 -2
  12. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts.map +1 -1
  13. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.d.ts +1 -2
  14. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.d.ts.map +1 -1
  15. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts +1 -2
  16. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts.map +1 -1
  17. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.d.ts +8 -7
  18. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.d.ts.map +1 -1
  19. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  20. package/build/@types/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.d.ts +17 -0
  21. package/build/@types/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.d.ts.map +1 -0
  22. package/build/@types/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.d.ts +8 -0
  23. package/build/@types/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.d.ts.map +1 -0
  24. package/build/@types/cim/components/ClusterDeployment/components/ValidationSection.d.ts +16 -0
  25. package/build/@types/cim/components/ClusterDeployment/components/ValidationSection.d.ts.map +1 -0
  26. package/build/@types/cim/components/ClusterDeployment/constants.d.ts +2 -0
  27. package/build/@types/cim/components/ClusterDeployment/constants.d.ts.map +1 -1
  28. package/build/@types/cim/components/ClusterDeployment/index.d.ts +1 -2
  29. package/build/@types/cim/components/ClusterDeployment/index.d.ts.map +1 -1
  30. package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +1 -11
  31. package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts.map +1 -1
  32. package/build/@types/cim/components/ClusterDeployment/types.d.ts +7 -9
  33. package/build/@types/cim/components/ClusterDeployment/types.d.ts.map +1 -1
  34. package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts +8 -2
  35. package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
  36. package/build/@types/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.d.ts.map +1 -1
  37. package/build/@types/cim/components/Hypershift/types.d.ts +6 -3
  38. package/build/@types/cim/components/Hypershift/types.d.ts.map +1 -1
  39. package/build/@types/cim/components/InfraEnv/InfraEnvAgentTable.d.ts.map +1 -1
  40. package/build/@types/cim/components/common/constants.d.ts.map +1 -1
  41. package/build/@types/cim/components/helpers/agents.d.ts +3 -0
  42. package/build/@types/cim/components/helpers/agents.d.ts.map +1 -1
  43. package/build/@types/cim/components/helpers/toAssisted.d.ts.map +1 -1
  44. package/build/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
  45. package/build/@types/cim/components/modals/EditAgentModal.d.ts.map +1 -1
  46. package/build/@types/cim/components/modals/ScaleUpModal.d.ts +3 -0
  47. package/build/@types/cim/components/modals/ScaleUpModal.d.ts.map +1 -1
  48. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +1 -0
  49. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
  50. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +7 -0
  51. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -0
  52. package/build/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
  53. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  54. package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts.map +1 -1
  55. package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
  56. package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  57. package/build/@types/common/components/hosts/EditHostForm.d.ts.map +1 -1
  58. package/build/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
  59. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -0
  60. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts.map +1 -1
  61. package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js +9 -7
  62. package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js.map +1 -1
  63. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +26 -1
  64. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
  65. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +13 -29
  66. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
  67. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js +2 -12
  68. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js.map +1 -1
  69. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js +50 -26
  70. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js.map +1 -1
  71. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js +3 -3
  72. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js.map +1 -1
  73. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js +39 -21
  74. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js.map +1 -1
  75. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js +58 -27
  76. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js.map +1 -1
  77. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.js +24 -24
  78. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.js.map +1 -1
  79. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js +26 -42
  80. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js.map +1 -1
  81. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.js +12 -8
  82. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.js.map +1 -1
  83. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +4 -5
  84. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  85. package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js +5 -5
  86. package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js.map +1 -1
  87. package/build/cjs/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.js +50 -0
  88. package/build/cjs/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.js.map +1 -0
  89. package/build/cjs/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.js +24 -0
  90. package/build/cjs/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.js.map +1 -0
  91. package/build/cjs/cim/components/ClusterDeployment/components/ValidationSection.js +17 -0
  92. package/build/cjs/cim/components/ClusterDeployment/components/ValidationSection.js.map +1 -0
  93. package/build/cjs/cim/components/ClusterDeployment/constants.js +2 -0
  94. package/build/cjs/cim/components/ClusterDeployment/constants.js.map +1 -1
  95. package/build/cjs/cim/components/ClusterDeployment/index.js +2 -5
  96. package/build/cjs/cim/components/ClusterDeployment/index.js.map +1 -1
  97. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +1 -14
  98. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
  99. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +2 -2
  100. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
  101. package/build/cjs/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.js +6 -4
  102. package/build/cjs/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.js.map +1 -1
  103. package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js +2 -12
  104. package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js.map +1 -1
  105. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js +1 -1
  106. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js.map +1 -1
  107. package/build/cjs/cim/components/common/constants.js +1 -1
  108. package/build/cjs/cim/components/common/constants.js.map +1 -1
  109. package/build/cjs/cim/components/helpers/agents.js +19 -1
  110. package/build/cjs/cim/components/helpers/agents.js.map +1 -1
  111. package/build/cjs/cim/components/helpers/toAssisted.js +25 -22
  112. package/build/cjs/cim/components/helpers/toAssisted.js.map +1 -1
  113. package/build/cjs/cim/components/modals/AddHostModal.js +4 -5
  114. package/build/cjs/cim/components/modals/AddHostModal.js.map +1 -1
  115. package/build/cjs/cim/components/modals/EditAgentModal.js +2 -2
  116. package/build/cjs/cim/components/modals/EditAgentModal.js.map +1 -1
  117. package/build/cjs/cim/components/modals/ScaleUpModal.js +3 -2
  118. package/build/cjs/cim/components/modals/ScaleUpModal.js.map +1 -1
  119. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +41 -0
  120. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -0
  121. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +4 -5
  122. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
  123. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js +5 -5
  124. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js.map +1 -1
  125. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -0
  126. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  127. package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js +14 -18
  128. package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js.map +1 -1
  129. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +4 -4
  130. package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
  131. package/build/cjs/common/components/hosts/EditHostForm.js +3 -3
  132. package/build/cjs/common/components/hosts/EditHostForm.js.map +1 -1
  133. package/build/cjs/common/components/ui/formik/validationSchemas.js +18 -15
  134. package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
  135. package/build/cjs/common/config/constants.js +1 -1
  136. package/build/cjs/common/config/constants.js.map +1 -1
  137. package/lib/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.tsx +11 -9
  138. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +63 -3
  139. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +25 -53
  140. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.tsx +7 -16
  141. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.tsx +102 -59
  142. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.tsx +16 -10
  143. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.tsx +84 -48
  144. package/lib/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.tsx +106 -54
  145. package/lib/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.tsx +96 -85
  146. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizard.tsx +109 -119
  147. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.tsx +27 -14
  148. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +4 -6
  149. package/lib/cim/components/ClusterDeployment/NetworkConfiguration.tsx +5 -5
  150. package/lib/cim/components/ClusterDeployment/components/ClusterDeploymentHostsSelectionAdvanced.tsx +107 -0
  151. package/lib/cim/components/ClusterDeployment/components/ClusterScaleUpAutoHostsSelection.tsx +49 -0
  152. package/lib/cim/components/ClusterDeployment/components/ValidationSection.tsx +41 -0
  153. package/lib/cim/components/ClusterDeployment/constants.ts +3 -1
  154. package/lib/cim/components/ClusterDeployment/index.ts +1 -3
  155. package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +1 -26
  156. package/lib/cim/components/ClusterDeployment/types.ts +7 -10
  157. package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +3 -3
  158. package/lib/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.tsx +4 -2
  159. package/lib/cim/components/Hypershift/types.ts +6 -3
  160. package/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx +7 -16
  161. package/lib/cim/components/InfraEnv/OpenshiftVersionDropdown.tsx +1 -1
  162. package/lib/cim/components/common/constants.ts +1 -2
  163. package/lib/cim/components/helpers/agents.ts +30 -1
  164. package/lib/cim/components/helpers/toAssisted.ts +13 -8
  165. package/lib/cim/components/modals/AddHostModal.tsx +4 -5
  166. package/lib/cim/components/modals/EditAgentModal.tsx +2 -1
  167. package/lib/cim/components/modals/ScaleUpModal.tsx +12 -2
  168. package/lib/cim/types/k8s/infra-env-k8s-resource.ts +1 -0
  169. package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +93 -0
  170. package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +10 -12
  171. package/lib/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.tsx +9 -9
  172. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -0
  173. package/lib/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.tsx +50 -61
  174. package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +4 -4
  175. package/lib/common/components/clusterWizard/types.ts +1 -0
  176. package/lib/common/components/hosts/EditHostForm.tsx +16 -6
  177. package/lib/common/components/ui/formik/validationSchemas.ts +13 -10
  178. package/lib/common/config/constants.ts +1 -1
  179. package/package.json +4 -3
  180. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.d.ts +0 -10
  181. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.d.ts.map +0 -1
  182. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.d.ts +0 -13
  183. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.d.ts.map +0 -1
  184. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts +0 -4
  185. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts.map +0 -1
  186. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.d.ts +0 -7
  187. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.d.ts.map +0 -1
  188. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.js +0 -31
  189. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.js.map +0 -1
  190. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.js +0 -50
  191. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.js.map +0 -1
  192. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js +0 -35
  193. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.js.map +0 -1
  194. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.js +0 -9
  195. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.js.map +0 -1
  196. package/lib/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.tsx +0 -79
  197. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.tsx +0 -128
  198. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.tsx +0 -81
  199. package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.tsx +0 -13
@@ -1,68 +1,11 @@
1
1
  import React from 'react';
2
2
  import { Alert, AlertActionLink, AlertVariant, Popover } from '@patternfly/react-core';
3
- import { HostSubnet, HostSubnets } from '../../../types/clusters';
4
- import { Cluster, Host } from '@openshift-assisted/types/assisted-installer-service';
3
+ import { HostSubnets } from '../../../types/clusters';
4
+ import { Host } from '@openshift-assisted/types/assisted-installer-service';
5
5
  import { SelectField } from '../../ui';
6
6
  import { NO_SUBNET_SET } from '../../../config';
7
7
  import { useTranslation } from '../../../hooks/use-translation-wrapper';
8
8
 
9
- interface SubnetHelperTextProps {
10
- matchingSubnet: HostSubnet;
11
- hosts: Cluster['hosts'];
12
- }
13
-
14
- const SubnetHelperText = ({ matchingSubnet, hosts }: SubnetHelperTextProps) => {
15
- const { t } = useTranslation();
16
- const excludedHosts =
17
- hosts?.filter(
18
- (host) =>
19
- !['disabled', 'disconnected'].includes(host.status) &&
20
- !matchingSubnet.hostIDs.includes(host.requestedHostname || ''),
21
- ) || [];
22
-
23
- // Workaround for bug in CIM backend. hostIDs are empty
24
- if (excludedHosts.length === 0 || !matchingSubnet.hostIDs.length) {
25
- return null;
26
- }
27
-
28
- const actionLinks = (
29
- <Popover
30
- position="right"
31
- bodyContent={
32
- <ul>
33
- {excludedHosts
34
- .sort(
35
- (hostA, hostB) =>
36
- hostA.requestedHostname?.localeCompare(hostB.requestedHostname || '') || 0,
37
- )
38
- .map((host) => (
39
- <li key={host.id}>{host.requestedHostname || host.id}</li>
40
- ))}
41
- </ul>
42
- }
43
- minWidth="30rem"
44
- maxWidth="50rem"
45
- >
46
- <AlertActionLink id="form-input-hostSubnet-field-helper-view-excluded">
47
- {t('ai:View {{count}} affected host', {
48
- count: excludedHosts.length,
49
- })}
50
- </AlertActionLink>
51
- </Popover>
52
- );
53
-
54
- return (
55
- <Alert
56
- title={t('ai:This subnet range is not available on all hosts')}
57
- variant={AlertVariant.warning}
58
- actionLinks={actionLinks}
59
- isInline
60
- >
61
- {t('ai:Hosts outside of this range will not be included in the new cluster.')}
62
- </Alert>
63
- );
64
- };
65
-
66
9
  export interface AvailableSubnetsControlProps {
67
10
  hostSubnets: HostSubnets;
68
11
  hosts: Host[];
@@ -79,14 +22,60 @@ export const AvailableSubnetsControl = ({
79
22
  const { t } = useTranslation();
80
23
  const getHelperText = (value: string) => {
81
24
  const matchingSubnet = hostSubnets.find((hn) => hn.subnet === value);
82
- if (matchingSubnet) {
25
+ if (matchingSubnet && isMultiNodeCluster) {
26
+ const excludedHosts =
27
+ hosts?.filter(
28
+ (host) =>
29
+ !['disabled', 'disconnected'].includes(host.status) &&
30
+ !matchingSubnet.hostIDs.includes(host.requestedHostname || ''),
31
+ ) || [];
32
+
33
+ // Workaround for bug in CIM backend. hostIDs are empty
34
+ if (excludedHosts.length === 0 || !matchingSubnet.hostIDs.length) {
35
+ return undefined;
36
+ }
37
+
38
+ const actionLinks = (
39
+ <Popover
40
+ position="right"
41
+ bodyContent={
42
+ <ul>
43
+ {excludedHosts
44
+ .sort(
45
+ (hostA, hostB) =>
46
+ hostA.requestedHostname?.localeCompare(hostB.requestedHostname || '') || 0,
47
+ )
48
+ .map((host) => (
49
+ <li key={host.id}>{host.requestedHostname || host.id}</li>
50
+ ))}
51
+ </ul>
52
+ }
53
+ minWidth="30rem"
54
+ maxWidth="50rem"
55
+ >
56
+ <AlertActionLink id="form-input-hostSubnet-field-helper-view-excluded">
57
+ {t('ai:View {{count}} affected host', {
58
+ count: excludedHosts.length,
59
+ })}
60
+ </AlertActionLink>
61
+ </Popover>
62
+ );
63
+
83
64
  return (
84
- isMultiNodeCluster && <SubnetHelperText matchingSubnet={matchingSubnet} hosts={hosts} />
65
+ <Alert
66
+ title={t('ai:This subnet range is not available on all hosts')}
67
+ variant={AlertVariant.warning}
68
+ actionLinks={actionLinks}
69
+ isInline
70
+ >
71
+ {t('ai:Hosts outside of this range will not be included in the new cluster.')}
72
+ </Alert>
85
73
  );
86
74
  }
87
75
 
88
76
  return undefined;
89
77
  };
78
+
90
79
  const hostSubnetLength = hostSubnets.length;
91
80
  return (
92
81
  <SelectField
@@ -122,7 +122,7 @@ export const VirtualIPControlGroup = ({
122
122
  <>
123
123
  <FormikStaticField
124
124
  label={t('ai:API IP')}
125
- name="apiVip"
125
+ name="apiVips.0.ip"
126
126
  helperText={apiVipHelperText}
127
127
  value={selectApiVip(cluster)}
128
128
  isValid={!apiVipFailedValidationMessage}
@@ -136,7 +136,7 @@ export const VirtualIPControlGroup = ({
136
136
  </FormikStaticField>
137
137
  <FormikStaticField
138
138
  label={t('ai:Ingress IP')}
139
- name="ingressVip"
139
+ name="ingressVips.0.ip"
140
140
  helperText={ingressVipHelperText}
141
141
  value={selectIngressVip(cluster)}
142
142
  isValid={!ingressVipFailedValidationMessage}
@@ -153,13 +153,13 @@ export const VirtualIPControlGroup = ({
153
153
  <>
154
154
  <InputField
155
155
  label={t('ai:API IP')}
156
- name="apiVip"
156
+ name="apiVips.0.ip"
157
157
  helperText={apiVipHelperText}
158
158
  isRequired
159
159
  isDisabled={!hostSubnets.length || values.hostSubnet === NO_SUBNET_SET}
160
160
  />
161
161
  <InputField
162
- name="ingressVip"
162
+ name="ingressVips.0.ip"
163
163
  label={t('ai:Ingress IP')}
164
164
  helperText={ingressVipHelperText}
165
165
  isRequired
@@ -34,6 +34,7 @@ export type ClusterDetailsValues = {
34
34
  platform: PlatformType;
35
35
  customOpenshiftSelect: OpenshiftVersionOptionType | null;
36
36
  userManagedNetworking: boolean;
37
+ controlPlaneCount: number;
37
38
  };
38
39
 
39
40
  export type HostsValidationsProps<S extends string, V extends string[]> = {
@@ -56,6 +56,7 @@ const EditHostForm = ({
56
56
  onHostSaveError,
57
57
  getEditErrorMessage,
58
58
  }: EditHostFormProps) => {
59
+ const { t } = useTranslation();
59
60
  const hostnameInputRef = React.useRef<HTMLInputElement>();
60
61
  const [isSaveInProgress, setIsSaveInProgress] = React.useState<boolean>(false);
61
62
 
@@ -71,7 +72,7 @@ const EditHostForm = ({
71
72
  hostId: host.id,
72
73
  hostname: requestedHostname || '',
73
74
  };
74
- const { t } = useTranslation();
75
+
75
76
  return (
76
77
  <Formik
77
78
  validateOnMount
@@ -110,11 +111,19 @@ const EditHostForm = ({
110
111
  status={status as StatusErrorType}
111
112
  onClose={() => setStatus({ error: null })}
112
113
  />
113
- <Alert
114
- variant={AlertVariant.info}
115
- title={t('ai:This name will replace the original discovered hostname.')}
116
- isInline
117
- />
114
+ {canHostnameBeChanged(host.status) ? (
115
+ <Alert
116
+ variant={AlertVariant.info}
117
+ title={t('ai:This name will replace the original discovered hostname.')}
118
+ isInline
119
+ />
120
+ ) : (
121
+ <Alert
122
+ variant={AlertVariant.warning}
123
+ title={t('ai:The hostname cannot be changed.')}
124
+ isInline
125
+ />
126
+ )}
118
127
  <StaticTextField name="discoveredHostname" label={t('ai:Discovered hostname')}>
119
128
  {hostname || ''}
120
129
  </StaticTextField>
@@ -134,6 +143,7 @@ const EditHostForm = ({
134
143
  data-testid="change-hostname-form__button-change"
135
144
  type={ButtonType.submit}
136
145
  isDisabled={isSubmitting || !isValid || !dirty}
146
+ isLoading={isSubmitting}
137
147
  >
138
148
  {t('ai:Change')}
139
149
  </Button>
@@ -3,6 +3,8 @@ import { Address4, Address6 } from 'ip-address';
3
3
  import isCIDR from 'is-cidr';
4
4
  import { isInSubnet } from 'is-in-subnet';
5
5
  import * as Yup from 'yup';
6
+ import { head } from 'lodash-es';
7
+ import parseUrl from 'parse-url';
6
8
 
7
9
  import { TFunction } from 'i18next';
8
10
  import {
@@ -27,7 +29,6 @@ import {
27
29
  } from './constants';
28
30
  import { allSubnetsIPv4, getAddress, trimCommaSeparatedList, trimSshPublicKey } from './utils';
29
31
  import { selectApiVip, selectIngressVip } from '../../../selectors';
30
- import { head } from 'lodash-es';
31
32
  import { ClusterDetailsValues } from '../../clusterWizard/types';
32
33
 
33
34
  const ALPHANUMERIC_REGEX = /^[a-zA-Z0-9]+$/;
@@ -45,10 +46,6 @@ const IP_V4_ZERO = '0.0.0.0';
45
46
  const IP_V6_ZERO = '0000:0000:0000:0000:0000:0000:0000:0000';
46
47
  const MAC_REGEX = /^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/;
47
48
  const HOST_NAME_REGEX = /^[^.]{1,63}(?:[.][^.]{1,63})*$/;
48
-
49
- // Source of information: https://github.com/metal3-io/baremetal-operator/blob/main/docs/api.md#baremetalhost-spec
50
- const BMC_REGEX =
51
- /^((redfish-virtualmedia|idrac-virtualmedia)(\+https?)?:(\/\/([a-z0-9\-._~%!$&'()*+,;=]+@)?([a-z0-9\-._~%]+|\[[a-f0-9:.]+\]|\[v[a-f0-9][a-z0-9\-._~%!$&'()*+,;=:]+\])(:[0-9]+)?(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?|(\/?[a-z0-9\-._~%!$&'()*+,;=:@]+(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?)?)|([a-z0-9\-._~%!$&'()*+,;=@]+(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?|(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?))(\?[a-z0-9\-._~%!$&'()*+,;=:@/?]*)?(#[a-z0-9\-._~%!$&'()*+,;=:@/?]*)?$/i;
52
49
  const LOCATION_CHARS_REGEX = /^[a-zA-Z0-9-._]*$/;
53
50
 
54
51
  export const nameValidationSchema = (
@@ -318,7 +315,7 @@ export const vipArrayValidationSchema = <T extends Yup.Maybe<Yup.AnyObject>>(
318
315
  values: NetworkConfigurationValues,
319
316
  initialValues?: ApiVip[] | IngressVip[],
320
317
  ) =>
321
- (values.apiVips?.length && values.managedNetworkingType === 'clusterManaged'
318
+ (values.managedNetworkingType === 'clusterManaged'
322
319
  ? Yup.array<T>().of(
323
320
  Yup.object({
324
321
  clusterId: Yup.string(),
@@ -643,10 +640,16 @@ export const day2ApiVipValidationSchema = Yup.string().test(
643
640
  export const bmcAddressValidationSchema = (t: TFunction) => {
644
641
  const bmcAddressValidationMessagesList = bmcAddressValidationMessages(t);
645
642
 
646
- return Yup.string().required().matches(BMC_REGEX, {
647
- message: bmcAddressValidationMessagesList.INVALID_VALUE,
648
- excludeEmptyString: true,
649
- });
643
+ return Yup.string()
644
+ .required()
645
+ .test('valid-bmc-address', bmcAddressValidationMessagesList.INVALID_VALUE, (val) => {
646
+ try {
647
+ const url = parseUrl(val);
648
+ return ['redfish-virtualmedia', 'idrac-virtualmedia'].includes(url.protocol as string);
649
+ } catch (error) {
650
+ return false;
651
+ }
652
+ });
650
653
  };
651
654
  export const locationValidationSchema = (t: TFunction) => {
652
655
  const locationValidationMessagesList = locationValidationMessages(t);
@@ -33,7 +33,7 @@ export const hostRoles = (t: TFunction): HostRole[] => [
33
33
  },
34
34
  {
35
35
  value: 'worker',
36
- label: t('ai:Worker'),
36
+ label: t('ai:Worker', { count: 1 }),
37
37
  description: t(
38
38
  'ai:Runs application workloads. Connect at least 5 hosts to enable dedicated workers.',
39
39
  ),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.14.0-cim",
4
- "@openshift-assisted/types": "2.14.0-cim",
3
+ "@openshift-assisted/locales": "2.14.2-cim",
4
+ "@openshift-assisted/types": "2.14.2-cim",
5
5
  "@openshift-console/dynamic-plugin-sdk": "0.0.3",
6
6
  "@patternfly/patternfly": "5.2.0",
7
7
  "@patternfly/react-code-editor": "5.2.0",
@@ -25,6 +25,7 @@
25
25
  "is-in-subnet": "^4",
26
26
  "js-yaml": "^4.1.0",
27
27
  "lodash-es": "^4.17.21",
28
+ "parse-url": "^9.2.0",
28
29
  "prism-react-renderer": "^1.1.1",
29
30
  "react-error-boundary": "^3.1.4",
30
31
  "react-measure": "^2.5.2",
@@ -139,5 +140,5 @@
139
140
  ]
140
141
  }
141
142
  },
142
- "version": "2.14.0-cim"
143
+ "version": "2.14.2-cim"
143
144
  }
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { AgentClusterInstallK8sResource } from '../../types';
3
- type ClusterDeploymentCreateProgressProps = {
4
- agentClusterInstall: AgentClusterInstallK8sResource;
5
- toDetails: VoidFunction;
6
- toListView: VoidFunction;
7
- };
8
- declare const ClusterDeploymentCreateProgress: React.FC<ClusterDeploymentCreateProgressProps>;
9
- export default ClusterDeploymentCreateProgress;
10
- //# sourceMappingURL=ClusterDeploymentCreateProgress.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentCreateProgress.d.ts","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAO7D,KAAK,oCAAoC,GAAG;IAC1C,mBAAmB,EAAE,8BAA8B,CAAC;IACpD,SAAS,EAAE,YAAY,CAAC;IACxB,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,+BAA+B,EAAE,KAAK,CAAC,EAAE,CAAC,oCAAoC,CAiDnF,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { WizardFooter, WizardFooterGenericProps } from '../../../common';
3
- import { AgentClusterInstallK8sResource } from '../../types/k8s/agent-cluster-install';
4
- import { AgentK8sResource } from '../../types/k8s/agent';
5
- type ClusterDeploymentWizardFooterProps = React.ComponentProps<typeof WizardFooter> & WizardFooterGenericProps & {
6
- agentClusterInstall?: AgentClusterInstallK8sResource;
7
- agents?: AgentK8sResource[];
8
- showClusterErrors?: boolean;
9
- onSyncError?: VoidFunction;
10
- };
11
- declare const ClusterDeploymentWizardFooter: React.FC<ClusterDeploymentWizardFooterProps>;
12
- export default ClusterDeploymentWizardFooter;
13
- //# sourceMappingURL=ClusterDeploymentWizardFooter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardFooter.d.ts","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAEZ,wBAAwB,EAEzB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAqCzD,KAAK,kCAAkC,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,GACjF,wBAAwB,GAAG;IACzB,mBAAmB,CAAC,EAAE,8BAA8B,CAAC;IACrD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEJ,QAAA,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,kCAAkC,CAiE/E,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const ClusterDeploymentWizardNavigation: React.FC<{}>;
3
- export default ClusterDeploymentWizardNavigation;
4
- //# sourceMappingURL=ClusterDeploymentWizardNavigation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardNavigation.d.ts","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,QAAA,MAAM,iCAAiC,EAAE,KAAK,CAAC,EAAE,CAAC,EAEjD,CAiEA,CAAC;AAEF,eAAe,iCAAiC,CAAC"}
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- type ClusterDeploymentWizardStepProps = {
3
- footer: React.ReactNode;
4
- };
5
- declare const ClusterDeploymentWizardStep: React.FC<ClusterDeploymentWizardStepProps>;
6
- export default ClusterDeploymentWizardStep;
7
- //# sourceMappingURL=ClusterDeploymentWizardStep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardStep.d.ts","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,gCAAgC,GAAG;IACtC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAEF,QAAA,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAE3E,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const React = tslib_1.__importStar(require("react"));
5
- const check_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/check-circle-icon");
6
- const global_palette_green_500_1 = require("@patternfly/react-tokens/dist/js/global_palette_green_500");
7
- const react_core_1 = require("@patternfly/react-core");
8
- const helpers_1 = require("./helpers");
9
- const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
10
- const GreenCheckCircleIcon = (props) => (React.createElement(check_circle_icon_1.CheckCircleIcon, Object.assign({}, props, { color: global_palette_green_500_1.global_palette_green_500.value })));
11
- const ClusterDeploymentCreateProgress = ({ agentClusterInstall, toDetails, toListView, }) => {
12
- const { t } = (0, use_translation_wrapper_1.useTranslation)();
13
- return (React.createElement(react_core_1.Bullseye, null,
14
- React.createElement(react_core_1.EmptyState, null,
15
- (0, helpers_1.isInstallationReady)(agentClusterInstall) ? (React.createElement(React.Fragment, null,
16
- React.createElement(react_core_1.EmptyStateIcon, { icon: GreenCheckCircleIcon }),
17
- React.createElement(react_core_1.Title, { headingLevel: "h4", size: "lg" }, t('ai:Cluster is ready for installation')),
18
- React.createElement(react_core_1.EmptyStateBody, null,
19
- React.createElement("div", null, t('ai:This cluster has been created and is ready to begin installation.')),
20
- React.createElement("div", null, t('ai:To see the status of the installation see the details page.'))))) : (React.createElement(React.Fragment, null,
21
- React.createElement(react_core_1.EmptyStateIcon, { icon: react_core_1.Spinner }),
22
- React.createElement(react_core_1.Title, { headingLevel: "h4", size: "lg" }, t('ai:Preparing cluster installation')),
23
- React.createElement(react_core_1.EmptyStateBody, null,
24
- React.createElement("div", null, t('ai:This cluster is in the process of getting ready to start installation.')),
25
- React.createElement("div", null, t('ai:If you exit this flow you can see its status in the list view or details page.'))))),
26
- React.createElement(react_core_1.EmptyStateActions, null,
27
- React.createElement(react_core_1.Button, { variant: "primary", onClick: toDetails }, t('ai:See cluster details')),
28
- React.createElement(react_core_1.Button, { variant: "link", onClick: toListView }, t('ai:Go to cluster list'))))));
29
- };
30
- exports.default = ClusterDeploymentCreateProgress;
31
- //# sourceMappingURL=ClusterDeploymentCreateProgress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentCreateProgress.js","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,+FAA0F;AAC1F,wGAAgH;AAChH,uDASgC;AAChC,uCAAgD;AAEhD,2FAA+E;AAE/E,MAAM,oBAAoB,GAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CAChD,oBAAC,mCAAe,oBAAK,KAAK,IAAE,KAAK,EAAE,mDAAO,CAAC,KAAK,IAAI,CACrD,CAAC;AAQF,MAAM,+BAA+B,GAAmD,CAAC,EACvF,mBAAmB,EACnB,SAAS,EACT,UAAU,GACX,EAAE,EAAE;IACH,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,wCAAc,GAAE,CAAC;IAC/B,OAAO,CACL,oBAAC,qBAAQ;QACP,oBAAC,uBAAU;YACR,IAAA,6BAAmB,EAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAC1C;gBACE,oBAAC,2BAAc,IAAC,IAAI,EAAE,oBAAoB,GAAI;gBAC9C,oBAAC,kBAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,IAC/B,CAAC,CAAC,sCAAsC,CAAC,CACpC;gBACR,oBAAC,2BAAc;oBACb,iCAAM,CAAC,CAAC,sEAAsE,CAAC,CAAO;oBACtF,iCAAM,CAAC,CAAC,gEAAgE,CAAC,CAAO,CACjE,CAChB,CACJ,CAAC,CAAC,CAAC,CACF;gBACE,oBAAC,2BAAc,IAAC,IAAI,EAAE,oBAAO,GAAI;gBACjC,oBAAC,kBAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,IAC/B,CAAC,CAAC,mCAAmC,CAAC,CACjC;gBACR,oBAAC,2BAAc;oBACb,iCACG,CAAC,CAAC,2EAA2E,CAAC,CAC3E;oBACN,iCACG,CAAC,CACA,mFAAmF,CACpF,CACG,CACS,CAChB,CACJ;YACD,oBAAC,8BAAiB;gBAChB,oBAAC,mBAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,SAAS,IACzC,CAAC,CAAC,wBAAwB,CAAC,CACrB;gBACT,oBAAC,mBAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,UAAU,IACvC,CAAC,CAAC,uBAAuB,CAAC,CACpB,CACS,CACT,CACJ,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,+BAA+B,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
- const react_core_1 = require("@patternfly/react-core");
6
- const common_1 = require("../../../common");
7
- const ClusterDeploymentWizardContext_1 = tslib_1.__importDefault(require("./ClusterDeploymentWizardContext"));
8
- const wizardTransition_1 = require("./wizardTransition");
9
- const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
10
- const ValidationsRunningAlert_1 = tslib_1.__importDefault(require("../common/ValidationsRunningAlert"));
11
- const ValidationSection = ({ currentStepId, clusterStatus, validationsInfo, hosts, children, }) => {
12
- return (react_1.default.createElement(react_core_1.AlertGroup, null,
13
- children,
14
- clusterStatus && (react_1.default.createElement(common_1.ClusterWizardStepValidationsAlert, { currentStepId: currentStepId, clusterStatus: clusterStatus, hosts: hosts, validationsInfo: validationsInfo, wizardStepsValidationsMap: wizardTransition_1.wizardStepsValidationsMap },
15
- react_1.default.createElement(ValidationsRunningAlert_1.default, null)))));
16
- };
17
- const ClusterDeploymentWizardFooter = (_a) => {
18
- var _b, _c, _d, _e, _f, _g;
19
- var { agentClusterInstall, agents, showClusterErrors, children, onSyncError, isNextDisabled } = _a, rest = tslib_1.__rest(_a, ["agentClusterInstall", "agents", "showClusterErrors", "children", "onSyncError", "isNextDisabled"]);
20
- const { alerts } = (0, common_1.useAlerts)();
21
- const { currentStepId } = react_1.default.useContext(ClusterDeploymentWizardContext_1.default);
22
- const clusterStatus = showClusterErrors
23
- ? (_c = (_b = agentClusterInstall === null || agentClusterInstall === void 0 ? void 0 : agentClusterInstall.status) === null || _b === void 0 ? void 0 : _b.debugInfo) === null || _c === void 0 ? void 0 : _c.state
24
- : undefined;
25
- const validationsInfo = showClusterErrors
26
- ? (_d = agentClusterInstall === null || agentClusterInstall === void 0 ? void 0 : agentClusterInstall.status) === null || _d === void 0 ? void 0 : _d.validationsInfo
27
- : undefined;
28
- const hosts = react_1.default.useMemo(() => (agents || []).reduce((result, agent) => {
29
- var _a, _b, _c;
30
- const status = (_b = (_a = agent.status) === null || _a === void 0 ? void 0 : _a.debugInfo) === null || _b === void 0 ? void 0 : _b.state;
31
- if (status) {
32
- result.push({ status, validationsInfo: (_c = agent.status) === null || _c === void 0 ? void 0 : _c.validationsInfo });
33
- }
34
- return result;
35
- }, []), [agents]);
36
- const syncError = (_g = (_f = (_e = agentClusterInstall === null || agentClusterInstall === void 0 ? void 0 : agentClusterInstall.status) === null || _e === void 0 ? void 0 : _e.conditions) === null || _f === void 0 ? void 0 : _f.find((c) => c.type === 'SpecSynced' && c.status === 'False')) === null || _g === void 0 ? void 0 : _g.message;
37
- const { t } = (0, use_translation_wrapper_1.useTranslation)();
38
- react_1.default.useEffect(() => {
39
- if (syncError && onSyncError) {
40
- onSyncError();
41
- }
42
- }, [syncError, onSyncError]);
43
- const alertsSection = alerts.length ? react_1.default.createElement(common_1.Alerts, null) : undefined;
44
- const errorsSection = (react_1.default.createElement(ValidationSection, { currentStepId: currentStepId, clusterStatus: clusterStatus, validationsInfo: validationsInfo, hosts: hosts },
45
- syncError && (react_1.default.createElement(react_core_1.Alert, { variant: react_core_1.AlertVariant.danger, title: t('ai:An error occured'), isInline: true }, syncError)),
46
- children));
47
- return (react_1.default.createElement(common_1.WizardFooter, Object.assign({ alerts: alertsSection, errors: errorsSection, isNextDisabled: isNextDisabled || !!syncError }, rest)));
48
- };
49
- exports.default = ClusterDeploymentWizardFooter;
50
- //# sourceMappingURL=ClusterDeploymentWizardFooter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardFooter.js","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,uDAAyE;AACzE,4CAMyB;AACzB,8GAA8E;AAI9E,yDAAuF;AAGvF,2FAA+E;AAC/E,wGAAwE;AAUxE,MAAM,iBAAiB,GAAqC,CAAC,EAC3D,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,8BAAC,uBAAU;QACR,QAAQ;QACR,aAAa,IAAI,CAChB,8BAAC,0CAAiC,IAChC,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,yBAAyB,EAAE,4CAAyB;YAEpD,8BAAC,iCAAuB,OAAG,CACO,CACrC,CACU,CACd,CAAC;AACJ,CAAC,CAAC;AAUF,MAAM,6BAA6B,GAAiD,CAAC,EAQpF,EAAE,EAAE;;QARgF,EACnF,mBAAmB,EACnB,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,cAAc,OAEf,EADI,IAAI,sBAP4E,mGAQpF,CADQ;IAEP,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC/B,MAAM,EAAE,aAAa,EAAE,GAAG,eAAK,CAAC,UAAU,CAAC,wCAA8B,CAAC,CAAC;IAC3E,MAAM,aAAa,GAAG,iBAAiB;QACrC,CAAC,CAAC,MAAA,MAAA,mBAAmB,aAAnB,mBAAmB,uBAA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,CAAC,CAAC,8BAAC,eAAM,OAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,MAAM,aAAa,GAAG,CACpB,8BAAC,iBAAiB,IAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,KAAK;QAEX,SAAS,IAAI,CACZ,8BAAC,kBAAK,IAAC,OAAO,EAAE,yBAAY,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,QAAQ,UAC3E,SAAS,CACJ,CACT;QACA,QAAQ,CACS,CACrB,CAAC;IAEF,OAAO,CACL,8BAAC,qBAAY,kBACX,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,IAAI,CAAC,CAAC,SAAS,IACzC,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,6BAA6B,CAAC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
- const deprecated_1 = require("@patternfly/react-core/deprecated");
6
- const common_1 = require("../../../common");
7
- const constants_1 = require("./constants");
8
- const ClusterDeploymentWizardContext_1 = tslib_1.__importDefault(require("./ClusterDeploymentWizardContext"));
9
- const helpers_1 = require("./helpers");
10
- const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
11
- const wizardSteps = Object.keys(constants_1.wizardStepNames);
12
- const ClusterDeploymentWizardNavigation = () => {
13
- const { currentStepId, setCurrentStepId, clusterDeployment } = react_1.default.useContext(ClusterDeploymentWizardContext_1.default);
14
- const { t } = (0, use_translation_wrapper_1.useTranslation)();
15
- const stepNames = (0, constants_1.wizardStepNames)(t);
16
- return (react_1.default.createElement(deprecated_1.WizardNav, null,
17
- react_1.default.createElement(common_1.WizardNavItem, { key: "installation-type", content: t('ai:Installation type'), step: 0, isDisabled: true }),
18
- react_1.default.createElement(common_1.WizardNavItem, { key: "cluster-details", content: stepNames['cluster-details'], isCurrent: currentStepId === 'cluster-details',
19
- // isValid={ () => !cluster || canNextHostDiscovery({ cluster }) }
20
- isDisabled: false, step: 1, onNavItemClick: () => setCurrentStepId('cluster-details') }),
21
- react_1.default.createElement(common_1.WizardNavItem, { key: "automation", content: t('ai:Automation'), step: 2, isDisabled: true }),
22
- (0, helpers_1.isCIMFlow)(clusterDeployment) ? (react_1.default.createElement(common_1.WizardNavItem, { key: "hosts-selection", content: stepNames['hosts-selection'], isDisabled: !wizardSteps.slice(1).includes(currentStepId),
23
- // isValid={ () => !cluster || canNextHostDiscovery({ cluster }) }
24
- isCurrent: currentStepId === 'hosts-selection', step: 2, onNavItemClick: () => setCurrentStepId('hosts-selection') })) : (react_1.default.createElement(common_1.WizardNavItem, { key: "hosts-discovery", content: stepNames['hosts-discovery'], isDisabled: !wizardSteps.slice(1).includes(currentStepId),
25
- // isValid={ () => !cluster || canNextHostDiscovery({ cluster }) }
26
- isCurrent: currentStepId === 'hosts-discovery', step: 2, onNavItemClick: () => setCurrentStepId('hosts-discovery') })),
27
- react_1.default.createElement(common_1.WizardNavItem, { key: "networking", content: stepNames['networking'], isDisabled: !wizardSteps.slice(2).includes(currentStepId),
28
- // isValid={ () => !cluster || canNextHostDiscovery({ cluster }) }
29
- isCurrent: currentStepId === 'networking', step: 3, onNavItemClick: () => setCurrentStepId('networking') }),
30
- react_1.default.createElement(common_1.WizardNavItem, { key: "review", content: stepNames['review'], isDisabled: !wizardSteps.slice(3).includes(currentStepId),
31
- // isValid={ () => !cluster || canNextHostDiscovery({ cluster }) }
32
- isCurrent: currentStepId === 'review', step: 4, onNavItemClick: () => setCurrentStepId('review') })));
33
- };
34
- exports.default = ClusterDeploymentWizardNavigation;
35
- //# sourceMappingURL=ClusterDeploymentWizardNavigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardNavigation.js","source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,GAChD,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,iCAAiC,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const React = tslib_1.__importStar(require("react"));
5
- const clusterWizard_1 = require("../../../common/components/clusterWizard");
6
- const ClusterDeploymentWizardNavigation_1 = tslib_1.__importDefault(require("./ClusterDeploymentWizardNavigation"));
7
- const ClusterDeploymentWizardStep = (props) => (React.createElement(clusterWizard_1.ClusterWizardStep, Object.assign({ navigation: React.createElement(ClusterDeploymentWizardNavigation_1.default, null) }, props)));
8
- exports.default = ClusterDeploymentWizardStep;
9
- //# sourceMappingURL=ClusterDeploymentWizardStep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClusterDeploymentWizardStep.js","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,4EAA6E;AAC7E,oHAAoF;AAMpF,MAAM,2BAA2B,GAA+C,CAAC,KAAK,EAAE,EAAE,CAAC,CACzF,oBAAC,iCAAiB,kBAAC,UAAU,EAAE,oBAAC,2CAAiC,OAAG,IAAM,KAAK,EAAI,CACpF,CAAC;AAEF,kBAAe,2BAA2B,CAAC"}
@@ -1,79 +0,0 @@
1
- import * as React from 'react';
2
- import { CheckCircleIcon } from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
3
- import { global_palette_green_500 as okColor } from '@patternfly/react-tokens/dist/js/global_palette_green_500';
4
- import {
5
- Bullseye,
6
- Button,
7
- EmptyState,
8
- EmptyStateBody,
9
- EmptyStateIcon,
10
- EmptyStateActions,
11
- Spinner,
12
- Title,
13
- } from '@patternfly/react-core';
14
- import { isInstallationReady } from './helpers';
15
- import { AgentClusterInstallK8sResource } from '../../types';
16
- import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
17
-
18
- const GreenCheckCircleIcon: React.FC = (props) => (
19
- <CheckCircleIcon {...props} color={okColor.value} />
20
- );
21
-
22
- type ClusterDeploymentCreateProgressProps = {
23
- agentClusterInstall: AgentClusterInstallK8sResource;
24
- toDetails: VoidFunction;
25
- toListView: VoidFunction;
26
- };
27
-
28
- const ClusterDeploymentCreateProgress: React.FC<ClusterDeploymentCreateProgressProps> = ({
29
- agentClusterInstall,
30
- toDetails,
31
- toListView,
32
- }) => {
33
- const { t } = useTranslation();
34
- return (
35
- <Bullseye>
36
- <EmptyState>
37
- {isInstallationReady(agentClusterInstall) ? (
38
- <>
39
- <EmptyStateIcon icon={GreenCheckCircleIcon} />
40
- <Title headingLevel="h4" size="lg">
41
- {t('ai:Cluster is ready for installation')}
42
- </Title>
43
- <EmptyStateBody>
44
- <div>{t('ai:This cluster has been created and is ready to begin installation.')}</div>
45
- <div>{t('ai:To see the status of the installation see the details page.')}</div>
46
- </EmptyStateBody>
47
- </>
48
- ) : (
49
- <>
50
- <EmptyStateIcon icon={Spinner} />
51
- <Title headingLevel="h4" size="lg">
52
- {t('ai:Preparing cluster installation')}
53
- </Title>
54
- <EmptyStateBody>
55
- <div>
56
- {t('ai:This cluster is in the process of getting ready to start installation.')}
57
- </div>
58
- <div>
59
- {t(
60
- 'ai:If you exit this flow you can see its status in the list view or details page.',
61
- )}
62
- </div>
63
- </EmptyStateBody>
64
- </>
65
- )}
66
- <EmptyStateActions>
67
- <Button variant="primary" onClick={toDetails}>
68
- {t('ai:See cluster details')}
69
- </Button>
70
- <Button variant="link" onClick={toListView}>
71
- {t('ai:Go to cluster list')}
72
- </Button>
73
- </EmptyStateActions>
74
- </EmptyState>
75
- </Bullseye>
76
- );
77
- };
78
-
79
- export default ClusterDeploymentCreateProgress;