Skip to content

Commit e2d2f27

Browse files
remove compass utils changes and cleanup
1 parent 2bf679d commit e2d2f27

File tree

8 files changed

+15
-79
lines changed

8 files changed

+15
-79
lines changed

package-lock.json

Lines changed: 1 addition & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-aggregations/src/modules/search-indexes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
8383
export const fetchIndexes = (): PipelineBuilderThunkAction<Promise<void>> => {
8484
return async (dispatch, getState) => {
8585
const {
86-
editViewName: viewNamespace,
87-
namespace: collectionNamespace,
8886
dataService: { dataService },
8987
searchIndexes: { status },
9088
} = getState();
9189

92-
const namespace = viewNamespace || collectionNamespace;
93-
9490
if (
9591
!dataService ||
9692
status === SearchIndexesStatuses.LOADING ||

packages/compass-aggregations/src/stores/store.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ import {
2222
setCollections,
2323
} from '../modules/collections-fields';
2424
import type { CollectionInfo } from '../modules/collections-fields';
25-
import {
26-
fetchIndexes,
27-
INITIAL_STATE as SEARCH_INDEXES_INITIAL_STATE,
28-
} from '../modules/search-indexes';
25+
import { INITIAL_STATE as SEARCH_INDEXES_INITIAL_STATE } from '../modules/search-indexes';
2926
import { INITIAL_PANEL_OPEN_LOCAL_STORAGE_KEY } from '../modules/side-panel';
3027
import type { DataService } from '../modules/data-service';
3128
import type { WorkspacesService } from '@mongodb-js/compass-workspaces/provider';
@@ -199,8 +196,6 @@ export function activateAggregationsPlugin(
199196
void store.dispatch(refreshInputDocuments());
200197
};
201198

202-
void store.dispatch(fetchIndexes());
203-
204199
on(localAppRegistry, 'generate-aggregation-from-query', (data) => {
205200
store.dispatch(generateAggregationFromQuery(data));
206201
});

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type { PreferencesAccess } from 'compass-preferences-model';
1414
import { createSandboxFromDefaultPreferences } from 'compass-preferences-model';
1515
import { PreferencesProvider } from 'compass-preferences-model/provider';
1616
import type { Document } from 'mongodb';
17-
//import type {Document} from "mongodb";
1817

1918
describe('IndexesToolbar Component', function () {
2019
before(cleanup);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { createIndexOpened } from '../../modules/create-index';
2929
import type { IndexView } from '../../modules/index-view';
3030
import { indexViewChanged } from '../../modules/index-view';
3131
import type { CollectionStats } from '../../modules/collection-stats';
32-
import { isPipelineSearchQueryable } from '@mongodb-js/compass-utils';
3332
import type { Document } from 'mongodb';
3433
import { VIEW_PIPELINE_UTILS } from '@mongodb-js/mongodb-constants';
3534

@@ -130,7 +129,9 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
130129
);
131130
const isViewPipelineSearchQueryable =
132131
isReadonlyView && collectionStats?.pipeline
133-
? isPipelineSearchQueryable(collectionStats.pipeline as Document[])
132+
? VIEW_PIPELINE_UTILS.isPipelineSearchQueryable(
133+
collectionStats.pipeline as Document[]
134+
)
134135
: true;
135136
const pipelineNotSearchQueryableDescription =
136137
'Search indexes can only be created on views containing $addFields, $set or $match stages with the $expr operator.';

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { getAtlasSearchIndexesLink } from '../../utils/atlas-search-indexes-link
3333
import CreateIndexModal from '../create-index-modal/create-index-modal';
3434
import { ZeroGraphic } from '../search-indexes-table/zero-graphic';
3535
import { ViewVersionIncompatibleBanner } from '../view-version-incompatible-banners/view-version-incompatible-banners';
36-
import semver from 'semver';
3736
import type { SearchIndex } from 'mongodb-data-service';
3837
import type { CollectionStats } from '../../modules/collection-stats';
3938
import type { Document } from 'mongodb';
@@ -79,7 +78,7 @@ const ViewVersionIncompatibleEmptyState = ({
7978
cannot create, drop or re-build indexes on a standard view directly, nor get a list of indexes on the view."
8079
callToActionLink={
8180
<Link
82-
href="https://www.mongodb.com/docs/atlas/atlas-search/" // PLACEHOLDER LINK
81+
href="https://www.mongodb.com/docs/manual/core/views/"
8382
target="_blank"
8483
>
8584
Learn more about views
@@ -110,7 +109,10 @@ const ViewNotSearchCompatibleBanner = ({
110109
$addFields, $set or $match stages with the $expr operator are compatible
111110
with search indexes.{' '}
112111
{!hasNoSearchIndexes && 'Edit the view to rebuild search indexes.'}{' '}
113-
<Link href={''} hideExternalIcon>
112+
<Link
113+
href={'https://www.mongodb.com/docs/atlas/atlas-search/view-support/'}
114+
hideExternalIcon
115+
>
114116
Learn more.
115117
</Link>
116118
</Banner>

packages/compass-indexes/src/components/search-indexes-table/search-indexes-table.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import BadgeWithIconLink from '../indexes-table/badge-with-icon-link';
4040
import { useConnectionInfo } from '@mongodb-js/compass-connections/provider';
4141
import { useWorkspaceTabId } from '@mongodb-js/compass-workspaces/provider';
4242
import type { CollectionStats } from '../../modules/collection-stats';
43-
import { isPipelineSearchQueryable } from '@mongodb-js/compass-utils';
43+
import { VIEW_PIPELINE_UTILS } from '@mongodb-js/mongodb-constants';
4444

4545
type SearchIndexesTableProps = {
4646
namespace: string;
@@ -323,7 +323,9 @@ export const SearchIndexesTable: React.FunctionComponent<
323323
}, [tabId, onSearchIndexesOpened, onSearchIndexesClosed]);
324324
const isViewPipelineSearchQueryable =
325325
isReadonlyView && collectionStats?.pipeline
326-
? isPipelineSearchQueryable(collectionStats.pipeline as Document[])
326+
? VIEW_PIPELINE_UTILS.isPipelineSearchQueryable(
327+
collectionStats.pipeline as Document[]
328+
)
327329
: true;
328330

329331
const data = useMemo<LGTableDataType<SearchIndexInfo>[]>(

packages/compass-utils/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
},
6868
"dependencies": {
6969
"@electron/remote": "^2.1.3",
70-
"electron": "^37.2.6",
71-
"mongodb": "^6.18.0"
70+
"electron": "^37.2.6"
7271
}
7372
}

0 commit comments

Comments
 (0)