File tree Expand file tree Collapse file tree 4 files changed +104
-84
lines changed
internal-plugins/metrics/lib Expand file tree Collapse file tree 4 files changed +104
-84
lines changed Original file line number Diff line number Diff line change 215
215
"@mongodb-js/compass-deployment-awareness" : " ^5.1.1" ,
216
216
"@mongodb-js/compass-document-validation" : " ^7.2.1" ,
217
217
"@mongodb-js/compass-instance" : " ^0.0.2" ,
218
- "@mongodb-js/compass-import-export" : " ^0.0.10 " ,
218
+ "@mongodb-js/compass-import-export" : " ^0.0.12 " ,
219
219
"@mongodb-js/compass-license" : " ^0.1.1" ,
220
220
"@mongodb-js/compass-query-history" : " ^2.2.2" ,
221
221
"@mongodb-js/compass-security" : " ^0.1.0" ,
Original file line number Diff line number Diff line change @@ -159,13 +159,27 @@ module.exports = [
159
159
condition : ( ) => true ,
160
160
metadata : ( ) => ( { } )
161
161
} ,
162
+ {
163
+ registryEvent : 'export-finished' ,
164
+ resource : 'Export' ,
165
+ action : 'completed' ,
166
+ condition : ( ) => true ,
167
+ metadata : ( ) => ( { } )
168
+ } ,
162
169
{
163
170
registryEvent : 'open-import' ,
164
171
resource : 'Import' ,
165
172
action : 'opened' ,
166
173
condition : ( ) => true ,
167
174
metadata : ( ) => ( { } )
168
175
} ,
176
+ {
177
+ registryEvent : 'import-finished' ,
178
+ resource : 'Import' ,
179
+ action : 'completed' ,
180
+ condition : ( ) => true ,
181
+ metadata : ( ) => ( { } )
182
+ } ,
169
183
{
170
184
registryEvent : 'document-deleted' ,
171
185
resource : 'Document' ,
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ var debug = require('debug')('mongodb-compass:menu');
13
13
14
14
const COMPASS_HELP = 'https://docs.mongodb.com/compass/' ;
15
15
16
+ function isReadonlyDistro ( ) {
17
+ return process . env . HADRON_READONLY === 'true' ;
18
+ }
19
+
16
20
// submenu related
17
21
function separator ( ) {
18
22
return {
@@ -204,30 +208,32 @@ function helpSubMenu() {
204
208
}
205
209
206
210
function collectionSubMenu ( ) {
211
+ var subMenu = [ ] ;
212
+ subMenu . push ( {
213
+ label : '&Share Schema as JSON' ,
214
+ accelerator : 'Alt+CmdOrCtrl+S' ,
215
+ click : function ( ) {
216
+ ipc . broadcast ( 'window:menu-share-schema-json' ) ;
217
+ }
218
+ } ) ;
219
+ subMenu . push ( separator ( ) ) ;
220
+ if ( ! isReadonlyDistro ( ) ) {
221
+ subMenu . push ( {
222
+ label : '&Import Data' ,
223
+ click : function ( ) {
224
+ ipc . broadcast ( 'compass:open-import' ) ;
225
+ }
226
+ } ) ;
227
+ }
228
+ subMenu . push ( {
229
+ label : '&Export Collection' ,
230
+ click : function ( ) {
231
+ ipc . broadcast ( 'compass:open-export' ) ;
232
+ }
233
+ } ) ;
207
234
return {
208
235
label : '&Collection' ,
209
- submenu : [
210
- {
211
- label : '&Share Schema as JSON' ,
212
- accelerator : 'Alt+CmdOrCtrl+S' ,
213
- click : function ( ) {
214
- ipc . broadcast ( 'window:menu-share-schema-json' ) ;
215
- }
216
- } ,
217
- separator ( ) ,
218
- {
219
- label : '&Import Data' ,
220
- click : function ( ) {
221
- ipc . broadcast ( 'compass:open-import' ) ;
222
- }
223
- } ,
224
- {
225
- label : '&Export Collection' ,
226
- click : function ( ) {
227
- ipc . broadcast ( 'compass:open-export' ) ;
228
- }
229
- }
230
- ]
236
+ submenu : subMenu
231
237
} ;
232
238
}
233
239
You can’t perform that action at this time.
0 commit comments