[ARVADOS-WORKBENCH2] updated: 1.3.1-369-gac687c48
Git user
git at public.curoverse.com
Mon Feb 25 16:29:18 EST 2019
Summary of changes:
src/store/auth/auth-action.ts | 5 +-
src/store/workbench/workbench-actions.ts | 49 +++++-----
src/views-components/main-app-bar/account-menu.tsx | 4 +-
src/views/inactive-panel/inactive-panel.tsx~ | 104 ---------------------
4 files changed, 28 insertions(+), 134 deletions(-)
delete mode 100644 src/views/inactive-panel/inactive-panel.tsx~
via ac687c484aeb0d16d4d2765cad4d64b171398b1e (commit)
from aa13b53dc7c7d4fcfaf9eea0540528f0af5525ae (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 ac687c484aeb0d16d4d2765cad4d64b171398b1e
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Mon Feb 25 16:27:59 2019 -0500
14841: Always reload user details on page initialization.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts
index fdaa2e1a..1654f514 100644
--- a/src/store/auth/auth-action.ts
+++ b/src/store/auth/auth-action.ts
@@ -53,7 +53,10 @@ export const initAuth = (config: Config) => (dispatch: Dispatch, getState: () =>
dispatch(authActions.CONFIG({ config }));
if (token && user) {
dispatch(authActions.INIT({ user, token }));
- dispatch<any>(initSessions(services.authService, config, user));
+ dispatch<any>(getUserDetails()).then((user: User) => {
+ dispatch(authActions.INIT({ user, token }));
+ dispatch<any>(initSessions(services.authService, config, user));
+ });
}
};
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index 2bac55af..ddfe296c 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -117,31 +117,26 @@ export const loadWorkbench = () =>
const { auth, router } = getState();
const { user } = auth;
if (user) {
- const userResource = await dispatch<any>(loadResource(user.uuid));
- if (userResource) {
- dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
- dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
- dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
- dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
- dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns }));
- dispatch(searchResultsPanelActions.SET_FETCH_MODE({ fetchMode: DataTableFetchMode.INFINITE }));
- dispatch(searchResultsPanelActions.SET_COLUMNS({ columns: searchResultsPanelColumns }));
- dispatch(userBindedActions.SET_COLUMNS({ columns: userPanelColumns }));
- dispatch(groupPanelActions.GroupsPanelActions.SET_COLUMNS({ columns: groupsPanelColumns }));
- dispatch(groupDetailsPanelActions.GroupDetailsPanelActions.SET_COLUMNS({columns: groupDetailsPanelColumns}));
- dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns }));
- dispatch(computeNodesActions.SET_COLUMNS({ columns: computeNodePanelColumns }));
- dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns }));
-
- dispatch<any>(initSidePanelTree());
- if (router.location) {
- const match = matchRootRoute(router.location.pathname);
- if (match) {
- dispatch(navigateToProject(userResource.uuid));
- }
+ dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
+ dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
+ dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
+ dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
+ dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns }));
+ dispatch(searchResultsPanelActions.SET_FETCH_MODE({ fetchMode: DataTableFetchMode.INFINITE }));
+ dispatch(searchResultsPanelActions.SET_COLUMNS({ columns: searchResultsPanelColumns }));
+ dispatch(userBindedActions.SET_COLUMNS({ columns: userPanelColumns }));
+ dispatch(groupPanelActions.GroupsPanelActions.SET_COLUMNS({ columns: groupsPanelColumns }));
+ dispatch(groupDetailsPanelActions.GroupDetailsPanelActions.SET_COLUMNS({ columns: groupDetailsPanelColumns }));
+ dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns }));
+ dispatch(computeNodesActions.SET_COLUMNS({ columns: computeNodePanelColumns }));
+ dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns }));
+
+ dispatch<any>(initSidePanelTree());
+ if (router.location) {
+ const match = matchRootRoute(router.location.pathname);
+ if (match) {
+ dispatch(navigateToProject(user.uuid));
}
- } else {
- dispatch(userIsNotAuthenticated);
}
} else {
dispatch(userIsNotAuthenticated);
@@ -470,9 +465,9 @@ export const loadSshKeys = handleFirstTimeLoad(
});
export const loadSiteManager = handleFirstTimeLoad(
-async (dispatch: Dispatch<any>) => {
- await dispatch(loadSiteManagerPanel());
-});
+ async (dispatch: Dispatch<any>) => {
+ await dispatch(loadSiteManagerPanel());
+ });
export const loadMyAccount = handleFirstTimeLoad(
(dispatch: Dispatch<any>) => {
diff --git a/src/views-components/main-app-bar/account-menu.tsx b/src/views-components/main-app-bar/account-menu.tsx
index 3481814d..87bfe0c6 100644
--- a/src/views-components/main-app-bar/account-menu.tsx
+++ b/src/views-components/main-app-bar/account-menu.tsx
@@ -74,8 +74,8 @@ export const AccountMenu = withStyles(styles)(
<MenuItem onClick={() => dispatch(openCurrentTokenDialog)}>Current token</MenuItem>
<MenuItem onClick={() => dispatch(navigateToSshKeysUser)}>Ssh Keys</MenuItem>
<MenuItem onClick={() => dispatch(navigateToSiteManager)}>Site Manager</MenuItem>
- <MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>)
- </> : null}
+ <MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>
+ </> : null}
<MenuItem>
<a href={`${workbenchURL.replace(/\/$/, "")}/${wb1URL(currentRoute)}?api_token=${apiToken}`}
className={classes.link}>
diff --git a/src/views/inactive-panel/inactive-panel.tsx~ b/src/views/inactive-panel/inactive-panel.tsx~
deleted file mode 100644
index eac4034b..00000000
--- a/src/views/inactive-panel/inactive-panel.tsx~
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import * as React from 'react';
-import { connect, DispatchProp } from 'react-redux';
-import { Grid, Typography, Button, Select, FormControl } from '@material-ui/core';
-import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
-import { login, authActions } from '~/store/auth/auth-action';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { RootState } from '~/store/store';
-import * as classNames from 'classnames';
-
-type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button';
-
-const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
- root: {
- position: 'relative',
- backgroundColor: theme.palette.grey["200"],
- '&::after': {
- content: `''`,
- position: 'absolute',
- top: 0,
- left: 0,
- bottom: 0,
- right: 0,
- background: 'url("arvados-logo-big.png") no-repeat center center',
- opacity: 0.2,
- }
- },
- container: {
- width: '560px',
- zIndex: 10
- },
- title: {
- marginBottom: theme.spacing.unit * 6,
- color: theme.palette.grey["800"]
- },
- content: {
- marginBottom: theme.spacing.unit * 3,
- lineHeight: '1.2rem',
- color: theme.palette.grey["800"]
- },
- 'content__bolder': {
- fontWeight: 'bolder'
- },
- button: {
- boxShadow: 'none'
- }
-});
-
-type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules> & {
- remoteHosts: { [key: string]: string },
- homeCluster: string,
- uuidPrefix: string
-};
-
-export const LoginPanel = withStyles(styles)(
- connect((state: RootState) => ({
- remoteHosts: state.auth.remoteHosts,
- homeCluster: state.auth.homeCluster,
- uuidPrefix: state.auth.localCluster
- }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix }: LoginPanelProps) =>
- <Grid container justify="center" alignItems="center"
- className={classes.root}
- style={{ marginTop: 56, overflowY: "auto" }}>
- <Grid item className={classes.container}>
- <Typography variant='h6' align="center" className={classes.title}>
- Welcome to the Arvados Workbench
- </Typography>
- <Typography className={classes.content}>
- The "Log in" button below will show you a Google sign-in page.
- After you assure Google that you want to log in here with your Google account, you will be redirected back here to Arvados Workbench.
- </Typography>
- <Typography className={classes.content}>
- If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account.
- </Typography>
- <Typography variant='body1' className={classNames(classes.content, classes.content__bolder)}>
- IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making.
- </Typography>
- <Typography className={classes.content}>
- Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google.
- </Typography>
-
- {Object.keys(remoteHosts).length > 1 &&
- <Typography component="div" align="right">
- <label>Please select the cluster that hosts your user account:</label>
- <Select native value={homeCluster} style={{ margin: "1em" }}
- onChange={(event) => dispatch(authActions.SET_HOME_CLUSTER(event.target.value))}>
- {Object.keys(remoteHosts).map((k) => <option key={k} value={k}>{k}</option>)}
- </Select>
- </Typography>}
-
- <Typography component="div" align="right">
- <Button variant="contained" color="primary" style={{ margin: "1em" }} className={classes.button}
- onClick={() => dispatch(login(uuidPrefix, remoteHosts[homeCluster]))}>
- Log in to {uuidPrefix}
- {uuidPrefix !== homeCluster &&
- <span> with user from {homeCluster}</span>}
- </Button>
- </Typography>
- </Grid>
- </Grid >
- ));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list