X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e5b901f7d6f87b56f43d3dbe002c9c90a3d41349..7df4149100f41cc8d4a5438630ba95a1d72409a1:/src/store/store.ts diff --git a/src/store/store.ts b/src/store/store.ts index 6b9c31ff..adb7ddde 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -6,34 +6,47 @@ import { createStore, applyMiddleware, compose, Middleware, combineReducers } fr import { routerMiddleware, routerReducer, RouterState } from "react-router-redux"; import thunkMiddleware from 'redux-thunk'; import { History } from "history"; -import projectsReducer, { ProjectState } from "./project/project-reducer"; -import authReducer, { AuthState } from "./auth/auth-reducer"; -import collectionsReducer from "./collection/collection-reducer"; + +import { projectsReducer, ProjectState } from "./project/project-reducer"; +import { sidePanelReducer, SidePanelState } from './side-panel/side-panel-reducer'; +import { authReducer, AuthState } from "./auth/auth-reducer"; +import { dataExplorerReducer, DataExplorerState } from './data-explorer/data-explorer-reducer'; +import { projectPanelMiddleware } from './project-panel/project-panel-middleware'; +import { detailsPanelReducer, DetailsPanelState } from './details-panel/details-panel-reducer'; +import { contextMenuReducer, ContextMenuState } from './context-menu/context-menu-reducer'; const composeEnhancers = (process.env.NODE_ENV === 'development' && - window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || + window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose; export interface RootState { auth: AuthState; projects: ProjectState; router: RouterState; + dataExplorer: DataExplorerState; + sidePanel: SidePanelState; + detailsPanel: DetailsPanelState; + contextMenu: ContextMenuState; } const rootReducer = combineReducers({ auth: authReducer, projects: projectsReducer, - collections: collectionsReducer, - router: routerReducer + router: routerReducer, + dataExplorer: dataExplorerReducer, + sidePanel: sidePanelReducer, + detailsPanel: detailsPanelReducer, + contextMenu: contextMenuReducer }); -export default function configureStore(initialState: RootState, history: History) { +export function configureStore(history: History) { const middlewares: Middleware[] = [ routerMiddleware(history), - thunkMiddleware + thunkMiddleware, + projectPanelMiddleware ]; const enhancer = composeEnhancers(applyMiddleware(...middlewares)); - return createStore(rootReducer, initialState!, enhancer); + return createStore(rootReducer, enhancer); }