@@ -19,7 +19,6 @@ import {
1919 DropdownMenuButton ,
2020 SegmentedControl ,
2121 SegmentedControlOption ,
22- usePersistedState ,
2322} from '@mongodb-js/compass-components' ;
2423import { useConnectionInfo } from '@mongodb-js/compass-connections/provider' ;
2524
@@ -54,6 +53,7 @@ type IndexesToolbarProps = {
5453 indexView : IndexView ;
5554 errorMessage : string | null ;
5655 hasTooManyIndexes : boolean ;
56+ showAtlasSearchLink : boolean ;
5757 isRefreshing : boolean ;
5858 onRefreshIndexes : ( ) => void ;
5959 onIndexViewChanged : ( newView : IndexView ) => void ;
@@ -68,9 +68,6 @@ type IndexesToolbarProps = {
6868 readOnly ?: boolean ;
6969} ;
7070
71- const DISMISSED_SEARCH_INDEXES_BANNER_LOCAL_STORAGE_KEY =
72- 'mongodb_compass_dismissedSearchIndexesBanner' as const ;
73-
7471export const IndexesToolbar : React . FunctionComponent < IndexesToolbarProps > = ( {
7572 namespace,
7673 indexView,
@@ -82,16 +79,13 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
8279 isRefreshing,
8380 writeStateDescription,
8481 hasTooManyIndexes,
82+ showAtlasSearchLink,
8583 isSearchIndexesSupported,
8684 onRefreshIndexes,
8785 onIndexViewChanged,
8886 readOnly, // preferences readOnly.
8987} ) => {
9088 const isSearchManagementActive = usePreference ( 'enableAtlasSearchIndexes' ) ;
91- const [ dismissed , setDismissed ] = usePersistedState (
92- DISMISSED_SEARCH_INDEXES_BANNER_LOCAL_STORAGE_KEY ,
93- false
94- ) ;
9589 const { atlasMetadata } = useConnectionInfo ( ) ;
9690 const showInsights = usePreference ( 'showInsights' ) && ! errorMessage ;
9791 const showCreateIndexButton = ! isReadonlyView && ! readOnly && ! errorMessage ;
@@ -138,21 +132,18 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
138132 >
139133 Refresh
140134 </ Button >
141- { ! isReadonlyView &&
142- ! isSearchManagementActive &&
143- dismissed &&
144- atlasMetadata && (
145- < Link
146- href = { getAtlasSearchIndexesLink ( {
147- clusterName : atlasMetadata . clusterName ,
148- namespace,
149- } ) }
150- hideExternalIcon
151- arrowAppearance = "persist"
152- >
153- Manage your search indexes
154- </ Link >
155- ) }
135+ { showAtlasSearchLink && atlasMetadata && (
136+ < Link
137+ href = { getAtlasSearchIndexesLink ( {
138+ clusterName : atlasMetadata . clusterName ,
139+ namespace,
140+ } ) }
141+ hideExternalIcon
142+ arrowAppearance = "persist"
143+ >
144+ Manage your search indexes
145+ </ Link >
146+ ) }
156147 { showInsights && hasTooManyIndexes && (
157148 < SignalPopover
158149 signals = { PerformanceSignals . get ( 'too-many-indexes' ) }
0 commit comments