File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
compass-collection/src/components
compass-preferences-model/src Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
18
18
useConnectionInfoRef ,
19
19
useConnectionSupports ,
20
20
} from '@mongodb-js/compass-connections/provider' ;
21
+ import { usePreference } from 'compass-preferences-model/provider' ;
21
22
22
23
type CollectionSubtabTrackingId = Lowercase < CollectionSubtab > extends infer U
23
24
? U extends string
@@ -119,13 +120,17 @@ function WithErrorBoundary({
119
120
function useCollectionTabs ( props : CollectionMetadata ) {
120
121
const pluginTabs = useCollectionSubTabs ( ) ;
121
122
const connectionInfoRef = useConnectionInfoRef ( ) ;
123
+ const isGlobalWritesEnabled = usePreference ( 'enableGlobalWrites' ) ;
122
124
const isGlobalWritesSupported =
123
125
useConnectionSupports ( connectionInfoRef . current . id , 'globalWrites' ) &&
124
126
! props . isReadonly &&
125
127
! toNS ( props . namespace ) . specialish ;
126
128
return pluginTabs
127
129
. filter ( ( x ) => {
128
- if ( x . name === 'GlobalWrites' && ! isGlobalWritesSupported ) {
130
+ if (
131
+ x . name === 'GlobalWrites' &&
132
+ ( ! isGlobalWritesEnabled || ! isGlobalWritesSupported )
133
+ ) {
129
134
return false ;
130
135
}
131
136
return true ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export type FeatureFlags = {
21
21
enableQueryHistoryAutocomplete : boolean ;
22
22
enableProxySupport : boolean ;
23
23
enableRollingIndexes : boolean ;
24
+ enableGlobalWrites : boolean ;
24
25
} ;
25
26
26
27
export const featureFlags : Required < {
@@ -92,4 +93,11 @@ export const featureFlags: Required<{
92
93
short : 'Enable creating indexes with the rolling build in Atlas Cloud' ,
93
94
} ,
94
95
} ,
96
+
97
+ enableGlobalWrites : {
98
+ stage : 'development' ,
99
+ description : {
100
+ short : 'Enable Global Writes tab in Atlas Cloud' ,
101
+ } ,
102
+ } ,
95
103
} ;
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ export type InternalUserPreferences = {
88
88
telemetryAnonymousId ?: string ;
89
89
telemetryAtlasUserId ?: string ;
90
90
userCreatedAt : number ;
91
- enableGlobalWrites : boolean ;
92
91
} ;
93
92
94
93
// UserPreferences contains all preferences stored to disk.
@@ -877,15 +876,6 @@ export const storedUserPreferencesProps: Required<{
877
876
validator : z . boolean ( ) . default ( true ) ,
878
877
type : 'boolean' ,
879
878
} ,
880
-
881
- enableGlobalWrites : {
882
- ui : false ,
883
- cli : false ,
884
- global : false ,
885
- description : null ,
886
- validator : z . boolean ( ) . default ( false ) ,
887
- type : 'boolean' ,
888
- } ,
889
879
enableGenAIFeaturesAtlasProject : {
890
880
ui : false ,
891
881
cli : true ,
You can’t perform that action at this time.
0 commit comments