Skip to content

Commit d303a54

Browse files
committed
Dispatch open create index modal with query from action
1 parent 249f5bf commit d303a54

File tree

1 file changed

+10
-6
lines changed
  • packages/compass-indexes/src/stores

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Store } from 'redux';
2-
import { createStore, applyMiddleware } from 'redux';
2+
import { applyMiddleware, createStore } from 'redux';
33
import type { IndexesThunkDispatch, RootState } from '../modules';
44
import reducer from '../modules';
55
import thunk from 'redux-thunk';
@@ -12,16 +12,16 @@ import {
1212
stopPollingRegularIndexes,
1313
} from '../modules/regular-indexes';
1414
import {
15-
fetchSearchIndexes,
1615
createSearchIndexOpened,
16+
fetchSearchIndexes,
1717
stopPollingSearchIndexes,
1818
} from '../modules/search-indexes';
1919
import type { DataService } from 'mongodb-data-service';
2020
import type AppRegistry from 'hadron-app-registry';
2121
import type { ActivateHelpers } from 'hadron-app-registry';
2222
import type {
23-
MongoDBInstance,
2423
Collection,
24+
MongoDBInstance,
2525
} from '@mongodb-js/compass-app-stores/provider';
2626
import type { Logger } from '@mongodb-js/compass-logging';
2727
import type { TrackFunction } from '@mongodb-js/compass-telemetry';
@@ -128,9 +128,13 @@ export function activateIndexesPlugin(
128128
)
129129
);
130130

131-
on(localAppRegistry, 'open-create-index-modal', () => {
132-
store.dispatch(createIndexOpened());
133-
});
131+
on(
132+
localAppRegistry,
133+
'open-create-index-modal',
134+
(openCreateModalRequest?: { query: Document }) => {
135+
store.dispatch(createIndexOpened(openCreateModalRequest?.query));
136+
}
137+
);
134138

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

0 commit comments

Comments
 (0)