@@ -36,28 +36,33 @@ export default function SidecarForm({
36
36
className ?: string
37
37
} ) {
38
38
return (
39
- < Form className = { nested ? className : `padding-content scrollable ${ className || '' } ` } >
40
- { Object . keys ( map ) . map ( ( key , idx ) => {
41
- const vvalue = map [ key ]
42
- const value =
43
- ( typeof vvalue === 'number' ? vvalue . toLocaleString ( ) : typeof vvalue !== 'object' ? vvalue : vvalue . label ) ||
44
- ''
39
+ < div className = "kui--form-section" >
40
+ < Form className = { nested ? className : `padding-content scrollable ${ className || '' } ` } >
41
+ { Object . keys ( map ) . map ( ( key , idx ) => {
42
+ const vvalue = map [ key ]
43
+ const value =
44
+ ( typeof vvalue === 'number'
45
+ ? vvalue . toLocaleString ( )
46
+ : typeof vvalue !== 'object'
47
+ ? vvalue
48
+ : vvalue . label ) || ''
45
49
46
- const colspan = Math . max ( Math . ceil ( key . length / 8 ) , Math . ceil ( ( value . length + 2 ) / 5.5 ) )
47
- const style = { gridColumn : `span ${ colspan > 15 ? 8 : colspan } ` }
48
- const className = typeof vvalue !== 'object' ? undefined : 'kui--form-item--for-label'
50
+ const colspan = Math . max ( Math . ceil ( key . length / 8 ) , Math . ceil ( ( value . length + 2 ) / 5.5 ) )
51
+ const style = { gridColumn : `span ${ colspan > 15 ? 8 : colspan } ` }
52
+ const className = typeof vvalue !== 'object' ? undefined : 'kui--form-item--for-label'
49
53
50
- return (
51
- < div key = { idx } style = { style } className = { className } >
52
- { colspan > 15 ? (
53
- < TextArea readOnly id = { `kubectl-summary-${ key } ` } labelText = { key } defaultValue = { value } />
54
- ) : (
55
- < TextInput readOnly id = { `kubectl-summary-${ key } ` } labelText = { key } defaultValue = { value } />
56
- ) }
57
- </ div >
58
- )
59
- } ) }
60
- </ Form >
54
+ return (
55
+ < div key = { idx } style = { style } className = { className } >
56
+ { colspan > 15 ? (
57
+ < TextArea readOnly id = { `kubectl-summary-${ key } ` } labelText = { key } defaultValue = { value } />
58
+ ) : (
59
+ < TextInput readOnly id = { `kubectl-summary-${ key } ` } labelText = { key } defaultValue = { value } />
60
+ ) }
61
+ </ div >
62
+ )
63
+ } ) }
64
+ </ Form >
65
+ </ div >
61
66
)
62
67
}
63
68
@@ -74,11 +79,7 @@ export function FormWithLabels(props: { map: FormMap; resource: KubeResource })
74
79
return (
75
80
< div className = "padding-content scrollable" >
76
81
< SidecarForm nested map = { props . map } />
77
- { nLabels > 0 && (
78
- < div style = { { paddingTop : '1em' } } >
79
- < SidecarForm nested map = { labelMap } className = "top-pad" />
80
- </ div >
81
- ) }
82
+ { nLabels > 0 && < SidecarForm nested map = { labelMap } /> }
82
83
</ div >
83
84
)
84
85
}
0 commit comments