@openshift-assisted/ui-lib 2.8.3-cim → 2.8.5-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 (91) hide show
  1. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetails.d.ts.map +1 -1
  2. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +6 -1
  3. package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
  4. package/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  5. package/@types/cim/components/ClusterDeployment/helpers.d.ts.map +1 -1
  6. package/@types/cim/components/ClusterDeployment/wizardTransition.d.ts.map +1 -1
  7. package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +2 -0
  8. package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
  9. package/@types/cim/components/helpers/toAssisted.d.ts.map +1 -1
  10. package/@types/cim/components/helpers/versions.d.ts +1 -0
  11. package/@types/cim/components/helpers/versions.d.ts.map +1 -1
  12. package/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
  13. package/@types/cim/components/modals/CimConfiguration/CimConfigProgressAlert.d.ts.map +1 -1
  14. package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts +4 -1
  15. package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
  16. package/@types/common/components/clusterConfiguration/DownloadIso.d.ts +2 -1
  17. package/@types/common/components/clusterConfiguration/DownloadIso.d.ts.map +1 -1
  18. package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts +2 -0
  19. package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts.map +1 -1
  20. package/@types/common/components/clusterWizard/ReviewValidations.d.ts.map +1 -1
  21. package/@types/common/components/clusterWizard/types.d.ts +1 -0
  22. package/@types/common/components/clusterWizard/types.d.ts.map +1 -1
  23. package/@types/common/components/clusterWizard/validationsInfoUtils.d.ts +4 -0
  24. package/@types/common/components/clusterWizard/validationsInfoUtils.d.ts.map +1 -1
  25. package/@types/common/components/ui/formik/types.d.ts +2 -2
  26. package/@types/common/components/ui/formik/types.d.ts.map +1 -1
  27. package/@types/common/config/constants.d.ts +1 -1
  28. package/@types/common/config/constants.d.ts.map +1 -1
  29. package/@types/ocm/components/ui/OcmFormFields.d.ts +1 -1
  30. package/@types/ocm/selectors/clusters.d.ts +3 -3
  31. package/@types/ocm/store/slices/infraEnvs/selectors.d.ts +1 -1
  32. package/build/build.json +1 -1
  33. package/build/cim/components/Agent/BMCForm.js +1 -1
  34. package/build/cim/components/Agent/BMCForm.js.map +1 -1
  35. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js +59 -56
  36. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js.map +1 -1
  37. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +10 -6
  38. package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
  39. package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +6 -2
  40. package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  41. package/build/cim/components/ClusterDeployment/helpers.js +4 -2
  42. package/build/cim/components/ClusterDeployment/helpers.js.map +1 -1
  43. package/build/cim/components/ClusterDeployment/wizardTransition.js +9 -0
  44. package/build/cim/components/ClusterDeployment/wizardTransition.js.map +1 -1
  45. package/build/cim/components/InfraEnv/InfraEnvFormPage.js +3 -3
  46. package/build/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
  47. package/build/cim/components/helpers/toAssisted.js +2 -1
  48. package/build/cim/components/helpers/toAssisted.js.map +1 -1
  49. package/build/cim/components/helpers/versions.js +1 -0
  50. package/build/cim/components/helpers/versions.js.map +1 -1
  51. package/build/cim/components/modals/AddHostModal.js +4 -4
  52. package/build/cim/components/modals/AddHostModal.js.map +1 -1
  53. package/build/cim/components/modals/CimConfiguration/CimConfigProgressAlert.js +2 -2
  54. package/build/cim/components/modals/CimConfiguration/CimConfigProgressAlert.js.map +1 -1
  55. package/build/cim/components/modals/CimConfiguration/constants.js +1 -1
  56. package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +5 -5
  57. package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
  58. package/build/common/components/clusterConfiguration/DownloadIso.js +2 -2
  59. package/build/common/components/clusterConfiguration/DownloadIso.js.map +1 -1
  60. package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js +2 -2
  61. package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js.map +1 -1
  62. package/build/common/components/clusterWizard/ReviewValidations.js +11 -3
  63. package/build/common/components/clusterWizard/ReviewValidations.js.map +1 -1
  64. package/build/common/components/clusterWizard/validationsInfoUtils.js.map +1 -1
  65. package/build/common/components/ui/formik/SelectField.js +1 -1
  66. package/build/common/components/ui/formik/SelectField.js.map +1 -1
  67. package/build/common/config/constants.js +1 -1
  68. package/build/common/config/constants.js.map +1 -1
  69. package/lib/cim/components/Agent/BMCForm.tsx +1 -1
  70. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetails.tsx +112 -102
  71. package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +17 -5
  72. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +9 -2
  73. package/lib/cim/components/ClusterDeployment/helpers.ts +13 -10
  74. package/lib/cim/components/ClusterDeployment/wizardTransition.ts +10 -0
  75. package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +11 -2
  76. package/lib/cim/components/helpers/toAssisted.ts +3 -0
  77. package/lib/cim/components/helpers/versions.ts +5 -0
  78. package/lib/cim/components/modals/AddHostModal.tsx +5 -0
  79. package/lib/cim/components/modals/CimConfiguration/CimConfigProgressAlert.tsx +4 -2
  80. package/lib/cim/components/modals/CimConfiguration/constants.ts +1 -1
  81. package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +6 -4
  82. package/lib/common/components/clusterConfiguration/DownloadIso.tsx +3 -1
  83. package/lib/common/components/clusterConfiguration/OpenShiftVersionSelect.tsx +4 -1
  84. package/lib/common/components/clusterWizard/ReviewValidations.tsx +12 -1
  85. package/lib/common/components/clusterWizard/types.ts +1 -0
  86. package/lib/common/components/clusterWizard/validationsInfoUtils.ts +9 -0
  87. package/lib/common/components/ui/formik/SelectField.tsx +1 -1
  88. package/lib/common/components/ui/formik/types.ts +2 -1
  89. package/lib/common/components/ui/formik/validationSchemas.test.ts +6 -0
  90. package/lib/common/config/constants.ts +2 -2
  91. package/package.json +1 -1
