@openshift-assisted/ui-lib 2.41.1 → 2.42.0

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 (186) hide show
  1. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
  2. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.d.ts.map +1 -1
  3. package/build/@types/cim/components/ClusterDeployment/LabelsSelector.d.ts.map +1 -1
  4. package/build/@types/cim/components/ClusterDeployment/ScaleUpForm.d.ts +1 -0
  5. package/build/@types/cim/components/ClusterDeployment/ScaleUpForm.d.ts.map +1 -1
  6. package/build/@types/cim/components/InfraEnv/AddHostDropdown.d.ts.map +1 -1
  7. package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
  8. package/build/@types/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.d.ts.map +1 -1
  9. package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -1
  10. package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
  11. package/build/@types/cim/components/modals/ScaleUpModal.d.ts +1 -0
  12. package/build/@types/cim/components/modals/ScaleUpModal.d.ts.map +1 -1
  13. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
  14. package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.d.ts.map +1 -1
  15. package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.d.ts +1 -0
  16. package/build/@types/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.d.ts.map +1 -1
  17. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  18. package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
  19. package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  20. package/build/@types/common/components/hosts/DiskRole.d.ts.map +1 -1
  21. package/build/@types/common/components/hosts/TableToolbar.d.ts.map +1 -1
  22. package/build/@types/common/components/operators/operatorSpecs.d.ts.map +1 -1
  23. package/build/@types/common/components/ui/ClusterEventsToolbar.d.ts.map +1 -1
  24. package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts +0 -1
  25. package/build/@types/common/components/ui/OpenShiftVersionDropdown.d.ts.map +1 -1
  26. package/build/@types/common/components/ui/SimpleDropdown.d.ts +2 -2
  27. package/build/@types/common/components/ui/SimpleDropdown.d.ts.map +1 -1
  28. package/build/@types/common/config/constants.d.ts.map +1 -1
  29. package/build/@types/common/config/docs_links.d.ts +1 -2
  30. package/build/@types/common/config/docs_links.d.ts.map +1 -1
  31. package/build/@types/common/index.d.ts +1 -0
  32. package/build/@types/common/index.d.ts.map +1 -1
  33. package/build/@types/common/types/ui-settings.d.ts +1 -0
  34. package/build/@types/common/types/ui-settings.d.ts.map +1 -1
  35. package/build/@types/common/utils.d.ts +8 -0
  36. package/build/@types/common/utils.d.ts.map +1 -1
  37. package/build/@types/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
  38. package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
  39. package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusterConfiguration/OcmBaseDomainField.d.ts.map +1 -1
  41. package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts +4 -0
  42. package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +1 -0
  43. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.d.ts.map +1 -1
  44. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.d.ts.map +1 -1
  45. package/build/@types/ocm/components/clusterConfiguration/operators/utils.d.ts.map +1 -1
  46. package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
  47. package/build/@types/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts.map +1 -1
  48. package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
  49. package/build/@types/ocm/components/clusterWizard/OperatorsBundle.d.ts.map +1 -1
  50. package/build/@types/ocm/components/clusterWizard/OperatorsSelect.d.ts.map +1 -1
  51. package/build/@types/ocm/components/hosts/use-hosts-table.d.ts.map +1 -1
  52. package/build/@types/ocm/services/DiskEncryptionService.d.ts +1 -1
  53. package/build/@types/ocm/services/DiskEncryptionService.d.ts.map +1 -1
  54. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -1
  55. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +2 -2
  56. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
  57. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js +2 -1
  58. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.js.map +1 -1
  59. package/build/cjs/cim/components/ClusterDeployment/LabelsSelector.js +5 -5
  60. package/build/cjs/cim/components/ClusterDeployment/LabelsSelector.js.map +1 -1
  61. package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js +2 -2
  62. package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js.map +1 -1
  63. package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js +29 -28
  64. package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js.map +1 -1
  65. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +16 -14
  66. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
  67. package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js +2 -2
  68. package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js.map +1 -1
  69. package/build/cjs/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.js +4 -8
  70. package/build/cjs/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.js.map +1 -1
  71. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +3 -3
  72. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -1
  73. package/build/cjs/cim/components/helpers/versions.js +1 -1
  74. package/build/cjs/cim/components/helpers/versions.js.map +1 -1
  75. package/build/cjs/cim/components/modals/MassApproveAction.js +2 -2
  76. package/build/cjs/cim/components/modals/MassApproveAction.js.map +1 -1
  77. package/build/cjs/cim/components/modals/ScaleUpModal.js +3 -3
  78. package/build/cjs/cim/components/modals/ScaleUpModal.js.map +1 -1
  79. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +5 -6
  80. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  81. package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js +11 -6
  82. package/build/cjs/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.js.map +1 -1
  83. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +2 -1
  84. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  85. package/build/cjs/common/components/hosts/DiskRole.js +5 -5
  86. package/build/cjs/common/components/hosts/DiskRole.js.map +1 -1
  87. package/build/cjs/common/components/hosts/HostToolbarActions.js +3 -3
  88. package/build/cjs/common/components/hosts/HostToolbarActions.js.map +1 -1
  89. package/build/cjs/common/components/hosts/TableToolbar.js +15 -15
  90. package/build/cjs/common/components/hosts/TableToolbar.js.map +1 -1
  91. package/build/cjs/common/components/operators/operatorSpecs.js +6 -4
  92. package/build/cjs/common/components/operators/operatorSpecs.js.map +1 -1
  93. package/build/cjs/common/components/storage/DisksTable.js +1 -1
  94. package/build/cjs/common/components/storage/DisksTable.js.map +1 -1
  95. package/build/cjs/common/components/ui/ClusterEventsToolbar.js +1 -1
  96. package/build/cjs/common/components/ui/ClusterEventsToolbar.js.map +1 -1
  97. package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js +13 -16
  98. package/build/cjs/common/components/ui/OpenShiftVersionDropdown.js.map +1 -1
  99. package/build/cjs/common/components/ui/SimpleDropdown.js +4 -5
  100. package/build/cjs/common/components/ui/SimpleDropdown.js.map +1 -1
  101. package/build/cjs/common/config/constants.js +10 -0
  102. package/build/cjs/common/config/constants.js.map +1 -1
  103. package/build/cjs/common/config/docs_links.js +41 -25
  104. package/build/cjs/common/config/docs_links.js.map +1 -1
  105. package/build/cjs/common/index.js +1 -0
  106. package/build/cjs/common/index.js.map +1 -1
  107. package/build/cjs/common/utils.js +27 -1
  108. package/build/cjs/common/utils.js.map +1 -1
  109. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +18 -9
  110. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  111. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +3 -5
  112. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
  113. package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js +15 -17
  114. package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js.map +1 -1
  115. package/build/cjs/ocm/components/clusterConfiguration/OcmBaseDomainField.js +5 -7
  116. package/build/cjs/ocm/components/clusterConfiguration/OcmBaseDomainField.js.map +1 -1
  117. package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js +14 -0
  118. package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js.map +1 -0
  119. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js +6 -8
  120. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.js.map +1 -1
  121. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js +7 -10
  122. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js.map +1 -1
  123. package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js +2 -1
  124. package/build/cjs/ocm/components/clusterConfiguration/operators/utils.js.map +1 -1
  125. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +11 -13
  126. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
  127. package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js +4 -0
  128. package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js.map +1 -1
  129. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +7 -4
  130. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
  131. package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js +6 -1
  132. package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js.map +1 -1
  133. package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js +2 -1
  134. package/build/cjs/ocm/components/clusterWizard/OperatorsSelect.js.map +1 -1
  135. package/build/cjs/ocm/components/hosts/use-hosts-table.js +9 -2
  136. package/build/cjs/ocm/components/hosts/use-hosts-table.js.map +1 -1
  137. package/build/cjs/ocm/services/DiskEncryptionService.js +11 -3
  138. package/build/cjs/ocm/services/DiskEncryptionService.js.map +1 -1
  139. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +4 -2
  140. package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.tsx +8 -6
  141. package/lib/cim/components/ClusterDeployment/LabelsSelector.tsx +27 -14
  142. package/lib/cim/components/ClusterDeployment/ScaleUpForm.tsx +3 -0
  143. package/lib/cim/components/InfraEnv/AddHostDropdown.tsx +60 -47
  144. package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +7 -10
  145. package/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx +1 -1
  146. package/lib/cim/components/InfraEnv/InfraEnvOpenShiftVersionDropdown.tsx +34 -22
  147. package/lib/cim/components/common/CpuArchitectureDropdown.tsx +6 -3
  148. package/lib/cim/components/helpers/versions.ts +2 -2
  149. package/lib/cim/components/modals/MassApproveAction.tsx +1 -1
  150. package/lib/cim/components/modals/ScaleUpModal.tsx +5 -2
  151. package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +30 -17
  152. package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.tsx +20 -5
  153. package/lib/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.ts +1 -0
  154. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +3 -0
  155. package/lib/common/components/clusterWizard/types.ts +1 -0
  156. package/lib/common/components/hosts/DiskRole.tsx +23 -17
  157. package/lib/common/components/hosts/HostToolbarActions.tsx +1 -1
  158. package/lib/common/components/hosts/TableToolbar.tsx +54 -48
  159. package/lib/common/components/operators/operatorSpecs.tsx +7 -4
  160. package/lib/common/components/storage/DisksTable.tsx +1 -1
  161. package/lib/common/components/ui/ClusterEventsToolbar.tsx +1 -0
  162. package/lib/common/components/ui/OpenShiftVersionDropdown.tsx +38 -44
  163. package/lib/common/components/ui/SimpleDropdown.tsx +23 -22
  164. package/lib/common/config/constants.ts +11 -0
  165. package/lib/common/config/docs_links.ts +44 -30
  166. package/lib/common/index.ts +1 -0
  167. package/lib/common/types/ui-settings.ts +1 -0
  168. package/lib/common/utils.ts +30 -0
  169. package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +42 -11
  170. package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +26 -20
  171. package/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx +47 -46
  172. package/lib/ocm/components/clusterConfiguration/OcmBaseDomainField.tsx +16 -13
  173. package/lib/ocm/components/clusterConfiguration/OcmTNADisclaimer.tsx +23 -0
  174. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/FolderDropdown.tsx +25 -26
  175. package/lib/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.tsx +26 -30
  176. package/lib/ocm/components/clusterConfiguration/operators/utils.tsx +2 -1
  177. package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +34 -33
  178. package/lib/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.tsx +4 -0
  179. package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +15 -5
  180. package/lib/ocm/components/clusterWizard/OperatorsBundle.tsx +5 -1
  181. package/lib/ocm/components/clusterWizard/OperatorsSelect.tsx +5 -1
  182. package/lib/ocm/components/hosts/use-hosts-table.tsx +9 -3
  183. package/lib/ocm/services/DiskEncryptionService.ts +7 -1
  184. package/package.json +3 -3
  185. package/build/cjs/common/components/ui/OpenShiftVersionDropdown.css +0 -9
  186. package/lib/common/components/ui/OpenShiftVersionDropdown.css +0 -9
