2018-07-04 16:43:46 +02:00
|
|
|
// @flow
|
|
|
|
|
import thunk from "redux-thunk";
|
|
|
|
|
import logger from "redux-logger";
|
|
|
|
|
import { createStore, compose, applyMiddleware, combineReducers } from "redux";
|
|
|
|
|
import { routerReducer, routerMiddleware } from "react-router-redux";
|
2018-07-02 14:50:13 +02:00
|
|
|
|
2018-07-04 16:43:46 +02:00
|
|
|
import users from "./users/modules/users";
|
2018-07-31 16:32:16 +02:00
|
|
|
import repos from "./repos/modules/repos";
|
2018-08-07 14:00:29 +02:00
|
|
|
import repositoryTypes from "./repos/modules/repositoryTypes";
|
2018-09-19 14:10:50 +02:00
|
|
|
import changesets from "./repos/modules/changesets";
|
2018-09-27 16:32:37 +02:00
|
|
|
import sources from "./repos/sources/modules/sources";
|
2018-07-31 13:04:09 +02:00
|
|
|
import groups from "./groups/modules/groups";
|
2018-07-12 11:33:41 +02:00
|
|
|
import auth from "./modules/auth";
|
2018-07-30 11:18:20 +02:00
|
|
|
import pending from "./modules/pending";
|
|
|
|
|
import failure from "./modules/failure";
|
2018-09-11 16:00:15 +02:00
|
|
|
import permissions from "./repos/permissions/modules/permissions";
|
2019-06-19 09:59:32 +02:00
|
|
|
import config from "./admin/modules/config";
|
|
|
|
|
import roles from "./admin/roles/modules/roles";
|
|
|
|
|
import namespaceStrategies from "./admin/modules/namespaceStrategies";
|
2018-10-05 11:15:19 +02:00
|
|
|
import indexResources from "./modules/indexResource";
|
2019-07-08 14:42:12 +02:00
|
|
|
import plugins from "./admin/plugins/modules/plugins";
|
2018-07-02 14:50:13 +02:00
|
|
|
|
2018-07-05 16:48:56 +02:00
|
|
|
import type { BrowserHistory } from "history/createBrowserHistory";
|
2019-04-02 09:27:34 +02:00
|
|
|
import branches from "./repos/branches/modules/branches";
|
2018-07-04 16:43:46 +02:00
|
|
|
|
|
|
|
|
function createReduxStore(history: BrowserHistory) {
|
2018-07-05 16:48:56 +02:00
|
|
|
const composeEnhancers =
|
|
|
|
|
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
2018-07-02 14:50:13 +02:00
|
|
|
|
|
|
|
|
const reducer = combineReducers({
|
|
|
|
|
router: routerReducer,
|
2018-07-30 11:18:20 +02:00
|
|
|
pending,
|
|
|
|
|
failure,
|
2018-10-05 11:15:19 +02:00
|
|
|
indexResources,
|
2018-07-05 16:48:56 +02:00
|
|
|
users,
|
2018-07-31 16:32:16 +02:00
|
|
|
repos,
|
2018-08-02 16:09:58 +02:00
|
|
|
repositoryTypes,
|
2018-09-10 17:00:53 +02:00
|
|
|
changesets,
|
2018-09-14 16:15:13 +02:00
|
|
|
branches,
|
2018-08-23 10:16:54 +02:00
|
|
|
permissions,
|
2018-07-31 13:04:09 +02:00
|
|
|
groups,
|
2018-08-09 13:05:34 +02:00
|
|
|
auth,
|
2018-09-27 16:32:37 +02:00
|
|
|
config,
|
2019-05-09 16:02:02 +02:00
|
|
|
roles,
|
2019-03-11 14:48:48 +01:00
|
|
|
sources,
|
2019-07-08 14:42:12 +02:00
|
|
|
namespaceStrategies,
|
|
|
|
|
plugins
|
2018-07-02 14:50:13 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return createStore(
|
|
|
|
|
reducer,
|
|
|
|
|
composeEnhancers(applyMiddleware(routerMiddleware(history), thunk, logger))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default createReduxStore;
|