1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
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';
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';
25 const history = createBrowserHistory();
27 const store = configureStore(history);
29 store.dispatch(authActions.INIT());
30 store.dispatch<any>(getProjectList(authService.getUuid()));
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"});
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" });
41 <MuiThemeProvider theme={CustomTheme}>
42 <Provider store={store}>
43 <ConnectedRouter history={history}>
45 <Route path="/" component={Workbench} />
46 <Route path="/token" component={ApiToken} />
54 document.getElementById('root') as HTMLElement