[ARVADOS-WORKBENCH2] updated: 1.4.1-57-ga8223b83
Git user
git at public.curoverse.com
Wed Oct 23 20:25:07 UTC 2019
Summary of changes:
src/services/auth-service/auth-service.ts | 2 +-
.../link-account-panel/link-account-panel-root.tsx | 216 +++++++++++----------
.../link-account-panel/link-account-panel.tsx | 1 +
.../search-results-panel-view.tsx | 10 +-
.../site-manager-panel/site-manager-panel-root.tsx | 2 +-
5 files changed, 117 insertions(+), 114 deletions(-)
via a8223b83cc9ae48174718d124a38a504d5312651 (commit)
from a34ed98858d0a43904715e62a09d6de118073701 (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 a8223b83cc9ae48174718d124a38a504d5312651
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Oct 23 16:23:35 2019 -0400
15530: Config takes precedence over local storage sessions
Cannot link accounts if there is a loginCluster set.
Search also links to peer clusters. Explains link to Session Manager.
diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts
index 359a78ec..da96f162 100644
--- a/src/services/auth-service/auth-service.ts
+++ b/src/services/auth-service/auth-service.ts
@@ -204,8 +204,8 @@ export class AuthService {
} as Session;
});
const sessions = [currentSession]
- .concat(localSessions)
.concat(cfgSessions)
+ .concat(localSessions)
.filter((r: Session) => r.clusterId !== "*");
const uniqSessions = uniqBy(sessions, 'clusterId');
diff --git a/src/views/link-account-panel/link-account-panel-root.tsx b/src/views/link-account-panel/link-account-panel-root.tsx
index 0eb494e6..47473fa4 100644
--- a/src/views/link-account-panel/link-account-panel-root.tsx
+++ b/src/views/link-account-panel/link-account-panel-root.tsx
@@ -32,10 +32,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
export interface LinkAccountPanelRootDataProps {
targetUser?: UserResource;
userToLink?: UserResource;
- remoteHosts: { [key: string]: string };
+ remoteHosts: { [key: string]: string };
hasRemoteHosts: boolean;
localCluster: string;
- status : LinkAccountPanelStatus;
+ loginCluster: string;
+ status: LinkAccountPanelStatus;
error: LinkAccountPanelError;
selectedCluster?: string;
isProcessing: boolean;
@@ -52,7 +53,7 @@ function displayUser(user: UserResource, showCreatedAt: boolean = false, showClu
const disp = [];
disp.push(<span><b>{user.email}</b> ({user.username}, {user.uuid})</span>);
if (showCluster) {
- const homeCluster = user.uuid.substr(0,5);
+ const homeCluster = user.uuid.substr(0, 5);
disp.push(<span> hosted on cluster <b>{homeCluster}</b> and </span>);
}
if (showCreatedAt) {
@@ -67,116 +68,119 @@ function isLocalUser(uuid: string, localCluster: string) {
type LinkAccountPanelRootProps = LinkAccountPanelRootDataProps & LinkAccountPanelRootActionProps & WithStyles<CssRules>;
-export const LinkAccountPanelRoot = withStyles(styles) (
- ({classes, targetUser, userToLink, status, isProcessing, error, startLinking, cancelLinking, linkAccount,
- remoteHosts, hasRemoteHosts, selectedCluster, setSelectedCluster, localCluster}: LinkAccountPanelRootProps) => {
+export const LinkAccountPanelRoot = withStyles(styles)(
+ ({ classes, targetUser, userToLink, status, isProcessing, error, startLinking, cancelLinking, linkAccount,
+ remoteHosts, hasRemoteHosts, selectedCluster, setSelectedCluster, localCluster, loginCluster }: LinkAccountPanelRootProps) => {
return <Card className={classes.root}>
<CardContent>
- { isProcessing && <Grid container item direction="column" alignContent="center" spacing={24}>
- <Grid item>
- Loading user info. Please wait.
- </Grid>
- <Grid item style={{ alignSelf: 'center' }}>
- <CircularProgress/>
- </Grid>
- </Grid> }
- { !isProcessing && status === LinkAccountPanelStatus.INITIAL && targetUser && <div>
- { isLocalUser(targetUser.uuid, localCluster) ? <Grid container spacing={24}>
- <Grid container item direction="column" spacing={24}>
- <Grid item>
- You are currently logged in as {displayUser(targetUser, true)}
- </Grid>
- <Grid item>
- You can link Arvados accounts. After linking, either login will take you to the same account.
- </Grid >
+ {isProcessing && <Grid container item direction="column" alignContent="center" spacing={24}>
+ <Grid item>
+ Loading user info. Please wait.
+ </Grid>
+ <Grid item style={{ alignSelf: 'center' }}>
+ <CircularProgress />
</Grid>
- <Grid container item direction="row" spacing={24}>
- <Grid item>
- <Button disabled={!targetUser.isActive} color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_OTHER_LOGIN)}>
- Add another login to this account
- </Button>
- </Grid>
- <Grid item>
- <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ACCESS_OTHER_ACCOUNT)}>
- Use this login to access another account
- </Button>
+ </Grid>}
+ {!isProcessing && status === LinkAccountPanelStatus.INITIAL && targetUser && <div>
+ {isLocalUser(targetUser.uuid, localCluster) ? <Grid container spacing={24}>
+ <Grid container item direction="column" spacing={24}>
+ <Grid item>
+ You are currently logged in as {displayUser(targetUser, true)}
+ </Grid>
+ <Grid item>
+ You can link Arvados accounts. After linking, either login will take you to the same account.
+ </Grid >
</Grid>
- </Grid>
- { hasRemoteHosts && selectedCluster && <Grid container item direction="column" spacing={24}>
- <Grid item>
- You can also link {displayUser(targetUser, false)} with an account from a remote cluster.
+ <Grid container item direction="row" spacing={24}>
+ <Grid item>
+ <Button disabled={!targetUser.isActive} color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_OTHER_LOGIN)}>
+ Add another login to this account
+ </Button>
+ </Grid>
+ <Grid item>
+ <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ACCESS_OTHER_ACCOUNT)}>
+ Use this login to access another account
+ </Button>
+ </Grid>
</Grid>
- <Grid item>
- Please select the cluster that hosts the account you want to link with:
- <Select id="remoteHostsDropdown" native defaultValue={selectedCluster} style={{ marginLeft: "1em" }}
+ {hasRemoteHosts && selectedCluster && <Grid container item direction="column" spacing={24}>
+ <Grid item>
+ You can also link {displayUser(targetUser, false)} with an account from a remote cluster.
+ </Grid>
+ <Grid item>
+ Please select the cluster that hosts the account you want to link with:
+ <Select id="remoteHostsDropdown" native defaultValue={selectedCluster} style={{ marginLeft: "1em" }}
onChange={(event) => setSelectedCluster(event.target.value)}>
{Object.keys(remoteHosts).map((k) => k !== localCluster ? <option key={k} value={k}>{k}</option> : null)}
</Select>
</Grid>
- <Grid item>
- <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ACCESS_OTHER_REMOTE_ACCOUNT)}>
- Link with an account on {hasRemoteHosts ? <label>{selectedCluster} </label> : null}
- </Button>
- </Grid>
- </Grid> }
- </Grid> :
- <Grid container spacing={24}>
- <Grid container item direction="column" spacing={24}>
- <Grid item>
- You are currently logged in as {displayUser(targetUser, true, true)}
+ <Grid item>
+ <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ACCESS_OTHER_REMOTE_ACCOUNT)}>
+ Link with an account on {hasRemoteHosts ? <label>{selectedCluster} </label> : null}
+ </Button>
+ </Grid>
+ </Grid>}
+ </Grid> :
+ <Grid container spacing={24}>
+ <Grid container item direction="column" spacing={24}>
+ <Grid item>
+ You are currently logged in as {displayUser(targetUser, true, true)}
+ </Grid>
+ {targetUser.isActive ? (loginCluster === "" ?
+ <> <Grid item>
+ This a remote account. You can link a local Arvados account to this one. After linking, you can access the local account's data by logging into the <b>{localCluster}</b> cluster as user <b>{targetUser.email}</b> from <b>{targetUser.uuid.substr(0, 5)}</b>.
+ </Grid >
+ <Grid item>
+ <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_LOCAL_TO_REMOTE)}>
+ Link an account from {localCluster} to this account
+ </Button>
+ </Grid> </>
+ : <Grid item>Must perform account linking on login cluster <b>{loginCluster}</b></Grid>
+ )
+ : <Grid item>
+ This an inactive remote account. An administrator must activate your account before you can proceed. After your accounts is activated, you can link a local Arvados account hosted by the <b>{localCluster}</b> cluster to this one.
+ </Grid >}
+ </Grid>
+ </Grid>}
+ </div>}
+ {!isProcessing && (status === LinkAccountPanelStatus.LINKING || status === LinkAccountPanelStatus.ERROR) && userToLink && targetUser &&
+ <Grid container spacing={24}>
+ {status === LinkAccountPanelStatus.LINKING && <Grid container item direction="column" spacing={24}>
+ <Grid item>
+ Clicking 'Link accounts' will link {displayUser(userToLink, true, !isLocalUser(targetUser.uuid, localCluster))} to {displayUser(targetUser, true, !isLocalUser(targetUser.uuid, localCluster))}.
+ </Grid>
+ {(isLocalUser(targetUser.uuid, localCluster)) && <Grid item>
+ After linking, logging in as {displayUser(userToLink)} will log you into the same account as {displayUser(targetUser)}.
+ </Grid>}
+ <Grid item>
+ Any object owned by {displayUser(userToLink)} will be transfered to {displayUser(targetUser)}.
+ </Grid>
+ {!isLocalUser(targetUser.uuid, localCluster) && <Grid item>
+ You can access <b>{userToLink.email}</b> data by logging into <b>{localCluster}</b> with the <b>{targetUser.email}</b> account.
+ </Grid>}
+ </Grid>}
+ {error === LinkAccountPanelError.NON_ADMIN && <Grid item>
+ Cannot link admin account {displayUser(userToLink)} to non-admin account {displayUser(targetUser)}.
+ </Grid>}
+ {error === LinkAccountPanelError.SAME_USER && <Grid item>
+ Cannot link {displayUser(targetUser)} to the same account.
+ </Grid>}
+ {error === LinkAccountPanelError.INACTIVE && <Grid item>
+ Cannot link account {displayUser(userToLink)} to inactive account {displayUser(targetUser)}.
+ </Grid>}
+ <Grid container item direction="row" spacing={24}>
+ <Grid item>
+ <Button variant="contained" onClick={() => cancelLinking()}>
+ Cancel
+ </Button>
+ </Grid>
+ <Grid item>
+ <Button disabled={status === LinkAccountPanelStatus.ERROR} color="primary" variant="contained" onClick={() => linkAccount()}>
+ Link accounts
+ </Button>
+ </Grid>
</Grid>
- {targetUser.isActive ? <> <Grid item>
- This a remote account. You can link a local Arvados account to this one. After linking, you can access the local account's data by logging into the <b>{localCluster}</b> cluster as user <b>{targetUser.email}</b> from <b>{targetUser.uuid.substr(0,5)}</b>.
- </Grid >
- <Grid item>
- <Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_LOCAL_TO_REMOTE)}>
- Link an account from {localCluster} to this account
- </Button>
- </Grid> </>
- : <Grid item>
- This an inactive remote account. An administrator must activate your account before you can proceed. After your accounts is activated, you can link a local Arvados account hosted by the <b>{localCluster}</b> cluster to this one.
- </Grid >}
- </Grid>
- </Grid>}
- </div> }
- { !isProcessing && (status === LinkAccountPanelStatus.LINKING || status === LinkAccountPanelStatus.ERROR) && userToLink && targetUser &&
- <Grid container spacing={24}>
- { status === LinkAccountPanelStatus.LINKING && <Grid container item direction="column" spacing={24}>
- <Grid item>
- Clicking 'Link accounts' will link {displayUser(userToLink, true, !isLocalUser(targetUser.uuid, localCluster))} to {displayUser(targetUser, true, !isLocalUser(targetUser.uuid, localCluster))}.
- </Grid>
- { (isLocalUser(targetUser.uuid, localCluster)) && <Grid item>
- After linking, logging in as {displayUser(userToLink)} will log you into the same account as {displayUser(targetUser)}.
- </Grid> }
- <Grid item>
- Any object owned by {displayUser(userToLink)} will be transfered to {displayUser(targetUser)}.
- </Grid>
- { !isLocalUser(targetUser.uuid, localCluster) && <Grid item>
- You can access <b>{userToLink.email}</b> data by logging into <b>{localCluster}</b> with the <b>{targetUser.email}</b> account.
- </Grid> }
- </Grid> }
- { error === LinkAccountPanelError.NON_ADMIN && <Grid item>
- Cannot link admin account {displayUser(userToLink)} to non-admin account {displayUser(targetUser)}.
- </Grid> }
- { error === LinkAccountPanelError.SAME_USER && <Grid item>
- Cannot link {displayUser(targetUser)} to the same account.
- </Grid> }
- { error === LinkAccountPanelError.INACTIVE && <Grid item>
- Cannot link account {displayUser(userToLink)} to inactive account {displayUser(targetUser)}.
- </Grid> }
- <Grid container item direction="row" spacing={24}>
- <Grid item>
- <Button variant="contained" onClick={() => cancelLinking()}>
- Cancel
- </Button>
- </Grid>
- <Grid item>
- <Button disabled={status === LinkAccountPanelStatus.ERROR} color="primary" variant="contained" onClick={() => linkAccount()}>
- Link accounts
- </Button>
- </Grid>
- </Grid>
- </Grid> }
- </CardContent>
- </Card>;
-});
\ No newline at end of file
+ </Grid>}
+ </CardContent>
+ </Card>;
+ });
diff --git a/src/views/link-account-panel/link-account-panel.tsx b/src/views/link-account-panel/link-account-panel.tsx
index f0a9e5a1..e1ec8af7 100644
--- a/src/views/link-account-panel/link-account-panel.tsx
+++ b/src/views/link-account-panel/link-account-panel.tsx
@@ -19,6 +19,7 @@ const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
hasRemoteHosts: Object.keys(state.auth.remoteHosts).length > 1 && state.auth.loginCluster === "",
selectedCluster: state.linkAccountPanel.selectedCluster,
localCluster: state.auth.localCluster,
+ loginCluster: state.auth.loginCluster,
targetUser: state.linkAccountPanel.targetUser,
userToLink: state.linkAccountPanel.userToLink,
status: state.linkAccountPanel.status,
diff --git a/src/views/search-results-panel/search-results-panel-view.tsx b/src/views/search-results-panel/search-results-panel-view.tsx
index 96f4a565..45638b89 100644
--- a/src/views/search-results-panel/search-results-panel-view.tsx
+++ b/src/views/search-results-panel/search-results-panel-view.tsx
@@ -23,7 +23,7 @@ import { getInitialResourceTypeFilters } from '~/store/resource-type-filters/res
import { SearchResultsPanelProps } from "./search-results-panel";
import { Routes } from '~/routes/routes';
import { Link } from 'react-router-dom';
-import { StyleRulesCallback, withStyles, WithStyles, Button } from '@material-ui/core';
+import { StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
export enum SearchResultsPanelColumnNames {
@@ -125,11 +125,9 @@ export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
title={
<div>{(props.localCluster !== homeCluster && loggedIn.length === 1) ?
<span>Searching local cluster {props.localCluster} only. To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></span> :
- <span>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}> {ss.clusterId}</span>)}</span>}
- <Link to={Routes.SITE_MANAGER} >
- <Button className={props.classes.siteManagerLink} >Site Manager</Button>
- </Link>
- </div>
+ <span>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}> <a href={props.remoteHostsConfig[ss.clusterId].workbench2Url}> {ss.clusterId}</a></span>)}</span>}
+ <span style={{ marginLeft: "2em" }}>Use <Link to={Routes.SITE_MANAGER} >Site Manager</Link> to manage which clusters will be searched.</span>
+ </div >
}
/>;
});
diff --git a/src/views/site-manager-panel/site-manager-panel-root.tsx b/src/views/site-manager-panel/site-manager-panel-root.tsx
index 36349774..303995b8 100644
--- a/src/views/site-manager-panel/site-manager-panel-root.tsx
+++ b/src/views/site-manager-panel/site-manager-panel-root.tsx
@@ -161,7 +161,7 @@ export const SiteManagerPanelRoot = compose(
<Grid item xs={12}>
<Typography paragraph={true} className={classes.remoteSiteInfo}>
To add a remote Arvados site, paste the remote site's host here (see "ARVADOS_API_HOST" on the "current token" page).
- </Typography>
+ </Typography>
</Grid>
<Grid item xs={8}>
<Field
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list