File tree Expand file tree Collapse file tree 6 files changed +27
-0
lines changed
compass-connections-navigation/src
compass-connections/src/stores Expand file tree Collapse file tree 6 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export type Actions =
1515 | 'duplicate-connection'
1616 | 'remove-connection'
1717 | 'connection-connect'
18+ | 'connection-connect-in-new-window'
1819 | 'connection-disconnect'
1920 | 'connection-performance-metrics'
2021 | 'open-connection-info'
Original file line number Diff line number Diff line change @@ -1507,6 +1507,13 @@ function isAtlasStreamsInstance(
15071507 }
15081508}
15091509
1510+ export const connectInNewWindow =
1511+ ( connectionInfo : ConnectionInfo ) : ConnectionsThunkAction < void > =>
1512+ ( _dispatch , _getState , { globalAppRegistry } ) => {
1513+ // TODO: Consider building a connection string?
1514+ globalAppRegistry . emit ( 'connect-in-new-window' , connectionInfo . id ) ;
1515+ } ;
1516+
15101517export const connect = (
15111518 connectionInfo : ConnectionInfo
15121519) : ConnectionsThunkAction <
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import type {
1818import {
1919 cancelEditConnection ,
2020 connect as connectionsConnect ,
21+ connectInNewWindow ,
2122 saveAndConnect ,
2223 connectionsEventEmitter ,
2324 createNewConnection ,
@@ -88,6 +89,9 @@ function getConnectionsActions(dispatch: ConnectionsStore['dispatch']) {
8889 connect : ( connectionInfo : ConnectionInfo ) => {
8990 return dispatch ( connectionsConnect ( connectionInfo ) ) ;
9091 } ,
92+ connectInNewWindow : ( connectionInfo : ConnectionInfo ) => {
93+ return dispatch ( connectInNewWindow ( connectionInfo ) ) ;
94+ } ,
9195 saveAndConnect : ( connectionInfo : ConnectionInfo ) => {
9296 return dispatch ( saveAndConnect ( connectionInfo ) ) ;
9397 } ,
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ type ConnectionsNavigationComponentProps = {
114114 updater : ( filter : ConnectionsFilter ) => ConnectionsFilter
115115 ) : void ;
116116 onConnect ( info : ConnectionInfo ) : void ;
117+ onConnectInNewWindow ( info : ConnectionInfo ) : void ;
117118 onNewConnection ( ) : void ;
118119 onEditConnection ( info : ConnectionInfo ) : void ;
119120 onRemoveConnection ( info : ConnectionInfo ) : void ;
@@ -159,6 +160,7 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
159160 isPerformanceTabSupported,
160161 onFilterChange,
161162 onConnect,
163+ onConnectInNewWindow,
162164 onNewConnection,
163165 onEditConnection,
164166 onRemoveConnection,
@@ -328,6 +330,9 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
328330 case 'connection-connect' :
329331 onConnect ( item . connectionInfo ) ;
330332 return ;
333+ case 'connection-connect-in-new-window' :
334+ onConnectInNewWindow ( item . connectionInfo ) ;
335+ return ;
331336 case 'edit-connection' :
332337 onEditConnection ( item . connectionInfo ) ;
333338 return ;
@@ -364,6 +369,7 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
364369 onOpenConnectionInfo ,
365370 onDisconnect ,
366371 onConnect ,
372+ onConnectInNewWindow ,
367373 onEditConnection ,
368374 onCopyConnectionString ,
369375 onToggleFavoriteConnectionInfo ,
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ export function MultipleConnectionSidebar({
108108 const connectionsWithStatus = useConnectionsWithStatus ( ) ;
109109 const {
110110 connect,
111+ connectInNewWindow,
111112 disconnect,
112113 createNewConnection,
113114 editConnection,
@@ -182,6 +183,9 @@ export function MultipleConnectionSidebar({
182183 onConnect = { ( connectionInfo ) => {
183184 void connect ( connectionInfo ) ;
184185 } }
186+ onConnectInNewWindow = { ( connectionInfo ) => {
187+ connectInNewWindow ( connectionInfo ) ;
188+ } }
185189 onNewConnection = { createNewConnection }
186190 onEditConnection = { ( connectionInfo ) => {
187191 editConnection ( connectionInfo . id ) ;
Original file line number Diff line number Diff line change @@ -368,6 +368,11 @@ const app = {
368368 } ) ;
369369 }
370370 ) ;
371+ // Propagate events from global app registry to the main process
372+ globalAppRegistry . on ( 'connect-in-new-window' , ( connectionId : string ) => {
373+ void ipcRenderer ?. call ( 'app:connect-in-new-window' , connectionId ) ;
374+ } ) ;
375+
371376 // As soon as dom is ready, render and set up the rest.
372377 state . render ( ) ;
373378 marky . stop ( 'Time to Connect rendered' ) ;
You can’t perform that action at this time.
0 commit comments