@@ -80,3 +80,8 @@ export const getMajorMinorVersion = (version = '') => {
80
80
  const match = /[0-9].[0-9][0-9]?/g.exec(version);
81
81
  return match?.[0] || '';
82
82
  };
83
+
84
+ export const getNetworkType = (
85
+ ocpVersion: OpenshiftVersionOptionType | undefined,
86
+ ): 'OVNKubernetes' | 'OpenShiftSDN' =>
87
+ parseFloat(getMajorMinorVersion(ocpVersion?.version)) >= 4.12 ? 'OVNKubernetes' : 'OpenShiftSDN';
@@ -74,6 +74,7 @@ const AddHostModal: React.FC<AddHostModalProps> = ({
74
74
  hasDHCP={hasDHCP}
75
75
  isIPXE={isIPXE}
76
76
  allowEmpty
77
+ docVersion={docVersion}
77
78
  />
78
79
  )}
79
80
  {dialogType === 'download' && (
@@ -90,6 +91,7 @@ const AddHostModal: React.FC<AddHostModalProps> = ({
90
91
  infraEnv={infraEnv}
91
92
  onReset={agentClusterInstall ? () => setDialogType('config') : undefined}
92
93
  hasDHCP={hasDHCP}
94
+ docVersion={docVersion}
93
95
  />
94
96
  )}
95
97
  </>
@@ -104,11 +106,13 @@ const GeneratingIsoDownload = ({
104
106
  onClose,
105
107
  onReset,
106
108
  hasDHCP,
109
+ docVersion,
107
110
  }: {
108
111
  infraEnv: InfraEnvK8sResource;
109
112
  onClose: VoidFunction;
110
113
  onReset?: VoidFunction;
111
114
  hasDHCP: boolean;
115
+ docVersion: string;
112
116
  }) => {
113
117
  const { t } = useTranslation();
114
118
  return infraEnv.status?.isoDownloadURL ? (
@@ -117,6 +121,7 @@ const GeneratingIsoDownload = ({
117
121
  downloadUrl={infraEnv.status.isoDownloadURL}
118
122
  onReset={onReset}
119
123
  hasDHCP={hasDHCP}
124
+ docVersion={docVersion}
120
125
  />
121
126
  ) : (
122
127
  <EmptyState>
@@ -84,7 +84,9 @@ export const CimConfigProgressAlert: React.FC<CimConfigProgressAlertProps> = ({
84
84
  title={t('ai:Configuration may take a few minutes.')}
85
85
  actionLinks={actionLinks}
86
86
  >
87
- {t("ai:If the configuration is taking longer than 3 minutes, you'll need to troubleshoot.")}
87
+ {t(
88
+ 'ai:If the configuration is taking longer than 5 minutes, you might need to troubleshoot.',
89
+ )}
88
90
  </Alert>
89
91
  );
90
92
  }
@@ -103,7 +105,7 @@ export const CimConfigProgressAlert: React.FC<CimConfigProgressAlertProps> = ({
103
105
  return (
104
106
  <Alert
105
107
  title={t('ai:Configuration is hanging for a long time.')}
106
- variant={AlertVariant.danger}
108
+ variant={AlertVariant.info}
107
109
  isInline
108
110
  actionLinks={actionLinks}
109
111
  >
@@ -2,4 +2,4 @@ export const MIN_DB_VOL_SIZE = 1; // In Gi
2
2
  export const MIN_FS_VOL_SIZE = 1;
3
3
  export const MIN_IMG_VOL_SIZE = 10;
4
4
 
5
- export const CIM_CONFIG_TIMEOUT = 3 * 60 * 1000; // in ms
5
+ export const CIM_CONFIG_TIMEOUT = 5 * 60 * 1000; // in ms
@@ -23,10 +23,10 @@ import { ProxyFieldsType, StatusErrorType } from '../../types';
23
23
  import ProxyFields from './ProxyFields';
24
24
  import UploadSSH from './UploadSSH';
25
25
  import DiscoveryImageTypeControlGroup from './DiscoveryImageTypeControlGroup';
26
- import { OCP_STATIC_IP_DOC } from '../../config/constants';
26
+ import { getOCPStaticIPDocLink } from '../../config/constants';
27
27
  import { useTranslation } from '../../hooks/use-translation-wrapper';
28
28
 
29
- export const StaticIPInfo: React.FC = () => {
29
+ export const StaticIPInfo = ({ docVersion }: { docVersion?: string }) => {
30
30
  const { t } = useTranslation();
31
31
  return (
32
32
  <Alert
@@ -41,7 +41,7 @@ export const StaticIPInfo: React.FC = () => {
41
41
  icon={<ExternalLinkAltIcon />}
42
42
  iconPosition="right"
43
43
  isInline
44
- onClick={() => window.open(OCP_STATIC_IP_DOC, '_blank', 'noopener')}
44
+ onClick={() => window.open(getOCPStaticIPDocLink(docVersion), '_blank', 'noopener')}
45
45
  >
46
46
  {t('ai:View documentation')}
47
47
  </Button>
@@ -73,6 +73,7 @@ type DiscoveryImageConfigFormProps = Proxy & {
73
73
  imageType?: ImageType;
74
74
  isIPXE?: boolean;
75
75
  allowEmpty?: boolean;
76
+ docVersion: string;
76
77
  };
77
78
 
78
79
  export const DiscoveryImageConfigForm: React.FC<DiscoveryImageConfigFormProps> = ({
@@ -87,6 +88,7 @@ export const DiscoveryImageConfigForm: React.FC<DiscoveryImageConfigFormProps> =
87
88
  hasDHCP,
88
89
  isIPXE,
89
90
  allowEmpty,
91
+ docVersion,
90
92
  }) => {
91
93
  const initialValues: DiscoveryImageFormValues = {
92
94
  sshPublicKey: sshPublicKey || '',
@@ -123,7 +125,7 @@ export const DiscoveryImageConfigForm: React.FC<DiscoveryImageConfigFormProps> =
123
125
  </StackItem>
124
126
  {hasDHCP === false && (
125
127
  <StackItem>
126
- <StaticIPInfo />
128
+ <StaticIPInfo docVersion={docVersion} />
127
129
  </StackItem>
128
130
  )}
129
131
  <StackItem>
@@ -23,6 +23,7 @@ export type DownloadISOProps = {
23
23
  downloadUrl?: string;
24
24
  onClose: () => void;
25
25
  onReset?: () => void;
26
+ docVersion?: string;
26
27
  };
27
28
 
28
29
  const DownloadIso = ({
@@ -32,6 +33,7 @@ const DownloadIso = ({
32
33
  onReset,
33
34
  hasDHCP,
34
35
  isSNO = false,
36
+ docVersion,
35
37
  }: DownloadISOProps) => {
36
38
  const wgetCommand = `wget -O ${fileName} '${downloadUrl || ''}'`;
37
39
  const { t } = useTranslation();
@@ -53,7 +55,7 @@ const DownloadIso = ({
53
55
  </StackItem>
54
56
  {hasDHCP === false && (
55
57
  <StackItem>
56
- <StaticIPInfo />
58
+ <StaticIPInfo docVersion={docVersion} />
57
59
  </StackItem>
58
60
  )}
59
61
  <StackItem>
@@ -12,6 +12,7 @@ import { OPENSHIFT_LIFE_CYCLE_DATES_LINK } from '../../config';
12
12
  import { OpenshiftVersionOptionType } from '../../types';
13
13
  import { SelectField } from '../ui';
14
14
  import { useTranslation } from '../../hooks/use-translation-wrapper';
15
+ import { SelectFieldProps } from '../ui/formik/types';
15
16
 
16
17
  const OpenShiftLifeCycleDatesLink = () => {
17
18
  const { t } = useTranslation();
@@ -54,8 +55,9 @@ const getOpenshiftVersionHelperText =
54
55
 
55
56
  type OpenShiftVersionSelectProps = {
56
57
  versions: OpenshiftVersionOptionType[];
58
+ onChange?: SelectFieldProps['onChange'];
57
59
  };
58
- const OpenShiftVersionSelect: React.FC<OpenShiftVersionSelectProps> = ({ versions }) => {
60
+ const OpenShiftVersionSelect: React.FC<OpenShiftVersionSelectProps> = ({ versions, onChange }) => {
59
61
  const selectOptions = React.useMemo(
60
62
  () =>
61
63
  versions
@@ -75,6 +77,7 @@ const OpenShiftVersionSelect: React.FC<OpenShiftVersionSelectProps> = ({ version
75
77
  getHelperText={getOpenshiftVersionHelperText(versions)}
76
78
  isDisabled={versions.length === 0}
77
79
  isRequired
80
+ onChange={onChange}
78
81
  />
79
82
  );
80
83
  };
@@ -65,6 +65,7 @@ const FailingValidation = <S extends string>({
65
65
  setCurrentStepId,
66
66
  wizardStepNames,
67
67
  wizardStepsValidationsMap,
68
+ host,
68
69
  }: FailingValidationsProps<S>) => {
69
70
  const { t } = useTranslation();
70
71
 
@@ -85,7 +86,16 @@ const FailingValidation = <S extends string>({
85
86
  // no sooner step, so the user can not do anything about it ...
86
87
  fix = t('ai:Please wait till all checks are finished.');
87
88
  } else if (step) {
88
- fix = (
89
+ const pageURL = host
90
+ ? wizardStepsValidationsMap[step].getPageURL?.(host, validation.id)
91
+ : undefined;
92
+ fix = pageURL ? (
93
+ <>
94
+ <Trans t={t}>
95
+ ai:It can be fixed in the <a href={pageURL.url}>{pageURL.name}</a> page.
96
+ </Trans>
97
+ </>
98
+ ) : (
89
99
  <>
90
100
  <Trans t={t}>
91
101
  ai:It can be fixed in the{' '}
@@ -193,6 +203,7 @@ export const HostsValidations = <S extends string, V extends string[]>({
193
203
  <FailingValidation<S>
194
204
  key={validationId}
195
205
  validation={validation}
206
+ host={host}
196
207
  hostGroup={group}
197
208
  severity={severity}
198
209
  setCurrentStepId={setCurrentStepId}
@@ -50,6 +50,7 @@ export type FailingValidationsProps<S extends string> = {
50
50
  severity?: 'danger' | 'warning';
51
51
  wizardStepNames: { [key in S]: string };
52
52
  wizardStepsValidationsMap: WizardStepsValidationMap<S>;
53
+ host?: Host;
53
54
  };
54
55
 
55
56
  export type ValidationActionLinkProps<S extends string> = {
@@ -28,6 +28,15 @@ export type WizardStepValidationMap = {
28
28
  validationIds: HostValidationId[];
29
29
  };
30
30
  softValidationIds: (HostValidationId | ClusterValidationId)[];
31
+ getPageURL?: (
32
+ host: Host,
33
+ validationId: string,
34
+ ) =>
35
+ | {
36
+ url: string;
37
+ name: string;
38
+ }
39
+ | undefined;
31
40
  };
32
41
 
33
42
  export type WizardStepsValidationMap<T extends string> = {
@@ -49,7 +49,7 @@ const SelectField: React.FC<SelectFieldProps> = ({
49
49
  onChange={(value, event) => {
50
50
  //customHandleChange enables calling formik change handler explicitly, useful for example to have the previous value
51
51
  callFormikOnChange && field.onChange(event);
52
- onChange && onChange(event);
52
+ onChange && onChange(value, event);
53
53
  }}
54
54
  >
55
55
  {options.map((option, index) => (
@@ -5,6 +5,7 @@ import {
5
5
  SelectOptionProps,
6
6
  TooltipProps,
7
7
  RadioProps,
8
+ FormSelectProps,
8
9
  } from '@patternfly/react-core';
9
10
  import { FieldValidator, FieldHelperProps } from 'formik';
10
11
  import { DropzoneProps, DropFileEventHandler } from 'react-dropzone';
@@ -37,7 +38,7 @@ export interface FieldProps {
37
38
 
38
39
  export interface SelectFieldProps extends FieldProps {
39
40
  options: FormSelectOptionProps[];
40
- onChange?: (event: React.FormEvent<HTMLSelectElement>) => void;
41
+ onChange?: FormSelectProps['onChange'];
41
42
  getHelperText?: (value: string) => React.ReactNode | undefined;
42
43
  // onBlur?: (event: React.FormEvent<HTMLSelectElement>) => void;
43
44
  }
@@ -0,0 +1,6 @@
1
+ import { test } from 'vitest';
2
+ import { noProxyValidationSchema } from './validationSchemas';
3
+
4
+ test('noProxyValidationSchema runs', async () => {
5
+ await noProxyValidationSchema.validate('.y.com');
6
+ });
@@ -352,8 +352,8 @@ export const operatorLabels = (
352
352
  };
353
353
  };
354
354
 
355
- export const OCP_STATIC_IP_DOC =
356
- 'https://docs.openshift.com/container-platform/latest/scalability_and_performance/ztp-deploying-disconnected.html#ztp-configuring-a-static-ip_ztp-deploying-disconnected';
355
+ export const getOCPStaticIPDocLink = (docVersion = '2.8') =>
356
+ `https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${docVersion}/html-single/clusters/index#on-prem-creating-your-cluster-with-the-cli-nmstateconfig`;
357
357
 
358
358
  export const AI_UI_TAG = 'ui_ocm';
359
359
 
package/package.json CHANGED
@@ -130,5 +130,5 @@
130
130
  ]
131
131
  }
132
132
  },
133
- "version": "2.8.3-cim"
133
+ "version": "2.8.5-cim"
134
134
  }