[ARVADOS-WORKBENCH2] updated: 1.3.0-268-gfb37efe5
Git user
git at public.curoverse.com
Thu Dec 27 09:47:55 EST 2018
Summary of changes:
src/store/users/users-actions.ts | 7 ++---
src/views-components/user-dialog/manage-dialog.tsx | 31 ++++++++++++----------
2 files changed, 21 insertions(+), 17 deletions(-)
via fb37efe50c142aaaa91fbb10c674347b85afaab1 (commit)
from db2c87fbe29eed8c4bfca47a97c97cee77959d58 (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 fb37efe50c142aaaa91fbb10c674347b85afaab1
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Thu Dec 27 15:47:38 2018 +0100
refs #14565-login-as
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/store/users/users-actions.ts b/src/store/users/users-actions.ts
index 71fd107b..42406858 100644
--- a/src/store/users/users-actions.ts
+++ b/src/store/users/users-actions.ts
@@ -38,7 +38,9 @@ export const openUserManagement = (uuid: string) =>
const { resources } = getState();
const user = getResource<UserResource>(uuid)(resources);
const clients = await services.apiClientAuthorizationService.list();
- dispatch(dialogActions.OPEN_DIALOG({ id: USER_MANAGEMENT_DIALOG, data: { user, ...clients } }));
+ const client = clients.items.find(it => it.ownerUuid === uuid);
+ console.log(client);
+ dispatch(dialogActions.OPEN_DIALOG({ id: USER_MANAGEMENT_DIALOG, data: { user, client } }));
};
export const openSetupShellAccount = (uuid: string) =>
@@ -132,5 +134,4 @@ export const loadUsersData = () =>
export const loadUsersPanel = () =>
(dispatch: Dispatch) => {
dispatch(userBindedActions.REQUEST_ITEMS());
- };
-
\ No newline at end of file
+ };
\ No newline at end of file
diff --git a/src/views-components/user-dialog/manage-dialog.tsx b/src/views-components/user-dialog/manage-dialog.tsx
index 59779928..d70d35f3 100644
--- a/src/views-components/user-dialog/manage-dialog.tsx
+++ b/src/views-components/user-dialog/manage-dialog.tsx
@@ -23,7 +23,7 @@ const styles = withStyles<CssRules>((theme: ArvadosTheme) => ({
}));
interface UserManageDataProps {
- data: UserResource;
+ data: any;
}
interface UserManageActionProps {
@@ -47,21 +47,24 @@ export const UserManageDialog = compose(
onClose={props.closeDialog}
fullWidth
maxWidth="md">
- <DialogTitle>{`Manage - ${props.data.firstName} ${props.data.lastName}`}</DialogTitle>
- <DialogContent>
- <Typography variant="body2" className={props.classes.spacing}>
- As an admin, you can log in as this user. When you’ve finished, you will need to log out and log in again with your own account.
+ {props.data.user &&
+ <span>
+ <DialogTitle>{`Manage - ${props.data.user.firstName} ${props.data.user.lastName}`}</DialogTitle>
+ <DialogContent>
+ <Typography variant="body2" className={props.classes.spacing}>
+ As an admin, you can log in as this user. When you’ve finished, you will need to log out and log in again with your own account.
</Typography>
- <Button variant="contained" color="primary" onClick={() => props.loginAs(props.data.createdAt)}>
- {`LOG IN AS ${props.data.firstName} ${props.data.lastName}`}
- </Button>
- <Typography variant="body2" className={props.classes.spacing}>
- As an admin, you can setup a shell account for this user. The login name is automatically generated from the user's e-mail address.
+ <Button variant="contained" color="primary" onClick={() => props.loginAs(props.data.client.uuid)}>
+ {`LOG IN AS ${props.data.user.firstName} ${props.data.user.lastName}`}
+ </Button>
+ <Typography variant="body2" className={props.classes.spacing}>
+ As an admin, you can setup a shell account for this user. The login name is automatically generated from the user's e-mail address.
</Typography>
- <Button variant="contained" color="primary" onClick={() => props.openSetupShellAccount(props.data.uuid)}>
- {`SETUP SHELL ACCOUNT FOR ${props.data.firstName} ${props.data.lastName}`}
- </Button>
- </DialogContent>
+ <Button variant="contained" color="primary" onClick={() => props.openSetupShellAccount(props.data.uuid)}>
+ {`SETUP SHELL ACCOUNT FOR ${props.data.user.firstName} ${props.data.user.lastName}`}
+ </Button>
+ </DialogContent></span>}
+
<DialogActions>
<Button
variant='flat'
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list