@openshift-assisted/ui-lib 2.11.3-cim → 2.12.1-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 (173) hide show
  1. package/build/@types/cim/components/Agent/NoAgentsAlert.d.ts.map +1 -1
  2. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  3. package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
  4. package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +1 -1
  5. package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
  6. package/build/@types/cim/components/InfraEnv/InfraTableToolbar.d.ts.map +1 -1
  7. package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts +5 -0
  8. package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -0
  9. package/build/@types/cim/components/helpers/agentStatus.d.ts.map +1 -1
  10. package/build/@types/cim/components/helpers/clusterDeployment.d.ts +1 -1
  11. package/build/@types/cim/components/helpers/clusterDeployment.d.ts.map +1 -1
  12. package/build/@types/cim/components/modals/CimConfiguration/CimStorageMissingAlert.d.ts.map +1 -1
  13. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +1 -1
  14. package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
  15. package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
  16. package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
  17. package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  18. package/build/@types/common/components/hosts/utils.d.ts.map +1 -1
  19. package/build/@types/common/types/cpuArchitecture.d.ts +6 -0
  20. package/build/@types/common/types/cpuArchitecture.d.ts.map +1 -1
  21. package/build/@types/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.d.ts +1 -4
  22. package/build/@types/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.d.ts.map +1 -1
  23. package/build/@types/ocm/components/Routes.d.ts +3 -2
  24. package/build/@types/ocm/components/Routes.d.ts.map +1 -1
  25. package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts +1 -7
  26. package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
  27. package/build/@types/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.d.ts.map +1 -1
  28. package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
  29. package/build/@types/ocm/components/clusterDetail/AssistedInstallerDetailCard.d.ts.map +1 -1
  30. package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
  31. package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
  32. package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts.map +1 -1
  33. package/build/@types/ocm/components/clusterWizard/Operators.d.ts.map +1 -1
  34. package/build/@types/ocm/components/clusters/ClusterBreadcrumbs.d.ts.map +1 -1
  35. package/build/@types/ocm/components/clusters/ClusterPage.d.ts +3 -9
  36. package/build/@types/ocm/components/clusters/ClusterPage.d.ts.map +1 -1
  37. package/build/@types/ocm/components/clusters/ClusterPageErrors.d.ts.map +1 -1
  38. package/build/@types/ocm/components/clusters/Clusters.d.ts +1 -3
  39. package/build/@types/ocm/components/clusters/Clusters.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusters/ClustersListToolbar.d.ts.map +1 -1
  41. package/build/@types/ocm/components/clusters/NewClusterPage.d.ts +2 -3
  42. package/build/@types/ocm/components/clusters/NewClusterPage.d.ts.map +1 -1
  43. package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
  44. package/build/@types/ocm/components/ui/Buttons/BackButton.d.ts +2 -3
  45. package/build/@types/ocm/components/ui/Buttons/BackButton.d.ts.map +1 -1
  46. package/build/@types/ocm/store/slices/clusters/selectors.d.ts.map +1 -1
  47. package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -1
  48. package/build/cjs/cim/components/Agent/NoAgentsAlert.js +12 -7
  49. package/build/cjs/cim/components/Agent/NoAgentsAlert.js.map +1 -1
  50. package/build/cjs/cim/components/Agent/tableUtils.js +3 -3
  51. package/build/cjs/cim/components/Agent/tableUtils.js.map +1 -1
  52. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +2 -2
  53. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  54. package/build/cjs/cim/components/Hypershift/DetailsPage/NodePoolsTable.js +2 -2
  55. package/build/cjs/cim/components/Hypershift/DetailsPage/NodePoolsTable.js.map +1 -1
  56. package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js +2 -2
  57. package/build/cjs/cim/components/InfraEnv/AddHostDropdown.js.map +1 -1
  58. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +2 -1
  59. package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
  60. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js +2 -9
  61. package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
  62. package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js +1 -4
  63. package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js.map +1 -1
  64. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +30 -0
  65. package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -0
  66. package/build/cjs/cim/components/helpers/agentStatus.js +5 -0
  67. package/build/cjs/cim/components/helpers/agentStatus.js.map +1 -1
  68. package/build/cjs/cim/components/helpers/clusterDeployment.js +8 -1
  69. package/build/cjs/cim/components/helpers/clusterDeployment.js.map +1 -1
  70. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigProgressAlert.js +3 -3
  71. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigProgressAlert.js.map +1 -1
  72. package/build/cjs/cim/components/modals/CimConfiguration/CimStorageMissingAlert.js +3 -3
  73. package/build/cjs/cim/components/modals/CimConfiguration/CimStorageMissingAlert.js.map +1 -1
  74. package/build/cjs/cim/components/modals/MassDeleteAgentModal.js +2 -2
  75. package/build/cjs/cim/components/modals/MassDeleteAgentModal.js.map +1 -1
  76. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -0
  77. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  78. package/build/cjs/common/components/hosts/utils.js +1 -0
  79. package/build/cjs/common/components/hosts/utils.js.map +1 -1
  80. package/build/cjs/common/types/cpuArchitecture.js +22 -1
  81. package/build/cjs/common/types/cpuArchitecture.js.map +1 -1
  82. package/build/cjs/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.js.map +1 -1
  83. package/build/cjs/ocm/components/Routes.js +10 -10
  84. package/build/cjs/ocm/components/Routes.js.map +1 -1
  85. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +5 -27
  86. package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
  87. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +2 -4
  88. package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js.map +1 -1
  89. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +1 -2
  90. package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
  91. package/build/cjs/ocm/components/clusterDetail/AssistedInstallerDetailCard.js +2 -3
  92. package/build/cjs/ocm/components/clusterDetail/AssistedInstallerDetailCard.js.map +1 -1
  93. package/build/cjs/ocm/components/clusterDetail/ClusterDetail.js +5 -5
  94. package/build/cjs/ocm/components/clusterDetail/ClusterDetail.js.map +1 -1
  95. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +4 -5
  96. package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
  97. package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +2 -2
  98. package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
  99. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +3 -2
  100. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
  101. package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js +3 -4
  102. package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js.map +1 -1
  103. package/build/cjs/ocm/components/clusterWizard/Operators.js +6 -4
  104. package/build/cjs/ocm/components/clusterWizard/Operators.js.map +1 -1
  105. package/build/cjs/ocm/components/clusters/ClusterBreadcrumbs.js +3 -4
  106. package/build/cjs/ocm/components/clusters/ClusterBreadcrumbs.js.map +1 -1
  107. package/build/cjs/ocm/components/clusters/ClusterPage.js +10 -7
  108. package/build/cjs/ocm/components/clusters/ClusterPage.js.map +1 -1
  109. package/build/cjs/ocm/components/clusters/ClusterPageErrors.js +1 -2
  110. package/build/cjs/ocm/components/clusters/ClusterPageErrors.js.map +1 -1
  111. package/build/cjs/ocm/components/clusters/Clusters.js +6 -5
  112. package/build/cjs/ocm/components/clusters/Clusters.js.map +1 -1
  113. package/build/cjs/ocm/components/clusters/ClustersListToolbar.js +3 -4
  114. package/build/cjs/ocm/components/clusters/ClustersListToolbar.js.map +1 -1
  115. package/build/cjs/ocm/components/clusters/NewClusterPage.js +1 -1
  116. package/build/cjs/ocm/components/clusters/NewClusterPage.js.map +1 -1
  117. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -2
  118. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
  119. package/build/cjs/ocm/components/ui/Buttons/BackButton.js +2 -2
  120. package/build/cjs/ocm/components/ui/Buttons/BackButton.js.map +1 -1
  121. package/build/cjs/ocm/store/slices/clusters/selectors.js +2 -3
  122. package/build/cjs/ocm/store/slices/clusters/selectors.js.map +1 -1
  123. package/lib/cim/components/Agent/NoAgentsAlert.tsx +9 -5
  124. package/lib/cim/components/Agent/tableUtils.tsx +1 -1
  125. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +3 -2
  126. package/lib/cim/components/Hypershift/DetailsPage/NodePoolsTable.tsx +1 -1
  127. package/lib/cim/components/InfraEnv/AddHostDropdown.tsx +1 -1
  128. package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +8 -2
  129. package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +7 -22
  130. package/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +1 -3
  131. package/lib/cim/components/common/CpuArchitectureDropdown.tsx +73 -0
  132. package/lib/cim/components/helpers/agentStatus.tsx +5 -0
  133. package/lib/cim/components/helpers/clusterDeployment.ts +8 -1
  134. package/lib/cim/components/modals/CimConfiguration/CimConfigProgressAlert.tsx +3 -3
  135. package/lib/cim/components/modals/CimConfiguration/CimStorageMissingAlert.tsx +3 -6
  136. package/lib/cim/components/modals/MassDeleteAgentModal.tsx +1 -1
  137. package/lib/cim/types/k8s/infra-env-k8s-resource.ts +1 -1
  138. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -0
  139. package/lib/common/components/clusterWizard/types.ts +1 -0
  140. package/lib/common/components/hosts/utils.ts +2 -0
  141. package/lib/common/types/cpuArchitecture.ts +28 -0
  142. package/lib/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabMock.tsx +1 -5
  143. package/lib/ocm/components/Routes.tsx +13 -9
  144. package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +2 -33
  145. package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +4 -7
  146. package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +1 -1
  147. package/lib/ocm/components/clusterDetail/AssistedInstallerDetailCard.tsx +2 -3
  148. package/lib/ocm/components/clusterDetail/ClusterDetail.tsx +5 -5
  149. package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +4 -5
  150. package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +1 -1
  151. package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +3 -2
  152. package/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx +3 -7
  153. package/lib/ocm/components/clusterWizard/Operators.tsx +5 -3
  154. package/lib/ocm/components/clusters/ClusterBreadcrumbs.tsx +2 -3
  155. package/lib/ocm/components/clusters/ClusterPage.tsx +19 -16
  156. package/lib/ocm/components/clusters/ClusterPageErrors.tsx +1 -2
  157. package/lib/ocm/components/clusters/Clusters.tsx +6 -8
  158. package/lib/ocm/components/clusters/ClustersListToolbar.tsx +3 -4
  159. package/lib/ocm/components/clusters/NewClusterPage.tsx +4 -6
  160. package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
  161. package/lib/ocm/components/ui/Buttons/BackButton.tsx +2 -4
  162. package/lib/ocm/store/slices/clusters/selectors.tsx +2 -3
  163. package/package.json +4 -4
  164. package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts +0 -8
  165. package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts.map +0 -1
  166. package/build/@types/ocm/components/ui/RedirectToCluster.d.ts +0 -8
  167. package/build/@types/ocm/components/ui/RedirectToCluster.d.ts.map +0 -1
  168. package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js +0 -44
  169. package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js.map +0 -1
  170. package/build/cjs/ocm/components/ui/RedirectToCluster.js +0 -14
  171. package/build/cjs/ocm/components/ui/RedirectToCluster.js.map +0 -1
  172. package/lib/cim/components/ClusterDeployment/ArmCheckbox.tsx +0 -101
  173. package/lib/ocm/components/ui/RedirectToCluster.tsx +0 -14