@@ -1,7 +1,12 @@
1
1
  import React from 'react';
2
- import { HelperText, FormGroup } from '@patternfly/react-core';
3
- import { DropdownItem, DropdownToggle, Dropdown } from '@patternfly/react-core/deprecated';
4
- import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
2
+ import {
3
+ HelperText,
4
+ FormGroup,
5
+ Dropdown,
6
+ DropdownItem,
7
+ MenuToggle,
8
+ MenuToggleElement,
9
+ } from '@patternfly/react-core';
5
10
  import { useField } from 'formik';
6
11
  import { getFieldId } from '../../../../../common/components/ui/formik';
7
12
  import { PopoverIcon } from '../../../../../common';
@@ -40,40 +45,34 @@ export const FolderDropdown = ({ name }: FolderDropdownProps) => {
40
45
  const [isOpen, setOpen] = React.useState(false);
41
46
  const fieldId = getFieldId(name, 'input');
42
47
 
43
- const onSelect = React.useCallback(
44
- (event?: React.SyntheticEvent<HTMLDivElement>) => {
45
- setValue(event?.currentTarget.id as string);
46
- setOpen(false);
47
- },
48
- [setOpen, setValue],
49
- );
48
+ const onSelect = (event?: React.MouseEvent<Element, MouseEvent>): void => {
49
+ setValue(event?.currentTarget.id as string);
50
+ setOpen(false);
51
+ };
50
52
 
51
- const toggle = React.useMemo(
52
- () => (
53
- <DropdownToggle
54
- onToggle={(_event, val) => setOpen(val)}
55
- toggleIndicator={CaretDownIcon}
56
- isText
57
- className="pf-v5-u-w-100"
58
- >
59
- {value || 'manifests'}
60
- </DropdownToggle>
61
- ),
62
- [setOpen, value],
53
+ const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
54
+ <MenuToggle
55
+ ref={toggleRef}
56
+ onClick={() => setOpen(!isOpen)}
57
+ isExpanded={isOpen}
58
+ className="pf-v5-u-w-100"
59
+ >
60
+ {value || 'manifests'}
61
+ </MenuToggle>
63
62
  );
64
63
 
65
64
  return (
66
65
  <FormGroup fieldId={fieldId} label={<FolderLabel />} isRequired>
67
66
  <Dropdown
68
67
  {...field}
69
- name={name}
70
68
  id={fieldId}
69
+ onOpenChange={() => setOpen(!isOpen)}
71
70
  onSelect={onSelect}
72
- dropdownItems={dropdownItems}
73
71
  toggle={toggle}
74
72
  isOpen={isOpen}
75
- className="pf-v5-u-w-100"
76
- />
73
+ >
74
+ {dropdownItems}
75
+ </Dropdown>
77
76
  <HelperText style={{ display: 'inherit' }}>
78
77
  {'Manifests can be placed in "manifests" or "openshift" directories.'}
79
78
  </HelperText>
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { DropdownItem, DropdownToggle, Dropdown } from '@patternfly/react-core/deprecated';
3
- import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
2
+ import { Dropdown, DropdownItem, MenuToggle, MenuToggleElement } from '@patternfly/react-core';
4
3
  import { useField } from 'formik';
5
4
  import { getFieldId, HostSubnet, NO_SUBNET_SET } from '../../../../common';
6
5
 
@@ -64,46 +63,43 @@ export const SubnetsDropdown = ({ name, machineSubnets, isDisabled }: SubnetsDro
64
63
  }, []);
65
64
 
66
65
  const dropdownItems = itemsSubnets.map(({ value, label, isDisabled }) => (
67
- <DropdownItem key={value} id={value} isDisabled={isDisabled}>
66
+ <DropdownItem key={value} id={value} isDisabled={isDisabled} value={value}>
68
67
  {label}
69
68
  </DropdownItem>
70
69
  ));
71
70
 
72
- const onSelect = React.useCallback(
73
- (event?: React.SyntheticEvent<HTMLDivElement>) => {
74
- const currentValue = event?.currentTarget.innerText ?? currentDisplayValue;
75
- setCurrentDisplayValue(currentValue);
76
- setValue(event?.currentTarget.id);
77
- setOpen(false);
78
- },
79
- [currentDisplayValue, setValue],
80
- );
71
+ const onSelect = (
72
+ event?: React.MouseEvent<Element, MouseEvent>,
73
+ value?: string | number,
74
+ ): void => {
75
+ setCurrentDisplayValue(value as string);
76
+ setValue(event?.currentTarget.id);
77
+ setOpen(false);
78
+ };
81
79
 
82
- const toggle = React.useMemo(
83
- () => (
84
- <DropdownToggle
85
- onToggle={(_event, val) => setOpen(!isDisabled && val)}
86
- toggleIndicator={CaretDownIcon}
87
- isDisabled={isDisabled}
88
- isText
89
- className="pf-v5-u-w-100"
90
- >
91
- {currentDisplayValue}
92
- </DropdownToggle>
93
- ),
94
- [setOpen, currentDisplayValue, isDisabled],
80
+ const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
81
+ <MenuToggle
82
+ ref={toggleRef}
83
+ onClick={() => setOpen(!isOpen)}
84
+ isExpanded={isOpen}
85
+ isDisabled={isDisabled}
86
+ className="pf-v5-u-w-100"
87
+ id={fieldId}
88
+ >
89
+ {currentDisplayValue}
90
+ </MenuToggle>
95
91
  );
96
92
 
97
93
  return (
98
94
  <Dropdown
99
95
  {...field}
100
- name={name}
101
- id={fieldId}
96
+ id={`${fieldId}-dropdown`}
97
+ onOpenChange={() => setOpen(!isOpen)}
102
98
  onSelect={onSelect}
103
- dropdownItems={dropdownItems}
104
99
  toggle={toggle}
105
100
  isOpen={isOpen}
106
- className="pf-v5-u-w-100"
107
- />
101
+ >
102
+ {dropdownItems}
103
+ </Dropdown>
108
104
  );
109
105
  };
