[ARVADOS-WORKBENCH2] updated: 16b7bebe83b28b5622f23385df5cacbd66bc425b

Git user git at public.curoverse.com
Wed Jun 6 11:01:29 EDT 2018


Summary of changes:
 src/components/api-token/api-token.tsx     |  2 +-
 src/index.tsx                              |  2 +-
 src/services/auth-service/auth-service.ts  |  1 -
 src/store/{ => auth}/auth-action.ts        |  2 +-
 src/store/{ => auth}/auth-reducer.ts       |  6 +++---
 src/store/{ => project}/project-action.ts  |  2 +-
 src/store/{ => project}/project-reducer.ts |  2 +-
 src/store/root-reducer.ts                  | 22 --------------------
 src/store/store.ts                         | 20 +++++++++++++++---
 src/views/workbench/workbench.tsx          | 33 +++++++++++++++++-------------
 10 files changed, 44 insertions(+), 48 deletions(-)
 rename src/store/{ => auth}/auth-action.ts (94%)
 rename src/store/{ => auth}/auth-reducer.ts (91%)
 rename src/store/{ => project}/project-action.ts (89%)
 rename src/store/{ => project}/project-reducer.ts (90%)
 delete mode 100644 src/store/root-reducer.ts

       via  16b7bebe83b28b5622f23385df5cacbd66bc425b (commit)
       via  8a514334ae2a6e02cc1e254d29b229b2750eec7d (commit)
      from  e5ff916017b1f215dc1d0ae5b82cd3d7e669a5fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 16b7bebe83b28b5622f23385df5cacbd66bc425b
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Wed Jun 6 17:01:26 2018 +0200

    Move reducers to separate folders
    
    Feature #13563
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>:

diff --git a/src/components/api-token/api-token.tsx b/src/components/api-token/api-token.tsx
index bc0caf5..daebe9b 100644
--- a/src/components/api-token/api-token.tsx
+++ b/src/components/api-token/api-token.tsx
@@ -5,7 +5,7 @@
 import { Redirect, RouteProps } from "react-router";
 import * as React from "react";
 import { connect, DispatchProp } from "react-redux";
-import authActions, { getUserDetails } from "../../store/auth-action";
+import authActions, { getUserDetails } from "../../store/auth/auth-action";
 
 interface ApiTokenProps {
 }
diff --git a/src/index.tsx b/src/index.tsx
index c1785c8..cb868eb 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -13,7 +13,7 @@ import createBrowserHistory from "history/createBrowserHistory";
 import configureStore from "./store/store";
 import { ConnectedRouter } from "react-router-redux";
 import ApiToken from "./components/api-token/api-token";
