@openshift-assisted/ui-lib 2.12.0-cim → 2.13.0-cim

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/build/@types/cim/components/Agent/NoAgentsAlert.d.ts.map +1 -1
  2. package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts +2 -0
  3. package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts.map +1 -1
  4. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +2 -1
  5. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
  6. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +3 -5
  7. package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
  8. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts +1 -0
  9. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  10. package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
  11. package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +5 -1
  12. package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
  13. package/build/@types/cim/components/InfraEnv/InfraTableToolbar.d.ts.map +1 -1
  14. package/build/@types/cim/components/InfraEnv/OpenshiftVersionDropdown.d.ts +6 -0
  15. package/build/@types/cim/components/InfraEnv/OpenshiftVersionDropdown.d.ts.map +1 -0
  16. package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts +6 -0
  17. package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -0
  18. package/build/@types/cim/components/helpers/agentStatus.d.ts.map +1 -1
  19. package/build/@types/cim/components/helpers/clusterDeployment.d.ts +1 -1
  20. package/build/@types/cim/components/helpers/clusterDeployment.d.ts.map +1 -1
  21. package/build/@types/cim/components/helpers/versions.d.ts +2 -2
  22. package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
  23. package/build/@types/cim/types/k8s/agent-service-config.d.ts +7 -0
  24. package/build/@types/cim/types/k8s/agent-service-config.d.ts.map +1 -1
  25. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +2 -1
  26. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
  27. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  28. package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
  29. package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  30. package/build/@types/common/components/hosts/utils.d.ts.map +1 -1
  31. package/build/@types/common/types/cpuArchitecture.d.ts +6 -0
  32. package/build/@types/common/types/cpuArchitecture.d.ts.map +1 -1
  33. package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts +1 -7
  34. package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
  35. package/build/@types/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.d.ts.map +1 -1
  36. package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
  37. package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
  38. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -1
  39. package/build/cjs/cim/components/Agent/NoAgentsAlert.js +10 -5
  40. package/build/cjs/cim/components/Agent/NoAgentsAlert.js.map +1 -1
  41. package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js +7 -6
  42. package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js.map +1 -1
  43. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +19 -4
  44. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
  45. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +4 -5
  46. package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
  47. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +3 -3
  48. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  49. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +12 -8
  50. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
  51. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js +6 -10
  52. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
  53. package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js +1 -4
  54. package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js.map +1 -1
  55. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js +34 -0
  56. package/build/cjs/cim/components/InfraEnv/OpenshiftVersionDropdown.js.map +1 -0
  57. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +46 -0
  58. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -0
  59. package/build/cjs/cim/components/helpers/agentStatus.js +5 -0
  60. package/build/cjs/cim/components/helpers/agentStatus.js.map +1 -1
  61. package/build/cjs/cim/components/helpers/clusterDeployment.js +8 -1
  62. package/build/cjs/cim/components/helpers/clusterDeployment.js.map +1 -1
  63. package/build/cjs/cim/components/helpers/versions.js +6 -1
  64. package/build/cjs/cim/components/helpers/versions.js.map +1 -1
  65. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -0
  66. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  67. package/build/cjs/common/components/hosts/utils.js +1 -0
  68. package/build/cjs/common/components/hosts/utils.js.map +1 -1
  69. package/build/cjs/common/components/ui/formik/LabelField.css +5 -0
  70. package/build/cjs/common/types/cpuArchitecture.js +22 -1
  71. package/build/cjs/common/types/cpuArchitecture.js.map +1 -1
  72. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +5 -27
  73. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
  74. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +2 -4
  75. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js.map +1 -1
  76. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +1 -2
  77. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
  78. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -2
  79. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
  80. package/lib/cim/components/Agent/NoAgentsAlert.tsx +8 -4
  81. package/lib/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.tsx +17 -3
  82. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +30 -4
  83. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +9 -9
  84. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +5 -3
  85. package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +18 -2
  86. package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +15 -22
  87. package/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +1 -3
  88. package/lib/cim/components/InfraEnv/OpenshiftVersionDropdown.tsx +71 -0
  89. package/lib/cim/components/common/CpuArchitectureDropdown.tsx +93 -0
  90. package/lib/cim/components/helpers/agentStatus.tsx +5 -0
  91. package/lib/cim/components/helpers/clusterDeployment.ts +8 -1
  92. package/lib/cim/components/helpers/versions.ts +12 -0
  93. package/lib/cim/types/k8s/agent-service-config.ts +8 -0
  94. package/lib/cim/types/k8s/infra-env-k8s-resource.ts +2 -1
  95. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -0
  96. package/lib/common/components/clusterWizard/types.ts +1 -0
  97. package/lib/common/components/hosts/utils.ts +2 -0
  98. package/lib/common/components/ui/formik/LabelField.css +5 -0
  99. package/lib/common/types/cpuArchitecture.ts +28 -0
  100. package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +2 -33
  101. package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +4 -7
  102. package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +1 -1
  103. package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
  104. package/package.json +3 -3
  105. package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts +0 -8
  106. package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts.map +0 -1
  107. package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js +0 -44
  108. package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js.map +0 -1
  109. package/lib/cim/components/ClusterDeployment/ArmCheckbox.tsx +0 -101
