99 ProgressStep ,
1010 ProgressStepper ,
1111 Stack ,
12- StackItem ,
1312} from '@patternfly/react-core' ;
14- import { CheckIcon } from '@patternfly/react-icons' ;
1513import { useCallback , useMemo , useState } from 'react' ;
1614import useGenericObjectState from '~/app/hooks/useGenericObjectState' ;
1715import { useNotebookAPI } from '~/app/hooks/useNotebookAPI' ;
@@ -32,6 +30,14 @@ enum WorkspaceFormSteps {
3230 Properties ,
3331}
3432
33+ const stepDescriptions : { [ key in WorkspaceFormSteps ] ?: string } = {
34+ [ WorkspaceFormSteps . KindSelection ] : 'Select a workspace kind to use for the workspace.' ,
35+ [ WorkspaceFormSteps . ImageSelection ] :
36+ 'Select a workspace image and image version to use for the workspace.' ,
37+ [ WorkspaceFormSteps . PodConfigSelection ] : 'Select a pod config to use for the workspace.' ,
38+ [ WorkspaceFormSteps . Properties ] : 'Configure properties for your workspace.' ,
39+ } ;
40+
3541const WorkspaceForm : React . FC = ( ) => {
3642 const navigate = useTypedNavigate ( ) ;
3743 const { api } = useNotebookAPI ( ) ;
@@ -158,75 +164,54 @@ const WorkspaceForm: React.FC = () => {
158164 < PageGroup isFilled = { false } stickyOnBreakpoint = { { default : 'top' } } >
159165 < PageSection >
160166 < Stack hasGutter >
161- < StackItem >
162- < Flex >
167+ < Flex direction = { { default : 'column' } } rowGap = { { default : 'rowGapXl' } } >
168+ < FlexItem >
163169 < Content >
164170 < h1 > { `${ mode === 'create' ? 'Create' : 'Edit' } workspace` } </ h1 >
171+ < p > { stepDescriptions [ currentStep ] } </ p >
165172 </ Content >
166- </ Flex >
167- </ StackItem >
168- < StackItem >
169- < ProgressStepper aria-label = "Workspace form stepper" >
170- < ProgressStep
171- variant = { getStepVariant ( WorkspaceFormSteps . KindSelection ) }
172- id = "kind-selection-step"
173- icon = {
174- getStepVariant ( WorkspaceFormSteps . KindSelection ) === 'success' ? (
175- < CheckIcon />
176- ) : (
177- 1
178- )
179- }
180- titleId = "kind-selection-step-title"
181- aria-label = "Kind selection step"
182- >
183- Workspace Kind
184- </ ProgressStep >
185- < ProgressStep
186- variant = { getStepVariant ( WorkspaceFormSteps . ImageSelection ) }
187- isCurrent
188- id = "image-selection-step"
189- icon = {
190- getStepVariant ( WorkspaceFormSteps . ImageSelection ) === 'success' ? (
191- < CheckIcon />
192- ) : (
193- 2
194- )
195- }
196- titleId = "image-selection-step-title"
197- aria-label = "Image selection step"
198- >
199- Image
200- </ ProgressStep >
201- < ProgressStep
202- variant = { getStepVariant ( WorkspaceFormSteps . PodConfigSelection ) }
203- isCurrent
204- id = "pod-config-selection-step"
205- icon = {
206- getStepVariant ( WorkspaceFormSteps . PodConfigSelection ) === 'success' ? (
207- < CheckIcon />
208- ) : (
209- 3
210- )
211- }
212- titleId = "pod-config-selection-step-title"
213- aria-label = "Pod config selection step"
214- >
215- Pod Config
216- </ ProgressStep >
217- < ProgressStep
218- variant = { getStepVariant ( WorkspaceFormSteps . Properties ) }
219- id = "properties-step"
220- icon = {
221- getStepVariant ( WorkspaceFormSteps . Properties ) === 'success' ? < CheckIcon /> : 4
222- }
223- titleId = "properties-step-title"
224- aria-label = "Properties step"
225- >
226- Properties
227- </ ProgressStep >
228- </ ProgressStepper >
229- </ StackItem >
173+ </ FlexItem >
174+ < FlexItem >
175+ < ProgressStepper aria-label = "Workspace form stepper" >
176+ < ProgressStep
177+ variant = { getStepVariant ( WorkspaceFormSteps . KindSelection ) }
178+ isCurrent = { currentStep === WorkspaceFormSteps . KindSelection }
179+ id = "kind-selection-step"
180+ titleId = "kind-selection-step-title"
181+ aria-label = "Kind selection step"
182+ >
183+ Workspace Kind
184+ </ ProgressStep >
185+ < ProgressStep
186+ variant = { getStepVariant ( WorkspaceFormSteps . ImageSelection ) }
187+ isCurrent = { currentStep === WorkspaceFormSteps . ImageSelection }
188+ id = "image-selection-step"
189+ titleId = "image-selection-step-title"
190+ aria-label = "Image selection step"
191+ >
192+ Image
193+ </ ProgressStep >
194+ < ProgressStep
195+ variant = { getStepVariant ( WorkspaceFormSteps . PodConfigSelection ) }
196+ isCurrent = { currentStep === WorkspaceFormSteps . PodConfigSelection }
197+ id = "pod-config-selection-step"
198+ titleId = "pod-config-selection-step-title"
199+ aria-label = "Pod config selection step"
200+ >
201+ Pod Config
202+ </ ProgressStep >
203+ < ProgressStep
204+ variant = { getStepVariant ( WorkspaceFormSteps . Properties ) }
205+ isCurrent = { currentStep === WorkspaceFormSteps . Properties }
206+ id = "properties-step"
207+ titleId = "properties-step-title"
208+ aria-label = "Properties step"
209+ >
210+ Properties
211+ </ ProgressStep >
212+ </ ProgressStepper >
213+ </ FlexItem >
214+ </ Flex >
230215 </ Stack >
231216 </ PageSection >
232217 </ PageGroup >
0 commit comments