From f9da94654424d521d2d21c8caf90983e0604c9bf Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Wed, 28 Aug 2024 23:53:24 -0400 Subject: [PATCH] configure cloud instance step progress --- .../create-cluster/CreateCluster.tsx | 8 +- .../create-cluster/CreateClusterActions.tsx | 6 +- .../create-cluster/CreateClusterWizard.tsx | 4 +- .../steps/ConfigureCloudInstanceStep.tsx | 126 +++++++++++++++++- 4 files changed, 139 insertions(+), 5 deletions(-) diff --git a/www/src/components/create-cluster/CreateCluster.tsx b/www/src/components/create-cluster/CreateCluster.tsx index 4a9890d94..f9eedc6b8 100644 --- a/www/src/components/create-cluster/CreateCluster.tsx +++ b/www/src/components/create-cluster/CreateCluster.tsx @@ -7,7 +7,7 @@ import { import { useNavigate } from 'react-router-dom' import styled, { useTheme } from 'styled-components' -import { useMemo, useState } from 'react' +import { ReactElement, useMemo, useState } from 'react' import OnboardingCard from 'components/shell/onboarding/OnboardingCard' @@ -27,6 +27,8 @@ export function CreateCluster() { ) const [hostingOption, setHostingOption] = useState<'local' | 'cloud'>('local') const [finishEnabled, setFinishEnabled] = useState(false) + const [continueBtn, setContinueBtn] = useState() + const steps = hostingOption === 'local' ? localSteps : cloudSteps const curStepIndex = steps.findIndex((step) => step.key === curStep) @@ -38,6 +40,8 @@ export function CreateCluster() { setHostingOption, finishEnabled, setFinishEnabled, + continueBtn, + setContinueBtn, }), [ curStep, @@ -46,6 +50,8 @@ export function CreateCluster() { setHostingOption, finishEnabled, setFinishEnabled, + continueBtn, + setContinueBtn, ] ) diff --git a/www/src/components/create-cluster/CreateClusterActions.tsx b/www/src/components/create-cluster/CreateClusterActions.tsx index dfb69a286..8fa2626c8 100644 --- a/www/src/components/create-cluster/CreateClusterActions.tsx +++ b/www/src/components/create-cluster/CreateClusterActions.tsx @@ -9,7 +9,7 @@ import { export function CreateClusterActions() { const theme = useTheme() - const { curStep, setCurStep, hostingOption, finishEnabled } = + const { curStep, setCurStep, hostingOption, finishEnabled, continueBtn } = useCreateClusterContext() const steps = hostingOption === 'local' ? localSteps : cloudSteps @@ -51,7 +51,9 @@ export function CreateClusterActions() { )} {nextStep ? ( - + continueBtn || ( + + ) ) : ( + ) + + return () => { + setContinueBtn(undefined) + } + }, [canSubmit, setContinueBtn, setCurStep]) + + return ( + + + After completing this step it may take a few minutes for your Console to + deploy. It will run in the background as you proceed. + + + setClusterName(e.target.value)} + /> + + + + + + + + {cloudProvider === CloudProvider.Aws && ( + + + + )} + + ) } + +const FormFieldSC = styled(FormField)(({ theme }) => ({ + color: theme.colors.text, +})) + +const regions = ['us-east-1']