@openshift-assisted/ui-lib 2.55.1 → 2.55.3

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 (61) hide show
  1. package/build/@types/common/config/docs_links.d.ts +1 -0
  2. package/build/@types/common/config/docs_links.d.ts.map +1 -1
  3. package/build/@types/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.d.ts.map +1 -1
  4. package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
  5. package/build/@types/ocm/components/clusterWizard/ClusterWizardNavigation.d.ts +7 -0
  6. package/build/@types/ocm/components/clusterWizard/ClusterWizardNavigation.d.ts.map +1 -1
  7. package/build/@types/ocm/components/clusterWizard/NewClusterWizard.d.ts.map +1 -1
  8. package/build/@types/ocm/components/clusterWizard/StaticIp.d.ts +1 -1
  9. package/build/@types/ocm/components/clusterWizard/StaticIp.d.ts.map +1 -1
  10. package/build/@types/ocm/components/clusterWizard/disconnected/BasicStep.d.ts +1 -1
  11. package/build/@types/ocm/components/clusterWizard/disconnected/BasicStep.d.ts.map +1 -1
  12. package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts +4 -0
  13. package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts.map +1 -0
  14. package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map +1 -1
  15. package/build/@types/ocm/components/clusterWizard/disconnected/ReviewStep.d.ts.map +1 -1
  16. package/build/@types/ocm/components/clusterWizard/utils.d.ts +7 -0
  17. package/build/@types/ocm/components/clusterWizard/utils.d.ts.map +1 -0
  18. package/build/@types/ocm/components/clusters/AssistedInstallerHeader.d.ts.map +1 -1
  19. package/build/cjs/common/components/clusterWizard/ClusterWizardStep.css +9 -0
  20. package/build/cjs/common/config/docs_links.js +3 -1
  21. package/build/cjs/common/config/docs_links.js.map +1 -1
  22. package/build/cjs/common/validationSchemas/addressValidation.js +2 -2
  23. package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -1
  24. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.js +3 -1
  25. package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.js.map +1 -1
  26. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +47 -47
  27. package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
  28. package/build/cjs/ocm/components/clusterWizard/ClusterWizardNavigation.js +31 -19
  29. package/build/cjs/ocm/components/clusterWizard/ClusterWizardNavigation.js.map +1 -1
  30. package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js +5 -0
  31. package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js.map +1 -1
  32. package/build/cjs/ocm/components/clusterWizard/StaticIp.js.map +1 -1
  33. package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js +1 -2
  34. package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js.map +1 -1
  35. package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js +26 -0
  36. package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js.map +1 -0
  37. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js +52 -19
  38. package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map +1 -1
  39. package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js +46 -48
  40. package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js.map +1 -1
  41. package/build/cjs/ocm/components/clusterWizard/utils.js +63 -0
  42. package/build/cjs/ocm/components/clusterWizard/utils.js.map +1 -0
  43. package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js +0 -3
  44. package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js.map +1 -1
  45. package/lib/common/components/clusterWizard/ClusterWizardStep.css +9 -0
  46. package/lib/common/config/docs_links.ts +3 -0
  47. package/lib/common/validationSchemas/_validationSchemas.test.ts +1 -1
  48. package/lib/common/validationSchemas/addressValidation.tsx +2 -2
  49. package/lib/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.tsx +4 -1
  50. package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +48 -71
  51. package/lib/ocm/components/clusterWizard/ClusterWizardNavigation.tsx +39 -16
  52. package/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +5 -0
  53. package/lib/ocm/components/clusterWizard/StaticIp.tsx +1 -1
  54. package/lib/ocm/components/clusterWizard/_wizardTransition.test.ts +60 -1
  55. package/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx +2 -3
  56. package/lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx +29 -0
  57. package/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +72 -12
  58. package/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +84 -89
  59. package/lib/ocm/components/clusterWizard/utils.ts +75 -0
  60. package/lib/ocm/components/clusters/AssistedInstallerHeader.tsx +1 -9
  61. package/package.json +3 -3
@@ -1,17 +1,7 @@
1
1
  import * as React from 'react';
