@openshift-assisted/ui-lib 2.46.3 → 2.47.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 (126) hide show
  1. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  2. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +1 -0
  3. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
  4. package/build/@types/common/api/assisted-service/BundleAPI.d.ts +2 -2
  5. package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +25 -25
  6. package/build/@types/common/api/assisted-service/ComponentVersionsAPI.d.ts +1 -1
  7. package/build/@types/common/api/assisted-service/EventsAPI.d.ts +1 -1
  8. package/build/@types/common/api/assisted-service/HostsAPI.d.ts +6 -6
  9. package/build/@types/common/api/assisted-service/InfraEnvsAPI.d.ts +7 -7
  10. package/build/@types/common/api/assisted-service/ManagedDomainsAPI.d.ts +1 -1
  11. package/build/@types/common/api/assisted-service/NewFeatureSupportLevelsAPI.d.ts +2 -2
  12. package/build/@types/common/api/assisted-service/OperatorsAPI.d.ts +1 -1
  13. package/build/@types/common/api/assisted-service/SupportedOpenshiftVersionsAPI.d.ts +1 -1
  14. package/build/@types/common/api/assisted-service/UISettingsAPI.d.ts +2 -2
  15. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +2 -1
  16. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
  17. package/build/@types/common/components/clusterConfiguration/DownloadIso.d.ts.map +1 -1
  18. package/build/@types/common/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +1 -0
  19. package/build/@types/common/components/clusterConfiguration/utils.d.ts +3 -1
  20. package/build/@types/common/components/clusterConfiguration/utils.d.ts.map +1 -1
  21. package/build/@types/common/components/clusterConfiguration/utils.test.d.ts +2 -0
  22. package/build/@types/common/components/clusterConfiguration/utils.test.d.ts.map +1 -0
  23. package/build/@types/common/components/ui/formik/validationSchemas.d.ts +1 -1
  24. package/build/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
  25. package/build/@types/common/config/constants.d.ts.map +1 -1
  26. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.d.ts.map +1 -1
  27. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.d.ts.map +1 -1
  28. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.d.ts +2 -1
  29. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.d.ts.map +1 -1
  30. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
  31. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
  32. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.d.ts.map +1 -1
  33. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.d.ts.map +1 -1
  34. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.d.ts.map +1 -1
  35. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts +1 -1
  36. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
  37. package/build/@types/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.d.ts.map +1 -1
  38. package/build/@types/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.d.ts.map +1 -1
  39. package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts +2 -0
  41. package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts.map +1 -0
  42. package/build/@types/ocm/services/ClustersService.d.ts +5 -5
  43. package/build/@types/ocm/services/HostsService.d.ts +11 -11
  44. package/build/@types/ocm/services/InfraEnvsService.d.ts +2 -2
  45. package/build/@types/ocm/services/UISettingsService.d.ts +1 -1
  46. package/build/@types/ocm/store/slices/infra-envs/thunks.d.ts +1 -1
  47. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +9 -5
  48. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  49. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +23 -6
  50. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  51. package/build/cjs/common/components/clusterConfiguration/DownloadIso.js +1 -2
  52. package/build/cjs/common/components/clusterConfiguration/DownloadIso.js.map +1 -1
  53. package/build/cjs/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.js +1 -1
  54. package/build/cjs/common/components/clusterConfiguration/OcmTNADisclaimer.js.map +1 -0
  55. package/build/cjs/common/components/clusterConfiguration/utils.js +23 -12
  56. package/build/cjs/common/components/clusterConfiguration/utils.js.map +1 -1
  57. package/build/cjs/common/components/clusterConfiguration/utils.test.js +242 -0
  58. package/build/cjs/common/components/clusterConfiguration/utils.test.js.map +1 -0
  59. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -1
  60. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  61. package/build/cjs/common/components/ui/formik/validationSchemas.js +13 -3
  62. package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
  63. package/build/cjs/common/config/constants.js +5 -10
  64. package/build/cjs/common/config/constants.js.map +1 -1
  65. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +1 -1
  66. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  67. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.js +0 -1
  68. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.js.map +1 -1
  69. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js +55 -13
  70. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js.map +1 -1
  71. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.js +49 -12
  72. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.js.map +1 -1
  73. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +3 -3
  74. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
  75. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +1 -1
  76. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
  77. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js +67 -7
  78. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js.map +1 -1
  79. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js +28 -4
  80. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js.map +1 -1
  81. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js +7 -16
  82. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js.map +1 -1
  83. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +8 -8
  84. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
  85. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js +26 -8
  86. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js.map +1 -1
  87. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js +5 -5
  88. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js.map +1 -1
  89. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js +2 -2
  90. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js.map +1 -1
  91. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js +180 -0
  92. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js.map +1 -0
  93. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +17 -35
  94. package/lib/cim/types/k8s/agent-cluster-install.ts +1 -0
  95. package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +61 -31
  96. package/lib/common/components/clusterConfiguration/DownloadIso.tsx +5 -2
  97. package/lib/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.tsx +1 -1
  98. package/lib/common/components/clusterConfiguration/utils.test.ts +275 -0
  99. package/lib/common/components/clusterConfiguration/utils.ts +28 -9
  100. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -1
  101. package/lib/common/components/ui/formik/_validationSchemas.test.ts +82 -0
  102. package/lib/common/components/ui/formik/validationSchemas.ts +16 -10
  103. package/lib/common/config/constants.ts +5 -11
  104. package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +1 -1
  105. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.tsx +1 -7
  106. package/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx +59 -13
  107. package/lib/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.tsx +98 -38
  108. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +3 -2
  109. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +3 -2
  110. package/lib/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.tsx +78 -11
  111. package/lib/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.tsx +65 -8
  112. package/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx +4 -9
  113. package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +17 -6
  114. package/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx +34 -4
  115. package/lib/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.tsx +7 -9
  116. package/lib/ocm/components/clusterDetail/ClusterProperties.test.ts +215 -0
  117. package/lib/ocm/components/clusterDetail/ClusterProperties.tsx +2 -2
  118. package/package.json +3 -3
  119. package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +0 -1
  120. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.d.ts +0 -6
  121. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.d.ts.map +0 -1
  122. package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js.map +0 -1
  123. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.js +0 -25
  124. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.js.map +0 -1
  125. package/lib/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.tsx +0 -30
  126. /package/build/@types/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.d.ts +0 -0
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const ClusterProperties_1 = require("./ClusterProperties");
5
+ const createCluster = (overrides = {}) => (Object.assign({ id: 'test-cluster', name: 'test-cluster', kind: 'Cluster', href: '/api/assisted-install/v2/clusters/test-cluster', openshiftVersion: '4.11', status: 'ready', statusInfo: 'Cluster is ready', machineNetworks: [], clusterNetworks: [], serviceNetworks: [] }, overrides));
6
+ const createMachineNetwork = (cidr) => ({ cidr, clusterId: 'test' });
7
+ const createClusterNetwork = (cidr, hostPrefix) => ({
8
+ cidr,
9
+ hostPrefix,
10
+ clusterId: 'test',
11
+ });
12
+ const createServiceNetwork = (cidr) => ({ cidr, clusterId: 'test' });
13
+ (0, vitest_1.describe)('getStackTypeLabel', () => {
14
+ (0, vitest_1.describe)('OCP < 4.12 (legacy behavior)', () => {
15
+ (0, vitest_1.test)('returns "Dual-stack" for valid dual stack with IPv4 primary', () => {
16
+ const cluster = createCluster({
17
+ openshiftVersion: '4.11',
18
+ machineNetworks: [
19
+ createMachineNetwork('192.168.1.0/24'),
20
+ createMachineNetwork('2001:db8::/64'),
21
+ ],
22
+ clusterNetworks: [
23
+ createClusterNetwork('10.128.0.0/14', 23),
24
+ createClusterNetwork('fd01::/48', 64),
25
+ ],
26
+ serviceNetworks: [
27
+ createServiceNetwork('172.30.0.0/16'),
28
+ createServiceNetwork('fd02::/112'),
29
+ ],
30
+ });
31
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('Dual-stack');
32
+ });
33
+ (0, vitest_1.test)('returns "IPv4" for single stack', () => {
34
+ const cluster = createCluster({
35
+ openshiftVersion: '4.11',
36
+ machineNetworks: [createMachineNetwork('192.168.1.0/24')],
37
+ clusterNetworks: [createClusterNetwork('10.128.0.0/14', 23)],
38
+ serviceNetworks: [createServiceNetwork('172.30.0.0/16')],
39
+ });
40
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
41
+ });
42
+ (0, vitest_1.test)('returns "IPv4" for IPv6 primary (invalid for OCP < 4.12)', () => {
43
+ const cluster = createCluster({
44
+ openshiftVersion: '4.11',
45
+ machineNetworks: [
46
+ createMachineNetwork('2001:db8::/64'),
47
+ createMachineNetwork('192.168.1.0/24'),
48
+ ],
49
+ clusterNetworks: [
50
+ createClusterNetwork('fd01::/48', 64),
51
+ createClusterNetwork('10.128.0.0/14', 23),
52
+ ],
53
+ serviceNetworks: [
54
+ createServiceNetwork('fd02::/112'),
55
+ createServiceNetwork('172.30.0.0/16'),
56
+ ],
57
+ });
58
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
59
+ });
60
+ });
61
+ (0, vitest_1.describe)('OCP >= 4.12 (new behavior)', () => {
62
+ (0, vitest_1.test)('returns "Dual-stack" for IPv4 primary and IPv6 secondary', () => {
63
+ const cluster = createCluster({
64
+ openshiftVersion: '4.12',
65
+ machineNetworks: [
66
+ createMachineNetwork('192.168.1.0/24'),
67
+ createMachineNetwork('2001:db8::/64'),
68
+ ],
69
+ clusterNetworks: [
70
+ createClusterNetwork('10.128.0.0/14', 23),
71
+ createClusterNetwork('fd01::/48', 64),
72
+ ],
73
+ serviceNetworks: [
74
+ createServiceNetwork('172.30.0.0/16'),
75
+ createServiceNetwork('fd02::/112'),
76
+ ],
77
+ });
78
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('Dual-stack');
79
+ });
80
+ (0, vitest_1.test)('returns "Dual-stack" for IPv6 primary and IPv4 secondary', () => {
81
+ const cluster = createCluster({
82
+ openshiftVersion: '4.12',
83
+ machineNetworks: [
84
+ createMachineNetwork('2001:db8::/64'),
85
+ createMachineNetwork('192.168.1.0/24'),
86
+ ],
87
+ clusterNetworks: [
88
+ createClusterNetwork('fd01::/48', 64),
89
+ createClusterNetwork('10.128.0.0/14', 23),
90
+ ],
91
+ serviceNetworks: [
92
+ createServiceNetwork('fd02::/112'),
93
+ createServiceNetwork('172.30.0.0/16'),
94
+ ],
95
+ });
96
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('Dual-stack');
97
+ });
98
+ (0, vitest_1.test)('returns "IPv4" for IPv6 primary and IPv6 secondary (not dual-stack)', () => {
99
+ const cluster = createCluster({
100
+ openshiftVersion: '4.12',
101
+ machineNetworks: [
102
+ createMachineNetwork('2001:db8::/64'),
103
+ createMachineNetwork('2001:db9::/64'),
104
+ ],
105
+ clusterNetworks: [
106
+ createClusterNetwork('fd01::/48', 64),
107
+ createClusterNetwork('fd02::/48', 64),
108
+ ],
109
+ serviceNetworks: [createServiceNetwork('fd03::/112'), createServiceNetwork('fd04::/112')],
110
+ });
111
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
112
+ });
113
+ (0, vitest_1.test)('returns "IPv4" for IPv4 primary and IPv4 secondary (not dual-stack)', () => {
114
+ const cluster = createCluster({
115
+ openshiftVersion: '4.12',
116
+ machineNetworks: [
117
+ createMachineNetwork('192.168.1.0/24'),
118
+ createMachineNetwork('10.0.0.0/24'),
119
+ ],
120
+ clusterNetworks: [
121
+ createClusterNetwork('10.128.0.0/14', 23),
122
+ createClusterNetwork('172.16.0.0/14', 23),
123
+ ],
124
+ serviceNetworks: [
125
+ createServiceNetwork('172.30.0.0/16'),
126
+ createServiceNetwork('172.31.0.0/16'),
127
+ ],
128
+ });
129
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
130
+ });
131
+ (0, vitest_1.test)('returns "IPv4" for single stack', () => {
132
+ const cluster = createCluster({
133
+ openshiftVersion: '4.12',
134
+ machineNetworks: [createMachineNetwork('192.168.1.0/24')],
135
+ clusterNetworks: [createClusterNetwork('10.128.0.0/14', 23)],
136
+ serviceNetworks: [createServiceNetwork('172.30.0.0/16')],
137
+ });
138
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
139
+ });
140
+ });
141
+ (0, vitest_1.describe)('edge cases', () => {
142
+ (0, vitest_1.test)('handles undefined openshiftVersion', () => {
143
+ const cluster = createCluster({
144
+ openshiftVersion: undefined,
145
+ machineNetworks: [
146
+ createMachineNetwork('192.168.1.0/24'),
147
+ createMachineNetwork('2001:db8::/64'),
148
+ ],
149
+ clusterNetworks: [
150
+ createClusterNetwork('10.128.0.0/14', 23),
151
+ createClusterNetwork('fd01::/48', 64),
152
+ ],
153
+ serviceNetworks: [
154
+ createServiceNetwork('172.30.0.0/16'),
155
+ createServiceNetwork('fd02::/112'),
156
+ ],
157
+ });
158
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('Dual-stack');
159
+ });
160
+ (0, vitest_1.test)('handles empty networks', () => {
161
+ const cluster = createCluster({
162
+ openshiftVersion: '4.12',
163
+ machineNetworks: [],
164
+ clusterNetworks: [],
165
+ serviceNetworks: [],
166
+ });
167
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
168
+ });
169
+ (0, vitest_1.test)('handles undefined networks', () => {
170
+ const cluster = createCluster({
171
+ openshiftVersion: '4.12',
172
+ machineNetworks: undefined,
173
+ clusterNetworks: undefined,
174
+ serviceNetworks: undefined,
175
+ });
176
+ (0, vitest_1.expect)((0, ClusterProperties_1.getStackTypeLabel)(cluster)).toBe('IPv4');
177
+ });
178
+ });
179
+ });
180
+ //# sourceMappingURL=ClusterProperties.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClusterProperties.test.js","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterDetail/ClusterProperties.test.ts"],"names":[],"mappings":";;AAAA,mCAAgD;AAChD,2DAAwD;AAGxD,MAAM,aAAa,GAAG,CAAC,YAA8B,EAAE,EAAW,EAAE,CAClE,CAAC,gBACC,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,gDAAgD,EACtD,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,kBAAkB,EAC9B,eAAe,EAAE,EAAE,EACnB,eAAe,EAAE,EAAE,EACnB,eAAe,EAAE,EAAE,IAChB,SAAS,CACD,CAAA,CAAC;AAEhB,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AAC7E,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,UAAkB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,EAAE;oBACf,oBAAoB,CAAC,eAAe,EAAE,EAAE,CAAC;oBACzC,oBAAoB,CAAC,WAAW,EAAE,EAAE,CAAC;iBACtC;gBACD,eAAe,EAAE;oBACf,oBAAoB,CAAC,eAAe,CAAC;oBACrC,oBAAoB,CAAC,YAAY,CAAC;iBACnC;aACF,CAAC,CAAC;YAEH,IAAA,eAAM,EAAC,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,wBAAwB,EAAE,GAAG,EAAE;YAClC,MAAM,OAAO,GAAG,aAAa,CAAC;gBAC5B,gBAAgB,EAAE,MAAM;gBACxB,eAAe,EAAE,EAAE;gBACnB,eAAe,EAAE,EAAE;gBACnB,eAAe,EAAE,EAAE;aACpB,CAAC,CAAC;YAEH,IAAA,eAAM,EAAC,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,GAAG,EAAE;YACtC,MAAM,OAAO,GAAG,aAAa,CAAC;gBAC5B,gBAAgB,EAAE,MAAM;gBACxB,eAAe,EAAE,SAAS;gBAC1B,eAAe,EAAE,SAAS;gBAC1B,eAAe,EAAE,SAAS;aAC3B,CAAC,CAAC;YAEH,IAAA,eAAM,EAAC,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import * as React from 'react';
2
- import { Alert, AlertVariant, FlexItem, Form } from '@patternfly/react-core';
2
+ import { Form } from '@patternfly/react-core';
3
3
  import { useFormikContext } from 'formik';
