diff --git a/src/Components/ProvisioningWizard/steps/index.js b/src/Components/ProvisioningWizard/steps/index.js index 70c76eaa..47fa3b86 100644 --- a/src/Components/ProvisioningWizard/steps/index.js +++ b/src/Components/ProvisioningWizard/steps/index.js @@ -1,7 +1,8 @@ import PropTypes from 'prop-types'; import React, { Suspense } from 'react'; -import { Bullseye, Spinner } from '@patternfly/react-core'; +import { Alert, Bullseye, Spinner } from '@patternfly/react-core'; import { humanizeProvider } from '../../Common/helpers'; +import { useFlag } from '@unleash/proxy-client-react'; const SourceMissing = React.lazy(() => import('./SourceMissing')); const AccountCustomizations = React.lazy(() => import('./AccountCustomizations')); @@ -45,6 +46,29 @@ const missingSource = ({ image, isLoading, sourcesError }) => [ }, ]; +const DecommissioningAlert = () => ( + +

+ As of August 31st, the Image Builder Launch service will be discontinued. It will no longer be possible to launch instances directly from custom + images using this service. After this date, custom images must be launched by following the cloud provider's standard procedures. +

+
+); + +const StepContentWrapper = ({ children }) => { + const decommissionFlag = useFlag('provisioning.decommissioning'); + return ( + <> + {decommissionFlag && } + {children} + + ); +}; + +StepContentWrapper.propTypes = { + children: PropTypes.node.isRequired, +}; + const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation, setLaunchSuccess }) => [ { name: 'Account and customization', @@ -54,9 +78,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation, id: 1, enableNext: stepValidation.awsStep, component: ( - - setStepValidation((prev) => ({ ...prev, awsStep: validated }))} /> - + + + setStepValidation((prev) => ({ ...prev, awsStep: validated }))} /> + + ), canJumpTo: stepIdReached >= 1, }, @@ -66,9 +92,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation, name: 'SSH key authentication', id: 4, component: ( - - setStepValidation((prev) => ({ ...prev, sshStep: validated }))} /> - + + + setStepValidation((prev) => ({ ...prev, sshStep: validated }))} /> + + ), canJumpTo: stepIdReached >= 4, enableNext: stepValidation.sshStep, @@ -77,9 +105,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation, name: 'Review details', id: 5, component: ( - - - + + + + + ), canJumpTo: stepIdReached >= 5, nextButtonText: 'Launch', @@ -88,9 +118,11 @@ const wizardSteps = ({ stepIdReached, image, stepValidation, setStepValidation, name: 'Finish Progress', id: 6, component: ( - - setLaunchSuccess(true)} imageID={image.id} /> - + + + setLaunchSuccess(true)} imageID={image.id} /> + + ), isFinishedStep: true, },