@openshift-assisted/ui-lib 2.56.0 → 2.56.2

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 (130) hide show
  1. package/build/@types/common/config/constants.d.ts.map +1 -1
  2. package/build/@types/common/config/docs_links.d.ts +1 -0
  3. package/build/@types/common/config/docs_links.d.ts.map +1 -1
  4. package/build/@types/ocm/components/wizard/NewClusterWizard.d.ts.map +1 -1
  5. package/build/@types/ocm/components/wizard/clusterWizardContext/ClusterWizardContextProvider.d.ts +1 -1
  6. package/build/@types/ocm/components/wizard/clusterWizardContext/ClusterWizardContextProvider.d.ts.map +1 -1
  7. package/build/@types/ocm/components/wizard/clusterWizardContext/utils.d.ts +7 -0
  8. package/build/@types/ocm/components/wizard/clusterWizardContext/utils.d.ts.map +1 -0
  9. package/build/@types/ocm/components/wizard/steps/clusterDetails/ClusterDetailsForm.d.ts.map +1 -1
  10. package/build/@types/ocm/components/wizard/steps/disconnected/BasicStep.d.ts +2 -1
  11. package/build/@types/ocm/components/wizard/steps/disconnected/BasicStep.d.ts.map +1 -1
  12. package/build/@types/ocm/components/wizard/steps/disconnected/DisconnectedReviewStep.d.ts.map +1 -1
  13. package/build/@types/ocm/components/wizard/steps/disconnected/DisconnectedStaticIp.d.ts +4 -0
  14. package/build/@types/ocm/components/wizard/steps/disconnected/DisconnectedStaticIp.d.ts.map +1 -0
  15. package/build/@types/ocm/components/wizard/steps/disconnected/InstallDisconnectedSwitch.d.ts.map +1 -1
  16. package/build/@types/ocm/components/wizard/steps/disconnected/OptionalConfigurationsStep.d.ts.map +1 -1
  17. package/build/@types/ocm/components/wizard/steps/disconnected/index.d.ts +1 -0
  18. package/build/@types/ocm/components/wizard/steps/disconnected/index.d.ts.map +1 -1
  19. package/build/@types/ocm/components/wizard/steps/staticIp/StaticIp.d.ts +1 -1
  20. package/build/@types/ocm/components/wizard/steps/staticIp/StaticIp.d.ts.map +1 -1
  21. package/build/@types/ocm/components/wizard/steps/staticIp/commonValidationSchemas.d.ts +6 -1
  22. package/build/@types/ocm/components/wizard/steps/staticIp/commonValidationSchemas.d.ts.map +1 -1
  23. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.d.ts.map +1 -1
  24. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWideFields.d.ts.map +1 -1
  25. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/disconnectedNetworkWideValidationSchema.d.ts +24 -0
  26. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/disconnectedNetworkWideValidationSchema.d.ts.map +1 -0
  27. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts +46 -1
  28. package/build/@types/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts.map +1 -1
  29. package/build/@types/ocm/components/wizard/steps/staticIp/components/StaticIpPage.d.ts.map +1 -1
  30. package/build/@types/ocm/components/wizard/steps/staticIp/data/dataTypes.d.ts +1 -1
  31. package/build/@types/ocm/components/wizard/steps/staticIp/data/dataTypes.d.ts.map +1 -1
  32. package/build/@types/ocm/components/wizard/steps/staticIp/data/disconnectedNetworkWide.d.ts +8 -0
  33. package/build/@types/ocm/components/wizard/steps/staticIp/data/disconnectedNetworkWide.d.ts.map +1 -0
  34. package/build/@types/ocm/components/wizard/steps/staticIp/data/formDataFromInfraEnvField.d.ts.map +1 -1
  35. package/build/@types/ocm/components/wizard/steps/staticIp/data/fromInfraEnv.d.ts +2 -0
  36. package/build/@types/ocm/components/wizard/steps/staticIp/data/fromInfraEnv.d.ts.map +1 -1
  37. package/build/@types/ocm/components/wizard/steps/staticIp/data/index.d.ts +1 -0
  38. package/build/@types/ocm/components/wizard/steps/staticIp/data/index.d.ts.map +1 -1
  39. package/build/@types/ocm/components/wizard/steps/staticIp/data/nmstateYaml.d.ts +1 -0
  40. package/build/@types/ocm/components/wizard/steps/staticIp/data/nmstateYaml.d.ts.map +1 -1
  41. package/build/@types/ocm/components/wizard/steps/staticIp/data/protocolVersion.d.ts +2 -2
  42. package/build/@types/ocm/components/wizard/steps/staticIp/data/protocolVersion.d.ts.map +1 -1
  43. package/build/@types/ocm/components/wizard/wizardComponents/ClusterWizardNavigation.d.ts +7 -0
  44. package/build/@types/ocm/components/wizard/wizardComponents/ClusterWizardNavigation.d.ts.map +1 -1
  45. package/build/cjs/common/components/clusterWizard/ClusterWizardStep.css +9 -0
  46. package/build/cjs/common/config/constants.js +1 -0
  47. package/build/cjs/common/config/constants.js.map +1 -1
  48. package/build/cjs/common/config/docs_links.js +3 -1
  49. package/build/cjs/common/config/docs_links.js.map +1 -1
  50. package/build/cjs/common/validationSchemas/addressValidation.js +2 -2
  51. package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -1
  52. package/build/cjs/ocm/components/wizard/NewClusterWizard.js +4 -0
  53. package/build/cjs/ocm/components/wizard/NewClusterWizard.js.map +1 -1
  54. package/build/cjs/ocm/components/wizard/clusterWizardContext/ClusterWizardContextProvider.js +62 -62
  55. package/build/cjs/ocm/components/wizard/clusterWizardContext/ClusterWizardContextProvider.js.map +1 -1
  56. package/build/cjs/ocm/components/wizard/clusterWizardContext/utils.js +61 -0
  57. package/build/cjs/ocm/components/wizard/clusterWizardContext/utils.js.map +1 -0
  58. package/build/cjs/ocm/components/wizard/steps/clusterDetails/ClusterDetailsForm.js +1 -2
  59. package/build/cjs/ocm/components/wizard/steps/clusterDetails/ClusterDetailsForm.js.map +1 -1
  60. package/build/cjs/ocm/components/wizard/steps/disconnected/BasicStep.js +95 -7
  61. package/build/cjs/ocm/components/wizard/steps/disconnected/BasicStep.js.map +1 -1
  62. package/build/cjs/ocm/components/wizard/steps/disconnected/DisconnectedReviewStep.js +54 -44
  63. package/build/cjs/ocm/components/wizard/steps/disconnected/DisconnectedReviewStep.js.map +1 -1
  64. package/build/cjs/ocm/components/wizard/steps/disconnected/DisconnectedStaticIp.js +26 -0
  65. package/build/cjs/ocm/components/wizard/steps/disconnected/DisconnectedStaticIp.js.map +1 -0
  66. package/build/cjs/ocm/components/wizard/steps/disconnected/InstallDisconnectedSwitch.js +1 -1
  67. package/build/cjs/ocm/components/wizard/steps/disconnected/InstallDisconnectedSwitch.js.map +1 -1
  68. package/build/cjs/ocm/components/wizard/steps/disconnected/OptionalConfigurationsStep.js +87 -56
  69. package/build/cjs/ocm/components/wizard/steps/disconnected/OptionalConfigurationsStep.js.map +1 -1
  70. package/build/cjs/ocm/components/wizard/steps/disconnected/index.js +1 -0
  71. package/build/cjs/ocm/components/wizard/steps/disconnected/index.js.map +1 -1
  72. package/build/cjs/ocm/components/wizard/steps/staticIp/StaticIp.js.map +1 -1
  73. package/build/cjs/ocm/components/wizard/steps/staticIp/commonValidationSchemas.js +49 -12
  74. package/build/cjs/ocm/components/wizard/steps/staticIp/commonValidationSchemas.js.map +1 -1
  75. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js +13 -4
  76. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js.map +1 -1
  77. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWideFields.js +96 -4
  78. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWideFields.js.map +1 -1
  79. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/disconnectedNetworkWideValidationSchema.js +70 -0
  80. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/disconnectedNetworkWideValidationSchema.js.map +1 -0
  81. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js +19 -9
  82. package/build/cjs/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js.map +1 -1
  83. package/build/cjs/ocm/components/wizard/steps/staticIp/components/StaticIpPage.js +8 -2
  84. package/build/cjs/ocm/components/wizard/steps/staticIp/components/StaticIpPage.js.map +1 -1
  85. package/build/cjs/ocm/components/wizard/steps/staticIp/data/disconnectedNetworkWide.js +55 -0
  86. package/build/cjs/ocm/components/wizard/steps/staticIp/data/disconnectedNetworkWide.js.map +1 -0
  87. package/build/cjs/ocm/components/wizard/steps/staticIp/data/formDataFromInfraEnvField.js +5 -1
  88. package/build/cjs/ocm/components/wizard/steps/staticIp/data/formDataFromInfraEnvField.js.map +1 -1
  89. package/build/cjs/ocm/components/wizard/steps/staticIp/data/fromInfraEnv.js +48 -1
  90. package/build/cjs/ocm/components/wizard/steps/staticIp/data/fromInfraEnv.js.map +1 -1
  91. package/build/cjs/ocm/components/wizard/steps/staticIp/data/index.js +1 -0
  92. package/build/cjs/ocm/components/wizard/steps/staticIp/data/index.js.map +1 -1
  93. package/build/cjs/ocm/components/wizard/steps/staticIp/data/nmstateYaml.js +12 -1
  94. package/build/cjs/ocm/components/wizard/steps/staticIp/data/nmstateYaml.js.map +1 -1
  95. package/build/cjs/ocm/components/wizard/steps/staticIp/data/protocolVersion.js +9 -7
  96. package/build/cjs/ocm/components/wizard/steps/staticIp/data/protocolVersion.js.map +1 -1
  97. package/build/cjs/ocm/components/wizard/wizardComponents/ClusterWizardNavigation.js +31 -20
  98. package/build/cjs/ocm/components/wizard/wizardComponents/ClusterWizardNavigation.js.map +1 -1
  99. package/lib/common/components/clusterWizard/ClusterWizardStep.css +9 -0
  100. package/lib/common/config/constants.ts +1 -0
  101. package/lib/common/config/docs_links.ts +3 -0
  102. package/lib/common/validationSchemas/_validationSchemas.test.ts +1 -1
  103. package/lib/common/validationSchemas/addressValidation.tsx +2 -2
  104. package/lib/ocm/components/wizard/NewClusterWizard.tsx +5 -0
  105. package/lib/ocm/components/wizard/clusterWizardContext/ClusterWizardContextProvider.tsx +63 -85
  106. package/lib/ocm/components/wizard/clusterWizardContext/utils.ts +73 -0
  107. package/lib/ocm/components/wizard/steps/clusterDetails/ClusterDetailsForm.tsx +0 -2
  108. package/lib/ocm/components/wizard/steps/disconnected/BasicStep.tsx +147 -7
  109. package/lib/ocm/components/wizard/steps/disconnected/DisconnectedReviewStep.tsx +101 -72
  110. package/lib/ocm/components/wizard/steps/disconnected/DisconnectedStaticIp.tsx +29 -0
  111. package/lib/ocm/components/wizard/steps/disconnected/InstallDisconnectedSwitch.tsx +1 -0
  112. package/lib/ocm/components/wizard/steps/disconnected/OptionalConfigurationsStep.tsx +137 -69
  113. package/lib/ocm/components/wizard/steps/disconnected/index.tsx +1 -0
  114. package/lib/ocm/components/wizard/steps/staticIp/StaticIp.tsx +1 -1
  115. package/lib/ocm/components/wizard/steps/staticIp/commonValidationSchemas.tsx +42 -3
  116. package/lib/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.tsx +15 -4
  117. package/lib/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/FormViewNetworkWideFields.tsx +232 -14
  118. package/lib/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/disconnectedNetworkWideValidationSchema.tsx +98 -0
  119. package/lib/ocm/components/wizard/steps/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.tsx +14 -5
  120. package/lib/ocm/components/wizard/steps/staticIp/components/StaticIpPage.tsx +8 -3
  121. package/lib/ocm/components/wizard/steps/staticIp/data/dataTypes.ts +1 -1
  122. package/lib/ocm/components/wizard/steps/staticIp/data/disconnectedNetworkWide.ts +81 -0
  123. package/lib/ocm/components/wizard/steps/staticIp/data/formDataFromInfraEnvField.ts +6 -2
  124. package/lib/ocm/components/wizard/steps/staticIp/data/fromInfraEnv.ts +57 -2
  125. package/lib/ocm/components/wizard/steps/staticIp/data/index.tsx +1 -0
  126. package/lib/ocm/components/wizard/steps/staticIp/data/nmstateYaml.ts +16 -0
  127. package/lib/ocm/components/wizard/steps/staticIp/data/protocolVersion.ts +9 -7
  128. package/lib/ocm/components/wizard/utils/_wizardTransition.test.ts +60 -1
  129. package/lib/ocm/components/wizard/wizardComponents/ClusterWizardNavigation.tsx +39 -16
  130. package/package.json +3 -3
