22// Licensed under the MIT license.
33import React from 'react' ;
44import PropTypes from 'prop-types' ;
5- import { Grid2 as Grid , Typography , Avatar } from '@mui/material' ;
5+ import { Grid2 as Grid , Typography , Avatar , Tooltip } from '@mui/material' ;
66import makeStyles from '@mui/styles/makeStyles' ;
77import { DefaultAvatar } from '../../misc' ;
88import { getIdentifierFromUserEmail } from '../../utils' ;
@@ -15,6 +15,11 @@ const useStyles = makeStyles((theme) => ({
1515 gap : '15px' ,
1616 marginLeft : 0 ,
1717 } ,
18+ agentName : {
19+ overflow : 'hidden' ,
20+ textOverflow : 'ellipsis' ,
21+ textWrap : 'nowrap ' ,
22+ } ,
1823 rolesEditor : {
1924 display : 'flex' ,
2025 alignItems : 'center' ,
@@ -23,6 +28,7 @@ const useStyles = makeStyles((theme) => ({
2328 nameGroup : {
2429 display : 'flex' ,
2530 flexDirection : 'column' ,
31+ maxWidth : '80%' ,
2632 } ,
2733} ) ) ;
2834export const RoleEditor = ( {
@@ -42,9 +48,11 @@ export const RoleEditor = ({
4248 < Grid className = { classes . agentGroup } size = { 7 } >
4349 { avatar }
4450 < div className = { classes . nameGroup } >
45- < Typography data-cy = "role-editor-agent-name" variant = "body1" >
46- { agentName }
47- </ Typography >
51+ < Tooltip title = { agentName } arrow >
52+ < Typography className = { classes . agentName } data-cy = "role-editor-agent-name" variant = "body1" >
53+ { agentName }
54+ </ Typography >
55+ </ Tooltip >
4856 { helperText != null && (
4957 < Typography data-cy = "role-editor-helper-text" variant = "body2" color = "textSecondary" >
5058 { helperText [ agentAccess ] }
@@ -102,4 +110,4 @@ RoleEditor.propTypes = {
102110 * List of detailed description of each role to display when changing access
103111 */
104112 helperText : PropTypes . object ,
105- } ;
113+ } ;
0 commit comments