2
- import ClusterWizardFooter from '../ClusterWizardFooter';
3
- import { useClusterWizardContext } from '../ClusterWizardContext';
4
- import {
5
- ClusterWizardStep,
6
- TechnologyPreview,
7
- PULL_SECRET_INFO_LINK,
8
- singleClusterOperators,
9
- } from '../../../../common';
10
- import ClusterWizardNavigation from '../ClusterWizardNavigation';
11
- import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
2
+ import { saveAs } from 'file-saver';
3
+ import { useNavigate } from 'react-router';
12
4
  import {
13
- Split,
14
- SplitItem,
15
5
  Alert,
16
6
  Grid,
17
7
  DescriptionList,
@@ -24,12 +14,20 @@ import {
24
14
  OrderType,
25
15
  Content,
26
16
  } from '@patternfly/react-core';
27
- import { Formik } from 'formik';
28
- import { saveAs } from 'file-saver';
29
- import { useNavigate } from 'react-router';
30
-
17
+ import {
18
+ ClusterWizardStep,
19
+ ExternalLink,
20
+ getDisconnectedDocsLink,
21
+ getMajorMinorVersion,
22
+ PULL_SECRET_INFO_LINK,
23
+ singleClusterOperators,
24
+ } from '../../../../common';
25
+ import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
31
26
  import { getOperatorSpecs } from '../../../../common/components/operators/operatorSpecs';
27
+ import { useClusterWizardContext } from '../ClusterWizardContext';
32
28
  import { DISCONNECTED_OPENSHIFT_VERSION } from './BasicStep';
29
+ import ClusterWizardFooter from '../ClusterWizardFooter';
30
+ import ClusterWizardNavigation from '../ClusterWizardNavigation';
33
31
 
34
32
  const ReviewStep = () => {
35
33
  const { moveBack, disconnectedInfraEnv } = useClusterWizardContext();
@@ -37,84 +35,81 @@ const ReviewStep = () => {
37
35
  const navigate = useNavigate();
38
36
 
39
37
  return (
40
- <Formik
41
- initialValues={{}}
42
- onSubmit={() => {
43
- // nothing to do
44
- }}
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
+ }
45
50
  >
46
- <ClusterWizardStep
47
- navigation={<ClusterWizardNavigation />}
48
- footer={
49
- <ClusterWizardFooter
50
- onNext={() => {
51
- saveAs(disconnectedInfraEnv?.downloadUrl ?? '');
52
- void navigate('/cluster-list');
53
- }}
54
- onBack={moveBack}
55
- nextButtonText="Download ISO"
56
- />
57
- }
58
- >
59
- <WithErrorBoundary title="Failed to load Review step">
60
- <Grid hasGutter>
61
- <Split>
62
- <SplitItem>
63
- <Content component="h2">Review and download ISO</Content>
64
- </SplitItem>
65
- <SplitItem>
66
- <TechnologyPreview />
67
- </SplitItem>
68
- </Split>
69
- <Alert isInline variant="info" title="Discovery ISO boot instructions">
70
- <List component={ListComponent.ol} type={OrderType.number}>
71
- <ListItem>Download ISO</ListItem>
72
- <ListItem>
73
- Download or copy your pull secret from{' '}
74
- <a href={PULL_SECRET_INFO_LINK} target="_blank" rel="noopener noreferrer">
75
- here
76
- </a>
77
- </ListItem>
78
- <ListItem>
79
- Boot your cluster's machines from this ISO and follow instructions
80
- </ListItem>
81
- <ListItem>
82
- Provide your pull secret inside the installation wizard when requested
83
- </ListItem>
84
- </List>
85
- </Alert>
86
- <Alert isInline isExpandable variant="info" title="List of available operators">
87
- <List>
88
- {singleClusterOperators.map((o) => {
89
- const operator = Object.values(opSpecs)
90
- .flatMap((op) => op)
91
- .find((op) => op.operatorKey === o);
92
- return <ListItem key={o}>{operator ? operator.title : o}</ListItem>;
93
- })}
94
- </List>
95
- </Alert>
96
- <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 && (
97
92
  <DescriptionListGroup>
98
- <DescriptionListTerm>OpenShift version</DescriptionListTerm>
93
+ <DescriptionListTerm>Rendezvous IP</DescriptionListTerm>
99
94
  <DescriptionListDescription>
100
- {disconnectedInfraEnv?.openshiftVersion ?? DISCONNECTED_OPENSHIFT_VERSION}
95
+ {disconnectedInfraEnv.rendezvousIp}
101
96
  </DescriptionListDescription>
102
97
  </DescriptionListGroup>
103
- <DescriptionListGroup>
104
- <DescriptionListTerm>CPU architecture</DescriptionListTerm>
105
- <DescriptionListDescription>
106
- {disconnectedInfraEnv?.cpuArchitecture ?? 'x86_64'}
107
- </DescriptionListDescription>
108
- </DescriptionListGroup>
109
- <DescriptionListGroup>
110
- <DescriptionListTerm>ISO size</DescriptionListTerm>
111
- <DescriptionListDescription>approx. 43.5GB</DescriptionListDescription>
112
- </DescriptionListGroup>
113
- </DescriptionList>
114
- </Grid>
115
- </WithErrorBoundary>
116
- </ClusterWizardStep>
117
- </Formik>
98
+ )}
99
+ <DescriptionListGroup>
100
+ <DescriptionListTerm>CPU architecture</DescriptionListTerm>
101
+ <DescriptionListDescription>
102
+ {disconnectedInfraEnv?.cpuArchitecture ?? 'x86_64'}
103
+ </DescriptionListDescription>
104
+ </DescriptionListGroup>
105
+ <DescriptionListGroup>
106
+ <DescriptionListTerm>ISO size</DescriptionListTerm>
107
+ <DescriptionListDescription>approx. 50+GB</DescriptionListDescription>
108
+ </DescriptionListGroup>
109
+ </DescriptionList>
110
+ </Grid>
111
+ </WithErrorBoundary>
112
+ </ClusterWizardStep>
118
113
  );
119
114
  };
