@@ -123,6 +123,7 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
123123 setValue,
124124 reset,
125125 watch,
126+ getValues,
126127 formState : { errors, isValid } ,
127128 } = useForm < CreateDialogProps > ( {
128129 resolver : zodResolver ( validationSchemaCreateManagedControlPlane ) ,
@@ -156,7 +157,8 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
156157
157158 setMetadataFormKey ( ( k ) => k + 1 ) ;
158159 } , [ selectedTemplate , selectedStep , setValue , normalizeChargingTargetType ] ) ;
159-
160+ console . log ( getValues ( ) ) ;
161+ console . log ( errors ) ;
160162 const nextButtonText = useMemo (
161163 ( ) => ( {
162164 metadata : t ( 'buttons.next' ) ,
@@ -488,134 +490,130 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
488490
489491 return (
490492 < >
491- { isOpen ? (
492- < Dialog
493- stretch
494- headerText = { isEditMode ? t ( 'editMCP.dialogTitle' ) : t ( 'createMCP.dialogTitle' ) }
495- open = { isOpen }
496- initialFocus = "project-name-input"
497- footer = {
498- < Bar
499- design = "Footer"
500- endContent = {
501- < div style = { { display : 'flex' , alignItems : 'center' , gap : 8 } } >
502- { selectedStep !== 'success' &&
503- ( selectedStep === 'metadata' ? (
504- < Button onClick = { resetFormAndClose } > { t ( 'buttons.close' ) } </ Button >
505- ) : (
506- < Button onClick = { onBackClick } > { t ( 'buttons.back' ) } </ Button >
507- ) ) }
508- < Button design = "Emphasized" onClick = { onNextClick } >
509- { nextButtonText [ selectedStep ] }
510- </ Button >
511- </ div >
512- }
493+ < Dialog
494+ stretch
495+ headerText = { isEditMode ? t ( 'editMCP.dialogTitle' ) : t ( 'createMCP.dialogTitle' ) }
496+ open = { isOpen }
497+ initialFocus = "project-name-input"
498+ footer = {
499+ < Bar
500+ design = "Footer"
501+ endContent = {
502+ < div style = { { display : 'flex' , alignItems : 'center' , gap : 8 } } >
503+ { selectedStep !== 'success' &&
504+ ( selectedStep === 'metadata' ? (
505+ < Button onClick = { resetFormAndClose } > { t ( 'buttons.close' ) } </ Button >
506+ ) : (
507+ < Button onClick = { onBackClick } > { t ( 'buttons.back' ) } </ Button >
508+ ) ) }
509+ < Button design = "Emphasized" onClick = { onNextClick } >
510+ { nextButtonText [ selectedStep ] }
511+ </ Button >
512+ </ div >
513+ }
514+ />
515+ }
516+ data-testid = "create-mcp-dialog"
517+ onClose = { resetFormAndClose }
518+ >
519+ < ErrorDialog ref = { errorDialogRef } />
520+ < Wizard contentLayout = "SingleStep" onStepChange = { handleStepChange } >
521+ < WizardStep
522+ icon = "create-form"
523+ titleText = { t ( 'common.metadata' ) }
524+ disabled = { isStepDisabled ( 'metadata' ) }
525+ selected = { selectedStep === 'metadata' }
526+ data-step = "metadata"
527+ >
528+ < MetadataForm
529+ key = { metadataFormKey }
530+ watch = { watch }
531+ setValue = { setValue }
532+ register = { register }
533+ errors = { errors }
534+ isEditMode = { isEditMode }
535+ disableChargingFields = { ! ! selectedTemplate }
536+ namePrefix = { templateAffixes . namePrefix }
537+ displayNamePrefix = { templateAffixes . displayNamePrefix }
538+ nameSuffix = { templateAffixes . nameSuffix }
539+ displayNameSuffix = { templateAffixes . displayNameSuffix }
513540 />
514- }
515- data-testid = "create-mcp-dialog"
516- onClose = { resetFormAndClose }
517- >
518- < ErrorDialog ref = { errorDialogRef } />
519- < Wizard contentLayout = "SingleStep" onStepChange = { handleStepChange } >
520- < WizardStep
521- icon = "create-form"
522- titleText = { t ( 'common.metadata' ) }
523- disabled = { isStepDisabled ( 'metadata' ) }
524- selected = { selectedStep === 'metadata' }
525- data-step = "metadata"
526- >
527- < MetadataForm
528- key = { metadataFormKey }
529- watch = { watch }
530- setValue = { setValue }
531- register = { register }
532- errors = { errors }
533- isEditMode = { isEditMode }
534- disableChargingFields = { ! ! selectedTemplate }
535- namePrefix = { templateAffixes . namePrefix }
536- displayNamePrefix = { templateAffixes . displayNamePrefix }
537- nameSuffix = { templateAffixes . nameSuffix }
538- displayNameSuffix = { templateAffixes . displayNameSuffix }
539- />
540- </ WizardStep >
541- < WizardStep
542- icon = "user-edit"
543- titleText = { t ( 'common.members' ) }
544- selected = { selectedStep === 'members' }
545- data-step = "members"
546- disabled = { isStepDisabled ( 'members' ) }
547- >
548- < Form >
549- < FormGroup headerText = { t ( 'CreateProjectWorkspaceDialog.membersHeader' ) } >
550- < EditMembers
551- members = { watch ( 'members' ) }
552- isValidationError = { ! ! errors . members }
553- requireAtLeastOneMember = { false }
554- workspaceName = { workspaceName }
555- projectName = { projectName }
556- type = { 'mcp' }
557- onMemberChanged = { setMembers }
558- />
559- </ FormGroup >
560- </ Form >
561- </ WizardStep >
562- < WizardStep
563- icon = "add-product"
564- titleText = { t ( 'common.componentSelection' ) }
565- selected = { selectedStep === 'componentSelection' }
566- data-step = "componentSelection"
567- disabled = { isStepDisabled ( 'componentSelection' ) }
568- >
569- { /* this condition is to remount the component from scratch to fix a bug with data loading */ }
570- { selectedStep === 'componentSelection' && (
571- < ComponentsSelectionContainer
572- componentsList = { componentsList ?? [ ] }
573- setComponentsList = { setComponentsList }
574- initialSelection = { initialSelection }
575- managedControlPlaneTemplate = { selectedTemplate }
541+ </ WizardStep >
542+ < WizardStep
543+ icon = "user-edit"
544+ titleText = { t ( 'common.members' ) }
545+ selected = { selectedStep === 'members' }
546+ data-step = "members"
547+ disabled = { isStepDisabled ( 'members' ) }
548+ >
549+ < Form >
550+ < FormGroup headerText = { t ( 'CreateProjectWorkspaceDialog.membersHeader' ) } >
551+ < EditMembers
552+ members = { watch ( 'members' ) }
553+ isValidationError = { ! ! errors . members }
554+ requireAtLeastOneMember = { false }
555+ workspaceName = { workspaceName }
556+ projectName = { projectName }
557+ type = { 'mcp' }
558+ onMemberChanged = { setMembers }
576559 />
577- ) }
578- </ WizardStep >
579- < WizardStep
580- icon = "activities"
581- titleText = { t ( 'common.summarize' ) }
582- disabled = { isStepDisabled ( 'summarize' ) }
583- selected = { selectedStep === 'summarize' }
584- data-step = "summarize"
585- >
586- < SummarizeStep
587- watch = { watch }
588- workspaceName = { workspaceName }
589- projectName = { projectName }
590- componentsList = { componentsList }
560+ </ FormGroup >
561+ </ Form >
562+ </ WizardStep >
563+ < WizardStep
564+ icon = "add-product"
565+ titleText = { t ( 'common.componentSelection' ) }
566+ selected = { selectedStep === 'componentSelection' }
567+ data-step = "componentSelection"
568+ disabled = { isStepDisabled ( 'componentSelection' ) }
569+ >
570+ { /* this condition is to remount the component from scratch to fix a bug with data loading */ }
571+ { selectedStep === 'componentSelection' && (
572+ < ComponentsSelectionContainer
573+ componentsList = { componentsList ?? [ ] }
574+ setComponentsList = { setComponentsList }
575+ initialSelection = { initialSelection }
576+ managedControlPlaneTemplate = { selectedTemplate }
591577 />
592- </ WizardStep >
593- < WizardStep
594- icon = "activities"
595- titleText = { t ( 'common.success' ) }
596- disabled = { isStepDisabled ( 'success' ) }
597- selected = { selectedStep === 'success' }
598- data-step = "success"
599- >
600- { isEditMode ? (
601- < IllustratedBanner
602- illustrationName = { IllustrationMessageType . SuccessScreen }
603- title = { t ( 'editMCP.titleText' ) }
604- subtitle = { t ( 'editMCP.subtitleText' ) }
605- />
606- ) : (
607- < IllustratedBanner
608- illustrationName = { IllustrationMessageType . SuccessScreen }
609- title = { t ( 'createMCP.titleText' ) }
610- subtitle = { t ( 'createMCP.subtitleText' ) }
611- />
612- ) }
613- </ WizardStep >
614- </ Wizard >
615- </ Dialog >
616- ) : (
617- < div />
618- ) }
578+ ) }
579+ </ WizardStep >
580+ < WizardStep
581+ icon = "activities"
582+ titleText = { t ( 'common.summarize' ) }
583+ disabled = { isStepDisabled ( 'summarize' ) }
584+ selected = { selectedStep === 'summarize' }
585+ data-step = "summarize"
586+ >
587+ < SummarizeStep
588+ watch = { watch }
589+ workspaceName = { workspaceName }
590+ projectName = { projectName }
591+ componentsList = { componentsList }
592+ />
593+ </ WizardStep >
594+ < WizardStep
595+ icon = "activities"
596+ titleText = { t ( 'common.success' ) }
597+ disabled = { isStepDisabled ( 'success' ) }
598+ selected = { selectedStep === 'success' }
599+ data-step = "success"
600+ >
601+ { isEditMode ? (
602+ < IllustratedBanner
603+ illustrationName = { IllustrationMessageType . SuccessScreen }
604+ title = { t ( 'editMCP.titleText' ) }
605+ subtitle = { t ( 'editMCP.subtitleText' ) }
606+ />
607+ ) : (
608+ < IllustratedBanner
609+ illustrationName = { IllustrationMessageType . SuccessScreen }
610+ title = { t ( 'createMCP.titleText' ) }
611+ subtitle = { t ( 'createMCP.subtitleText' ) }
612+ />
613+ ) }
614+ </ WizardStep >
615+ </ Wizard >
616+ </ Dialog >
619617 </ >
620618 ) ;
621619} ;
0 commit comments