4
4
 
5
- import { OpenShiftVersionDropdown, OpenShiftVersionModal } from '../../../common';
5
+ import {
6
+ isMajorMinorVersionEqualOrGreater,
7
+ OpenShiftVersionDropdown,
8
+ OpenShiftVersionModal,
9
+ } from '../../../common';
6
10
  import { StaticTextField } from '../../../common/components/ui/StaticTextField';
7
11
  import { PullSecret } from '../../../common/components/clusters';
8
12
  import { OpenshiftVersionOptionType, SupportedCpuArchitecture } from '../../../common/types';
@@ -100,8 +104,13 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
100
104
  return [];
101
105
  }, [selectOptions, values.customOpenshiftSelect]);
102
106
 
103
- const isDiskEncryptionEnabled =
104
- values.enableDiskEncryptionOnMasters || values.enableDiskEncryptionOnWorkers;
107
+ const allowTNA = React.useMemo(() => {
108
+ const current =
109
+ values.customOpenshiftSelect?.version ||
110
+ versions.find((version) => version.value === values.openshiftVersion)?.version;
111
+
112
+ return isMajorMinorVersionEqualOrGreater(current, '4.19') && values.platform === 'baremetal';
113
+ }, [values.customOpenshiftSelect?.version, values.openshiftVersion, values.platform, versions]);
105
114
 