@@ -0,0 +1,73 @@
1
+ import { defaultWizardSteps, staticIpFormViewSubSteps } from '../constants';
2
+ import { StaticIpView } from '../steps/staticIp/data/dataTypes';
3
+ import { ClusterWizardStepsType, disconnectedSteps } from '../utils';
4
+
5
+ export const addStepToClusterWizard = (
6
+ wizardStepIds: ClusterWizardStepsType[],
7
+ addAfterStep: ClusterWizardStepsType,
8
+ itemsToAdd: ClusterWizardStepsType[],
9
+ ): ClusterWizardStepsType[] => {
10
+ const stepsIds = [...wizardStepIds];
11
+ const referencePosition = stepsIds.findIndex((step) => step === addAfterStep);
12
+ const found = wizardStepIds.filter((step) => step === itemsToAdd[0]);
13
+ if (referencePosition !== -1 && found.length === 0) {
14
+ stepsIds.splice(referencePosition + 1, 0, ...itemsToAdd);
15
+ }
16
+ return stepsIds;
17
+ };
18
+
19
+ export const removeStepFromClusterWizard = (
20
+ wizardStepIds: ClusterWizardStepsType[],
21
+ itemToRemove: ClusterWizardStepsType,
22
+ numberItemsToRemove: number,
23
+ ): ClusterWizardStepsType[] => {
24
+ const stepsIds = [...wizardStepIds];
25
+ const position = stepsIds.findIndex((step) => step === itemToRemove);
26
+ if (position !== -1) {
27
+ stepsIds.splice(position, numberItemsToRemove);
28
+ }
29
+ return stepsIds;
30
+ };
31
+
32
+ export const getWizardStepIds = (
33
+ wizardStepIds: ClusterWizardStepsType[] | undefined,
34
+ staticIpView?: StaticIpView | 'dhcp-selected',
35
+ isSingleClusterFeatureEnabled?: boolean,
36
+ ): ClusterWizardStepsType[] => {
37
+ let stepsCopy = wizardStepIds ? [...wizardStepIds] : [...defaultWizardSteps];
38
+ if (staticIpView === StaticIpView.YAML) {
39
+ stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
40
+ stepsCopy = addStepToClusterWizard(stepsCopy, 'cluster-details', ['static-ip-yaml-view']);
41
+ } else if (staticIpView === StaticIpView.FORM) {
42
+ stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-yaml-view', 1);
43
+ stepsCopy = addStepToClusterWizard(stepsCopy, 'cluster-details', staticIpFormViewSubSteps);
44
+ } else if (staticIpView === 'dhcp-selected') {
45
+ stepsCopy = removeStepFromClusterWizard(stepsCopy, 'static-ip-network-wide-configurations', 2);
46
+ }
47
+
48
+ if (isSingleClusterFeatureEnabled && !stepsCopy.includes('credentials-download')) {
49
+ stepsCopy = addStepToClusterWizard(stepsCopy, 'custom-manifests', ['credentials-download']);
50
+ }
51
+
52
+ return stepsCopy;
53
+ };
54
+
55
+ export const getDisconnectedWizardStepIds = (
56
+ staticIpView?: StaticIpView | 'dhcp-selected',
57
+ ): ClusterWizardStepsType[] => {
58
+ // Always rebuild from the base disconnected steps so toggling static IP / DHCP
59
+ // cannot leave leftover sub-steps in the list.
60
+ const copy = [...disconnectedSteps];
61
+
62
+ if (staticIpView === StaticIpView.YAML) {
63
+ return addStepToClusterWizard(copy, 'disconnected-basic', ['static-ip-yaml-view']);
64
+ }
65
+ if (staticIpView === StaticIpView.FORM) {
66
+ return addStepToClusterWizard(copy, 'disconnected-basic', [
67
+ 'static-ip-network-wide-configurations',
68
+ 'static-ip-host-configurations',
69
+ ]);
70
+ }
71
+
72
+ return copy;
73
+ };
@@ -19,7 +19,6 @@ import {
19
19
  getFormikErrorFields,
20
20
  ClusterWizardStep,
21
21
  ClusterWizardStepHeader,
22
- TechnologyPreview,
23
22
  isInOcm,
24
23
  useTranslation,
25
24
  } from '../../../../../common';