@@ -35,7 +35,8 @@ export const getNewOperators = (
35
35
  const dependencies = getOperatorDependencies(operatorId, preflightRequirements);
36
36
 
37
37
  if (add) {
38
- return [...new Set([...currentOperators, ...dependencies, operatorId])];
38
+ const uniqueOps = new Set([...currentOperators, ...dependencies, operatorId]);
39
+ return Array.from(uniqueOps);
39
40
  }
40
41
 
41
42
  const newOperators = currentOperators.filter((op) => op !== operatorId);
@@ -6,9 +6,12 @@ import {
6
6
  Split,
7
7
  SplitItem,
8
8
  Tooltip,
9
+ Dropdown,
10
+ DropdownItem,
11
+ MenuToggle,
12
+ MenuToggleElement,
13
+ DropdownList,
9
14
  } from '@patternfly/react-core';
10
- import { Dropdown, DropdownItem, DropdownToggle } from '@patternfly/react-core/deprecated';
11
- import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
12
15
  import { useField } from 'formik';
13
16
  import {
14
17
  CpuArchitecture,
@@ -199,7 +202,12 @@ export const ExternalPlatformDropdown = ({
199
202
  ] as ExternalPlatformInfo;
200
203
 
201
204
  return (
202
- <DropdownItem key={platform} id={platform} isAriaDisabled={disabledReason !== undefined}>
205
+ <DropdownItem
206
+ value={platform}
207
+ key={platform}
208
+ id={platform}
209
+ isAriaDisabled={disabledReason !== undefined}
210
+ >
203
211
  <Split>
204
212
  <SplitItem>
205
213
  <Tooltip hidden={!disabledReason} content={disabledReason} position="top">
@@ -234,29 +242,17 @@ export const ExternalPlatformDropdown = ({
234
242
  );
235
243
  });
236
244
 
237
- const onSelect = React.useCallback(
238
- (event?: React.SyntheticEvent<HTMLDivElement>) => {
239
- const selectedPlatform = event?.currentTarget.id as PlatformType;
240
- setValue(selectedPlatform);
241
- setOpen(false);
242
- onChange(selectedPlatform);
243
- },
244
- [setOpen, setValue, onChange],
245
- );
246
-
247
- const toggle = React.useMemo(
248
- () => (
249
- <DropdownToggle
250
- onToggle={(_event, val) => setOpen(val)}
251
- toggleIndicator={CaretDownIcon}
252
- isText
253
- className="pf-v5-u-w-100"
254
- isDisabled={dropdownIsDisabled}
255
- >
256
- {externalPlatformTypes[field.value as PlatformType]?.label}
257
- </DropdownToggle>
258
- ),
259
- [externalPlatformTypes, field, dropdownIsDisabled],
245
+ const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
246
+ <MenuToggle
247
+ id={fieldId}
248
+ className="pf-v5-u-w-100"
249
+ ref={toggleRef}
250
+ onClick={() => setOpen(!isOpen)}
251
+ isDisabled={dropdownIsDisabled}
252
+ isExpanded={isOpen}
253
+ >
254
+ {externalPlatformTypes[field.value as PlatformType]?.label}
255
+ </MenuToggle>
260
256
  );
261
257
 
262
258
  return (
@@ -272,15 +268,20 @@ export const ExternalPlatformDropdown = ({
272
268
  distance={7}
273
269
  >
274
270
  <Dropdown
275
- {...field}
276
- id={fieldId}
277
- dropdownItems={enabledItems}
271
+ id={`${fieldId}-dropdown`}
278
272
  toggle={toggle}
279
273
  isOpen={isOpen}
280
- className="pf-v5-u-w-100"
281
- onSelect={onSelect}
282
- disabled={dropdownIsDisabled}
283
- />
274
+ onOpenChange={() => setOpen(!isOpen)}
275
+ onSelect={(event) => {
276
+ const selectedPlatform = event?.currentTarget.id as PlatformType;
277
+ setValue(selectedPlatform);
278
+ setOpen(false);
279
+ onChange(selectedPlatform);
280
+ }}
281
+ shouldFocusToggleOnSelect
282
+ >
283
+ <DropdownList>{enabledItems}</DropdownList>
284
+ </Dropdown>
284
285
  </Tooltip>
285
286
  </FormGroup>
286
287
  );
@@ -232,6 +232,10 @@ export const getIpIsNotNetworkOrBroadcastAddressSchema = (
232
232
  'is-not-network-or-broadcast',
233
233
  `The IP address must not match the network or broadcast address`,
234
234
  (value) => {
235
+ // Allow both addresses for IPv4 /31 subnets (RFC 3021)
236
+ if (protocolVersion === ProtocolVersion.ipv4 && subnet.endsWith('/31')) {
237
+ return true;
238
+ }
235
239
  const subnetAddr = getAddressObject(subnet, protocolVersion);
236
240
  if (!subnetAddr) {
237
241
  return true;
@@ -1,7 +1,13 @@
1
1
  import React from 'react';
2
2
  import { useLocation, useNavigate } from 'react-router-dom-v5-compat';
3
3
  import { useDispatch } from 'react-redux';
4
- import { useAlerts, LoadingState, ClusterWizardStep, ErrorState } from '../../../common';
4
+ import {
5
+ useAlerts,
6
+ LoadingState,
7
+ ClusterWizardStep,
8
+ ErrorState,
9
+ UISettingsValues,
10
+ } from '../../../common';
5
11
  import { usePullSecret } from '../../hooks';
6
12
  import { getApiErrorMessage, handleApiError, isUnknownServerError } from '../../../common/api';
7
13
  import { setServerUpdateError, updateCluster } from '../../store/slices/current-cluster/slice';
@@ -81,11 +87,15 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
81
87
  }
82
88
  const cluster = await ClustersService.create(params, isAssistedMigration);
83
89
  navigate(`../${cluster.id}`, { state: ClusterWizardFlowStateNew });
84
- await UISettingService.update(cluster.id, { addCustomManifests });
85
- //For Assisted Migration we need to enable virtualization bundle
90
+
91
+ const uiPatch: UISettingsValues = { addCustomManifests };
86
92
  if (isAssistedMigration) {
87
- await UISettingService.update(cluster.id, { bundlesSelected: ['virtualization'] });
93
+ //For Assisted Migration we need to enable virtualization bundle
94
+ uiPatch.bundlesSelected = ['virtualization'];
95
+ uiPatch.isAssistedMigration = true;
88
96
  }
97
+ await UISettingService.update(cluster.id, uiPatch);
98
+ await clusterWizardContext.updateUISettings(uiPatch); // keeps local state current
89
99
  } catch (e) {
90
100
  handleApiError(e, () =>
91
101
  addAlert({ title: 'Failed to create new cluster', message: getApiErrorMessage(e) }),
@@ -95,7 +105,7 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
95
105
  }
96
106
  }
97
107
  },
98
- [clearAlerts, location.search, navigate, addAlert, dispatch],
108
+ [clearAlerts, location.search, navigate, clusterWizardContext, addAlert, dispatch],
99
109
  );
100
110
 
101
111
  const navigation = <ClusterWizardNavigation cluster={cluster} />;
@@ -36,6 +36,7 @@ import { bundleSpecs } from '../clusterConfiguration/operators/bundleSpecs';
36
36
  import { useOperatorSpecs } from '../../../common/components/operators/operatorSpecs';
37
37
 
38
38
  import './OperatorsBundle.css';
39
+ import { useClusterWizardContext } from './ClusterWizardContext';
39
40
 
40
41
  const BundleLabel = ({ bundle }: { bundle: Bundle }) => {
41
42
  const opSpecs = useOperatorSpecs();
@@ -114,6 +115,7 @@ const BundleCard = ({
114
115
  const isSNO = useSelector(selectIsCurrentClusterSNO);
115
116
  const { isFeatureSupported, getFeatureSupportLevel } = useNewFeatureSupportLevel();
116
117
  const opSpecs = useOperatorSpecs();
118
+ const { uiSettings } = useClusterWizardContext();
117
119
 
118
120
  const supportLevel = getBundleSupportLevel(bundle, opSpecs, getFeatureSupportLevel);
119
121
 
@@ -130,7 +132,7 @@ const BundleCard = ({
130
132
  const incompatibleBundle = bundleSpec?.incompatibleBundles?.find((b) =>
131
133
  values.selectedBundles.includes(b),
132
134
  );
133
-
135
+ const isAssistedMigration = uiSettings?.isAssistedMigration;
134
136
  const disabledReason = hasUnsupportedOperators
135
137
  ? 'Some operators in this bundle are not supported with the current configuration.'
136
138
  : isSNO && bundleSpec?.noSNO
@@ -139,6 +141,8 @@ const BundleCard = ({
139
141
  ? `Bundle cannot be installed together with ${
140
142
  bundles.find(({ id }) => id === incompatibleBundle)?.title || incompatibleBundle
141
143
  }`
144
+ : isAssistedMigration
145
+ ? 'This bundle needs to be selected for clusters created from Migration Assessment'
142
146
  : undefined;
143
147
 
144
148
  const onSelect = (checked: boolean) => {
@@ -74,9 +74,13 @@ const OperatorsSelect = ({
74
74
  return <LoadingState />;
75
75
  }
76
76
 
77
+ const selectedOperators = values.selectedOperators.filter(
78
+ (opKey) => operators.includes(opKey) && !!opSpecs[opKey],
79
+ );
80
+
77
81
  return (
78
82
  <ExpandableSection
79
- toggleText={`Single Operators (${operators.length} | ${values.selectedOperators.length} selected)`}
83
+ toggleText={`Single Operators (${operators.length} | ${selectedOperators.length} selected)`}
80
84
  onToggle={() => setIsExpanded(!isExpanded)}
81
85
  isExpanded={isExpanded}
82
86
  data-testid="single-operators-section"
@@ -60,8 +60,10 @@ import {
60
60
  selectCurrentClusterPermissionsState,
61
61
  selectCurrentClusterState,
62
62
  } from '../../store/slices/current-cluster/selectors';
63
+ import { useFeature } from '../../hooks/use-feature';
63
64
 
64
65
  export const useHostsTable = (cluster: Cluster) => {
66
+ const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
65
67
  const { addAlert } = useAlerts();
66
68
  const {
67
69
  eventsDialog,
@@ -248,8 +250,12 @@ export const useHostsTable = (cluster: Cluster) => {
248
250
 
249
251
  const actionChecks = React.useMemo(
250
252
  () => ({
251
- canEditRole: (host: Host) =>
252
- !isViewerMode && canEditRoleUtil(cluster.status, host.status, isSNO(cluster)),
253
+ canEditRole: (host: Host) => {
254
+ if (isSingleClusterFeatureEnabled && host.bootstrap) {
255
+ return false;
256
+ }
257
+ return !isViewerMode && canEditRoleUtil(cluster.status, host.status, isSNO(cluster));
258
+ },
253
259
  canInstallHost: (host: Host) => !isViewerMode && canInstallHostUtil(cluster, host.status),
254
260
  canEditDisks: (host: Host) => !isViewerMode && canEditDisksUtil(cluster.status, host.status),
255
261
  canEnable: (host: Host) => !isViewerMode && canEnableUtil(cluster.status, host.status),
@@ -259,7 +265,7 @@ export const useHostsTable = (cluster: Cluster) => {
259
265
  canReset: (host: Host) => !isViewerMode && canResetUtil(cluster.status, host.status),
260
266
  canEditHostname: () => !isViewerMode && canEditHostnameUtil(cluster.status),
261
267
  }),
262
- [cluster, isViewerMode],
268
+ [cluster, isViewerMode, isSingleClusterFeatureEnabled],
263
269
  );
264
270
 
265
271
  const onReset = React.useCallback(() => {
@@ -8,9 +8,14 @@ const DiskEncryptionService = {
8
8
  diskEncryptionEnableOn(
9
9
  isEnableOnMasters: boolean,
10
10
  isEnableOnWorkers: boolean,
11
+ isEnableOnArbiters: boolean,
11
12
  ): DiskEncryption['enableOn'] {
12
13
  let enableOnParam: DiskEncryption['enableOn'];
13
- if (isEnableOnMasters && isEnableOnWorkers) enableOnParam = 'all';
14
+ if (isEnableOnMasters && isEnableOnWorkers && isEnableOnArbiters) enableOnParam = 'all';
15
+ else if (isEnableOnMasters && isEnableOnWorkers) enableOnParam = 'masters,workers';
16
+ else if (isEnableOnMasters && isEnableOnArbiters) enableOnParam = 'masters,arbiters';
17
+ else if (isEnableOnWorkers && isEnableOnArbiters) enableOnParam = 'arbiters,workers';
18
+ else if (isEnableOnArbiters) enableOnParam = 'arbiters';
14
19
  else if (isEnableOnWorkers) enableOnParam = 'workers';
15
20
  else if (isEnableOnMasters) enableOnParam = 'masters';
16
21
  else enableOnParam = 'none';
@@ -28,6 +33,7 @@ const DiskEncryptionService = {
28
33
  : DiskEncryptionService.diskEncryptionEnableOn(
29
34
  values.enableDiskEncryptionOnMasters,
30
35
  values.enableDiskEncryptionOnWorkers,
36
+ values.enableDiskEncryptionOnArbiters,
31
37
  ),
32
38
  tangServers:
33
39
  values.diskEncryptionMode === 'tang'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.41.1",
4
- "@openshift-assisted/types": "2.41.1",
3
+ "@openshift-assisted/locales": "2.42.0",
4
+ "@openshift-assisted/types": "2.42.0",
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",
@@ -140,5 +140,5 @@
140
140
  ]
141
141
  }
142
142
  },
143
- "version": "2.41.1"
143
+ "version": "2.42.0"
144
144
  }
@@ -1,9 +0,0 @@
1
- #form-input-openshiftVersion-field .pf-v5-c-dropdown__menu {
2
- max-height: 22vh;
3
- overflow: auto;
4
- }
5
-
6
- #form-input-openshiftVersion-field .pf-v5-c-dropdown__menu ul {
7
- list-style: none;
8
- padding-left: 0;
9
- }
@@ -1,9 +0,0 @@
1
- #form-input-openshiftVersion-field .pf-v5-c-dropdown__menu {
2
- max-height: 22vh;
3
- overflow: auto;
4
- }
5
-
6
- #form-input-openshiftVersion-field .pf-v5-c-dropdown__menu ul {
7
- list-style: none;
8
- padding-left: 0;
9
- }