improve attributes and dt-factory, modify side-panel, main-app-bar and icons
[arvados-workbench2.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 './index.css';
10 import { Route } from "react-router";
11 import createBrowserHistory from "history/createBrowserHistory";
12 import configureStore from "./store/store";
13 import { ConnectedRouter } from "react-router-redux";
14 import ApiToken from "./views-components/api-token/api-token";
15 import authActions from "./store/auth/auth-action";
16 import { authService } from "./services/services";
17 import { getProjectList } from "./store/project/project-action";
18 import { MuiThemeProvider } from '@material-ui/core/styles';
19 import { CustomTheme } from './common/custom-theme';
20 import CommonResourceService from './common/api/common-resource-service';
21 import { CollectionResource } from './models/collection';
22 import { serverApi } from './common/api/server-api';
23 import { ProcessResource } from './models/process';
24
25 const history = createBrowserHistory();
26
27 const store = configureStore(history);
28
29 store.dispatch(authActions.INIT());
30 store.dispatch<any>(getProjectList(authService.getUuid()));
31
32 // const service = new CommonResourceService<CollectionResource>(serverApi, "collections");
33 // service.create({ ownerUuid: "qr1hi-j7d0g-u55bcc7fa5w7v4p", name: "Collection 1 short title"});
34 // service.create({ ownerUuid: "qr1hi-j7d0g-u55bcc7fa5w7v4p", name: "Collection 2 long long long title"});
35
36 // const processService = new CommonResourceService<ProcessResource>(serverApi, "container_requests");
37 // processService.create({ ownerUuid: "qr1hi-j7d0g-u55bcc7fa5w7v4p", name: "Process 1 short title"});
38 // processService.create({ ownerUuid: "qr1hi-j7d0g-u55bcc7fa5w7v4p", name: "Process 2 long long long title" });
39
40 const App = () =>
41     <MuiThemeProvider theme={CustomTheme}>
42         <Provider store={store}>
43             <ConnectedRouter history={history}>
44                 <div>
45                     <Route path="/" component={Workbench} />
46                     <Route path="/token" component={ApiToken} />
47                 </div>
48             </ConnectedRouter>
49         </Provider>
50     </MuiThemeProvider>;
51
52 ReactDOM.render(
53     <App />,
54     document.getElementById('root') as HTMLElement
55 );