@@ -184,7 +183,6 @@ export const ClusterDetailsForm = (props: ClusterDetailsFormProps) => {
184
183
  <span>
185
184
  {t("ai:I'm installing on a disconnected/air-gapped/secured environment")}
186
185
  </span>
187
- <TechnologyPreview />
188
186
  </Flex>
189
187
  </GridItem>
190
188
  )}
@@ -1,24 +1,60 @@
1
1
  import * as React from 'react';
2
- import { Grid, GridItem, Content, Flex, Form } from '@patternfly/react-core';
2
+ import * as Yup from 'yup';
3
+ import { Formik, useFormikContext } from 'formik';
4
+ import { AlertVariant, Grid, GridItem, Content, Flex, Form } from '@patternfly/react-core';
5
+ import { ImageType } from '@openshift-assisted/types/assisted-installer-service';
3
6
  import {
4
7
  ClusterWizardStep,
5
- TechnologyPreview,
6
8
  StaticTextField,
7
9
  WithErrorBoundary,
10
+ useAlerts,
11
+ ClustersAPI,
12
+ InfraEnvsAPI,
13
+ handleApiError,
14
+ getApiErrorMessage,
15
+ isInOcm,
16
+ PullSecret,
17
+ pullSecretValidationSchema,
18
+ useTranslation,
19
+ getFormikErrorFields,
8
20
  } from '../../../../../common';
