11import PropTypes from 'prop-types' ;
22import React , { Suspense } from 'react' ;
3- import { Bullseye , Spinner } from '@patternfly/react-core' ;
3+ import { Alert , Bullseye , Spinner } from '@patternfly/react-core' ;
44import { humanizeProvider } from '../../Common/helpers' ;
5+ import { useFlag } from '@unleash/proxy-client-react' ;
56
67const SourceMissing = React . lazy ( ( ) => import ( './SourceMissing' ) ) ;
78const AccountCustomizations = React . lazy ( ( ) => import ( './AccountCustomizations' ) ) ;
@@ -45,6 +46,29 @@ const missingSource = ({ image, isLoading, sourcesError }) => [
4546 } ,
4647] ;
4748
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+
4872const wizardSteps = ( { stepIdReached, image, stepValidation, setStepValidation, setLaunchSuccess } ) => [
4973 {
5074 name : 'Account and customization' ,
@@ -54,9 +78,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
5478 id : 1 ,
5579 enableNext : stepValidation . awsStep ,
5680 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 >
6086 ) ,
6187 canJumpTo : stepIdReached >= 1 ,
6288 } ,
@@ -66,9 +92,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
6692 name : 'SSH key authentication' ,
6793 id : 4 ,
6894 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 >
72100 ) ,
73101 canJumpTo : stepIdReached >= 4 ,
74102 enableNext : stepValidation . sshStep ,
@@ -77,9 +105,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
77105 name : 'Review details' ,
78106 id : 5 ,
79107 component : (
80- < Loader >
81- < ReviewDetails image = { image } />
82- </ Loader >
108+ < StepContentWrapper >
109+ < Loader >
110+ < ReviewDetails image = { image } />
111+ </ Loader >
112+ </ StepContentWrapper >
83113 ) ,
84114 canJumpTo : stepIdReached >= 5 ,
85115 nextButtonText : 'Launch' ,
@@ -88,9 +118,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation,
88118 name : 'Finish Progress' ,
89119 id : 6 ,
90120 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 >
94126 ) ,
95127 isFinishedStep : true ,
96128 } ,
0 commit comments