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 215215 "@mongodb-js/compass-deployment-awareness" : " ^5.1.1" ,
216216 "@mongodb-js/compass-document-validation" : " ^7.2.1" ,
217217 "@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 " ,
219219 "@mongodb-js/compass-license" : " ^0.1.1" ,
220220 "@mongodb-js/compass-query-history" : " ^2.2.2" ,
221221 "@mongodb-js/compass-security" : " ^0.1.0" ,
Original file line number Diff line number Diff line change @@ -159,13 +159,27 @@ module.exports = [
159159 condition : ( ) => true ,
160160 metadata : ( ) => ( { } )
161161 } ,
162+ {
163+ registryEvent : 'export-finished' ,
164+ resource : 'Export' ,
165+ action : 'completed' ,
166+ condition : ( ) => true ,
167+ metadata : ( ) => ( { } )
168+ } ,
162169 {
163170 registryEvent : 'open-import' ,
164171 resource : 'Import' ,
165172 action : 'opened' ,
166173 condition : ( ) => true ,
167174 metadata : ( ) => ( { } )
168175 } ,
176+ {
177+ registryEvent : 'import-finished' ,
178+ resource : 'Import' ,
179+ action : 'completed' ,
180+ condition : ( ) => true ,
181+ metadata : ( ) => ( { } )
182+ } ,
169183 {
170184 registryEvent : 'document-deleted' ,
171185 resource : 'Document' ,
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ var debug = require('debug')('mongodb-compass:menu');
1313
1414const COMPASS_HELP = 'https://docs.mongodb.com/compass/' ;
1515
16+ function isReadonlyDistro ( ) {
17+ return process . env . HADRON_READONLY === 'true' ;
18+ }
19+
1620// submenu related
1721function separator ( ) {
1822 return {
@@ -204,30 +208,32 @@ function helpSubMenu() {
204208}
205209
206210function 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+ } ) ;
207234 return {
208235 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
231237 } ;
232238}
233239
You can’t perform that action at this time.
0 commit comments