From b6bc0f475c4fbc9016fe03cea2717ff686a7f87f Mon Sep 17 00:00:00 2001 From: Daniel Echlin Date: Mon, 11 Nov 2024 16:10:39 -0500 Subject: [PATCH 1/2] changes --- .../compass-collection/src/components/collection-tab.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/compass-collection/src/components/collection-tab.tsx b/packages/compass-collection/src/components/collection-tab.tsx index f4da240c81b..b97e1ae27b0 100644 --- a/packages/compass-collection/src/components/collection-tab.tsx +++ b/packages/compass-collection/src/components/collection-tab.tsx @@ -118,10 +118,10 @@ function WithErrorBoundary({ function useCollectionTabs(props: CollectionMetadata) { const pluginTabs = useCollectionSubTabs(); const connectionInfoRef = useConnectionInfoRef(); - const isGlobalWritesSupported = useConnectionSupports( - connectionInfoRef.current.id, - 'globalWrites' - ); + const isGlobalWritesSupported = + useConnectionSupports(connectionInfoRef.current.id, 'globalWrites') && + !props.isReadonly && + !['config', 'local', 'admin'].includes(props.namespace.split('.')[0]); return pluginTabs .filter((x) => { if (x.name === 'GlobalWrites' && !isGlobalWritesSupported) { From 0fe3fa0b3e50e6014cfa6790651189c87762faa0 Mon Sep 17 00:00:00 2001 From: Daniel Echlin Date: Tue, 12 Nov 2024 13:16:02 -0500 Subject: [PATCH 2/2] specialish --- packages/compass-collection/src/components/collection-tab.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/compass-collection/src/components/collection-tab.tsx b/packages/compass-collection/src/components/collection-tab.tsx index b97e1ae27b0..305a115204d 100644 --- a/packages/compass-collection/src/components/collection-tab.tsx +++ b/packages/compass-collection/src/components/collection-tab.tsx @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { type CollectionState, selectTab } from '../modules/collection-tab'; import { css, ErrorBoundary, TabNavBar } from '@mongodb-js/compass-components'; import CollectionHeader from './collection-header'; +import toNS from 'mongodb-ns'; import { useLogger } from '@mongodb-js/compass-logging/provider'; import { useCollectionQueryBar, @@ -121,7 +122,7 @@ function useCollectionTabs(props: CollectionMetadata) { const isGlobalWritesSupported = useConnectionSupports(connectionInfoRef.current.id, 'globalWrites') && !props.isReadonly && - !['config', 'local', 'admin'].includes(props.namespace.split('.')[0]); + !toNS(props.namespace).specialish; return pluginTabs .filter((x) => { if (x.name === 'GlobalWrites' && !isGlobalWritesSupported) {