File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -318,12 +318,20 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
318318 const onItemAction = useCallback (
319319 ( item : SidebarItem , action : Actions ) => {
320320 const getConnectionInfo = ( item : SidebarItem ) => {
321- if ( item . type === 'connection' ) {
322- return item . connectionInfo ;
321+ switch ( item . type ) {
322+ case 'connection' :
323+ return item . connectionInfo ;
324+ case 'database' :
325+ return item . connectionItem . connectionInfo ;
326+ case 'view' :
327+ case 'collection' :
328+ case 'timeseries' :
329+ return item . databaseItem . connectionItem . connectionInfo ;
330+ default :
331+ throw new Error (
332+ `Item type does not have connection info for action ${ action } `
333+ ) ;
323334 }
324- throw new Error (
325- `Item type ${ item . type } does not have connection info for action ${ action } `
326- ) ;
327335 } ;
328336
329337 const getNamespace = ( item : SidebarItem ) => {
@@ -369,11 +377,7 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
369377 track (
370378 'Open Shell' ,
371379 { entrypoint : 'sidebar' } ,
372- item . type === 'connection'
373- ? getConnectionInfo ( item )
374- : {
375- id : connectionId ,
376- }
380+ getConnectionInfo ( item )
377381 ) ;
378382 return ;
379383 }
You can’t perform that action at this time.
0 commit comments