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<
183
183
return {
184
184
actions : notConnectedConnectionItemActions ( {
185
185
connectionInfo : item . connectionInfo ,
186
+ connectionStatus : item . connectionStatus ,
186
187
} ) ,
187
188
config : {
188
189
collapseAfter : 1 ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { ItemAction } from '@mongodb-js/compass-components';
2
2
import { type ConnectionInfo } from '@mongodb-js/connection-info' ;
3
3
import { type Actions } from './constants' ;
4
4
import { type ItemSeparator } from '@mongodb-js/compass-components' ;
5
+ import { type NotConnectedConnectionStatus } from './tree-data' ;
5
6
6
7
export type NavigationItemActions = ( ItemAction < Actions > | ItemSeparator ) [ ] ;
7
8
@@ -137,19 +138,25 @@ export const connectedConnectionItemActions = ({
137
138
138
139
export const notConnectedConnectionItemActions = ( {
139
140
connectionInfo,
141
+ connectionStatus,
140
142
} : {
141
143
connectionInfo : ConnectionInfo ;
144
+ connectionStatus : NotConnectedConnectionStatus ;
142
145
} ) : NavigationItemActions => {
143
146
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
+ }
153
160
} ;
154
161
155
162
export const databaseItemActions = ( {
You can’t perform that action at this time.
0 commit comments