Skip to content

Commit 789ddb7

Browse files
author
Jimmy Choi
committed
initial commit
1 parent 3a41616 commit 789ddb7

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

packages/compass-indexes/src/components/indexes-toolbar/indexes-toolbar.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('IndexesToolbar Component', function () {
4444
onCreateSearchIndexClick={() => {}}
4545
namespace=""
4646
showAtlasSearchLink={false}
47+
serverVersion={'8.0.11'}
4748
{...props}
4849
/>
4950
</PreferencesProvider>

packages/compass-indexes/src/components/indexes-toolbar/indexes-toolbar.tsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
SegmentedControlOption,
2222
} from '@mongodb-js/compass-components';
2323
import { useConnectionInfo } from '@mongodb-js/compass-connections/provider';
24+
import semver from 'semver';
2425

2526
import type { RootState } from '../../modules';
2627
import { createSearchIndexOpened } from '../../modules/search-indexes';
@@ -62,6 +63,7 @@ type IndexesToolbarProps = {
6263
isRefreshing: boolean;
6364
onRefreshIndexes: () => void;
6465
onIndexViewChanged: (newView: IndexView) => void;
66+
serverVersion: string;
6567
// connected:
6668
isReadonlyView: boolean;
6769
isWritable: boolean;
@@ -88,6 +90,7 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
8890
isSearchIndexesSupported,
8991
onRefreshIndexes,
9092
onIndexViewChanged,
93+
serverVersion,
9194
readOnly, // preferences readOnly.
9295
}) => {
9396
const isSearchManagementActive = usePreference('enableAtlasSearchIndexes');
@@ -188,16 +191,27 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
188191
</SegmentedControlOption>
189192
}
190193
>
191-
<p>
192-
Atlas Search index management in Compass is only available
193-
for Atlas local deployments and clusters running MongoDB
194-
6.0.7 or newer.
195-
</p>
196-
<p>
197-
For clusters running an earlier version of MongoDB, you
198-
can manage your Atlas Search indexes from the Atlas web
199-
Ul, with the CLI, or with the Administration API.
200-
</p>
194+
{semver.gte(serverVersion, '6.0.7') ? (
195+
<p>
196+
Unable to fetch search indexes. This can occur when your
197+
cluster does not support search indexes or the listing
198+
search indexes request failed.
199+
</p>
200+
) : (
201+
<>
202+
<p>
203+
Atlas Search index management in Compass is only
204+
available for Atlas local deployments and clusters
205+
running MongoDB 6.0.7 or newer.
206+
</p>
207+
<p>
208+
For clusters running an earlier version of MongoDB,
209+
you can manage your Atlas Search indexes from the
210+
Atlas web Ul, with the CLI, or with the Administration
211+
API.
212+
</p>
213+
</>
214+
)}
201215
</Tooltip>
202216
)}
203217
{isSearchIndexesSupported && (

0 commit comments

Comments
 (0)