@@ -1,101 +0,0 @@
1
- import * as React from 'react';
2
- import { Checkbox, FormGroup, Tooltip } from '@patternfly/react-core';
3
- import { useField, useFormikContext } from 'formik';
4
- import {
5
- CpuArchitecture,
6
- getFieldId,
7
- HelperText,
8
- OpenshiftVersionOptionType,
9
- PopoverIcon,
10
- } from '../../../common';
11
- import {
12
- FeatureSupportLevelBadge,
13
- useFeatureSupportLevel,
14
- } from '../../../common/components/featureSupportLevels';
15
- import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
16
- import { ClusterCreateParams } from '@openshift-assisted/types/assisted-installer-service';
17
-
18
- const Label = ({ version }: { version: string }) => {
19
- const { t } = useTranslation();
20
- return (
21
- <>
22
- {t('ai:Use arm64 CPU architecture')}{' '}
23
- <PopoverIcon
24
- noVerticalAlign
25
- bodyContent={
26
- <p>
27
- {t(
28
- 'ai:Check this option if you want to use the arm64 CPU architecture instead of the default x86_64 CPU architecture. Please note that some features will not be available.',
29
- )}
30
- </p>
31
- }
32
- />
33
- <FeatureSupportLevelBadge featureId="ARM64_ARCHITECTURE" openshiftVersion={version} />
34
- </>
35
- );
36
- };
37
-
38
- type ArmCheckboxProps = { versions: OpenshiftVersionOptionType[] };
39
-
40
- const ArmCheckbox: React.FC<ArmCheckboxProps> = ({ versions }) => {
41
- const { t } = useTranslation();
42
- const {
43
- values: { openshiftVersion },
44
- } = useFormikContext<ClusterCreateParams>();
45
- const [{ name, value }, , { setValue }] = useField<CpuArchitecture>('cpuArchitecture');
46
- const fieldId = getFieldId(name, 'input');
47
-
48
- const featureSupportLevelContext = useFeatureSupportLevel();
49
- const isSupportedVersionAvailable = !!versions.find((version) =>
50
- featureSupportLevelContext.isFeatureSupported(version.value, 'ARM64_ARCHITECTURE'),
51
- );
52
-
53
- const prevVersionRef = React.useRef(openshiftVersion);
54
- const handleChange = React.useCallback(
55
- (checked: boolean) => setValue(checked ? CpuArchitecture.ARM : CpuArchitecture.x86),
56
- [setValue],
57
- );
58
-
59
- React.useEffect(() => {
60
- if (
61
- prevVersionRef.current !== openshiftVersion &&
62
- !featureSupportLevelContext.isFeatureSupported(openshiftVersion, 'ARM64_ARCHITECTURE')
63
- ) {
64
- //invoke updating cpu architecture value only if the version changed to not be in danger of touching existing clusters
65
- handleChange(false);
66
- }
67
- prevVersionRef.current = openshiftVersion;
68
- }, [openshiftVersion, handleChange, featureSupportLevelContext]);
69
- if (!isSupportedVersionAvailable) {
70
- return null;
71
- }
72
- const disabledReason = featureSupportLevelContext.getFeatureDisabledReason(
73
- openshiftVersion,
74
- 'ARM64_ARCHITECTURE',
75
- );
76
- return (
77
- <FormGroup isInline fieldId={fieldId}>
78
- <Tooltip hidden={!disabledReason} content={disabledReason}>
79
- <Checkbox
80
- id={fieldId}
81
- name={name}
82
- isDisabled={featureSupportLevelContext.isFeatureDisabled(
83
- openshiftVersion,
84
- 'ARM64_ARCHITECTURE',
85
- )}
86
- label={<Label version={openshiftVersion} />}
87
- aria-describedby={`${fieldId}-helper`}
88
- description={
89
- <HelperText fieldId={fieldId}>
90
- {t('ai:Make sure all the hosts are using arm64 CPU architecture.')}
91
- </HelperText>
92
- }
93
- isChecked={value === CpuArchitecture.ARM}
94
- onChange={handleChange}
95
- />
96
- </Tooltip>
97
- </FormGroup>
98
- );
99
- };
100
-
101
- export default ArmCheckbox;