1
1
import PropTypes from 'prop-types' ;
2
2
import React , { Suspense } from 'react' ;
3
- import { Bullseye , Spinner } from '@patternfly/react-core' ;
3
+ import { Alert , Bullseye , Spinner } from '@patternfly/react-core' ;
4
4
import { humanizeProvider } from '../../Common/helpers' ;
5
+ import { useFlag } from '@unleash/proxy-client-react' ;
5
6
6
7
const SourceMissing = React . lazy ( ( ) => import ( './SourceMissing' ) ) ;
7
8
const AccountCustomizations = React . lazy ( ( ) => import ( './AccountCustomizations' ) ) ;
@@ -45,6 +46,29 @@ const missingSource = ({ image, isLoading, sourcesError }) => [
45
46
} ,
46
47
] ;
47
48
49
+ const DecommissioningAlert = ( ) => (
50
+ < Alert variant = "info" isInline title = "Upcoming decommission of the Image Builder Launch service" className = "pf-v6-u-mt-sm pf-v6-u-mb-sm" >
51
+ < p >
52
+ As of August 31st, the Image Builder Launch service will be discontinued. It will no longer be possible to launch instances directly from custom
53
+ images using this service. After this date, custom images must be launched by following the cloud provider's standard procedures.
54
+ </ p >
55
+ </ Alert >
56
+ ) ;
57
+
58
+ const StepContentWrapper = ( { children } ) => {
59
+ const decommissionFlag = useFlag ( 'provisioning.decommissioning' ) ;
60
+ return (
61
+ < >
62
+ { decommissionFlag && < DecommissioningAlert /> }
63
+ { children }
64
+ </ >
65
+ ) ;
66
+ } ;
67
+
68
+ StepContentWrapper . propTypes = {
69
+ children : PropTypes . node . isRequired ,
70
+ } ;
71
+
48
72
const wizardSteps = ( { stepIdReached, image, stepValidation, setStepValidation, setLaunchSuccess } ) => [
49
73
{
50
74
name : 'Account and customization' ,
@@ -54,9 +78,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
54
78
id : 1 ,
55
79
enableNext : stepValidation . awsStep ,
56
80
component : (
57
- < Loader >
58
- < AccountCustomizations image = { image } setStepValidated = { ( validated ) => setStepValidation ( ( prev ) => ( { ...prev , awsStep : validated } ) ) } />
59
- </ Loader >
81
+ < StepContentWrapper >
82
+ < Loader >
83
+ < AccountCustomizations image = { image } setStepValidated = { ( validated ) => setStepValidation ( ( prev ) => ( { ...prev , awsStep : validated } ) ) } />
84
+ </ Loader >
85
+ </ StepContentWrapper >
60
86
) ,
61
87
canJumpTo : stepIdReached >= 1 ,
62
88
} ,
@@ -66,9 +92,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
66
92
name : 'SSH key authentication' ,
67
93
id : 4 ,
68
94
component : (
69
- < Loader >
70
- < PublicKeys setStepValidated = { ( validated ) => setStepValidation ( ( prev ) => ( { ...prev , sshStep : validated } ) ) } />
71
- </ Loader >
95
+ < StepContentWrapper >
96
+ < Loader >
97
+ < PublicKeys setStepValidated = { ( validated ) => setStepValidation ( ( prev ) => ( { ...prev , sshStep : validated } ) ) } />
98
+ </ Loader >
99
+ </ StepContentWrapper >
72
100
) ,
73
101
canJumpTo : stepIdReached >= 4 ,
74
102
enableNext : stepValidation . sshStep ,
@@ -77,9 +105,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
77
105
name : 'Review details' ,
78
106
id : 5 ,
79
107
component : (
80
- < Loader >
81
- < ReviewDetails image = { image } />
82
- </ Loader >
108
+ < StepContentWrapper >
109
+ < Loader >
110
+ < ReviewDetails image = { image } />
111
+ </ Loader >
112
+ </ StepContentWrapper >
83
113
) ,
84
114
canJumpTo : stepIdReached >= 5 ,
85
115
nextButtonText : 'Launch' ,
@@ -88,9 +118,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
88
118
name : 'Finish Progress' ,
89
119
id : 6 ,
90
120
component : (
91
- < Loader >
92
- < FinishStep setLaunchSuccess = { ( ) => setLaunchSuccess ( true ) } imageID = { image . id } />
93
- </ Loader >
121
+ < StepContentWrapper >
122
+ < Loader >
123
+ < FinishStep setLaunchSuccess = { ( ) => setLaunchSuccess ( true ) } imageID = { image . id } />
124
+ </ Loader >
125
+ </ StepContentWrapper >
94
126
) ,
95
127
isFinishedStep : true ,
96
128
} ,
0 commit comments