-import authActions from "./store/auth-action";
+import authActions from "./store/auth/auth-action";
 
 const history = createBrowserHistory();
 const store = configureStore({
diff --git a/src/store/auth-action.ts b/src/store/auth/auth-action.ts
similarity index 94%
rename from src/store/auth-action.ts
rename to src/store/auth/auth-action.ts
index 3343a57..dbf9a0f 100644
--- a/src/store/auth-action.ts
+++ b/src/store/auth/auth-action.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { serverApi } from "../common/server-api";
+import { serverApi } from "../../common/server-api";
 import { ofType, default as unionize, UnionOf } from "unionize";
 import { Dispatch } from "redux";
 
diff --git a/src/store/auth-reducer.ts b/src/store/auth/auth-reducer.ts
similarity index 91%
rename from src/store/auth-reducer.ts
rename to src/store/auth/auth-reducer.ts
index 7901e62..730312f 100644
--- a/src/store/auth-reducer.ts
+++ b/src/store/auth/auth-reducer.ts
@@ -3,9 +3,9 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import actions, { AuthAction, UserDetailsResponse } from "./auth-action";
-import { User } from "../models/user";
-import { authService } from "../services/services";
-import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../common/server-api";
+import { User } from "../../models/user";
+import { authService } from "../../services/services";
+import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/server-api";
 
 export interface AuthState {
     user?: User;
diff --git a/src/store/project-action.ts b/src/store/project/project-action.ts
similarity index 89%
rename from src/store/project-action.ts
rename to src/store/project/project-action.ts
index 904a34d..8d57d2b 100644
--- a/src/store/project-action.ts
+++ b/src/store/project/project-action.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Project } from "../models/project";
+import { Project } from "../../models/project";
 import { default as unionize, ofType, UnionOf } from "unionize";
 
 const actions = unionize({
diff --git a/src/store/project-reducer.ts b/src/store/project/project-reducer.ts
similarity index 90%
rename from src/store/project-reducer.ts
rename to src/store/project/project-reducer.ts
index a321265..de11d51 100644
--- a/src/store/project-reducer.ts
+++ b/src/store/project/project-reducer.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Project } from "../models/project";
+import { Project } from "../../models/project";
 import actions, { ProjectAction } from "./project-action";
 
 export type ProjectState = Project[];
diff --git a/src/store/root-reducer.ts b/src/store/root-reducer.ts
deleted file mode 100644
index 380bd53..0000000
--- a/src/store/root-reducer.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { combineReducers } from "redux";
-import { routerReducer, RouterState } from "react-router-redux";
-import authReducer, { AuthState } from "./auth-reducer";
-import projectsReducer, { ProjectState } from "./project-reducer";
-
-export interface RootState {
-    auth: AuthState,
-    projects: ProjectState,
-    router: RouterState
-}
-
-const rootReducer = combineReducers({
-    auth: authReducer,
-    projects: projectsReducer,
-    router: routerReducer
-});
-
-export default rootReducer;
diff --git a/src/store/store.ts b/src/store/store.ts
index d3646e6..d541156 100644
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@ -2,17 +2,31 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { createStore, applyMiddleware, compose, Middleware } from 'redux';
-import { default as rootReducer, RootState } from "./root-reducer";
-import { routerMiddleware } from "react-router-redux";
+import { createStore, applyMiddleware, compose, Middleware, combineReducers } from 'redux';
+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";
 
 const composeEnhancers =
     (process.env.NODE_ENV === 'development' &&
     window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) ||
     compose;
 
+export interface RootState {
+    auth: AuthState,
+    projects: ProjectState,
+    router: RouterState
+}
+
+const rootReducer = combineReducers({
+    auth: authReducer,
+    projects: projectsReducer,
+    router: routerReducer
+});
+
+
 export default function configureStore(initialState: RootState, history: History) {
     const middlewares: Middleware[] = [
         routerMiddleware(history),
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index b5babde..8c3145b 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -12,18 +12,18 @@ import Typography from '@material-ui/core/Typography';
 import { connect, DispatchProp } from "react-redux";
 import Tree from "../../components/tree/tree";
 import { Project } from "../../models/project";
-import { RootState } from "../../store/root-reducer";
 import ProjectList from "../../components/project-list/project-list";
 import { Route, Switch } from "react-router";
 import { Link } from "react-router-dom";
 import Button from "@material-ui/core/Button/Button";
-import authActions from "../../store/auth-action";
+import authActions from "../../store/auth/auth-action";
 import IconButton from "@material-ui/core/IconButton/IconButton";
 import Menu from "@material-ui/core/Menu/Menu";
 import MenuItem from "@material-ui/core/MenuItem/MenuItem";
 import { AccountCircle } from "@material-ui/icons";
 import { User } from "../../models/user";
 import Grid from "@material-ui/core/Grid/Grid";
+import { RootState } from "../../store/store";
 
 const drawerWidth = 240;
 

commit 8a514334ae2a6e02cc1e254d29b229b2750eec7d
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Wed Jun 6 16:38:18 2018 +0200

    Add better layout for user name on the appbar
    
    Feature #13563
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>:

diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts
index 5a08d3b..12c5b68 100644
--- a/src/services/auth-service/auth-service.ts
+++ b/src/services/auth-service/auth-service.ts
@@ -2,7 +2,6 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import Axios from "axios";
 import { API_HOST } from "../../common/server-api";
 import { User } from "../../models/user";
 
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 38c3f04..b5babde 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -23,6 +23,7 @@ import Menu from "@material-ui/core/Menu/Menu";
 import MenuItem from "@material-ui/core/MenuItem/MenuItem";
 import { AccountCircle } from "@material-ui/icons";
 import { User } from "../../models/user";
+import Grid from "@material-ui/core/Grid/Grid";
 
 const drawerWidth = 240;
 
@@ -109,17 +110,21 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                             <span>Arvados</span><br/><span style={{fontSize: 12}}>Workbench 2</span>
                         </Typography>
                         {user ?
-                            <div>
-                                <Typography variant="title" color="inherit" noWrap>
-                                    {user.firstName} {user.lastName}
-                                </Typography>
-                                <IconButton
-                                      aria-owns={this.state.anchorEl ? 'menu-appbar' : undefined}
-                                      aria-haspopup="true"
-                                      onClick={this.handleOpenMenu}
-                                      color="inherit">
-                                  <AccountCircle/>
-                                </IconButton>
+                            <Grid container style={{width: 'auto'}}>
+                                <Grid container style={{width: 'auto'}} alignItems='center'>
+                                    <Typography variant="title" color="inherit" noWrap>
+                                        {user.firstName} {user.lastName}
+                                    </Typography>
+                                </Grid>
+                                <Grid item>
+                                    <IconButton
+                                          aria-owns={this.state.anchorEl ? 'menu-appbar' : undefined}
+                                          aria-haspopup="true"
+                                          onClick={this.handleOpenMenu}
+                                          color="inherit">
+                                      <AccountCircle/>
+                                    </IconButton>
+                                </Grid>
                                 <Menu
                                   id="menu-appbar"
                                   anchorEl={this.state.anchorEl}
@@ -136,7 +141,7 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                                   <MenuItem onClick={this.logout}>Logout</MenuItem>
                                   <MenuItem onClick={this.handleClose}>My account</MenuItem>
                                 </Menu>
-                            </div>
+                            </Grid>
                             :
                             <Button color="inherit" onClick={this.login}>Login</Button>
                         }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list