120
115
 
@@ -0,0 +1,75 @@
1
+ import { defaultWizardSteps, staticIpFormViewSubSteps } from './constants';
2
+ import { StaticIpView } from '../clusterConfiguration/staticIp/data/dataTypes';
3
+ import { ClusterWizardStepsType, disconnectedSteps } from './wizardTransition';
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-optional-configurations', [
64
+ 'static-ip-yaml-view',
65
+ ]);
66
+ }
67
+ if (staticIpView === StaticIpView.FORM) {
68
+ return addStepToClusterWizard(copy, 'disconnected-optional-configurations', [
69
+ 'static-ip-network-wide-configurations',
70
+ 'static-ip-host-configurations',
71
+ ]);
72
+ }
73
+
74
+ return copy;
75
+ };
@@ -1,25 +1,17 @@
1
1
  import React from 'react';
2
2
  import { Content, Split, SplitItem } from '@patternfly/react-core';
3
- import {
4
- ASSISTED_INSTALLER_DOCUMENTATION_LINK,
5
- TechnologyPreview,
6
- ExternalLink,
7
- isInOcm,
8
- } from '../../../common';
9
- import { useFeature } from '../../hooks/use-feature';
3
+ import { ASSISTED_INSTALLER_DOCUMENTATION_LINK, ExternalLink, isInOcm } from '../../../common';
10
4
 
11
5
  type AssistedInstallerHeaderProps = {
12
6
  clusterName?: string;
13
7
  };
14
8
 
15
9
  export const AssistedInstallerHeader = ({ clusterName }: AssistedInstallerHeaderProps) => {
16
- const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
17
10
  return (
18
11
  <>
19
12
  <Content component="h1" className="pf-v6-u-display-inline">
20
13
  {clusterName || 'Install OpenShift with the Assisted Installer'}
21
14
  </Content>
22
- {isSingleClusterFeatureEnabled && <TechnologyPreview />}
23
15
  <Split hasGutter>
24
16
  <SplitItem>
25
17
  <ExternalLink href={ASSISTED_INSTALLER_DOCUMENTATION_LINK}>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.55.1",
4
- "@openshift-assisted/types": "2.55.1",
3
+ "@openshift-assisted/locales": "2.55.3",
4
+ "@openshift-assisted/types": "2.55.3",
5
5
  "@openshift-console/dynamic-plugin-sdk": "^4.22.0",
6
6
  "@patternfly/patternfly": "6.4.0",
7
7
  "@patternfly/react-code-editor": "6.4.1",
@@ -136,5 +136,5 @@
136
136
  ]
137
137
  }
138
138
  },
139
- "version": "2.55.1"
139
+ "version": "2.55.3"
140
140
  }