21
+ import { usePullSecret } from '../../../../hooks';
9
22
  import { useClusterWizardContext } from '../../clusterWizardContext';
10
23
  import { ClusterWizardNavigation, ClusterWizardFooter } from '../../wizardComponents';
24
+ import { HostsNetworkConfigurationControlGroup } from '../clusterDetails/fields/HostsNetworkConfigurationControlGroup';
25
+ import { HostsNetworkConfigurationType } from '../../../../services/types';
26
+ import { getDummyInfraEnvField } from '../staticIp/data/dummyData';
27
+ import { getStaticNetworkConfig } from '../staticIp/data/fromInfraEnv';
11
28
  import { InstallDisconnectedSwitch } from './InstallDisconnectedSwitch';
12
29
 
13
- export const DISCONNECTED_OPENSHIFT_VERSION = '4.21';
30
+ export const DISCONNECTED_OPENSHIFT_VERSION = '4.22.13';
14
31
 
15
- export const BasicStep = () => {
16
- const { moveNext } = useClusterWizardContext();
32
+ const DISCONNECTED_IMAGE_TYPE: ImageType = 'disconnected-iso';
33
+ const DISCONNECTED_CLUSTER_NAME = 'disconnected-cluster';
34
+
35
+ type BasicStepValues = {
36
+ hostsNetworkConfigurationType: HostsNetworkConfigurationType;
37
+ pullSecret: string;
38
+ };
39
+
40
+ const BasicStepForm: React.FC<{
41
+ isSubmitting: boolean;
42
+ defaultPullSecret?: string;
43
+ }> = ({ isSubmitting, defaultPullSecret }) => {
44
+ const { submitForm, isValid, errors, touched } = useFormikContext<BasicStepValues>();
45
+ const errorFields = getFormikErrorFields(errors, touched);
17
46
 
18
47
  return (
19
48
  <ClusterWizardStep
20
49
  navigation={<ClusterWizardNavigation />}
21
- footer={<ClusterWizardFooter onNext={moveNext} />}
50
+ footer={
51
+ <ClusterWizardFooter
52
+ onNext={() => void submitForm()}
53
+ isSubmitting={isSubmitting}
54
+ isNextDisabled={!isValid || isSubmitting}
55
+ errorFields={errorFields}
56
+ />
57
+ }
22
58
  >
23
59
  <WithErrorBoundary title="Failed to load Basic step">
24
60
  <Grid hasGutter>
@@ -29,7 +65,6 @@ export const BasicStep = () => {
29
65
  <Flex alignItems={{ default: 'alignItemsCenter' }} gap={{ default: 'gapSm' }}>
30
66
  <InstallDisconnectedSwitch />
31
67
  <span>I'm installing on a disconnected/air-gapped/secured environment</span>
32
- <TechnologyPreview />
33
68
  </Flex>
34
69
  </GridItem>
35
70
  <GridItem>
@@ -40,6 +75,8 @@ export const BasicStep = () => {
40
75
  <StaticTextField name="cpuArchitecture" label="CPU architecture">
41
76
  x86_64
42
77
  </StaticTextField>
78
+ <HostsNetworkConfigurationControlGroup clusterExists={false} isDisabled={false} />
79
+ {!isInOcm && <PullSecret isOcm={false} defaultPullSecret={defaultPullSecret} />}
43
80
  </Form>
44
81
  </GridItem>
45
82
  </Grid>
@@ -47,3 +84,106 @@ export const BasicStep = () => {
47
84
  </ClusterWizardStep>
48
85
  );
49
86
  };
87
+
88
+ export const BasicStep = () => {
89
+ const { t } = useTranslation();
90
+ const {
91
+ moveNext,
92
+ disconnectedCluster,
93
+ setDisconnectedCluster,
94
+ disconnectedInfraEnv,
95
+ setDisconnectedInfraEnv,
96
+ } = useClusterWizardContext();
97
+ const { addAlert, clearAlerts } = useAlerts();
98
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
99
+ const defaultPullSecret = usePullSecret();
100
+
101
+ const validationSchema = React.useMemo(
102
+ () =>
103
+ Yup.object({
104
+ pullSecret: isInOcm ? Yup.string() : pullSecretValidationSchema(t),
105
+ }),
106
+ [t],
107
+ );
108
+
109
+ const initialValues: BasicStepValues = {
110
+ hostsNetworkConfigurationType: disconnectedInfraEnv?.staticNetworkConfig
111
+ ? HostsNetworkConfigurationType.STATIC
112
+ : HostsNetworkConfigurationType.DHCP,
113
+ pullSecret: defaultPullSecret ?? '',
114
+ };
115
+
116
+ const handleNext = React.useCallback(
117
+ async (values: BasicStepValues) => {
118
+ clearAlerts();
119
+ setIsSubmitting(true);
120
+ try {
121
+ const isStatic =
122
+ values.hostsNetworkConfigurationType === HostsNetworkConfigurationType.STATIC;
123
+ let infraEnvToUse = disconnectedInfraEnv;
124
+
125
+ if (!disconnectedCluster?.id || !infraEnvToUse?.id) {
126
+ const { data: cluster } = await ClustersAPI.registerDisconnected({
127
+ name: DISCONNECTED_CLUSTER_NAME,
128
+ openshiftVersion: DISCONNECTED_OPENSHIFT_VERSION,
129
+ });
130
+ setDisconnectedCluster(cluster);
131
+
132
+ const pullSecret = isInOcm ? defaultPullSecret ?? '' : values.pullSecret;
133
+ const { data: createdInfraEnv } = await InfraEnvsAPI.register({
134
+ name: 'disconnected-infra-env',
135
+ pullSecret,
136
+ clusterId: cluster.id,
137
+ imageType: DISCONNECTED_IMAGE_TYPE,
138
+ openshiftVersion: DISCONNECTED_OPENSHIFT_VERSION,
139
+ staticNetworkConfig: isStatic ? getDummyInfraEnvField() : undefined,
140
+ });
141
+ infraEnvToUse = createdInfraEnv;
142
+ } else {
143
+ const staticNetworkConfig = isStatic
144
+ ? getStaticNetworkConfig(infraEnvToUse) ?? getDummyInfraEnvField()
145
+ : [];
146
+ const { data: updatedInfraEnv } = await InfraEnvsAPI.update(infraEnvToUse.id, {
147
+ staticNetworkConfig,
148
+ });
149
+ infraEnvToUse = updatedInfraEnv;
150
+ }
151
+
152
+ setDisconnectedInfraEnv(infraEnvToUse);
153
+ moveNext();
154
+ } catch (error) {
155
+ handleApiError(error, () => {
156
+ addAlert({
157
+ title: 'Failed to save basic information',
158
+ message: getApiErrorMessage(error),
159
+ variant: AlertVariant.danger,
160
+ });
161
+ });
162
+ } finally {
163
+ setIsSubmitting(false);
164
+ }
165
+ },
166
+ [
167
+ clearAlerts,
168
+ defaultPullSecret,
169
+ disconnectedCluster,
170
+ disconnectedInfraEnv,
171
+ setDisconnectedCluster,
172
+ setDisconnectedInfraEnv,
173
+ addAlert,
174
+ moveNext,
175
+ ],
176
+ );
177
+
178
+ return (
179
+ <Formik<BasicStepValues>
180
+ initialValues={initialValues}
181
+ validationSchema={validationSchema}
182
+ onSubmit={(values) => void handleNext(values)}
183
+ >
184
+ <BasicStepForm isSubmitting={isSubmitting} defaultPullSecret={defaultPullSecret} />
185
+ </Formik>
186
+ );
187
+ };
188
+
189
+ export default BasicStep;
@@ -1,10 +1,7 @@
1
1
  import * as React from 'react';
2
- import { Formik } from 'formik';
3
2
  import { saveAs } from 'file-saver';
4
3
  import { useNavigate } from 'react-router';
5
4
  import {
6
- Split,
7
- SplitItem,
8
5
  Alert,
9
6
  Grid,
10
7
  DescriptionList,
@@ -19,99 +16,131 @@ import {
19
16
  } from '@patternfly/react-core';
20
17
  import {
21
18
  ClusterWizardStep,
22
- TechnologyPreview,
23
19
  PULL_SECRET_INFO_LINK,
24
20
  singleClusterOperators,
25
21
  WithErrorBoundary,
26
22
  getOperatorSpecs,
23
+ ExternalLink,
24
+ getDisconnectedDocsLink,
25
+ getMajorMinorVersion,
27
26
  } from '../../../../../common';
28
27
  import { ClusterWizardFooter, ClusterWizardNavigation } from '../../wizardComponents';
29
28
  import { useClusterWizardContext } from '../../clusterWizardContext';
30
29
  import { DISCONNECTED_OPENSHIFT_VERSION } from './BasicStep';
31
30
 
31
+ const opSpecs = getOperatorSpecs(() => undefined, true);
32
+
32
33
  export const DisconnectedReviewStep = () => {
33
34
  const { moveBack, disconnectedInfraEnv } = useClusterWizardContext();
34
- const opSpecs = getOperatorSpecs(() => undefined);
35
35
  const navigate = useNavigate();
36
36
 
37
37
  return (
38
- <Formik
39
- initialValues={{}}
40
- onSubmit={() => {
41
- // nothing to do
42
- }}
38
+ <ClusterWizardStep
39
+ navigation={<ClusterWizardNavigation />}
40
+ footer={
41
+ <ClusterWizardFooter
42
+ onNext={() => {
43
+ saveAs(disconnectedInfraEnv?.downloadUrl ?? '');
44
+ void navigate('/cluster-list');
45
+ }}
46
+ onBack={moveBack}
47
+ nextButtonText="Download ISO"
48
+ />
49
+ }
43
50
  >
44
- <ClusterWizardStep
45
- navigation={<ClusterWizardNavigation />}
46
- footer={
47
- <ClusterWizardFooter
48
- onNext={() => {
49
- saveAs(disconnectedInfraEnv?.downloadUrl ?? '');
50
- void navigate('/cluster-list');
51
- }}
52
- onBack={moveBack}
53
- nextButtonText="Download ISO"
54
- />
55
- }
56
- >
57
- <WithErrorBoundary title="Failed to load Review step">
58
- <Grid hasGutter>
59
- <Split>
60
- <SplitItem>
61
- <Content component="h2">Review and download ISO</Content>
62
- </SplitItem>
63
- <SplitItem>
64
- <TechnologyPreview />
65
- </SplitItem>
66
- </Split>
67
- <Alert isInline variant="info" title="Discovery ISO boot instructions">
68
- <List component={ListComponent.ol} type={OrderType.number}>
69
- <ListItem>Download ISO</ListItem>
70
- <ListItem>
71
- Download or copy your pull secret from{' '}
72
- <a href={PULL_SECRET_INFO_LINK} target="_blank" rel="noopener noreferrer">
73
- here
74
- </a>
75
- </ListItem>
76
- <ListItem>
77
- Boot your cluster's machines from this ISO and follow instructions
78
- </ListItem>
79
- <ListItem>
80
- Provide your pull secret inside the installation wizard when requested
81
- </ListItem>
82
- </List>
83
- </Alert>
84
- <Alert isInline isExpandable variant="info" title="List of available operators">
85
- <List>
86
- {singleClusterOperators.map((o) => {
87
- const operator = Object.values(opSpecs)
88
- .flatMap((op) => op)
89
- .find((op) => op.operatorKey === o);
90
- return <ListItem key={o}>{operator ? operator.title : o}</ListItem>;
91
- })}
92
- </List>
93
- </Alert>
94
- <DescriptionList isHorizontal>
51
+ <WithErrorBoundary title="Failed to load Review step">
52
+ <Grid hasGutter>
53
+ <Content component="h2">Review and download ISO</Content>
54
+ <Alert isInline variant="info" title="ISO boot instructions">
55
+ <List component={ListComponent.ol} type={OrderType.number}>
56
+ <ListItem>Download the ISO.</ListItem>
57
+ <ListItem>
58
+ Boot your cluster's machines from this ISO and{' '}
59
+ <ExternalLink
60
+ href={getDisconnectedDocsLink(
61
+ getMajorMinorVersion(DISCONNECTED_OPENSHIFT_VERSION),
62
+ )}
63
+ >
64
+ follow instructions
65
+ </ExternalLink>
66
+ .
67
+ </ListItem>
68
+ <ListItem>
69
+ Your <ExternalLink href={PULL_SECRET_INFO_LINK}>pull secret</ExternalLink> was
70
+ included automatically. You can change it inside the installation wizard.
71
+ </ListItem>
72
+ </List>
73
+ </Alert>
74
+ <Alert isInline isExpandable variant="info" title="List of available operators">
75
+ <List>
76
+ {singleClusterOperators.map((o) => {
77
+ const operator = Object.values(opSpecs)
78
+ .flatMap((op) => op)
79
+ .find((op) => op.operatorKey === o);
80
+ return <ListItem key={o}>{operator ? operator.title : o}</ListItem>;
81
+ })}
82
+ </List>
83
+ </Alert>
84
+ <DescriptionList isHorizontal>
85
+ <DescriptionListGroup>
86
+ <DescriptionListTerm>OpenShift version</DescriptionListTerm>
87
+ <DescriptionListDescription>
88
+ {disconnectedInfraEnv?.openshiftVersion ?? DISCONNECTED_OPENSHIFT_VERSION}
89
+ </DescriptionListDescription>
90
+ </DescriptionListGroup>
91
+ {disconnectedInfraEnv?.rendezvousIp && (
92
+ <DescriptionListGroup>
93
+ <DescriptionListTerm>Rendezvous IP</DescriptionListTerm>
94
+ <DescriptionListDescription>
95
+ {disconnectedInfraEnv.rendezvousIp}
96
+ </DescriptionListDescription>
97
+ </DescriptionListGroup>
98
+ )}
99
+ {disconnectedInfraEnv?.proxy?.httpProxy && (
95
100
  <DescriptionListGroup>
96
- <DescriptionListTerm>OpenShift version</DescriptionListTerm>
101
+ <DescriptionListTerm>HTTP proxy</DescriptionListTerm>
97
102
  <DescriptionListDescription>
98
- {disconnectedInfraEnv?.openshiftVersion ?? DISCONNECTED_OPENSHIFT_VERSION}
103
+ {disconnectedInfraEnv.proxy.httpProxy}
99
104
  </DescriptionListDescription>
100
105
  </DescriptionListGroup>
106
+ )}
107
+ {disconnectedInfraEnv?.proxy?.httpsProxy && (
101
108
  <DescriptionListGroup>
102
- <DescriptionListTerm>CPU architecture</DescriptionListTerm>
109
+ <DescriptionListTerm>HTTPS proxy</DescriptionListTerm>
103
110
  <DescriptionListDescription>
104
- {disconnectedInfraEnv?.cpuArchitecture ?? 'x86_64'}
111
+ {disconnectedInfraEnv.proxy.httpsProxy}
105
112
  </DescriptionListDescription>
106
113
  </DescriptionListGroup>
114
+ )}
115
+ {disconnectedInfraEnv?.proxy?.noProxy && (
107
116
  <DescriptionListGroup>
108
- <DescriptionListTerm>ISO size</DescriptionListTerm>
109
- <DescriptionListDescription>approx. 43.5GB</DescriptionListDescription>
117
+ <DescriptionListTerm>No proxy</DescriptionListTerm>
118
+ <DescriptionListDescription>
119
+ {disconnectedInfraEnv.proxy.noProxy}
120
+ </DescriptionListDescription>
121
+ </DescriptionListGroup>
122
+ )}
123
+ {disconnectedInfraEnv?.ntpSources && (
124
+ <DescriptionListGroup>
125
+ <DescriptionListTerm>NTP sources</DescriptionListTerm>
126
+ <DescriptionListDescription>
127
+ {disconnectedInfraEnv.ntpSources}
128
+ </DescriptionListDescription>
110
129
  </DescriptionListGroup>
111
- </DescriptionList>
112
- </Grid>
113
- </WithErrorBoundary>
114
- </ClusterWizardStep>
115
- </Formik>
130
+ )}
131
+ <DescriptionListGroup>
132
+ <DescriptionListTerm>CPU architecture</DescriptionListTerm>
133
+ <DescriptionListDescription>
134
+ {disconnectedInfraEnv?.cpuArchitecture ?? 'x86_64'}
135
+ </DescriptionListDescription>
136
+ </DescriptionListGroup>
137
+ <DescriptionListGroup>
138
+ <DescriptionListTerm>ISO size</DescriptionListTerm>
139
+ <DescriptionListDescription>approx. 60+GB</DescriptionListDescription>
140
+ </DescriptionListGroup>
141
+ </DescriptionList>
142
+ </Grid>
143
+ </WithErrorBoundary>
144
+ </ClusterWizardStep>
116
145
  );
117
146
  };
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { InfraEnvUpdateParams } from '@openshift-assisted/types/assisted-installer-service';
3
+ import { InfraEnvsAPI } from '../../../../../common';
4
+ import { useClusterWizardContext } from '../../clusterWizardContext';
5
+ import { StaticIp } from '../staticIp/StaticIp';
6
+
7
+ export const DisconnectedStaticIp: React.FC = () => {
8
+ const { disconnectedInfraEnv, setDisconnectedInfraEnv } = useClusterWizardContext();
9
+
10
+ const updateInfraEnv = React.useCallback(
11
+ async (params: InfraEnvUpdateParams) => {
12
+ if (!disconnectedInfraEnv?.id) {
13
+ throw new Error('No disconnected infraEnv available');
14
+ }
15
+ const { data: updatedInfraEnv } = await InfraEnvsAPI.update(disconnectedInfraEnv.id, params);
16
+ setDisconnectedInfraEnv(updatedInfraEnv);
17
+ return updatedInfraEnv;
18
+ },
19
+ [disconnectedInfraEnv, setDisconnectedInfraEnv],
20
+ );
21
+
22
+ if (!disconnectedInfraEnv) {
23
+ return null;
24
+ }
25
+
26
+ return <StaticIp infraEnv={disconnectedInfraEnv} updateInfraEnv={updateInfraEnv} />;
27
+ };
28
+
29
+ export default DisconnectedStaticIp;
@@ -14,6 +14,7 @@ export const InstallDisconnectedSwitch = ({ isDisabled }: { isDisabled?: boolean
14
14
  onChange={(_, checked) => setInstallDisconnected(checked)}
15
15
  ouiaId="DisconnectedInstall"
16
16
  isDisabled={isDisabled}
17
+ label={<>{"I'm installing on a disconnected/air-gapped/secured environment"}</>}
17
18
  />
18
19
  );
19
20