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 {
1818 useConnectionInfoRef ,
1919 useConnectionSupports ,
2020} from '@mongodb-js/compass-connections/provider' ;
21+ import { usePreference } from 'compass-preferences-model/provider' ;
2122
2223type CollectionSubtabTrackingId = Lowercase < CollectionSubtab > extends infer U
2324 ? U extends string
@@ -119,13 +120,17 @@ function WithErrorBoundary({
119120function useCollectionTabs ( props : CollectionMetadata ) {
120121 const pluginTabs = useCollectionSubTabs ( ) ;
121122 const connectionInfoRef = useConnectionInfoRef ( ) ;
123+ const isGlobalWritesEnabled = usePreference ( 'enableGlobalWrites' ) ;
122124 const isGlobalWritesSupported =
123125 useConnectionSupports ( connectionInfoRef . current . id , 'globalWrites' ) &&
124126 ! props . isReadonly &&
125127 ! toNS ( props . namespace ) . specialish ;
126128 return pluginTabs
127129 . filter ( ( x ) => {
128- if ( x . name === 'GlobalWrites' && ! isGlobalWritesSupported ) {
130+ if (
131+ x . name === 'GlobalWrites' &&
132+ ( ! isGlobalWritesEnabled || ! isGlobalWritesSupported )
133+ ) {
129134 return false ;
130135 }
131136 return true ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export type FeatureFlags = {
2121 enableQueryHistoryAutocomplete : boolean ;
2222 enableProxySupport : boolean ;
2323 enableRollingIndexes : boolean ;
24+ enableGlobalWrites : boolean ;
2425} ;
2526
2627export const featureFlags : Required < {
@@ -92,4 +93,11 @@ export const featureFlags: Required<{
9293 short : 'Enable creating indexes with the rolling build in Atlas Cloud' ,
9394 } ,
9495 } ,
96+
97+ enableGlobalWrites : {
98+ stage : 'development' ,
99+ description : {
100+ short : 'Enable Global Writes tab in Atlas Cloud' ,
101+ } ,
102+ } ,
95103} ;
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ export type InternalUserPreferences = {
8888 telemetryAnonymousId ?: string ;
8989 telemetryAtlasUserId ?: string ;
9090 userCreatedAt : number ;
91- enableGlobalWrites : boolean ;
9291} ;
9392
9493// UserPreferences contains all preferences stored to disk.
@@ -877,15 +876,6 @@ export const storedUserPreferencesProps: Required<{
877876 validator : z . boolean ( ) . default ( true ) ,
878877 type : 'boolean' ,
879878 } ,
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- } ,
889879 enableGenAIFeaturesAtlasProject : {
890880 ui : false ,
891881 cli : true ,
You can’t perform that action at this time.
0 commit comments