@@ -105,15 +105,17 @@ const NavDrawer = ({
105
105
[ pipelineRunningStatus , activePipelinePath ] ,
106
106
) ;
107
107
108
- const SubItemTitle = ( { id } ) => {
108
+ const SubItemTitle = ( { id, isMenuOpen } ) => {
109
109
return (
110
110
< >
111
111
{ selectedPipelineName && MENU_ITEMS_INFO . BUILD_MODEL . id === id ? (
112
112
< ListItem >
113
- < ListItemText
114
- primary = { filterTruncate ( selectedPipelineName , 17 ) }
115
- className = { classes . navTitle }
116
- />
113
+ { isMenuOpen ? (
114
+ < ListItemText
115
+ primary = { filterTruncate ( selectedPipelineName , 17 ) }
116
+ className = { classes . navTitle }
117
+ />
118
+ ) : null }
117
119
< Tooltip title = { "Close Pipeline" } >
118
120
< IconButton onClick = { ( _e ) => handleChangePipeline ( ) } variant = "contained" size = "small" >
119
121
< CloseIcon fontSize = "small" />
@@ -167,26 +169,25 @@ const NavDrawer = ({
167
169
} ) }
168
170
disabled = { selectedProject === null }
169
171
>
170
- < Tooltip
171
- title = { menuItem . tooltip || menuItem . title }
172
- placement = "right"
173
- aria-label = "menuItem.title"
174
- >
175
- < ListItem key = { menuItem . id } id = { menuItem . id } >
172
+ < ListItem key = { menuItem . id } id = { menuItem . id } >
173
+ < Tooltip title = { menuItem . tooltip || menuItem . title } aria-label = { menuItem . title } >
176
174
< ListItemIcon className = { classes . iconButton } >
177
175
{ menuItem . iconfn ( getMenuProps ( menuItem . orderIndex ) ) }
178
176
</ ListItemIcon >
179
- < ListItemText primary = { menuItem . title } / >
180
- </ ListItem >
181
- </ Tooltip >
177
+ </ Tooltip >
178
+ < ListItemText sx = { { pl : isOpen ? 0 : 2 } } primary = { menuItem . title } / >
179
+ </ ListItem >
182
180
</ NavLink >
183
181
184
182
{ menuItem ?. subItems ? (
185
183
< >
186
184
< Collapse in = { isSubmenuItemsOpened ( menuItem . id ) } timeout = { 0 } >
187
185
< Divider variant = "middle" />
188
- < SubItemTitle id = { menuItem . id } />
189
- < List key = { `subitem_list_${ menuItem . id } ` } sx = { { pl : 2 , pt : 0 , pb : 0 } } >
186
+ < SubItemTitle id = { menuItem . id } isMenuOpen = { isOpen } />
187
+ < List
188
+ key = { `subitem_list_${ menuItem . id } ` }
189
+ sx = { { pl : isOpen ? 2 : 0 , pt : 0 , pb : 0 } }
190
+ >
190
191
{ menuItem . subItems . map ( ( subItem ) => (
191
192
< Box key = { `subitem_nav_link_${ subItem . id } ` } >
192
193
{ showIfRunning ( menuItem . id , subItem . getPath ( ) ) ? (
@@ -200,22 +201,24 @@ const NavDrawer = ({
200
201
...( selectedPipeline && { pipelineUUID : selectedPipeline } ) ,
201
202
} ) }
202
203
>
203
- < Tooltip
204
- title = { subItem . tooltip || subItem . title }
205
- placement = "right"
206
- aria-label = { subItem . title }
207
- >
208
- < ListItem sx = { { pt : 0.5 , pb : 0.5 } } id = { subItem . id } >
204
+ < ListItem sx = { { pt : 0.5 , pb : 0.5 } } id = { subItem . id } >
205
+ < Tooltip
206
+ title = { subItem . tooltip || subItem . title }
207
+ aria-label = { subItem . title }
208
+ >
209
209
< ListItemIcon className = { classes . iconButton } >
210
210
{ getIsPathHasStatus ( subItem . getPath ( ) ) ? (
211
211
< StatusRunningIcon status = { pipelineRunningStatus } />
212
212
) : (
213
213
subItem . iconfn ( getMenuProps ( subItem . orderIndex ) )
214
214
) }
215
215
</ ListItemIcon >
216
- < ListItemText primary = { subItem . title } />
217
- </ ListItem >
218
- </ Tooltip >
216
+ </ Tooltip >
217
+ < ListItemText
218
+ sx = { { pl : isOpen ? 0 : 2 } }
219
+ primary = { subItem . title }
220
+ />
221
+ </ ListItem >
219
222
</ NavLink >
220
223
) : null }
221
224
</ Box >
@@ -245,12 +248,7 @@ const NavDrawer = ({
245
248
{ menuItem . iconfn ( { color : "inherit" , fontSize : "small" } ) }
246
249
</ Tooltip >
247
250
</ ListItemIcon >
248
- < ListItemText
249
- primary = { menuItem . title }
250
- classes = { {
251
- primary : classes . disabledMenuText ,
252
- } }
253
- />
251
+ < ListItemText sx = { { pl : isOpen ? 0 : 2 } } primary = { menuItem . title } />
254
252
</ ListItem >
255
253
</ NavLink >
256
254
) ) }
0 commit comments