Merge branch 'origin/master' into 14348-cluster-search
[arvados-workbench2.git] / src / views-components / user-dialog / manage-dialog.tsx
index 8db1e053a49ac081a36799887ab17c5251ee1d57..d70d35f3205bff3b71a4b90b1e82e0cc651422f0 100644 (file)
@@ -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.uuid)}>
-                        {`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'