Merge branch '13628-connect-breadcrumbs-with-project-tree'
[arvados.git] / src / index.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import * as ReactDOM from 'react-dom';
7 import { Provider } from "react-redux";
8 import Workbench from './views/workbench/workbench';
9 import ProjectList from './components/project-list/project-list';
10 import './index.css';
11 import { Route } from "react-router";
12 import createBrowserHistory from "history/createBrowserHistory";
13 import configureStore from "./store/store";
14 import { ConnectedRouter } from "react-router-redux";
15 import ApiToken from "./components/api-token/api-token";
16 import authActions from "./store/auth/auth-action";
17 import { authService, projectService } from "./services/services";
18
19 const history = createBrowserHistory();
20
21 const store = configureStore({
22     projects: [
23     ],
24     router: {
25         location: null
26     },
27     auth: {
28         user: undefined
29     }
30 }, history);
31
32 store.dispatch(authActions.INIT());
33 const rootUuid = authService.getRootUuid();
34 store.dispatch<any>(projectService.getProjectList(rootUuid));
35
36 const App = () =>
37     <Provider store={store}>
38         <ConnectedRouter history={history}>
39             <div>
40                 <Route path="/" component={Workbench}/>
41                 <Route path="/token" component={ApiToken}/>
42             </div>
43         </ConnectedRouter>
44     </Provider>;
45
46 ReactDOM.render(
47     <App/>,
48     document.getElementById('root') as HTMLElement
49 );