106
115
  return (
107
116
  <Form id="wizard-cluster-details__form">
@@ -163,44 +172,17 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
163
172
  <ControlPlaneNodesDropdown
164
173
  isDisabled={isEditFlow}
165
174
  allowHighlyAvailable={allowHighlyAvailable}
175
+ allowTNA={allowTNA}
166
176
  />
167
177
  {!isNutanix && (
168
178
  <CpuArchitectureDropdown cpuArchitectures={cpuArchitectures} isDisabled={isEditFlow} />
169
179
  )}
180
+
170
181
  {extensionAfter?.['openshiftVersion'] && extensionAfter['openshiftVersion']}
182
+
171
183
  {!isEditFlow && <PullSecret />}
184
+
172
185
  {extensionAfter?.['pullSecret'] && extensionAfter['pullSecret']}
173
- {/* <DiskEncryptionControlGroup
174
- values={values}
175
- isDisabled={isPullSecretSet}
176
- isSNO={isSNO({ controlPlaneCount })}
177
- /> */}
178
- {isDiskEncryptionEnabled && values.diskEncryptionMode === 'tpmv2' && (
179
- <Alert
180
- variant={AlertVariant.warning}
181
- isInline
182
- title={
183
- <FlexItem>
184
- {t(
185
- 'ai:To use this encryption method, enable TPMv2 encryption in the BIOS of each selected host.',
186
- )}
187
- </FlexItem>
188
- }
189
- />
190
- )}
191
- {isDiskEncryptionEnabled && values.diskEncryptionMode === 'tang' && (
192
- <Alert
193
- variant={AlertVariant.warning}
194
- isInline
195
- title={
196
- <FlexItem>
197
- {t(
198
- 'ai:The use of Tang encryption mode to encrypt your disks is only supported for bare metal or vSphere installations on user-provisioned infrastructure.',
199
- )}
200
- </FlexItem>
201
- }
202
- />
203
- )}
204
186
  </Form>
205
187
  );
