@@ -12,73 +12,51 @@ import { UseFormGetValues } from 'react-hook-form';
1212import { CreateDialogProps } from '../../Dialogs/CreateWorkspaceDialogContainer.tsx' ;
1313
1414interface SummarizeStepProps {
15- getValues : UseFormGetValues < CreateDialogProps > ;
15+ watch : UseFormGetValues < CreateDialogProps > ;
1616 projectName : string ;
1717 workspaceName : string ;
1818 componentsList ?: ComponentsListItem [ ] ;
1919}
2020
21- export const SummarizeStep : React . FC < SummarizeStepProps > = ( {
22- getValues,
23- projectName,
24- workspaceName,
25- componentsList,
26- } ) => {
21+ export const SummarizeStep : React . FC < SummarizeStepProps > = ( { watch, projectName, workspaceName, componentsList } ) => {
2722 const { t } = useTranslation ( ) ;
2823 return (
2924 < >
3025 < Title > { t ( 'common.summarize' ) } </ Title >
3126 < Grid defaultSpan = "XL6 L6 M6 S6" >
3227 < div >
3328 < List headerText = { t ( 'common.metadata' ) } >
34- < ListItemStandard
35- text = { t ( 'common.name' ) }
36- additionalText = { getValues ( 'name' ) }
37- />
38- < ListItemStandard
39- text = { t ( 'common.displayName' ) }
40- additionalText = { getValues ( 'displayName' ) }
41- />
29+ < ListItemStandard text = { t ( 'common.name' ) } additionalText = { watch ( 'name' ) } />
30+ < ListItemStandard text = { t ( 'common.displayName' ) } additionalText = { watch ( 'displayName' ) } />
4231 < ListItemStandard
4332 text = { t ( 'CreateProjectWorkspaceDialog.chargingTargetLabel' ) }
44- additionalText = { getValues ( 'chargingTarget' ) }
45- />
46- < ListItemStandard
47- text = { t ( 'common.namespace' ) }
48- additionalText = { `${ projectName } --ws-${ workspaceName } ` }
33+ additionalText = { watch ( 'chargingTarget' ) }
4934 />
35+ < ListItemStandard text = { t ( 'common.namespace' ) } additionalText = { `${ projectName } --ws-${ workspaceName } ` } />
5036 </ List >
5137 < br />
5238 < List headerText = { t ( 'common.members' ) } >
53- { getValues ( 'members' ) . map ( ( member ) => (
54- < ListItemStandard
55- key = { member . name }
56- text = { member . name }
57- additionalText = { member . roles [ 0 ] }
58- />
39+ { watch ( 'members' ) . map ( ( member ) => (
40+ < ListItemStandard key = { member . name } text = { member . name } additionalText = { member . roles [ 0 ] } />
5941 ) ) }
6042 </ List >
6143 < br />
6244 < List headerText = { t ( 'common.components' ) } >
6345 { getSelectedComponents ( componentsList ?? [ ] ) . map ( ( component ) => (
64- < ListItemStandard
65- key = { component . name }
66- text = { component . name }
67- additionalText = { component . selectedVersion }
68- />
46+ < ListItemStandard key = { component . name } text = { component . name } additionalText = { component . selectedVersion } />
6947 ) ) }
7048 </ List >
7149 </ div >
7250 < div >
7351 < YamlViewer
7452 yamlString = { stringify (
7553 CreateManagedControlPlane (
76- getValues ( 'name' ) ,
54+ watch ( 'name' ) ,
7755 `${ projectName } --ws-${ workspaceName } ` ,
7856 {
79- displayName : getValues ( 'displayName' ) ,
80- chargingTarget : getValues ( 'chargingTarget' ) ,
81- members : getValues ( 'members' ) ,
57+ displayName : watch ( 'displayName' ) ,
58+ chargingTarget : watch ( 'chargingTarget' ) ,
59+ members : watch ( 'members' ) ,
8260 componentsList : componentsList ?? [ ] ,
8361 } ,
8462 idpPrefix ,
0 commit comments