@@ -20,7 +20,12 @@ import { PencilAltIcon } from '@patternfly/react-icons/dist/js/icons/pencil-alt-
20
20
  import { global_palette_green_500 as okColor } from '@patternfly/react-tokens/dist/js/global_palette_green_500';
21
21
  import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
22
22
 
23
- import { CpuArchitecture, LabelValue } from '../../../common';
23
+ import {
24
+ architectureData,
25
+ CpuArchitecture,
26
+ LabelValue,
27
+ SupportedCpuArchitecture,
28
+ } from '../../../common';
24
29
  import { InfraEnvK8sResource, SecretK8sResource } from '../../types';
25
30
  import { AGENT_LOCATION_LABEL_KEY } from '../common';
26
31
  import EditPullSecretModal, { EditPullSecretModalProps } from '../modals/EditPullSecretModal';
@@ -160,7 +165,8 @@ const EnvironmentDetails: React.FC<EnvironmentDetailsProps> = ({
160
165
  <DescriptionListGroup>
161
166
  <DescriptionListTerm>{t('ai:CPU architecture')}</DescriptionListTerm>
162
167
  <DescriptionListDescription>
163
- {infraEnv.spec?.cpuArchitecture ?? CpuArchitecture.x86}
168
+ {architectureData[infraEnv.spec?.cpuArchitecture as SupportedCpuArchitecture]
169
+ .label ?? CpuArchitecture.x86}
164
170
  </DescriptionListDescription>
165
171
  </DescriptionListGroup>
166
172
  <DescriptionListGroup>
@@ -48,6 +48,7 @@ import './infra-env.css';
48
48
  import { getErrorMessage } from '../../../common/utils';
49
49
  import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
50
50
  import { TFunction } from 'i18next';
51
+ import CpuArchitectureDropdown from '../common/CpuArchitectureDropdown';
51
52
 
52
53
  export type EnvironmentStepFormValues = {
53
54
  name: string;
@@ -60,7 +61,10 @@ export type EnvironmentStepFormValues = {
60
61
  enableProxy: boolean;
61
62
  labels: string[];
62
63
  networkType: 'dhcp' | 'static';
63
- cpuArchitecture: CpuArchitecture;
64
+ cpuArchitecture: Extract<
65
+ CpuArchitecture,
66
+ CpuArchitecture.x86 | CpuArchitecture.ARM | CpuArchitecture.s390x
67
+ >;
64
68
  enableNtpSources: boolean;
65
69
  additionalNtpSources: string;
66
70
  };
@@ -136,6 +140,7 @@ const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
136
140
  setFieldValue('sshPublicKey', sshPublicKey);
137
141
  // eslint-disable-next-line react-hooks/exhaustive-deps
138
142
  }, [pullSecret, sshPublicKey]);
143
+
139
144
  return (
140
145
  <Stack hasGutter>
141
146
  <StackItem>
@@ -216,27 +221,7 @@ const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
216
221
  </FlexItem>
217
222
  </Flex>
218
223
  </FormGroup>
219
- <FormGroup fieldId="cpuArchitecture" label={t('ai:CPU architecture')}>
220
- <Flex justifyContent={{ default: 'justifyContentFlexStart' }}>
221
- <FlexItem>
222
- <RadioField
223
- name="cpuArchitecture"
224
- id="x86_64"
225
- value="x86_64"
226
- label={t('ai:x86_64')}
227
- />
228
- </FlexItem>
229
- <FlexItem spacer={{ default: 'spacer4xl' }} />
230
- <FlexItem>
231
- <RadioField
232
- name="cpuArchitecture"
233
- id="arm64"
234
- value="arm64"
235
- label={<>{t('ai:arm64')}&nbsp;</>}
236
- />
237
- </FlexItem>
238
- </Flex>
239
- </FormGroup>
224
+ <CpuArchitectureDropdown />
240
225
  <RichInputField
241
226
  label={t('ai:Location')}
242
227
  name="location"
@@ -105,9 +105,7 @@ const InfraTableToolbar: React.FC<InfraTableToolbarProps> = ({
105
105
  <SearchInput
106
106
  placeholder={t('ai:Find by hostname')}
107
107
  value={hostnameFilter}
108
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
109
- // @ts-ignore
110
- onChange={setHostnameFilter}
108
+ onChange={(_e, value) => setHostnameFilter(value)}
111
109
  onClear={() => setHostnameFilter(undefined)}
112
110
  />
113
111
  </ToolbarItem>
@@ -0,0 +1,73 @@
1
+ import * as React from 'react';
2
+ import { Dropdown, DropdownItem, DropdownToggle, FormGroup } from '@patternfly/react-core';
3
+ import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
4
+ import {
5
+ architectureData,
6
+ CpuArchitecture,
7
+ getFieldId,
8
+ StaticField,
9
+ SupportedCpuArchitecture,
10
+ } from '../../../common';
11
+ import { useField } from 'formik';
12
+ import { useFormikHelpers } from '../../../common/hooks/useFormikHelpers';
13
+
14
+ const CpuArchitectureDropdown = ({ isDisabled = false }: { isDisabled?: boolean }) => {
15
+ const { t } = useTranslation();
16
+ const [{ name, value }, , { setValue }] = useField<SupportedCpuArchitecture>('cpuArchitecture');
17
+ const [cpuArchOpen, setCpuArchOpen] = React.useState(false);
18
+ const fieldId = getFieldId(name, 'input');
19
+ const { setValue: setUserManagedNetworking } = useFormikHelpers<boolean>('userManagedNetworking');
20
+
21
+ const onCpuArchSelect = (e?: React.SyntheticEvent<HTMLDivElement>) => {
22
+ const val = e?.currentTarget.id as SupportedCpuArchitecture;
23
+ setValue(val);
24
+ setUserManagedNetworking(val === CpuArchitecture.s390x);
25
+
26
+ setCpuArchOpen(false);
27
+ };
28
+
29
+ return !isDisabled ? (
30
+ <FormGroup isInline fieldId={fieldId} label={t('ai:CPU architecture')} required>
31
+ <Dropdown
32
+ toggle={
33
+ <DropdownToggle onToggle={() => setCpuArchOpen(!cpuArchOpen)} className="pf-u-w-100">
34
+ {value ? architectureData[value].label : t('ai:CPU architecture')}
35
+ </DropdownToggle>
36
+ }
37
+ name="cpuArchitecture"
38
+ isOpen={cpuArchOpen}
39
+ onSelect={onCpuArchSelect}
40
+ dropdownItems={[
41
+ <DropdownItem
42
+ key={'x86_64'}
43
+ id="x86_64"
44
+ description={architectureData['x86_64'].description}
45
+ >
46
+ {architectureData['x86_64'].label}
47
+ </DropdownItem>,
48
+ <DropdownItem
49
+ key={'arm64'}
50
+ id="arm64"
51
+ description={architectureData['arm64'].description}
52
+ >
53
+ {architectureData['arm64'].label}
54
+ </DropdownItem>,
55
+ <DropdownItem
56
+ key={'s390x'}
57
+ id="s390x"
58
+ description={architectureData['s390x'].description}
59
+ >
60
+ {architectureData['s390x'].label}
61
+ </DropdownItem>,
62
+ ]}
63
+ className="pf-u-w-100"
64
+ />
65
+ </FormGroup>
66
+ ) : (
67
+ <StaticField name={'cpuArchitecture'} label={t('ai:CPU architecture')} isRequired>
68
+ {architectureData[value].label}
69
+ </StaticField>
70
+ );
71
+ };
72
+
73
+ export default CpuArchitectureDropdown;
@@ -42,6 +42,11 @@ export const bmhStatus = (t: TFunction): HostStatus<string> => ({
42
42
  title: t('ai:Pending'),
43
43
  category: 'Bare Metal Host related',
44
44
  },
45
+ 'externally provisioned': {
46
+ key: 'externally provisioned',
47
+ title: t('ai:Externally provisioned'),
48
+ category: 'Bare Metal Host related',
49
+ },
45
50
  });
46
51
 
47
52
  export const agentStatus = (t: TFunction): HostStatus<string> => ({
@@ -234,5 +234,12 @@ export const getClusterDeploymentCpuArchitecture = (
234
234
  arch = clusterDeployment.metadata?.annotations?.[CPU_ARCHITECTURE_ANNOTATION_KEY];
235
235
  }
236
236
 
237
- return arch === CpuArchitecture.ARM ? CpuArchitecture.ARM : CpuArchitecture.x86;
237
+ switch (arch) {
238
+ case CpuArchitecture.ARM:
239
+ return CpuArchitecture.ARM;
240
+ case CpuArchitecture.s390x:
241
+ return CpuArchitecture.s390x;
242
+ default:
243
+ return CpuArchitecture.x86;
244
+ }
238
245
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useHistory } from 'react-router-dom';
2
+ import { useNavigate } from 'react-router-dom-v5-compat';
3
3
  import {
4
4
  Alert,
5
5
  AlertVariant,
@@ -26,7 +26,7 @@ export const CimConfigProgressAlert: React.FC<CimConfigProgressAlertProps> = ({
26
26
  assistedServiceDeploymentUrl,
27
27
  }) => {
28
28
  const { t } = useTranslation();
29
- const history = useHistory();
29
+ const navigate = useNavigate();
30
30
  const [hideSuccess, setHideSuccess] = React.useState(true);
31
31
 
32
32
  React.useEffect(
@@ -68,7 +68,7 @@ export const CimConfigProgressAlert: React.FC<CimConfigProgressAlertProps> = ({
68
68
  variant={ButtonVariant.link}
69
69
  isInline
70
70
  key="assisted-service-deployment"
71
- onClick={() => history.push(assistedServiceDeploymentUrl)}
71
+ onClick={() => navigate(assistedServiceDeploymentUrl)}
72
72
  >
73
73
  {t('ai:Troubleshoot in the assisted service deployment')} <ExternalLinkAltIcon />
74
74
  </Button>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useHistory } from 'react-router-dom';
2
+ import { useNavigate } from 'react-router-dom-v5-compat';
3
3
  import { Alert, AlertActionLink, AlertVariant } from '@patternfly/react-core';
4
4
  import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
5
5
 
@@ -10,7 +10,7 @@ export const CimStorageMissingAlert: React.FC<{
10
10
  storageOperatorUrl: string;
11
11
  }> = ({ docStorageUrl, storageOperatorUrl }) => {
12
12
  const { t } = useTranslation();
13
- const history = useHistory();
13
+ const navigate = useNavigate();
14
14
 
15
15
  const contentWorkaround = (
16
16
  <>
@@ -20,10 +20,7 @@ export const CimStorageMissingAlert: React.FC<{
20
20
  );
21
21
 
22
22
  const actionLinks: React.ReactNode[] = [
23
- <AlertActionLink
24
- key="install-storage-operator"
25
- onClick={() => history.push(storageOperatorUrl)}
26
- >
23
+ <AlertActionLink key="install-storage-operator" onClick={() => navigate(storageOperatorUrl)}>
27
24
  {t('ai:Install storage operator')}
28
25
  </AlertActionLink>,
29
26
  <AlertActionLink key="storage-class" onClick={() => window.open(docStorageUrl, '_blank')}>
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Button, Flex, FlexItem, Popover } from '@patternfly/react-core';
3
3
  import { InfoCircleIcon } from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
4
- import { Link } from 'react-router-dom';
4
+ import { Link } from 'react-router-dom-v5-compat';
5
5
  import { sortable } from '@patternfly/react-table';
6
6
  import { global_palette_blue_300 as blueInfoColor } from '@patternfly/react-tokens/dist/js/global_palette_blue_300';
7
7
  import {
@@ -23,7 +23,7 @@ export type InfraEnvK8sResource = K8sResourceCommon & {
23
23
  };
24
24
  nmStateConfigLabelSelector?: Selector;
25
25
  additionalNTPSources?: string[];
26
- cpuArchitecture?: 'x86_64' | 'arm64';
26
+ cpuArchitecture?: 'x86_64' | 'arm64' | 's390x';
27
27
  };
28
28
  status?: {
29
29
  agentLabelSelector?: Selector;
@@ -76,6 +76,7 @@ export const getClusterDetailsInitialValues = ({
76
76
  diskEncryption: cluster?.diskEncryption ?? {},
77
77
  cpuArchitecture: cluster?.cpuArchitecture || getDefaultCpuArchitecture(),
78
78
  platform: cluster?.platform?.type || 'none',
79
+ userManagedNetworking: cluster?.userManagedNetworking || false,
79
80
  };
80
81
  };
81
82
 
@@ -31,6 +31,7 @@ export type ClusterDetailsValues = {
31
31
  diskEncryption: DiskEncryption;
32
32
  cpuArchitecture: string;
33
33
  platform: PlatformType;
34
+ userManagedNetworking: boolean;
34
35
  };
35
36
 
36
37
  export type HostsValidationsProps<S extends string, V extends string[]> = {
@@ -211,8 +211,10 @@ export const filterByHostname = (hosts: Host[], hostnameFilter: string | undefin
211
211
 
212
212
  const fuse = new Fuse(hostsWithHostname, {
213
213
  ignoreLocation: true,
214
+ threshold: 0.3,
214
215
  keys: ['hostname'],
215
216
  });
217
+
216
218
  return fuse.search(hostnameFilter).map(({ item }) => item.host);
217
219
  };
218
220
 
@@ -2,6 +2,12 @@ import { ArchitectureSupportLevelId } from '@openshift-assisted/types/assisted-i
2
2
 
3
3
  export type ClusterCpuArchitecture = 'x86_64' | 'aarch64' | 'arm64' | 'ppc64le' | 's390x' | 'multi';
4
4
 
5
+ export type CpuArchitectureItem = {
6
+ description: string;
7
+ featureSupportLevelId?: ArchitectureSupportLevelId;
8
+ label: string;
9
+ };
10
+
5
11
  export enum CpuArchitecture {
6
12
  x86 = 'x86_64',
7
13
  ARM = 'arm64',
@@ -43,6 +49,28 @@ export const getAllCpuArchitectures = (): SupportedCpuArchitecture[] => [
43
49
  CpuArchitecture.s390x,
44
50
  ];
45
51
 
52
+ export const architectureData: Record<SupportedCpuArchitecture, CpuArchitectureItem> = {
53
+ [CpuArchitecture.x86]: {
54
+ description: '',
55
+ label: 'x86_64',
56
+ },
57
+ [CpuArchitecture.ARM]: {
58
+ description: 'Some features may not be available',
59
+ featureSupportLevelId: 'ARM64_ARCHITECTURE',
60
+ label: 'Arm64',
61
+ },
62
+ [CpuArchitecture.ppc64le]: {
63
+ description: 'Some features may not be available',
64
+ featureSupportLevelId: 'PPC64LE_ARCHITECTURE',
65
+ label: 'IBM Power (ppc64le)',
66
+ },
67
+ [CpuArchitecture.s390x]: {
68
+ description: 'Some features may not be available',
69
+ featureSupportLevelId: 'S390X_ARCHITECTURE',
70
+ label: 'IBM Z (s390x)',
71
+ },
72
+ };
73
+
46
74
  export const getSupportedCpuArchitectures = (
47
75
  cpuArchitectures: CpuArchitecture[],
48
76
  day1CpuArchitecture?: SupportedCpuArchitecture,
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { RouteComponentProps } from 'react-router-dom';
3
2
  import {
4
3
  ButtonVariant,
5
4
  EmptyState,
@@ -9,7 +8,6 @@ import {
9
8
  PageSectionVariants,
10
9
  Title,
11
10
  } from '@patternfly/react-core';
12
- import { HostsClusterDetailTabProps } from './types';
13
11
  import {
14
12
  OcmCpuArchitecture,
15
13
  STANDALONE_DEPLOYMENT_ENABLED_FEATURES,
@@ -43,9 +41,7 @@ const getCluster = (type: string) => {
43
41
  }
44
42
  };
45
43
 
46
- export const HostsClusterDetailTabMock: React.FC<
47
- RouteComponentProps & HostsClusterDetailTabProps
48
- > = () => {
44
+ export const HostsClusterDetailTabMock = () => {
49
45
  const [tabShown, setTabShown] = React.useState<string>('');
50
46
  const [isMocked, setIsMocked] = React.useState<boolean>(false);
51
47
 
@@ -1,29 +1,33 @@
1
1
  import React from 'react';
2
2
  import { Provider } from 'react-redux';
3
- import { Switch, Route, Redirect } from 'react-router-dom';
3
+ import { Routes, Route, Navigate, Outlet } from 'react-router-dom-v5-compat';
4
4
  import { Clusters, ClusterPage, NewClusterPage } from './clusters';
5
5
  import type { FeatureListType } from '../../common/features/featureGate';
6
- import { routeBasePath } from '../config';
7
6
  import { AssistedUILibVersion } from './ui';
8
7
  import { storeDay1 } from '../store';
9
8
  import { useFeatureDetection } from '../hooks/use-feature-detection';
10
9
 
11
- export const Routes: React.FC<{ allEnabledFeatures: FeatureListType }> = ({
10
+ export const UILibRoutes = ({
12
11
  allEnabledFeatures,
13
12
  children,
13
+ }: {
14
+ allEnabledFeatures: FeatureListType;
15
+ children: React.ReactNode;
14
16
  }) => {
15
17
  useFeatureDetection(allEnabledFeatures);
16
18
 
17
19
  return (
18
20
  <Provider store={storeDay1}>
19
21
  <AssistedUILibVersion />
20
- <Switch>
21
- <Route path={`${routeBasePath}/clusters/~new`} component={NewClusterPage} />
22
- <Route path={`${routeBasePath}/clusters/:clusterId`} component={ClusterPage} />
23
- <Route path={`${routeBasePath}/clusters`} component={Clusters} />
22
+ <Routes>
23
+ <Route path="clusters" element={<Outlet />}>
24
+ <Route path="~new" element={<NewClusterPage />} />
25
+ <Route path=":clusterId" element={<ClusterPage />} />
26
+ <Route index element={<Clusters />} />
27
+ </Route>
24
28
  {children}
25
- <Redirect to={`${routeBasePath}/clusters`} />
26
- </Switch>
29
+ <Route path="*" element={<Navigate to="clusters" />} />
30
+ </Routes>
27
31
  </Provider>
28
32
  );
29
33
  };
@@ -11,17 +11,14 @@ import {
11
11
  import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
12
12
  import { useField } from 'formik';
13
13
  import {
14
+ architectureData,
14
15
  CpuArchitecture,
15
16
  FeatureId,
16
17
  getDefaultCpuArchitecture,
17
18
  getFieldId,
18
19
  SupportedCpuArchitecture,
19
20
  } from '../../../common';
20
- import {
21
- ArchitectureSupportLevelId,
22
- Cluster,
23
- PlatformType,
24
- } from '@openshift-assisted/types/assisted-installer-service';
21
+ import { Cluster, PlatformType } from '@openshift-assisted/types/assisted-installer-service';
25
22
  import {
26
23
  NewFeatureSupportLevelMap,
27
24
  useNewFeatureSupportLevel,
@@ -29,34 +26,6 @@ import {
29
26
  import useSupportLevelsAPI from '../../hooks/useSupportLevelsAPI';
30
27
  import { ExternalPlaformIds, ExternalPlatformLabels } from './platformIntegration/constants';
31
28
 
32
- export type CpuArchitectureItem = {
33
- description: string;
34
- featureSupportLevelId?: ArchitectureSupportLevelId;
35
- label: string;
36
- };
37
-
38
- export const architectureData: Record<SupportedCpuArchitecture, CpuArchitectureItem> = {
39
- [CpuArchitecture.x86]: {
40
- description: '',
41
- label: 'x86_64',
42
- },
43
- [CpuArchitecture.ARM]: {
44
- description: 'Some features may not be available',
45
- featureSupportLevelId: 'ARM64_ARCHITECTURE',
46
- label: 'Arm64',
47
- },
48
- [CpuArchitecture.ppc64le]: {
49
- description: 'Some features may not be available',
50
- featureSupportLevelId: 'PPC64LE_ARCHITECTURE',
51
- label: 'IBM Power (ppc64le)',
52
- },
53
- [CpuArchitecture.s390x]: {
54
- description: 'Some features may not be available',
55
- featureSupportLevelId: 'S390X_ARCHITECTURE',
56
- label: 'IBM Z (s390x)',
57
- },
58
- };
59
-
60
29
  const INPUT_NAME = 'cpuArchitecture';
61
30
  const fieldId = getFieldId(INPUT_NAME, 'input');
62
31
 
@@ -14,6 +14,7 @@ import {
14
14
  StaticTextField,
15
15
  getSupportedCpuArchitectures,
16
16
  SupportedCpuArchitecture,
17
+ architectureData,
17
18
  } from '../../../common';
18
19
  import DiskEncryptionControlGroup from '../../../common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup';
19
20
  import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
@@ -21,10 +22,7 @@ import { OcmRichInputField } from '../ui/OcmFormFields';
21
22
  import OcmOpenShiftVersion from './OcmOpenShiftVersion';
22
23
  import OcmOpenShiftVersionSelect from './OcmOpenShiftVersionSelect';
23
24
  import CustomManifestCheckbox from './CustomManifestCheckbox';
24
- import CpuArchitectureDropdown, {
25
- architectureData,
26
- CpuArchitectureItem,
27
- } from './CpuArchitectureDropdown';
25
+ import CpuArchitectureDropdown from './CpuArchitectureDropdown';
28
26
  import { OcmBaseDomainField } from './OcmBaseDomainField';
29
27
  import OcmSNOControlGroup from './OcmSNOControlGroup';
30
28
  import useSupportLevelsAPI from '../../hooks/useSupportLevelsAPI';
@@ -80,9 +78,8 @@ export const OcmClusterDetailsFormFields = ({
80
78
  () => getSupportedCpuArchitectures(cpuArchitecturesByVersionImage),
81
79
  [cpuArchitecturesByVersionImage],
82
80
  );
83
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
84
- // @ts-ignore
85
- const cpuArchitecture = (architectureData[values.cpuArchitecture] as CpuArchitectureItem).label;
81
+ const cpuArchitecture =
82
+ architectureData[values.cpuArchitecture as SupportedCpuArchitecture].label;
86
83
 
87
84
  const featureSupportLevelContext = useNewFeatureSupportLevel();
88
85
 
@@ -16,6 +16,7 @@ import {
16
16
  CpuArchitecture,
17
17
  FeatureId,
18
18
  SupportedCpuArchitecture,
19
+ architectureData,
19
20
  getFieldId,
20
21
  } from '../../../../common';
21
22
  import { ExternalPlaformIds, ExternalPlatformLabels, ExternalPlatformLinks } from './constants';
@@ -25,7 +26,6 @@ import {
25
26
  NewFeatureSupportLevelMap,
26
27
  useNewFeatureSupportLevel,
27
28
  } from '../../../../common/components/newFeatureSupportLevels';
28
- import { architectureData } from '../CpuArchitectureDropdown';
29
29
  import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
30
30
 
31
31
  const INPUT_NAME = 'platform';
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { Provider } from 'react-redux';
3
3
  import { Card, CardBody, CardHeader, Title } from '@patternfly/react-core';
4
4
  import { storeDay1 } from '../../store';
5
- import { OCM_CLUSTER_LIST_LINK } from '../../config';
6
5
  import {
7
6
  AlertsContextProvider,
8
7
  AssistedInstallerOCMPermissionTypesListType,
@@ -62,7 +61,7 @@ const ClusterLoadFailed = ({ clusterId, error }: { clusterId: Cluster['id']; err
62
61
  <ErrorState
63
62
  title="Failed to fetch the cluster"
64
63
  fetchData={fetchCluster}
65
- actions={[<BackButton key={'cancel'} to={OCM_CLUSTER_LIST_LINK} />]}
64
+ actions={[<BackButton key={'cancel'} to={'..'} />]}
66
65
  content={error}
67
66
  />
68
67
  </CardBody>
@@ -80,7 +79,7 @@ const LoadingDefaultConfigFailedCard = () => (
80
79
  <CardBody>
81
80
  <ErrorState
82
81
  title="Failed to retrieve the default configuration"
83
- actions={[<BackButton key={'cancel'} to={OCM_CLUSTER_LIST_LINK} />]}
82
+ actions={[<BackButton key={'cancel'} to={'..'} />]}
84
83
  />
85
84
  </CardBody>
86
85
  </Card>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useHistory } from 'react-router-dom';
2
+ import { useNavigate } from 'react-router-dom-v5-compat';
3
3
  import {
4
4
  Stack,
5
5
  StackItem,
@@ -40,7 +40,7 @@ const ClusterDetail: React.FC<ClusterDetailProps> = ({ cluster }) => {
40
40
  const isSNOExpansionAllowed =
41
41
  featureSupportLevelContext.isFeatureSupported('SINGLE_NODE_EXPANSION');
42
42
  const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
43
- const history = useHistory();
43
+ const navigate = useNavigate();
44
44
  const canAddHosts =
45
45
  (!isSNO(cluster) || isSNOExpansionAllowed) && cluster.status === 'installed' && !isInOcm;
46
46
 
@@ -49,13 +49,13 @@ const ClusterDetail: React.FC<ClusterDetailProps> = ({ cluster }) => {
49
49
  try {
50
50
  const { data } = await ClustersAPI.allowAddHosts(cluster.id);
51
51
  updateCluster(data);
52
- history.push(`${routeBasePath}/clusters/${cluster.id}`);
52
+ navigate(`${routeBasePath}/clusters/${cluster.id}`);
53
53
  } catch (e) {
54
54
  handleApiError(e);
55
55
  }
56
56
  };
57
57
  void doItAsync();
58
- }, [cluster.id, history]);
58
+ }, [cluster.id, navigate]);
59
59
 
60
60
  return (
61
61
  <Stack hasGutter>
@@ -112,7 +112,7 @@ const ClusterDetail: React.FC<ClusterDetailProps> = ({ cluster }) => {
112
112
  {!isSingleClusterFeatureEnabled && (
113
113
  <ToolbarButton
114
114
  variant={ButtonVariant.link}
115
- onClick={() => history.push(`${routeBasePath}/clusters`)}
115
+ onClick={() => navigate('..')}
116
116
  id={getClusterDetailId('button-back-to-all-clusters')}
117
117
  >
118
118
  Back to all clusters
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useHistory } from 'react-router-dom';
2
+ import { useNavigate } from 'react-router-dom-v5-compat';
3
3
  import { useDispatch } from 'react-redux';
4
4
  import { useAlerts, LoadingState, ClusterWizardStep, ErrorState } from '../../../common';
5
5
  import { usePullSecret } from '../../hooks';
@@ -10,7 +10,6 @@ import { canNextClusterDetails, ClusterWizardFlowStateNew } from './wizardTransi
10
10
  import { useOpenshiftVersions, useManagedDomains, useUsedClusterNames } from '../../hooks';
11
11
  import ClusterDetailsForm from './ClusterDetailsForm';
12
12
  import ClusterWizardNavigation from './ClusterWizardNavigation';
13
- import { routeBasePath } from '../../config';
14
13
  import {
15
14
  ClusterDetailsUpdateParams,
16
15
  ClustersService,
@@ -28,7 +27,7 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
28
27
  const clusterWizardContext = useClusterWizardContext();
29
28
  const managedDomains = useManagedDomains();
30
29
  const { addAlert, clearAlerts } = useAlerts();
31
- const history = useHistory();
30
+ const navigate = useNavigate();
32
31
  const dispatch = useDispatch();
33
32
  const { usedClusterNames } = useUsedClusterNames(cluster?.id || '');
34
33
  const pullSecret = usePullSecret();
@@ -69,7 +68,7 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
69
68
  clearAlerts();
70
69
  try {
71
70
  const cluster = await ClustersService.create(params);
72
- history.push(`${routeBasePath}/clusters/${cluster.id}`, ClusterWizardFlowStateNew);
71
+ navigate(`../${cluster.id}`, { state: ClusterWizardFlowStateNew });
73
72
  await UISettingService.update(cluster.id, { addCustomManifests });
74
73
  } catch (e) {
75
74
  handleApiError(e, () =>
@@ -80,7 +79,7 @@ const ClusterDetails = ({ cluster, infraEnv }: ClusterDetailsProps) => {
80
79
  }
81
80
  }
82
81
  },
83
- [clearAlerts, history, addAlert, dispatch],
82
+ [clearAlerts, navigate, addAlert, dispatch],
84
83
  );
85
84
 
86
85
  const navigation = <ClusterWizardNavigation cluster={cluster} />;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
- import { useLocation } from 'react-router-dom';
3
+ import { useLocation } from 'react-router-dom-v5-compat';
4
4
  import { Grid, GridItem } from '@patternfly/react-core';
5
5
  import isUndefined from 'lodash-es/isUndefined.js';
6
6
  import { Formik, FormikHelpers } from 'formik';
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import { useLocation } from 'react-router-dom';
2
+ import { useLocation } from 'react-router-dom-v5-compat';
3
3
  import { ClusterWizardContextType, ClusterWizardContext } from './ClusterWizardContext';
4
4
  import {
5
5
  ClusterWizardFlowStateType,
@@ -91,7 +91,8 @@ const ClusterWizardContextProvider = ({
91
91
  const [wizardStepIds, setWizardStepIds] = React.useState<ClusterWizardStepsType[]>();
92
92
  const [wizardPerPage, setWizardPerPage] = React.useState(10);
93
93
  const [customManifestsStep, setCustomManifestsStep] = React.useState<boolean>(false);
94
- const { state: locationState } = useLocation<ClusterWizardFlowStateType>();
94
+ const location = useLocation();
95
+ const locationState = location.state as ClusterWizardFlowStateType | undefined;
95
96
  const {
96
97
  uiSettings,
97
98
  updateUISettings,