File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed
packages/compass-connections-navigation/src Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ const ConnectionsNavigationTree: React.FunctionComponent<
183183 return {
184184 actions : notConnectedConnectionItemActions ( {
185185 connectionInfo : item . connectionInfo ,
186+ connectionStatus : item . connectionStatus ,
186187 } ) ,
187188 config : {
188189 collapseAfter : 1 ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { ItemAction } from '@mongodb-js/compass-components';
22import { type ConnectionInfo } from '@mongodb-js/connection-info' ;
33import { type Actions } from './constants' ;
44import { type ItemSeparator } from '@mongodb-js/compass-components' ;
5+ import { type NotConnectedConnectionStatus } from './tree-data' ;
56
67export type NavigationItemActions = ( ItemAction < Actions > | ItemSeparator ) [ ] ;
78
@@ -137,19 +138,25 @@ export const connectedConnectionItemActions = ({
137138
138139export const notConnectedConnectionItemActions = ( {
139140 connectionInfo,
141+ connectionStatus,
140142} : {
141143 connectionInfo : ConnectionInfo ;
144+ connectionStatus : NotConnectedConnectionStatus ;
142145} ) : NavigationItemActions => {
143146 const commonActions = commonConnectionItemActions ( { connectionInfo } ) ;
144- return [
145- {
146- action : 'connection-connect' ,
147- label : 'Connect' ,
148- icon : 'Connect' ,
149- expandedPresentation : 'button' ,
150- } ,
151- ...commonActions ,
152- ] ;
147+ if ( connectionStatus === 'connecting' ) {
148+ return commonActions ;
149+ } else {
150+ return [
151+ {
152+ action : 'connection-connect' ,
153+ label : 'Connect' ,
154+ icon : 'Connect' ,
155+ expandedPresentation : 'button' ,
156+ } ,
157+ ...commonActions ,
158+ ] ;
159+ }
153160} ;
154161
155162export const databaseItemActions = ( {
You can’t perform that action at this time.
0 commit comments