@openshift-assisted/ui-lib 2.37.3 → 2.38.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 (232) hide show
  1. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  2. package/build/@types/cim/components/ClusterDeployment/wizardTransition.d.ts +1 -1
  3. package/build/@types/cim/components/ClusterDeployment/wizardTransition.d.ts.map +1 -1
  4. package/build/@types/cim/components/common/constants.d.ts.map +1 -1
  5. package/build/@types/cim/components/helpers/toAssisted.d.ts.map +1 -1
  6. package/build/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
  7. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +1 -0
  8. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
  9. package/build/@types/common/api/assisted-service/BundleAPI.d.ts +8 -0
  10. package/build/@types/common/api/assisted-service/BundleAPI.d.ts.map +1 -0
  11. package/build/@types/common/api/assisted-service/OperatorsAPI.d.ts +6 -0
  12. package/build/@types/common/api/assisted-service/OperatorsAPI.d.ts.map +1 -0
  13. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +7 -0
  14. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -0
  15. package/build/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
  16. package/build/@types/common/components/clusterWizard/types.d.ts +3 -1
  17. package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  18. package/build/@types/common/components/hosts/HostRowDetail.d.ts.map +1 -1
  19. package/build/@types/common/components/storage/DisksTable.d.ts.map +1 -1
  20. package/build/@types/common/config/constants.d.ts +5 -0
  21. package/build/@types/common/config/constants.d.ts.map +1 -1
  22. package/build/@types/common/config/docs_links.d.ts +1 -1
  23. package/build/@types/common/config/docs_links.d.ts.map +1 -1
  24. package/build/@types/common/selectors/clusterSelectors.d.ts +1 -0
  25. package/build/@types/common/selectors/clusterSelectors.d.ts.map +1 -1
  26. package/build/@types/common/types/clusters.d.ts +8 -0
  27. package/build/@types/common/types/clusters.d.ts.map +1 -1
  28. package/build/@types/common/types/ui-settings.d.ts +1 -0
  29. package/build/@types/common/types/ui-settings.d.ts.map +1 -1
  30. package/build/@types/ocm/components/SentryErrorMonitorContextProvider.d.ts.map +1 -1
  31. package/build/@types/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
  32. package/build/@types/ocm/components/clusterConfiguration/operators/AuthorinoCheckbox.d.ts +8 -0
  33. package/build/@types/ocm/components/clusterConfiguration/operators/AuthorinoCheckbox.d.ts.map +1 -0
  34. package/build/@types/ocm/components/clusterConfiguration/operators/CnvCheckbox.d.ts +4 -1
  35. package/build/@types/ocm/components/clusterConfiguration/operators/CnvCheckbox.d.ts.map +1 -1
  36. package/build/@types/ocm/components/clusterConfiguration/operators/LsoCheckbox.d.ts +8 -0
  37. package/build/@types/ocm/components/clusterConfiguration/operators/LsoCheckbox.d.ts.map +1 -0
  38. package/build/@types/ocm/components/clusterConfiguration/operators/LvmCheckbox.d.ts +4 -1
  39. package/build/@types/ocm/components/clusterConfiguration/operators/LvmCheckbox.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusterConfiguration/operators/MceCheckbox.d.ts +4 -1
  41. package/build/@types/ocm/components/clusterConfiguration/operators/MceCheckbox.d.ts.map +1 -1
  42. package/build/@types/ocm/components/clusterConfiguration/operators/MtvOperatorCheckbox.d.ts +4 -1
  43. package/build/@types/ocm/components/clusterConfiguration/operators/MtvOperatorCheckbox.d.ts.map +1 -1
  44. package/build/@types/ocm/components/clusterConfiguration/operators/NmstateCheckbox.d.ts +10 -0
  45. package/build/@types/ocm/components/clusterConfiguration/operators/NmstateCheckbox.d.ts.map +1 -0
  46. package/build/@types/ocm/components/clusterConfiguration/operators/NmstateRequirements.d.ts +7 -0
  47. package/build/@types/ocm/components/clusterConfiguration/operators/NmstateRequirements.d.ts.map +1 -0
  48. package/build/@types/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.d.ts +8 -0
  49. package/build/@types/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.d.ts.map +1 -0
  50. package/build/@types/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.d.ts +8 -0
  51. package/build/@types/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.d.ts.map +1 -0
  52. package/build/@types/ocm/components/clusterConfiguration/operators/OdfCheckbox.d.ts +5 -1
  53. package/build/@types/ocm/components/clusterConfiguration/operators/OdfCheckbox.d.ts.map +1 -1
  54. package/build/@types/ocm/components/clusterConfiguration/operators/OpenShiftAICheckbox.d.ts +5 -1
  55. package/build/@types/ocm/components/clusterConfiguration/operators/OpenShiftAICheckbox.d.ts.map +1 -1
  56. package/build/@types/ocm/components/clusterConfiguration/operators/OscCheckbox.d.ts +5 -1
  57. package/build/@types/ocm/components/clusterConfiguration/operators/OscCheckbox.d.ts.map +1 -1
  58. package/build/@types/ocm/components/clusterConfiguration/operators/PipelinesChekbox.d.ts +8 -0
  59. package/build/@types/ocm/components/clusterConfiguration/operators/PipelinesChekbox.d.ts.map +1 -0
  60. package/build/@types/ocm/components/clusterConfiguration/operators/ServerlessCheckbox.d.ts +8 -0
  61. package/build/@types/ocm/components/clusterConfiguration/operators/ServerlessCheckbox.d.ts.map +1 -0
  62. package/build/@types/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.d.ts +8 -0
  63. package/build/@types/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.d.ts.map +1 -0
  64. package/build/@types/ocm/components/clusterConfiguration/operators/SupportedOperators.d.ts +24 -0
  65. package/build/@types/ocm/components/clusterConfiguration/operators/SupportedOperators.d.ts.map +1 -0
  66. package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
  67. package/build/@types/ocm/components/clusterWizard/Operators.d.ts.map +1 -1
  68. package/build/@types/ocm/components/clusterWizard/OperatorsStep.d.ts.map +1 -1
  69. package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts +1 -1
  70. package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
  71. package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
  72. package/build/@types/ocm/config/constants.d.ts +2 -0
  73. package/build/@types/ocm/config/constants.d.ts.map +1 -1
  74. package/build/@types/ocm/sentry.d.ts +2 -2
  75. package/build/@types/ocm/sentry.d.ts.map +1 -1
  76. package/build/@types/ocm/services/BundleService.d.ts +6 -0
  77. package/build/@types/ocm/services/BundleService.d.ts.map +1 -0
  78. package/build/@types/ocm/services/ClustersService.d.ts +1 -0
  79. package/build/@types/ocm/services/ClustersService.d.ts.map +1 -1
  80. package/build/@types/ocm/services/OperatorsService.d.ts +1 -0
  81. package/build/@types/ocm/services/OperatorsService.d.ts.map +1 -1
  82. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -0
  83. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts.map +1 -1
  84. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +4 -5
  85. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  86. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js +1 -1
  87. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js.map +1 -1
  88. package/build/cjs/cim/components/common/constants.js +1 -1
  89. package/build/cjs/cim/components/common/constants.js.map +1 -1
  90. package/build/cjs/cim/components/helpers/toAssisted.js +2 -1
  91. package/build/cjs/cim/components/helpers/toAssisted.js.map +1 -1
  92. package/build/cjs/cim/components/modals/AddHostModal.js +4 -5
  93. package/build/cjs/cim/components/modals/AddHostModal.js.map +1 -1
  94. package/build/cjs/common/api/assisted-service/BundleAPI.js +16 -0
  95. package/build/cjs/common/api/assisted-service/BundleAPI.js.map +1 -0
  96. package/build/cjs/common/api/assisted-service/OperatorsAPI.js +13 -0
  97. package/build/cjs/common/api/assisted-service/OperatorsAPI.js.map +1 -0
  98. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +41 -0
  99. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -0
  100. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +4 -5
  101. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
  102. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js +5 -5
  103. package/build/cjs/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.js.map +1 -1
  104. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +2 -2
  105. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  106. package/build/cjs/common/components/hosts/AITableMemo.js +16 -13
  107. package/build/cjs/common/components/hosts/AITableMemo.js.map +1 -1
  108. package/build/cjs/common/components/hosts/HostRowDetail.js +35 -1
  109. package/build/cjs/common/components/hosts/HostRowDetail.js.map +1 -1
  110. package/build/cjs/common/components/storage/DisksTable.js +16 -10
  111. package/build/cjs/common/components/storage/DisksTable.js.map +1 -1
  112. package/build/cjs/common/config/constants.js +11 -1
  113. package/build/cjs/common/config/constants.js.map +1 -1
  114. package/build/cjs/common/config/docs_links.js +1 -1
  115. package/build/cjs/common/config/docs_links.js.map +1 -1
  116. package/build/cjs/common/selectors/clusterSelectors.js +7 -1
  117. package/build/cjs/common/selectors/clusterSelectors.js.map +1 -1
  118. package/build/cjs/common/types/clusters.js.map +1 -1
  119. package/build/cjs/ocm/components/SentryErrorMonitorContextProvider.js.map +1 -1
  120. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +10 -9
  121. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  122. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +2 -2
  123. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js.map +1 -1
  124. package/build/cjs/ocm/components/clusterConfiguration/operators/AuthorinoCheckbox.js +29 -0
  125. package/build/cjs/ocm/components/clusterConfiguration/operators/AuthorinoCheckbox.js.map +1 -0
  126. package/build/cjs/ocm/components/clusterConfiguration/operators/CnvCheckbox.js +3 -20
  127. package/build/cjs/ocm/components/clusterConfiguration/operators/CnvCheckbox.js.map +1 -1
  128. package/build/cjs/ocm/components/clusterConfiguration/operators/LsoCheckbox.js +29 -0
  129. package/build/cjs/ocm/components/clusterConfiguration/operators/LsoCheckbox.js.map +1 -0
  130. package/build/cjs/ocm/components/clusterConfiguration/operators/LvmCheckbox.js +5 -21
  131. package/build/cjs/ocm/components/clusterConfiguration/operators/LvmCheckbox.js.map +1 -1
  132. package/build/cjs/ocm/components/clusterConfiguration/operators/MceCheckbox.js +6 -7
  133. package/build/cjs/ocm/components/clusterConfiguration/operators/MceCheckbox.js.map +1 -1
  134. package/build/cjs/ocm/components/clusterConfiguration/operators/MtvOperatorCheckbox.js +8 -13
  135. package/build/cjs/ocm/components/clusterConfiguration/operators/MtvOperatorCheckbox.js.map +1 -1
  136. package/build/cjs/ocm/components/clusterConfiguration/operators/NmstateCheckbox.js +30 -0
  137. package/build/cjs/ocm/components/clusterConfiguration/operators/NmstateCheckbox.js.map +1 -0
  138. package/build/cjs/ocm/components/clusterConfiguration/operators/NmstateRequirements.js +48 -0
  139. package/build/cjs/ocm/components/clusterConfiguration/operators/NmstateRequirements.js.map +1 -0
  140. package/build/cjs/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.js +29 -0
  141. package/build/cjs/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.js.map +1 -0
  142. package/build/cjs/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.js +29 -0
  143. package/build/cjs/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.js.map +1 -0
  144. package/build/cjs/ocm/components/clusterConfiguration/operators/OdfCheckbox.js +7 -18
  145. package/build/cjs/ocm/components/clusterConfiguration/operators/OdfCheckbox.js.map +1 -1
  146. package/build/cjs/ocm/components/clusterConfiguration/operators/OpenShiftAICheckbox.js +4 -17
  147. package/build/cjs/ocm/components/clusterConfiguration/operators/OpenShiftAICheckbox.js.map +1 -1
  148. package/build/cjs/ocm/components/clusterConfiguration/operators/OscCheckbox.js +3 -12
  149. package/build/cjs/ocm/components/clusterConfiguration/operators/OscCheckbox.js.map +1 -1
  150. package/build/cjs/ocm/components/clusterConfiguration/operators/PipelinesChekbox.js +29 -0
  151. package/build/cjs/ocm/components/clusterConfiguration/operators/PipelinesChekbox.js.map +1 -0
  152. package/build/cjs/ocm/components/clusterConfiguration/operators/ServerlessCheckbox.js +29 -0
  153. package/build/cjs/ocm/components/clusterConfiguration/operators/ServerlessCheckbox.js.map +1 -0
  154. package/build/cjs/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.js +29 -0
  155. package/build/cjs/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.js.map +1 -0
  156. package/build/cjs/ocm/components/clusterConfiguration/operators/SupportedOperators.js +73 -0
  157. package/build/cjs/ocm/components/clusterConfiguration/operators/SupportedOperators.js.map +1 -0
  158. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js +1 -1
  159. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js.map +1 -1
  160. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +4 -0
  161. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
  162. package/build/cjs/ocm/components/clusterWizard/Operators.js +9 -1
  163. package/build/cjs/ocm/components/clusterWizard/Operators.js.map +1 -1
  164. package/build/cjs/ocm/components/clusterWizard/OperatorsStep.js +209 -22
  165. package/build/cjs/ocm/components/clusterWizard/OperatorsStep.js.map +1 -1
  166. package/build/cjs/ocm/components/clusterWizard/wizardTransition.js +1 -1
  167. package/build/cjs/ocm/components/clusterWizard/wizardTransition.js.map +1 -1
  168. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +40 -0
  169. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
  170. package/build/cjs/ocm/config/constants.js +155 -1
  171. package/build/cjs/ocm/config/constants.js.map +1 -1
  172. package/build/cjs/ocm/sentry.js +1 -1
  173. package/build/cjs/ocm/sentry.js.map +1 -1
  174. package/build/cjs/ocm/services/BundleService.js +20 -0
  175. package/build/cjs/ocm/services/BundleService.js.map +1 -0
  176. package/build/cjs/ocm/services/ClustersService.js +26 -0
  177. package/build/cjs/ocm/services/ClustersService.js.map +1 -1
  178. package/build/cjs/ocm/services/OperatorsService.js +16 -8
  179. package/build/cjs/ocm/services/OperatorsService.js.map +1 -1
  180. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +4 -6
  181. package/lib/cim/components/InfraEnv/OpenshiftVersionDropdown.tsx +1 -1
  182. package/lib/cim/components/common/constants.ts +1 -2
  183. package/lib/cim/components/helpers/toAssisted.ts +1 -0
  184. package/lib/cim/components/modals/AddHostModal.tsx +4 -5
  185. package/lib/cim/types/k8s/infra-env-k8s-resource.ts +1 -0
  186. package/lib/common/api/assisted-service/BundleAPI.ts +18 -0
  187. package/lib/common/api/assisted-service/OperatorsAPI.ts +13 -0
  188. package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +93 -0
  189. package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +10 -12
  190. package/lib/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.tsx +9 -9
  191. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -1
  192. package/lib/common/components/clusterWizard/types.ts +4 -2
  193. package/lib/common/components/hosts/AITableMemo.tsx +1 -1
  194. package/lib/common/components/hosts/HostRowDetail.tsx +71 -1
  195. package/lib/common/components/storage/DisksTable.tsx +25 -18
  196. package/lib/common/config/constants.ts +10 -0
  197. package/lib/common/config/docs_links.ts +1 -1
  198. package/lib/common/selectors/clusterSelectors.ts +8 -0
  199. package/lib/common/types/clusters.ts +8 -0
  200. package/lib/common/types/ui-settings.ts +1 -0
  201. package/lib/ocm/components/SentryErrorMonitorContextProvider.tsx +1 -2
  202. package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +13 -12
  203. package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +2 -2
  204. package/lib/ocm/components/clusterConfiguration/operators/AuthorinoCheckbox.tsx +63 -0
  205. package/lib/ocm/components/clusterConfiguration/operators/CnvCheckbox.tsx +7 -31
  206. package/lib/ocm/components/clusterConfiguration/operators/LsoCheckbox.tsx +63 -0
  207. package/lib/ocm/components/clusterConfiguration/operators/LvmCheckbox.tsx +8 -26
  208. package/lib/ocm/components/clusterConfiguration/operators/MceCheckbox.tsx +10 -3
  209. package/lib/ocm/components/clusterConfiguration/operators/MtvOperatorCheckbox.tsx +23 -12
  210. package/lib/ocm/components/clusterConfiguration/operators/NmstateCheckbox.tsx +76 -0
  211. package/lib/ocm/components/clusterConfiguration/operators/NmstateRequirements.tsx +53 -0
  212. package/lib/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.tsx +66 -0
  213. package/lib/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.tsx +63 -0
  214. package/lib/ocm/components/clusterConfiguration/operators/OdfCheckbox.tsx +20 -25
  215. package/lib/ocm/components/clusterConfiguration/operators/OpenShiftAICheckbox.tsx +11 -24
  216. package/lib/ocm/components/clusterConfiguration/operators/OscCheckbox.tsx +10 -25
  217. package/lib/ocm/components/clusterConfiguration/operators/PipelinesChekbox.tsx +64 -0
  218. package/lib/ocm/components/clusterConfiguration/operators/ServerlessCheckbox.tsx +63 -0
  219. package/lib/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.tsx +63 -0
  220. package/lib/ocm/components/clusterConfiguration/operators/SupportedOperators.tsx +105 -0
  221. package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.tsx +1 -1
  222. package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +4 -0
  223. package/lib/ocm/components/clusterWizard/Operators.tsx +21 -1
  224. package/lib/ocm/components/clusterWizard/OperatorsStep.tsx +374 -38
  225. package/lib/ocm/components/clusterWizard/wizardTransition.ts +1 -1
  226. package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +40 -0
  227. package/lib/ocm/config/constants.ts +156 -0
  228. package/lib/ocm/sentry.ts +2 -1
  229. package/lib/ocm/services/BundleService.ts +14 -0
  230. package/lib/ocm/services/ClustersService.ts +28 -0
  231. package/lib/ocm/services/OperatorsService.tsx +21 -10
  232. package/package.json +3 -3
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon, ClusterOperatorProps } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import NmstateRequirements from './NmstateRequirements';
6
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
7
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
8
+
9
+ const NMSTATE_FIELD_NAME = 'useNmstate';
10
+
11
+ const NmstateLabel = ({
12
+ disabledReason,
13
+ clusterId,
14
+ supportLevel,
15
+ }: {
16
+ disabledReason?: string;
17
+ clusterId: ClusterOperatorProps['clusterId'];
18
+ supportLevel?: SupportLevel;
19
+ }) => {
20
+ return (
21
+ <>
22
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
23
+ <span>Install NMState </span>
24
+ </Tooltip>
25
+ <PopoverIcon
26
+ id={NMSTATE_FIELD_NAME}
27
+ component={'a'}
28
+ headerContent="Additional requirements"
29
+ bodyContent={<NmstateRequirements clusterId={clusterId} />}
30
+ />
31
+ <NewFeatureSupportLevelBadge featureId="NMSTATE" supportLevel={supportLevel} />
32
+ </>
33
+ );
34
+ };
35
+
36
+ const NmstateHelperText = () => {
37
+ return (
38
+ <HelperText>
39
+ <HelperTextItem variant="indeterminate">
40
+ Provides users with functionality to configure various network interface types, DNS, and
41
+ routing on cluster nodes.{' '}
42
+ </HelperTextItem>
43
+ </HelperText>
44
+ );
45
+ };
46
+
47
+ const NmstateCheckbox = ({
48
+ clusterId,
49
+ disabledReason,
50
+ supportLevel,
51
+ }: {
52
+ clusterId: ClusterOperatorProps['clusterId'];
53
+ disabledReason?: string;
54
+ supportLevel?: SupportLevel | undefined;
55
+ }) => {
56
+ const fieldId = getFieldId(NMSTATE_FIELD_NAME, 'input');
57
+
58
+ return (
59
+ <FormGroup isInline fieldId={fieldId}>
60
+ <OcmCheckboxField
61
+ name={NMSTATE_FIELD_NAME}
62
+ label={
63
+ <NmstateLabel
64
+ clusterId={clusterId}
65
+ disabledReason={disabledReason}
66
+ supportLevel={supportLevel}
67
+ />
68
+ }
69
+ helperText={<NmstateHelperText />}
70
+ isDisabled={!!disabledReason}
71
+ />
72
+ </FormGroup>
73
+ );
74
+ };
75
+
76
+ export default NmstateCheckbox;
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import { List, ListItem } from '@patternfly/react-core';
4
+ import { useClusterPreflightRequirements } from '../../../hooks';
5
+ import { ErrorState, LoadingState, OPERATOR_NAME_NMSTATE, RenderIf } from '../../../../common';
6
+ import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
7
+ import { selectIsCurrentClusterSNO } from '../../../store/slices/current-cluster/selectors';
8
+
9
+ const NmstateRequirements = ({ clusterId }: { clusterId: Cluster['id'] }) => {
10
+ const { preflightRequirements, error, isLoading } = useClusterPreflightRequirements(clusterId);
11
+ const isSingleNode = useSelector(selectIsCurrentClusterSNO);
12
+
13
+ if (isLoading) {
14
+ return <LoadingState content="Loading hardware requirements ..." />;
15
+ }
16
+ if (error) {
17
+ return <ErrorState />;
18
+ }
19
+
20
+ const NmstateRequirements = preflightRequirements?.operators?.find(
21
+ (operatorRequirements) => operatorRequirements.operatorName === OPERATOR_NAME_NMSTATE,
22
+ );
23
+
24
+ const workerRequirements = NmstateRequirements?.requirements?.worker?.quantitative;
25
+ const masterRequirements = NmstateRequirements?.requirements?.master?.quantitative;
26
+
27
+ return (
28
+ <>
29
+ <List>
30
+ <RenderIf condition={!isSingleNode}>
31
+ <ListItem>
32
+ Each worker node requires an additional {workerRequirements?.ramMib || 360} MiB of
33
+ memory {workerRequirements?.diskSizeGb ? ',' : ''}{' '}
34
+ {workerRequirements?.cpuCores ? ` and ${workerRequirements?.cpuCores} CPUs` : ''}
35
+ {workerRequirements?.diskSizeGb
36
+ ? ` and ${workerRequirements?.diskSizeGb} storage space`
37
+ : ''}
38
+ </ListItem>
39
+ </RenderIf>
40
+ <ListItem>
41
+ Each control plane node requires an additional {masterRequirements?.ramMib || 150} MiB of
42
+ memory {masterRequirements?.diskSizeGb ? ',' : ''}{' '}
43
+ {masterRequirements?.cpuCores ? ` and ${masterRequirements?.cpuCores} CPUs` : ''}
44
+ {masterRequirements?.diskSizeGb
45
+ ? ` and ${masterRequirements?.diskSizeGb} storage space`
46
+ : ''}
47
+ </ListItem>
48
+ </List>
49
+ </>
50
+ );
51
+ };
52
+
53
+ export default NmstateRequirements;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
6
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
7
+
8
+ const NODEFEATUREDISCOVERY_FIELD_NAME = 'useNodeFeatureDiscovery';
9
+
10
+ const NodeFeatureDiscoveryLabel = ({
11
+ disabledReason,
12
+ supportLevel,
13
+ }: {
14
+ disabledReason?: string;
15
+ supportLevel?: SupportLevel;
16
+ }) => {
17
+ return (
18
+ <>
19
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
20
+ <span>Install Node Feature Discovery </span>
21
+ </Tooltip>
22
+ <PopoverIcon
23
+ id={NODEFEATUREDISCOVERY_FIELD_NAME}
24
+ component={'a'}
25
+ bodyContent={'No additional requirements needed'}
26
+ />
27
+ <NewFeatureSupportLevelBadge featureId="NODE_FEATURE_DISCOVERY" supportLevel={supportLevel} />
28
+ </>
29
+ );
30
+ };
31
+
32
+ const NodeFeatureDiscoveryHelperText = () => {
33
+ return (
34
+ <HelperText>
35
+ <HelperTextItem variant="indeterminate">
36
+ Manage the detection of hardware features and configuration by labeling nodes with
37
+ hardware-specific information.{' '}
38
+ </HelperTextItem>
39
+ </HelperText>
40
+ );
41
+ };
42
+
43
+ const NodeFeatureDiscoveryCheckbox = ({
44
+ disabledReason,
45
+ supportLevel,
46
+ }: {
47
+ disabledReason?: string;
48
+ supportLevel?: SupportLevel | undefined;
49
+ }) => {
50
+ const fieldId = getFieldId(NODEFEATUREDISCOVERY_FIELD_NAME, 'input');
51
+
52
+ return (
53
+ <FormGroup isInline fieldId={fieldId}>
54
+ <OcmCheckboxField
55
+ name={NODEFEATUREDISCOVERY_FIELD_NAME}
56
+ label={
57
+ <NodeFeatureDiscoveryLabel disabledReason={disabledReason} supportLevel={supportLevel} />
58
+ }
59
+ helperText={<NodeFeatureDiscoveryHelperText />}
60
+ isDisabled={!!disabledReason}
61
+ />
62
+ </FormGroup>
63
+ );
64
+ };
65
+
66
+ export default NodeFeatureDiscoveryCheckbox;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
6
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
7
+
8
+ const NVIDIAGPU_FIELD_NAME = 'useNvidiaGpu';
9
+
10
+ const NvidiaGpuLabel = ({
11
+ disabledReason,
12
+ supportLevel,
13
+ }: {
14
+ disabledReason?: string;
15
+ supportLevel?: SupportLevel;
16
+ }) => {
17
+ return (
18
+ <>
19
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
20
+ <span>Install NVIDIA GPU </span>
21
+ </Tooltip>
22
+ <PopoverIcon
23
+ id={NVIDIAGPU_FIELD_NAME}
24
+ component={'a'}
25
+ bodyContent={'No additional requirements needed'}
26
+ />
27
+ <NewFeatureSupportLevelBadge featureId="NVIDIA_GPU" supportLevel={supportLevel} />
28
+ </>
29
+ );
30
+ };
31
+
32
+ const NvidiaGpuHelperText = () => {
33
+ return (
34
+ <HelperText>
35
+ <HelperTextItem variant="indeterminate">
36
+ Automate the management of NVIDIA software components needed to provision and monitor GPUs.{' '}
37
+ </HelperTextItem>
38
+ </HelperText>
39
+ );
40
+ };
41
+
42
+ const NvidiaGpuCheckbox = ({
43
+ disabledReason,
44
+ supportLevel,
45
+ }: {
46
+ disabledReason?: string;
47
+ supportLevel?: SupportLevel | undefined;
48
+ }) => {
49
+ const fieldId = getFieldId(NVIDIAGPU_FIELD_NAME, 'input');
50
+
51
+ return (
52
+ <FormGroup isInline fieldId={fieldId}>
53
+ <OcmCheckboxField
54
+ name={NVIDIAGPU_FIELD_NAME}
55
+ label={<NvidiaGpuLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
56
+ helperText={<NvidiaGpuHelperText />}
57
+ isDisabled={!!disabledReason}
58
+ />
59
+ </FormGroup>
60
+ );
61
+ };
62
+
63
+ export default NvidiaGpuCheckbox;
@@ -1,21 +1,20 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
3
  import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
4
- import {
5
- getFieldId,
6
- PopoverIcon,
7
- ODF_REQUIREMENTS_LINK,
8
- ODF_LINK,
9
- OperatorsValues,
10
- } from '../../../../common';
4
+ import { getFieldId, PopoverIcon, ODF_REQUIREMENTS_LINK, ODF_LINK } from '../../../../common';
11
5
  import { OcmCheckboxField } from '../../ui/OcmFormFields';
12
- import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels';
13
- import { useFormikContext } from 'formik';
14
- import { getOdfIncompatibleWithLvmsReason } from '../../featureSupportLevels/featureStateUtils';
6
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
7
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
15
8
 
16
9
  const ODF_FIELD_NAME = 'useOpenShiftDataFoundation';
17
10
 
18
- const OdfLabel = ({ disabledReason }: { disabledReason?: string }) => (
11
+ const OdfLabel = ({
12
+ disabledReason,
13
+ supportLevel,
14
+ }: {
15
+ disabledReason?: string;
16
+ supportLevel?: SupportLevel;
17
+ }) => (
19
18
  <>
20
19
  <Tooltip hidden={!disabledReason} content={disabledReason}>
21
20
  <span>Install OpenShift Data Foundation </span>
@@ -29,6 +28,7 @@ const OdfLabel = ({ disabledReason }: { disabledReason?: string }) => (
29
28
  </a>
30
29
  }
31
30
  />
31
+ <NewFeatureSupportLevelBadge featureId="ODF" supportLevel={supportLevel} />
32
32
  </>
33
33
  );
34
34
 
@@ -45,25 +45,20 @@ const OdfHelperText = () => {
45
45
  );
46
46
  };
47
47
 
48
- const OdfCheckbox = () => {
49
- const featureSupportLevelContext = useNewFeatureSupportLevel();
50
- const { values } = useFormikContext<OperatorsValues>();
48
+ const OdfCheckbox = ({
49
+ disabledReason,
50
+ supportLevel,
51
+ }: {
52
+ disabledReason?: string;
53
+ supportLevel?: SupportLevel | undefined;
54
+ }) => {
51
55
  const fieldId = getFieldId(ODF_FIELD_NAME, 'input');
52
- const [disabledReason, setDisabledReason] = useState<string | undefined>();
53
-
54
- React.useEffect(() => {
55
- let disabledReason = featureSupportLevelContext.getFeatureDisabledReason('ODF');
56
- if (!disabledReason) {
57
- disabledReason = getOdfIncompatibleWithLvmsReason(values);
58
- }
59
- setDisabledReason(disabledReason);
60
- }, [values, featureSupportLevelContext]);
61
56
 
62
57
  return (
63
58
  <FormGroup isInline fieldId={fieldId}>
64
59
  <OcmCheckboxField
65
60
  name={ODF_FIELD_NAME}
66
- label={<OdfLabel disabledReason={disabledReason} />}
61
+ label={<OdfLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
67
62
  isDisabled={!!disabledReason}
68
63
  helperText={<OdfHelperText />}
69
64
  />
@@ -1,14 +1,11 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
3
  import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
4
- import { useFormikContext } from 'formik';
5
- import { getFieldId, PopoverIcon, OPENSHIFT_AI_LINK, OperatorsValues } from '../../../../common';
4
+ import { getFieldId, PopoverIcon, OPENSHIFT_AI_LINK } from '../../../../common';
6
5
  import OpenShiftAIRequirements from './OpenShiftAIRequirements';
7
6
  import { OcmCheckboxField } from '../../ui/OcmFormFields';
8
- import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels';
9
7
  import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
10
8
  import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service';
11
- import { getOpenShiftAIIncompatibleWithLvmsReason } from '../../featureSupportLevels/featureStateUtils';
12
9
 
13
10
  const OPENSHIFT_AI_FIELD_NAME = 'useOpenShiftAI';
14
11
 
@@ -21,7 +18,7 @@ const OpenShiftAILabel = ({ disabledReason, supportLevel }: OpenShiftAILabelProp
21
18
  return (
22
19
  <>
23
20
  <Tooltip hidden={!disabledReason} content={disabledReason}>
24
- <span>Install OpenShift AI bundle </span>
21
+ <span>Install OpenShift AI </span>
25
22
  </Tooltip>
26
23
  <PopoverIcon
27
24
  component={'a'}
@@ -46,30 +43,20 @@ const OpenShiftAIHelperText = () => {
46
43
  );
47
44
  };
48
45
 
49
- const OpenShiftAICheckbox = () => {
50
- const featureSupportLevel = useNewFeatureSupportLevel();
51
- const { values } = useFormikContext<OperatorsValues>();
46
+ const OpenShiftAICheckbox = ({
47
+ disabledReason,
48
+ supportLevel,
49
+ }: {
50
+ disabledReason?: string;
51
+ supportLevel?: SupportLevel | undefined;
52
+ }) => {
52
53
  const fieldId = getFieldId(OPENSHIFT_AI_FIELD_NAME, 'input');
53
- const [disabledReason, setDisabledReason] = useState<string | undefined>();
54
-
55
- React.useEffect(() => {
56
- let disabledReason = featureSupportLevel.getFeatureDisabledReason('OPENSHIFT_AI');
57
- if (!disabledReason) {
58
- disabledReason = getOpenShiftAIIncompatibleWithLvmsReason(values);
59
- }
60
- setDisabledReason(disabledReason);
61
- }, [values, featureSupportLevel]);
62
54
 
63
55
  return (
64
56
  <FormGroup isInline fieldId={fieldId}>
65
57
  <OcmCheckboxField
66
58
  name={OPENSHIFT_AI_FIELD_NAME}
67
- label={
68
- <OpenShiftAILabel
69
- disabledReason={disabledReason}
70
- supportLevel={featureSupportLevel.getFeatureSupportLevel('OPENSHIFT_AI')}
71
- />
72
- }
59
+ label={<OpenShiftAILabel disabledReason={disabledReason} supportLevel={supportLevel} />}
73
60
  isDisabled={!!disabledReason}
74
61
  helperText={<OpenShiftAIHelperText />}
75
62
  />
@@ -1,16 +1,8 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
3
  import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
4
- import { useFormikContext } from 'formik';
5
- import {
6
- getFieldId,
7
- PopoverIcon,
8
- OSC_REQUIREMENTS_LINK,
9
- OSC_LINK,
10
- OperatorsValues,
11
- } from '../../../../common';
4
+ import { getFieldId, PopoverIcon, OSC_REQUIREMENTS_LINK, OSC_LINK } from '../../../../common';
12
5
  import { OcmCheckboxField } from '../../ui/OcmFormFields';
13
- import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels';
14
6
  import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
15
7
  import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service';
16
8
 
@@ -57,27 +49,20 @@ const OscHelperText = () => {
57
49
  );
58
50
  };
59
51
 
60
- const OscCheckbox = () => {
61
- const featureSupportLevel = useNewFeatureSupportLevel();
62
- const { values } = useFormikContext<OperatorsValues>();
52
+ const OscCheckbox = ({
53
+ disabledReason,
54
+ supportLevel,
55
+ }: {
56
+ disabledReason?: string;
57
+ supportLevel?: SupportLevel | undefined;
58
+ }) => {
63
59
  const fieldId = getFieldId(OSC_FIELD_NAME, 'input');
64
- const [disabledReason, setDisabledReason] = useState<string | undefined>();
65
-
66
- React.useEffect(() => {
67
- const disabledReason = featureSupportLevel.getFeatureDisabledReason('OSC');
68
- setDisabledReason(disabledReason);
69
- }, [values, featureSupportLevel]);
70
60
 
71
61
  return (
72
62
  <FormGroup isInline fieldId={fieldId}>
73
63
  <OcmCheckboxField
74
64
  name={OSC_FIELD_NAME}
75
- label={
76
- <OscLabel
77
- disabledReason={disabledReason}
78
- supportLevel={featureSupportLevel.getFeatureSupportLevel('OSC')}
79
- />
80
- }
65
+ label={<OscLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
81
66
  isDisabled={!!disabledReason}
82
67
  helperText={<OscHelperText />}
83
68
  />
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
6
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
7
+
8
+ const PIPELINES_FIELD_NAME = 'usePipelines';
9
+
10
+ const PipelinesLabel = ({
11
+ disabledReason,
12
+ supportLevel,
13
+ }: {
14
+ disabledReason?: string;
15
+ supportLevel?: SupportLevel;
16
+ }) => {
17
+ return (
18
+ <>
19
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
20
+ <span>Install Pipelines </span>
21
+ </Tooltip>
22
+ <PopoverIcon
23
+ id={PIPELINES_FIELD_NAME}
24
+ component={'a'}
25
+ bodyContent={'No additional requirements needed'}
26
+ />
27
+ <NewFeatureSupportLevelBadge featureId="PIPELINES" supportLevel={supportLevel} />
28
+ </>
29
+ );
30
+ };
31
+
32
+ const PipelinesHelperText = () => {
33
+ return (
34
+ <HelperText>
35
+ <HelperTextItem variant="indeterminate">
36
+ Cloud-native continuous integration and delivery (CI/CD) solution for building pipelines
37
+ using Tekton.{' '}
38
+ </HelperTextItem>
39
+ </HelperText>
40
+ );
41
+ };
42
+
43
+ const PipelinesCheckbox = ({
44
+ disabledReason,
45
+ supportLevel,
46
+ }: {
47
+ disabledReason?: string;
48
+ supportLevel?: SupportLevel | undefined;
49
+ }) => {
50
+ const fieldId = getFieldId(PIPELINES_FIELD_NAME, 'input');
51
+
52
+ return (
53
+ <FormGroup isInline fieldId={fieldId}>
54
+ <OcmCheckboxField
55
+ name={PIPELINES_FIELD_NAME}
56
+ label={<PipelinesLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
57
+ helperText={<PipelinesHelperText />}
58
+ isDisabled={!!disabledReason}
59
+ />
60
+ </FormGroup>
61
+ );
62
+ };
63
+
64
+ export default PipelinesCheckbox;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
6
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
7
+
8
+ const SERVERLESS_FIELD_NAME = 'useServerless';
9
+
10
+ const ServerlessLabel = ({
11
+ disabledReason,
12
+ supportLevel,
13
+ }: {
14
+ disabledReason?: string;
15
+ supportLevel?: SupportLevel;
16
+ }) => {
17
+ return (
18
+ <>
19
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
20
+ <span>Install Serverless </span>
21
+ </Tooltip>
22
+ <PopoverIcon
23
+ id={SERVERLESS_FIELD_NAME}
24
+ component={'a'}
25
+ bodyContent={'No additional requirements needed'}
26
+ />
27
+ <NewFeatureSupportLevelBadge featureId="SERVERLESS" supportLevel={supportLevel} />
28
+ </>
29
+ );
30
+ };
31
+
32
+ const ServerlessHelperText = () => {
33
+ return (
34
+ <HelperText>
35
+ <HelperTextItem variant="indeterminate">
36
+ Deploy workflow applications based on the CNCF Serverless Workflow specification.{' '}
37
+ </HelperTextItem>
38
+ </HelperText>
39
+ );
40
+ };
41
+
42
+ const ServerlessCheckbox = ({
43
+ disabledReason,
44
+ supportLevel,
45
+ }: {
46
+ disabledReason?: string;
47
+ supportLevel?: SupportLevel | undefined;
48
+ }) => {
49
+ const fieldId = getFieldId(SERVERLESS_FIELD_NAME, 'input');
50
+
51
+ return (
52
+ <FormGroup isInline fieldId={fieldId}>
53
+ <OcmCheckboxField
54
+ name={SERVERLESS_FIELD_NAME}
55
+ label={<ServerlessLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
56
+ helperText={<ServerlessHelperText />}
57
+ isDisabled={!!disabledReason}
58
+ />
59
+ </FormGroup>
60
+ );
61
+ };
62
+
63
+ export default ServerlessCheckbox;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core';
3
+ import { getFieldId, PopoverIcon } from '../../../../common';
4
+ import { OcmCheckboxField } from '../../ui/OcmFormFields';
5
+ import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service';
6
+ import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
7
+
8
+ const SERVICEMESH_FIELD_NAME = 'useServiceMesh';
9
+
10
+ const ServiceMeshLabel = ({
11
+ disabledReason,
12
+ supportLevel,
13
+ }: {
14
+ disabledReason?: string;
15
+ supportLevel?: SupportLevel;
16
+ }) => {
17
+ return (
18
+ <>
19
+ <Tooltip hidden={!disabledReason} content={disabledReason}>
20
+ <span>Install Service Mesh </span>
21
+ </Tooltip>
22
+ <PopoverIcon
23
+ id={SERVICEMESH_FIELD_NAME}
24
+ component={'a'}
25
+ bodyContent={'No additional requirements needed'}
26
+ />
27
+ <NewFeatureSupportLevelBadge featureId="SERVICEMESH" supportLevel={supportLevel} />
28
+ </>
29
+ );
30
+ };
31
+
32
+ const ServiceMeshHelperText = () => {
33
+ return (
34
+ <HelperText>
35
+ <HelperTextItem variant="indeterminate">
36
+ Platform that provides behavioral insight and operational control over a service mesh.{' '}
37
+ </HelperTextItem>
38
+ </HelperText>
39
+ );
40
+ };
41
+
42
+ const ServiceMeshCheckbox = ({
43
+ disabledReason,
44
+ supportLevel,
45
+ }: {
46
+ disabledReason?: string;
47
+ supportLevel?: SupportLevel | undefined;
48
+ }) => {
49
+ const fieldId = getFieldId(SERVICEMESH_FIELD_NAME, 'input');
50
+
51
+ return (
52
+ <FormGroup isInline fieldId={fieldId}>
53
+ <OcmCheckboxField
54
+ name={SERVICEMESH_FIELD_NAME}
55
+ label={<ServiceMeshLabel disabledReason={disabledReason} supportLevel={supportLevel} />}
56
+ helperText={<ServiceMeshHelperText />}
57
+ isDisabled={!!disabledReason}
58
+ />
59
+ </FormGroup>
60
+ );
61
+ };
62
+
63
+ export default ServiceMeshCheckbox;