@@ -22,7 +22,6 @@ import RediStackLightMin from 'uiSrc/assets/img/modules/redistack/RediStackLight
22
22
import RediStackDarkLogo from 'uiSrc/assets/img/modules/redistack/RedisStackLogoDark.svg'
23
23
import RediStackLightLogo from 'uiSrc/assets/img/modules/redistack/RedisStackLogoLight.svg'
24
24
import CloudLinkIcon from 'uiSrc/assets/img/oauth/cloud_link.svg?react'
25
- import { ShowChildByCondition } from 'uiSrc/components'
26
25
import DatabaseListModules from 'uiSrc/components/database-list-modules/DatabaseListModules'
27
26
import ItemList from 'uiSrc/components/item-list'
28
27
import { BrowserStorageItem , Pages , Theme } from 'uiSrc/constants'
@@ -68,7 +67,6 @@ const DatabasesListWrapper = ({ width, onEditInstance, editedInstance, onDeleteI
68
67
const [ , forceRerender ] = useState ( { } )
69
68
70
69
const deletingIdRef = useRef ( '' )
71
- const isLoadingRef = useRef ( false )
72
70
73
71
const closePopover = ( ) => {
74
72
if ( deletingIdRef . current ) {
@@ -84,19 +82,14 @@ const DatabasesListWrapper = ({ width, onEditInstance, editedInstance, onDeleteI
84
82
85
83
useEffect ( ( ) => {
86
84
const editInstanceId = new URLSearchParams ( search ) . get ( 'editInstance' )
87
- if ( editInstanceId && ! instances . loading ) {
85
+ if ( editInstanceId && instances ?. data ?. length ) {
88
86
const instance = instances . data . find ( ( item : Instance ) => item . id === editInstanceId )
89
87
if ( instance ) {
90
88
handleClickEditInstance ( instance )
91
- }
92
- setTimeout ( ( ) => {
93
89
history . replace ( Pages . home )
94
- } , 1000 )
90
+ }
95
91
}
96
-
97
- isLoadingRef . current = instances . loading
98
- forceRerender ( { } )
99
- } , [ instances . loading , search ] )
92
+ } , [ instances , search ] )
100
93
101
94
useEffect ( ( ) => {
102
95
closePopover ( )
@@ -235,32 +228,28 @@ const DatabasesListWrapper = ({ width, onEditInstance, editedInstance, onDeleteI
235
228
return (
236
229
< div role = "presentation" >
237
230
{ newStatus && (
238
- < ShowChildByCondition isShow = { ! isLoadingRef . current } innerClassName = { styles . newStatusAnchor } >
239
- < EuiToolTip content = "New" position = "top" anchorClassName = { styles . newStatusAnchor } >
240
- < div className = { styles . newStatus } data-testid = { `database-status-new-${ id } ` } />
241
- </ EuiToolTip >
242
- </ ShowChildByCondition >
231
+ < EuiToolTip content = "New" position = "top" anchorClassName = { styles . newStatusAnchor } >
232
+ < div className = { styles . newStatus } data-testid = { `database-status-new-${ id } ` } />
233
+ </ EuiToolTip >
243
234
) }
244
- < ShowChildByCondition isShow = { ! isLoadingRef . current } >
245
- < EuiToolTip
246
- position = "bottom"
247
- title = "Database Alias"
248
- className = { styles . tooltipColumnName }
249
- content = { `${ formatLongName ( name ) } ${ getDbIndex ( db ) } ` }
235
+ < EuiToolTip
236
+ position = "bottom"
237
+ title = "Database Alias"
238
+ className = { styles . tooltipColumnName }
239
+ content = { `${ formatLongName ( name ) } ${ getDbIndex ( db ) } ` }
240
+ >
241
+ < EuiText
242
+ className = { styles . tooltipAnchorColumnName }
243
+ data-testid = { `instance-name-${ id } ` }
244
+ onClick = { ( e : React . MouseEvent ) => handleCheckConnectToInstance ( e , instance ) }
245
+ onKeyDown = { ( e : React . KeyboardEvent ) => handleCheckConnectToInstance ( e , instance ) }
250
246
>
251
- < EuiText
252
- className = { styles . tooltipAnchorColumnName }
253
- data-testid = { `instance-name-${ id } ` }
254
- onClick = { ( e : React . MouseEvent ) => handleCheckConnectToInstance ( e , instance ) }
255
- onKeyDown = { ( e : React . KeyboardEvent ) => handleCheckConnectToInstance ( e , instance ) }
256
- >
257
- < EuiTextColor className = { cx ( styles . tooltipColumnNameText , { [ styles . withDb ] : db } ) } >
258
- { cellContent }
259
- </ EuiTextColor >
260
- < EuiTextColor > { ` ${ getDbIndex ( db ) } ` } </ EuiTextColor >
261
- </ EuiText >
262
- </ EuiToolTip >
263
- </ ShowChildByCondition >
247
+ < EuiTextColor className = { cx ( styles . tooltipColumnNameText , { [ styles . withDb ] : db } ) } >
248
+ { cellContent }
249
+ </ EuiTextColor >
250
+ < EuiTextColor > { ` ${ getDbIndex ( db ) } ` } </ EuiTextColor >
251
+ </ EuiText >
252
+ </ EuiToolTip >
264
253
</ div >
265
254
)
266
255
} ,
0 commit comments