206
188
  };
@@ -42,6 +42,7 @@ export type AgentClusterInstallK8sResource = K8sResourceCommon & {
42
42
  provisionRequirements: {
43
43
  controlPlaneAgents: number;
44
44
  workerAgents?: number;
45
+ arbiterAgents?: number;
45
46
  };
46
47
  networking: {
47
48
  clusterNetwork?: {
@@ -12,6 +12,21 @@ import { useTranslation } from '../../hooks/use-translation-wrapper';
12
12
  import { getFieldId, StaticField } from '../..';
13
13
  import { useField } from 'formik';
14
14
  import toNumber from 'lodash-es/toNumber';
15
+ import OcmTNADisclaimer from './OcmTNADisclaimer';
16
+
17
+ const isItemEnabled = (value: number, allowHighlyAvailable?: boolean, allowTNA?: boolean) => {
18
+ switch (value) {
19
+ case 1:
20
+ case 3:
21
+ return true;
22
+ case 2:
23
+ return !!allowTNA;
24
+ case 4:
25
+ case 5:
26
+ return !!allowHighlyAvailable;
27
+ }
28
+ return false;
29
+ };
15
30
 
16
31
  interface ControlPlaneNodesOption {
17
32
  value: number;
@@ -21,9 +36,11 @@ interface ControlPlaneNodesOption {
21
36
  const ControlPlaneNodesDropdown = ({
22
37
  isDisabled = false,
23
38
  allowHighlyAvailable,
39
+ allowTNA,
24
40
  }: {
25
41
  isDisabled?: boolean;
26
42
  allowHighlyAvailable?: boolean;
43
+ allowTNA?: boolean;
27
44
  }) => {
28
45
  const { t } = useTranslation();
29
46
  const [{ name, value: selectedValue }, , { setValue }] = useField<number>('controlPlaneCount');
@@ -32,6 +49,7 @@ const ControlPlaneNodesDropdown = ({
32
49
 
33
50
  const options: ControlPlaneNodesOption[] = [
34
51
  { value: 1, label: t('ai:1 (Single Node OpenShift - not highly available cluster)') },
52
+ { value: 2, label: t('ai:2 (Two-Nodes Arbiter)') },
35
53
  { value: 3, label: t('ai:3 (highly available cluster)') },
36
54
  { value: 4, label: t('ai:4 (highly available cluster+)') },
37
55
  { value: 5, label: t('ai:5 (highly available cluster++)') },
@@ -44,7 +62,8 @@ const ControlPlaneNodesDropdown = ({
44
62
  }, [allowHighlyAvailable, selectedValue, setValue]);
45
63
 
46
64
  const dropdownItems = options.map(({ value, label }) => {
47
- const isItemEnabled = [1, 3].includes(value) || allowHighlyAvailable;
65
+ const isEnabled = isItemEnabled(value, allowHighlyAvailable, allowTNA);
66
+
48
67
  const disabledReason = t('ai:This option is not available with the selected OpenShift version');
49
68
  return (
50
69
  <DropdownItem
@@ -55,7 +74,7 @@ const ControlPlaneNodesDropdown = ({
55
74
  selected={selectedValue === value}
56
75
  value={value}
57
76
  >
58
- <Tooltip hidden={isItemEnabled} content={disabledReason} position="top">
77
+ <Tooltip hidden={isEnabled} content={disabledReason} position="top">
59
78
  <div>{label}</div>
60
79
  </Tooltip>
61
80
  </DropdownItem>
@@ -70,36 +89,47 @@ const ControlPlaneNodesDropdown = ({
70
89
  setControlPlanelOpen(false);
71
90
  };
72
91
 
73
- return !isDisabled ? (
74
- <FormGroup isInline fieldId={fieldId} label={t('ai:Number of control plane nodes')} isRequired>
75
- <Dropdown
76
- isOpen={controlPlanelOpen}
77
- onSelect={onControlPlaneSelect}
78
- onOpenChange={() => setControlPlanelOpen(!controlPlanelOpen)}
79
- toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
80
- <MenuToggle
81
- className="pf-v6-u-w-100"
82
- ref={toggleRef}
83
- isFullWidth
84
- onClick={() => setControlPlanelOpen(!controlPlanelOpen)}
85
- isExpanded={controlPlanelOpen}
92
+ return (
93
+ <>
94
+ {!isDisabled ? (
95
+ <FormGroup
96
+ isInline
97
+ fieldId={fieldId}
98
+ label={t('ai:Number of control plane nodes')}
99
+ isRequired
100
+ >
101
+ <Dropdown
102
+ isOpen={controlPlanelOpen}
103
+ onSelect={onControlPlaneSelect}
104
+ onOpenChange={() => setControlPlanelOpen(!controlPlanelOpen)}
105
+ toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
106
+ <MenuToggle
107
+ className="pf-v5-u-w-100"
108
+ ref={toggleRef}
109
+ isFullWidth
110
+ onClick={() => setControlPlanelOpen(!controlPlanelOpen)}
111
+ isExpanded={controlPlanelOpen}
112
+ >
113
+ {selectedValue ? selectedValue : '3'}
114
+ </MenuToggle>
115
+ )}
116
+ shouldFocusToggleOnSelect
86
117
  >
87
- {selectedValue ? selectedValue : '3'}
88
- </MenuToggle>
89
- )}
90
- shouldFocusToggleOnSelect
91
- >
92
- <DropdownList>{dropdownItems}</DropdownList>
93
- </Dropdown>
94
- </FormGroup>
95
- ) : (
96
- <StaticField
97
- name={'controlPlaneCount'}
98
- label={t('ai:Number of control plane nodes')}
99
- isRequired
100
- >
101
- {selectedValue}
102
- </StaticField>
118
+ <DropdownList>{dropdownItems}</DropdownList>
119
+ </Dropdown>
120
+ </FormGroup>
121
+ ) : (
122
+ <StaticField
123
+ name={'controlPlaneCount'}
124
+ label={t('ai:Number of control plane nodes')}
125
+ isRequired
126
+ >
127
+ {selectedValue}
128
+ </StaticField>
129
+ )}
130
+
131
+ {selectedValue === 2 && <OcmTNADisclaimer />}
132
+ </>
103
133
  );
104
134
  };
105
135
 
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { saveAs } from 'file-saver';
3
2
  import {
4
3
  Alert,
5
4
  Button,
@@ -119,9 +118,13 @@ const DownloadIso = ({
119
118
  <ModalFooter>
120
119
  <Button
121
120
  variant={ButtonVariant.primary}
122
- onClick={() => downloadUrl && saveAs(downloadUrl)}
123
121
  data-testid="download-iso-btn"
124
122
  isDisabled={!downloadUrl}
123
+ component={'a'}
124
+ target="_blank"
125
+ href={downloadUrl}
126
+ download
127
+ rel="noopener noreferrer"
125
128
  >
126
129
  {t('ai:Download Discovery ISO')}
127
130
  </Button>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Alert, AlertVariant, List, ListItem } from '@patternfly/react-core';
3
- import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
3
+ import { useTranslation } from '../../hooks/use-translation-wrapper';
4
4
 
5
5
  const OcmTNADisclaimer = () => {
6
6
  const { t } = useTranslation();