1
- const app = require ( 'hadron-app' ) ;
2
1
const SchemaComponent = require ( './lib/component' ) ;
3
2
const SchemaStatusSubview = require ( './lib/component/status-subview' ) ;
4
3
const SchemaAction = require ( './lib/action' ) ;
@@ -17,23 +16,30 @@ const COLLECTION_TAB_ROLE = {
17
16
/**
18
17
* Activate all the components in the Schema package.
19
18
*
20
- * @param {Object } appRegistry the app registry
19
+ * @param {Object } appRegistry - the app registry
21
20
*/
22
21
function activate ( appRegistry ) {
23
- appRegistry . registerRole ( 'Collection.Tab' , COLLECTION_TAB_ROLE ) ;
24
- appRegistry . registerAction ( 'Schema.Actions' , SchemaAction ) ;
25
- appRegistry . registerStore ( 'Schema.Store' , SchemaStore ) ;
26
- appRegistry . registerComponent ( 'Schema.StatusSubview' , SchemaStatusSubview ) ;
22
+ // @todo : Temporary hack to remove the internal plugin from the community edition.
23
+ if ( process . env . HADRON_PRODUCT !== 'mongodb-compass-community' ) {
24
+ appRegistry . registerRole ( 'Collection.Tab' , COLLECTION_TAB_ROLE ) ;
25
+ appRegistry . registerAction ( 'Schema.Actions' , SchemaAction ) ;
26
+ appRegistry . registerStore ( 'Schema.Store' , SchemaStore ) ;
27
+ appRegistry . registerComponent ( 'Schema.StatusSubview' , SchemaStatusSubview ) ;
28
+ }
27
29
}
28
30
29
31
/**
30
32
* Deactivate all the components in the Schema package.
33
+ *
34
+ * @param {Object } appRegistry - the app registry
31
35
*/
32
- function deactivate ( ) {
33
- app . appRegistry . deregisterRole ( 'Collection.Tab' , COLLECTION_TAB_ROLE ) ;
34
- app . appRegistry . deregisterAction ( 'Schema.Actions' ) ;
35
- app . appRegistry . deregisterStore ( 'Schema.Store' ) ;
36
- app . appRegistry . deregisterComponent ( 'Schema.StatusSubview' ) ;
36
+ function deactivate ( appRegistry ) {
37
+ if ( process . env . HADRON_PRODUCT !== 'mongodb-compass-community' ) {
38
+ appRegistry . deregisterRole ( 'Collection.Tab' , COLLECTION_TAB_ROLE ) ;
39
+ appRegistry . deregisterAction ( 'Schema.Actions' ) ;
40
+ appRegistry . deregisterStore ( 'Schema.Store' ) ;
41
+ appRegistry . deregisterComponent ( 'Schema.StatusSubview' ) ;
42
+ }
37
43
}
38
44
39
45
module . exports . activate = activate ;
0 commit comments