X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/24574669fd453c6846bc9f64ce9ae407db79568b..addb01b6d7636a8963ddb1eff4799ebc96f44739:/src/views-components/user-dialog/manage-dialog.tsx diff --git a/src/views-components/user-dialog/manage-dialog.tsx b/src/views-components/user-dialog/manage-dialog.tsx index 8db1e053..a62e1a21 100644 --- a/src/views-components/user-dialog/manage-dialog.tsx +++ b/src/views-components/user-dialog/manage-dialog.tsx @@ -2,16 +2,17 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from "react"; -import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@material-ui/core"; -import { WithDialogProps } from "~/store/dialog/with-dialog"; -import { withDialog } from '~/store/dialog/with-dialog'; -import { WithStyles, withStyles } from '@material-ui/core/styles'; -import { ArvadosTheme } from '~/common/custom-theme'; +import React from "react"; import { compose, Dispatch } from "redux"; -import { USER_MANAGEMENT_DIALOG, openSetupShellAccount, loginAs } from "~/store/users/users-actions"; -import { UserResource } from "~/models/user"; import { connect } from "react-redux"; +import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@material-ui/core"; +import { WithDialogProps } from "store/dialog/with-dialog"; +import { withDialog } from 'store/dialog/with-dialog'; +import { WithStyles, withStyles } from '@material-ui/core/styles'; +import { ArvadosTheme } from 'common/custom-theme'; +import { USER_MANAGEMENT_DIALOG } from "store/users/users-actions"; +import { openSetupShellAccount, loginAs } from 'store/users/users-actions'; +import { getUserDisplayName } from "models/user"; type CssRules = 'spacing'; @@ -23,7 +24,7 @@ const styles = withStyles((theme: ArvadosTheme) => ({ })); interface UserManageDataProps { - data: UserResource; + data: any; } interface UserManageActionProps { @@ -47,24 +48,27 @@ export const UserManageDialog = compose( onClose={props.closeDialog} fullWidth maxWidth="md"> - {`Manage - ${props.data.firstName} ${props.data.lastName}`} - - - 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 && + + {`Manage - ${getUserDisplayName(props.data)}`} + + + 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. - - - 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. + + + 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. - - + + } +