@openshift-assisted/ui-lib 2.8.3-cim → 2.8.4-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.
- package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetails.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +6 -1
- package/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/helpers.d.ts.map +1 -1
- package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +2 -0
- package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
- package/@types/cim/components/helpers/versions.d.ts +1 -0
- package/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
- package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts +4 -1
- package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
- package/@types/common/components/clusterConfiguration/DownloadIso.d.ts +2 -1
- package/@types/common/components/clusterConfiguration/DownloadIso.d.ts.map +1 -1
- package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts +2 -0
- package/@types/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts.map +1 -1
- package/@types/common/components/ui/formik/types.d.ts +2 -2
- package/@types/common/components/ui/formik/types.d.ts.map +1 -1
- package/@types/common/config/constants.d.ts +1 -1
- package/@types/common/config/constants.d.ts.map +1 -1
- package/@types/ocm/components/ui/OcmFormFields.d.ts +1 -1
- package/@types/ocm/selectors/clusters.d.ts +3 -3
- package/@types/ocm/store/slices/infraEnvs/selectors.d.ts +1 -1
- package/build/build.json +1 -1
- package/build/cim/components/Agent/BMCForm.js +1 -1
- package/build/cim/components/Agent/BMCForm.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js +59 -56
- package/build/cim/components/ClusterDeployment/ClusterDeploymentDetails.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +10 -6
- package/build/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +6 -2
- package/build/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cim/components/ClusterDeployment/helpers.js +4 -2
- package/build/cim/components/ClusterDeployment/helpers.js.map +1 -1
- package/build/cim/components/InfraEnv/InfraEnvFormPage.js +3 -3
- package/build/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
- package/build/cim/components/helpers/versions.js +1 -0
- package/build/cim/components/helpers/versions.js.map +1 -1
- package/build/cim/components/modals/AddHostModal.js +4 -4
- package/build/cim/components/modals/AddHostModal.js.map +1 -1
- package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +5 -5
- package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
- package/build/common/components/clusterConfiguration/DownloadIso.js +2 -2
- package/build/common/components/clusterConfiguration/DownloadIso.js.map +1 -1
- package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js +2 -2
- package/build/common/components/clusterConfiguration/OpenShiftVersionSelect.js.map +1 -1
- package/build/common/components/ui/formik/SelectField.js +1 -1
- package/build/common/components/ui/formik/SelectField.js.map +1 -1
- package/build/common/config/constants.js +1 -1
- package/build/common/config/constants.js.map +1 -1
- package/lib/cim/components/Agent/BMCForm.tsx +1 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetails.tsx +112 -102
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +17 -5
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +9 -2
- package/lib/cim/components/ClusterDeployment/helpers.ts +13 -10
- package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +11 -2
- package/lib/cim/components/helpers/versions.ts +5 -0
- package/lib/cim/components/modals/AddHostModal.tsx +5 -0
- package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +6 -4
- package/lib/common/components/clusterConfiguration/DownloadIso.tsx +3 -1
- package/lib/common/components/clusterConfiguration/OpenShiftVersionSelect.tsx +4 -1
- package/lib/common/components/ui/formik/SelectField.tsx +1 -1
- package/lib/common/components/ui/formik/types.ts +2 -1
- package/lib/common/components/ui/formik/validationSchemas.test.ts +6 -0
- package/lib/common/config/constants.ts +2 -2
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from '../../types';
|
|
20
20
|
import ClusterDeploymentCredentials from './ClusterDeploymentCredentials';
|
|
21
21
|
import { shouldShowClusterCredentials, shouldShowClusterInstallationProgress } from './helpers';
|
|
22
|
-
import {
|
|
22
|
+
import { EventsModal } from '../../../common/components/ui/eventsModal';
|
|
23
23
|
import ClusterDeploymentDetailsTable from './ClusterDeploymentDetailsTable';
|
|
24
24
|
import { FetchSecret } from './types';
|
|
25
25
|
import { getClusterProperties, getConsoleUrl } from '../helpers/clusterDeployment';
|
|
@@ -45,6 +45,7 @@ const ClusterDeploymentDetails: React.FC<ClusterDeploymentDetailsProps> = ({
|
|
|
45
45
|
const [progressCardExpanded, setProgressCardExpanded] = React.useState(true);
|
|
46
46
|
const [inventoryCardExpanded, setInventoryCardExpanded] = React.useState(true);
|
|
47
47
|
const [detailsCardExpanded, setDetailsCardExpanded] = React.useState(true);
|
|
48
|
+
const [isEventsModalOpen, setIsEventsModalOpen] = React.useState(false);
|
|
48
49
|
|
|
49
50
|
const clusterAgents = agents.filter(
|
|
50
51
|
(a) =>
|
|
@@ -60,120 +61,129 @@ const ClusterDeploymentDetails: React.FC<ClusterDeploymentDetailsProps> = ({
|
|
|
60
61
|
);
|
|
61
62
|
const { t } = useTranslation();
|
|
62
63
|
return (
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
<>
|
|
65
|
+
<Stack hasGutter>
|
|
66
|
+
{shouldShowClusterInstallationProgress(agentClusterInstall) && (
|
|
67
|
+
<StackItem>
|
|
68
|
+
<Card id="cluster-installation-progress-card" isExpanded={progressCardExpanded}>
|
|
69
|
+
<CardHeader
|
|
70
|
+
onExpand={() => setProgressCardExpanded(!progressCardExpanded)}
|
|
71
|
+
toggleButtonProps={{
|
|
72
|
+
id: 'progress-card-toggle-button',
|
|
73
|
+
'aria-label': 'Cluster installation process',
|
|
74
|
+
'aria-labelledby': 'titleId progress-card-toggle-button',
|
|
75
|
+
'aria-expanded': progressCardExpanded,
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<CardTitle id="titleId">{t('ai:Cluster installation process')}</CardTitle>
|
|
79
|
+
</CardHeader>
|
|
80
|
+
<CardExpandableContent>
|
|
81
|
+
<CardBody>
|
|
82
|
+
<Stack hasGutter>
|
|
83
|
+
{shouldShowClusterCredentials(agentClusterInstall) && (
|
|
84
|
+
<StackItem>
|
|
85
|
+
<ClusterDeploymentCredentials
|
|
86
|
+
clusterDeployment={clusterDeployment}
|
|
87
|
+
agentClusterInstall={agentClusterInstall}
|
|
88
|
+
agents={clusterAgents}
|
|
89
|
+
fetchSecret={fetchSecret}
|
|
90
|
+
consoleUrl={getConsoleUrl(clusterDeployment)}
|
|
91
|
+
/>
|
|
92
|
+
</StackItem>
|
|
93
|
+
)}
|
|
94
|
+
<StackItem>
|
|
95
|
+
<ClusterDeploymentKubeconfigDownload
|
|
96
|
+
clusterDeployment={clusterDeployment}
|
|
97
|
+
agentClusterInstall={agentClusterInstall}
|
|
98
|
+
fetchSecret={fetchSecret}
|
|
99
|
+
/>{' '}
|
|
100
|
+
<Button
|
|
101
|
+
id="cluster-events-button"
|
|
102
|
+
variant={ButtonVariant.link}
|
|
103
|
+
style={{ textAlign: 'right' }}
|
|
104
|
+
onClick={() => setIsEventsModalOpen(true)}
|
|
105
|
+
>
|
|
106
|
+
{t('ai:View cluster events')}
|
|
107
|
+
</Button>
|
|
108
|
+
</StackItem>
|
|
109
|
+
</Stack>
|
|
110
|
+
</CardBody>
|
|
111
|
+
</CardExpandableContent>
|
|
112
|
+
</Card>
|
|
113
|
+
</StackItem>
|
|
114
|
+
)}
|
|
65
115
|
<StackItem>
|
|
66
|
-
<Card id="cluster-
|
|
116
|
+
<Card id="cluster-inventory-card" isExpanded={inventoryCardExpanded}>
|
|
67
117
|
<CardHeader
|
|
68
|
-
onExpand={() =>
|
|
118
|
+
onExpand={() => setInventoryCardExpanded(!inventoryCardExpanded)}
|
|
69
119
|
toggleButtonProps={{
|
|
70
|
-
id: '
|
|
71
|
-
'aria-label': '
|
|
72
|
-
'aria-labelledby': 'titleId
|
|
73
|
-
'aria-expanded':
|
|
120
|
+
id: 'inventory-card-toggle-button',
|
|
121
|
+
'aria-label': 'Hosts inventory',
|
|
122
|
+
'aria-labelledby': 'titleId inventory-card-toggle-button',
|
|
123
|
+
'aria-expanded': inventoryCardExpanded,
|
|
74
124
|
}}
|
|
75
125
|
>
|
|
76
|
-
<CardTitle id="titleId">{t('ai:
|
|
126
|
+
<CardTitle id="titleId">{t('ai:Hosts inventory')}</CardTitle>
|
|
77
127
|
</CardHeader>
|
|
78
128
|
<CardExpandableContent>
|
|
79
129
|
<CardBody>
|
|
80
|
-
<
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
130
|
+
<ClusterDeploymentDetailsTable
|
|
131
|
+
agents={clusterAgents}
|
|
132
|
+
agentClusterInstall={agentClusterInstall}
|
|
133
|
+
/>
|
|
134
|
+
</CardBody>
|
|
135
|
+
</CardExpandableContent>
|
|
136
|
+
</Card>
|
|
137
|
+
</StackItem>
|
|
138
|
+
<StackItem>
|
|
139
|
+
<Card id="cluster-details-card" isExpanded={detailsCardExpanded}>
|
|
140
|
+
<CardHeader
|
|
141
|
+
onExpand={() => setDetailsCardExpanded(!detailsCardExpanded)}
|
|
142
|
+
toggleButtonProps={{
|
|
143
|
+
id: 'details-card-toggle-button',
|
|
144
|
+
'aria-label': 'Details',
|
|
145
|
+
'aria-labelledby': 'titleId details-card-toggle-button',
|
|
146
|
+
'aria-expanded': detailsCardExpanded,
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
<CardTitle id="titleId">{t('ai:Details')}</CardTitle>
|
|
150
|
+
</CardHeader>
|
|
151
|
+
<CardExpandableContent>
|
|
152
|
+
<CardBody>
|
|
153
|
+
<ClusterPropertiesList
|
|
154
|
+
leftItems={[
|
|
155
|
+
clusterProperties.name,
|
|
156
|
+
clusterProperties.openshiftVersion,
|
|
157
|
+
clusterProperties.clusterId,
|
|
158
|
+
clusterProperties.installedTimestamp,
|
|
159
|
+
clusterProperties.baseDnsDomain,
|
|
160
|
+
]}
|
|
161
|
+
rightItems={[
|
|
162
|
+
clusterProperties.apiVip,
|
|
163
|
+
clusterProperties.ingressVip,
|
|
164
|
+
clusterProperties.clusterNetworkCidr,
|
|
165
|
+
clusterProperties.clusterNetworkHostPrefix,
|
|
166
|
+
clusterProperties.serviceNetworkCidr,
|
|
167
|
+
]}
|
|
168
|
+
/>
|
|
113
169
|
</CardBody>
|
|
114
170
|
</CardExpandableContent>
|
|
115
171
|
</Card>
|
|
116
172
|
</StackItem>
|
|
173
|
+
</Stack>
|
|
174
|
+
{isEventsModalOpen && (
|
|
175
|
+
<EventsModal
|
|
176
|
+
entityKind="cluster"
|
|
177
|
+
cluster={cluster}
|
|
178
|
+
title={t('ai:Cluster Events')}
|
|
179
|
+
onFetchEvents={onFetchEvents}
|
|
180
|
+
hostId={undefined}
|
|
181
|
+
disablePagination
|
|
182
|
+
isOpen
|
|
183
|
+
onClose={() => setIsEventsModalOpen(false)}
|
|
184
|
+
/>
|
|
117
185
|
)}
|
|
118
|
-
|
|
119
|
-
<Card id="cluster-inventory-card" isExpanded={inventoryCardExpanded}>
|
|
120
|
-
<CardHeader
|
|
121
|
-
onExpand={() => setInventoryCardExpanded(!inventoryCardExpanded)}
|
|
122
|
-
toggleButtonProps={{
|
|
123
|
-
id: 'inventory-card-toggle-button',
|
|
124
|
-
'aria-label': 'Hosts inventory',
|
|
125
|
-
'aria-labelledby': 'titleId inventory-card-toggle-button',
|
|
126
|
-
'aria-expanded': inventoryCardExpanded,
|
|
127
|
-
}}
|
|
128
|
-
>
|
|
129
|
-
<CardTitle id="titleId">{t('ai:Hosts inventory')}</CardTitle>
|
|
130
|
-
</CardHeader>
|
|
131
|
-
<CardExpandableContent>
|
|
132
|
-
<CardBody>
|
|
133
|
-
<ClusterDeploymentDetailsTable
|
|
134
|
-
agents={clusterAgents}
|
|
135
|
-
agentClusterInstall={agentClusterInstall}
|
|
136
|
-
/>
|
|
137
|
-
</CardBody>
|
|
138
|
-
</CardExpandableContent>
|
|
139
|
-
</Card>
|
|
140
|
-
</StackItem>
|
|
141
|
-
<StackItem>
|
|
142
|
-
<Card id="cluster-details-card" isExpanded={detailsCardExpanded}>
|
|
143
|
-
<CardHeader
|
|
144
|
-
onExpand={() => setDetailsCardExpanded(!detailsCardExpanded)}
|
|
145
|
-
toggleButtonProps={{
|
|
146
|
-
id: 'details-card-toggle-button',
|
|
147
|
-
'aria-label': 'Details',
|
|
148
|
-
'aria-labelledby': 'titleId details-card-toggle-button',
|
|
149
|
-
'aria-expanded': detailsCardExpanded,
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
<CardTitle id="titleId">{t('ai:Details')}</CardTitle>
|
|
153
|
-
</CardHeader>
|
|
154
|
-
<CardExpandableContent>
|
|
155
|
-
<CardBody>
|
|
156
|
-
<ClusterPropertiesList
|
|
157
|
-
leftItems={[
|
|
158
|
-
clusterProperties.name,
|
|
159
|
-
clusterProperties.openshiftVersion,
|
|
160
|
-
clusterProperties.clusterId,
|
|
161
|
-
clusterProperties.installedTimestamp,
|
|
162
|
-
clusterProperties.baseDnsDomain,
|
|
163
|
-
]}
|
|
164
|
-
rightItems={[
|
|
165
|
-
clusterProperties.apiVip,
|
|
166
|
-
clusterProperties.ingressVip,
|
|
167
|
-
clusterProperties.clusterNetworkCidr,
|
|
168
|
-
clusterProperties.clusterNetworkHostPrefix,
|
|
169
|
-
clusterProperties.serviceNetworkCidr,
|
|
170
|
-
]}
|
|
171
|
-
/>
|
|
172
|
-
</CardBody>
|
|
173
|
-
</CardExpandableContent>
|
|
174
|
-
</Card>
|
|
175
|
-
</StackItem>
|
|
176
|
-
</Stack>
|
|
186
|
+
</>
|
|
177
187
|
);
|
|
178
188
|
};
|
|
179
189
|
|
|
@@ -17,7 +17,7 @@ import { ClusterDeploymentDetailsStepProps, ClusterDeploymentDetailsValues } fro
|
|
|
17
17
|
import ClusterDeploymentWizardFooter from './ClusterDeploymentWizardFooter';
|
|
18
18
|
import ClusterDeploymentWizardContext from './ClusterDeploymentWizardContext';
|
|
19
19
|
import ClusterDeploymentWizardStep from './ClusterDeploymentWizardStep';
|
|
20
|
-
import { getAICluster, getOCPVersions } from '../helpers';
|
|
20
|
+
import { getAICluster, getNetworkType, getOCPVersions } from '../helpers';
|
|
21
21
|
import {
|
|
22
22
|
AgentClusterInstallK8sResource,
|
|
23
23
|
AgentK8sResource,
|
|
@@ -45,7 +45,10 @@ export const useDetailsFormik = ({
|
|
|
45
45
|
clusterImages,
|
|
46
46
|
usedClusterNames,
|
|
47
47
|
infraEnv,
|
|
48
|
-
}: UseDetailsFormikArgs): [
|
|
48
|
+
}: UseDetailsFormikArgs): [
|
|
49
|
+
ClusterDetailsValues & { networkType: 'OpenShiftSDN' | 'OVNKubernetes' },
|
|
50
|
+
Lazy,
|
|
51
|
+
] => {
|
|
49
52
|
const { t } = useTranslation();
|
|
50
53
|
const featureSupportLevels = useFeatureSupportLevel();
|
|
51
54
|
const ocpVersions = getOCPVersions(clusterImages);
|
|
@@ -62,12 +65,21 @@ export const useDetailsFormik = ({
|
|
|
62
65
|
[agentClusterInstall, clusterDeployment, agents, infraEnv],
|
|
63
66
|
);
|
|
64
67
|
const initialValues = React.useMemo(
|
|
65
|
-
() =>
|
|
66
|
-
getClusterDetailsInitialValues({
|
|
68
|
+
() => {
|
|
69
|
+
const initValues = getClusterDetailsInitialValues({
|
|
67
70
|
managedDomains: [], // not supported
|
|
68
71
|
cluster,
|
|
69
72
|
ocpVersions,
|
|
70
|
-
})
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const ocpVersion = ocpVersions.find(
|
|
76
|
+
(ocpVersion) => ocpVersion.value === initValues.openshiftVersion,
|
|
77
|
+
);
|
|
78
|
+
return {
|
|
79
|
+
...initValues,
|
|
80
|
+
networkType: getNetworkType(ocpVersion),
|
|
81
|
+
};
|
|
82
|
+
},
|
|
71
83
|
[], // eslint-disable-line react-hooks/exhaustive-deps
|
|
72
84
|
);
|
|
73
85
|
|
|
@@ -15,6 +15,7 @@ import { ClusterDetailsValues } from '../../../common/components/clusterWizard/t
|
|
|
15
15
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
16
16
|
import ArmCheckbox from './ArmCheckbox';
|
|
17
17
|
import { SNOControlGroup } from '../../../common';
|
|
18
|
+
import { getNetworkType } from '../helpers';
|
|
18
19
|
|
|
19
20
|
export type ClusterDetailsFormFieldsProps = {
|
|
20
21
|
isEditFlow: boolean;
|
|
@@ -47,7 +48,7 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
|
|
|
47
48
|
forceOpenshiftVersion,
|
|
48
49
|
extensionAfter,
|
|
49
50
|
}) => {
|
|
50
|
-
const { values } = useFormikContext<ClusterDetailsValues>();
|
|
51
|
+
const { values, setFieldValue } = useFormikContext<ClusterDetailsValues>();
|
|
51
52
|
const { name, baseDnsDomain, highAvailabilityMode } = values;
|
|
52
53
|
const nameInputRef = React.useRef<HTMLInputElement>();
|
|
53
54
|
React.useEffect(() => {
|
|
@@ -97,7 +98,13 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
|
|
|
97
98
|
{t('ai:OpenShift')} {forceOpenshiftVersion}
|
|
98
99
|
</StaticTextField>
|
|
99
100
|
) : (
|
|
100
|
-
<OpenShiftVersionSelect
|
|
101
|
+
<OpenShiftVersionSelect
|
|
102
|
+
versions={versions}
|
|
103
|
+
onChange={(value) => {
|
|
104
|
+
const ocpVersion = versions.find((v) => v.value === value);
|
|
105
|
+
setFieldValue('networkType', getNetworkType(ocpVersion));
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
101
108
|
)}
|
|
102
109
|
<SNOControlGroup versions={versions} highAvailabilityMode={highAvailabilityMode} />
|
|
103
110
|
<ArmCheckbox versions={versions} />
|
|
@@ -38,16 +38,19 @@ export const shouldShowClusterInstallationProgress = (
|
|
|
38
38
|
agentClusterInstall?: AgentClusterInstallK8sResource,
|
|
39
39
|
) => {
|
|
40
40
|
const [clusterStatus] = getClusterStatus(agentClusterInstall);
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
return (
|
|
42
|
+
[
|
|
43
|
+
'preparing-for-installation',
|
|
44
|
+
'installing',
|
|
45
|
+
'installing-pending-user-action',
|
|
46
|
+
'finalizing',
|
|
47
|
+
'installed',
|
|
48
|
+
'error',
|
|
49
|
+
'cancelled',
|
|
50
|
+
'adding-hosts',
|
|
51
|
+
'ready',
|
|
52
|
+
].includes(clusterStatus) && !agentClusterInstall?.spec?.holdInstallation
|
|
53
|
+
);
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
export const isInstallationInProgress = (agentClusterInstall: AgentClusterInstallK8sResource) => {
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
RadioField,
|
|
32
32
|
PopoverIcon,
|
|
33
33
|
pullSecretValidationSchema,
|
|
34
|
-
OCP_STATIC_IP_DOC,
|
|
35
34
|
CheckboxField,
|
|
36
35
|
AdditionalNTPSourcesField,
|
|
37
36
|
richNameValidationSchema,
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
locationValidationMessages,
|
|
43
42
|
ntpSourceValidationSchema,
|
|
44
43
|
CpuArchitecture,
|
|
44
|
+
getOCPStaticIPDocLink,
|
|
45
45
|
} from '../../../common';
|
|
46
46
|
|
|
47
47
|
import './infra-env.css';
|
|
@@ -118,6 +118,7 @@ type InfraEnvFormProps = {
|
|
|
118
118
|
onValuesChanged?: (values: EnvironmentStepFormValues) => void;
|
|
119
119
|
pullSecret?: string;
|
|
120
120
|
sshPublicKey?: string;
|
|
121
|
+
docVersion: string;
|
|
121
122
|
};
|
|
122
123
|
|
|
123
124
|
const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
|
|
@@ -125,6 +126,7 @@ const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
|
|
|
125
126
|
children,
|
|
126
127
|
pullSecret,
|
|
127
128
|
sshPublicKey,
|
|
129
|
+
docVersion,
|
|
128
130
|
}) => {
|
|
129
131
|
const { values, setFieldValue } = useFormikContext<EnvironmentStepFormValues>();
|
|
130
132
|
const { t } = useTranslation();
|
|
@@ -194,7 +196,13 @@ const InfraEnvForm: React.FC<InfraEnvFormProps> = ({
|
|
|
194
196
|
icon={<ExternalLinkAltIcon />}
|
|
195
197
|
iconPosition="right"
|
|
196
198
|
isInline
|
|
197
|
-
onClick={() =>
|
|
199
|
+
onClick={() =>
|
|
200
|
+
window.open(
|
|
201
|
+
getOCPStaticIPDocLink(docVersion),
|
|
202
|
+
'_blank',
|
|
203
|
+
'noopener',
|
|
204
|
+
)
|
|
205
|
+
}
|
|
198
206
|
>
|
|
199
207
|
{t('ai:View documentation')}
|
|
200
208
|
</Button>
|
|
@@ -282,6 +290,7 @@ type InfraEnvFormPageProps = InfraEnvFormProps & {
|
|
|
282
290
|
formRef: React.Ref<FormikProps<EnvironmentStepFormValues>>;
|
|
283
291
|
pullSecret?: string;
|
|
284
292
|
sshPublicKey?: string;
|
|
293
|
+
docVersion: string;
|
|
285
294
|
};
|
|
286
295
|
|
|
287
296
|
export const InfraEnvFormPage: React.FC<InfraEnvFormPageProps> = ({
|
|
@@ -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>
|
|
@@ -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 {
|
|
26
|
+
import { getOCPStaticIPDocLink } from '../../config/constants';
|
|
27
27
|
import { useTranslation } from '../../hooks/use-translation-wrapper';
|
|
28
28
|
|
|
29
|
-
export const StaticIPInfo:
|
|
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(
|
|
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
|
};
|
|
@@ -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?:
|
|
41
|
+
onChange?: FormSelectProps['onChange'];
|
|
41
42
|
getHelperText?: (value: string) => React.ReactNode | undefined;
|
|
42
43
|
// onBlur?: (event: React.FormEvent<HTMLSelectElement>) => void;
|
|
43
44
|
}
|
|
@@ -352,8 +352,8 @@ export const operatorLabels = (
|
|
|
352
352
|
};
|
|
353
353
|
};
|
|
354
354
|
|
|
355
|
-
export const
|
|
356
|
-
|
|
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