Skip to content

feat: Open create index modal with query context CLOUDP-311788 #6904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Dispatch open create index modal with query from action
  • Loading branch information
waltertan12 committed May 7, 2025
commit d303a5496e115a22a0d24e6a34a883a33e613837
16 changes: 10 additions & 6 deletions packages/compass-indexes/src/stores/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Store } from 'redux';
import { createStore, applyMiddleware } from 'redux';
import { applyMiddleware, createStore } from 'redux';
import type { IndexesThunkDispatch, RootState } from '../modules';
import reducer from '../modules';
import thunk from 'redux-thunk';
Expand All @@ -12,16 +12,16 @@ import {
stopPollingRegularIndexes,
} from '../modules/regular-indexes';
import {
fetchSearchIndexes,
createSearchIndexOpened,
fetchSearchIndexes,
stopPollingSearchIndexes,
} from '../modules/search-indexes';
import type { DataService } from 'mongodb-data-service';
import type AppRegistry from 'hadron-app-registry';
import type { ActivateHelpers } from 'hadron-app-registry';
import type {
MongoDBInstance,
Collection,
MongoDBInstance,
} from '@mongodb-js/compass-app-stores/provider';
import type { Logger } from '@mongodb-js/compass-logging';
import type { TrackFunction } from '@mongodb-js/compass-telemetry';
Expand Down Expand Up @@ -128,9 +128,13 @@ export function activateIndexesPlugin(
)
);

on(localAppRegistry, 'open-create-index-modal', () => {
store.dispatch(createIndexOpened());
});
on(
localAppRegistry,
'open-create-index-modal',
(openCreateModalRequest?: { query: Document }) => {
store.dispatch(createIndexOpened(openCreateModalRequest?.query));
}
);

on(localAppRegistry, 'open-create-search-index-modal', () => {
store.dispatch(createSearchIndexOpened());
Expand Down