1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-18 00:19:49 +01:00

feat: add username to CR overview and list (#3498)

This commit is contained in:
Jaanus Sellin 2023-04-12 09:43:05 +03:00 committed by GitHub
parent 15e5b983ac
commit 427030c390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 7 deletions

View File

@ -45,6 +45,12 @@ export const ChangeRequestHeader: FC<{ changeRequest: IChangeRequest }> = ({
/> />
</Tooltip> </Tooltip>
</Box> </Box>
<Typography
variant="body2"
sx={theme => ({ marginLeft: theme.spacing(0.5) })}
>
{changeRequest?.createdBy?.username}
</Typography>
<Box sx={theme => ({ marginLeft: theme.spacing(1.5) })}> <Box sx={theme => ({ marginLeft: theme.spacing(1.5) })}>
<StyledCard variant="outlined"> <StyledCard variant="outlined">
<Typography variant="body2" sx={{ lineHeight: 1 }}> <Typography variant="body2" sx={{ lineHeight: 1 }}>

View File

@ -1,13 +1,27 @@
import { UserAvatar } from '../../../../common/UserAvatar/UserAvatar'; import { UserAvatar } from 'component/common/UserAvatar/UserAvatar';
import { TextCell } from '../../../../common/Table/cells/TextCell/TextCell'; import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
import { styled, Typography } from '@mui/material';
const StyledContainer = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
margin: 0,
}));
export const AvatarCell = ({ value }: any) => { export const AvatarCell = ({ value }: any) => {
return ( return (
<TextCell> <TextCell>
<UserAvatar <StyledContainer>
user={value} <UserAvatar
sx={{ maxWidth: '30px', maxHeight: '30px', alignSelf: 'left' }} user={value}
/> sx={theme => ({ marginRight: theme.spacing(0.5) })}
/>
<Typography component={'span'} variant={'body2'}>
{' '}
{value?.username}
</Typography>
</StyledContainer>
</TextCell> </TextCell>
); );
}; };

View File

@ -108,7 +108,7 @@ export const ChangeRequestsTabs = ({
{ {
Header: 'By', Header: 'By',
accessor: 'createdBy', accessor: 'createdBy',
maxWidth: 50, maxWidth: 100,
canSort: false, canSort: false,
Cell: AvatarCell, Cell: AvatarCell,
align: 'center', align: 'center',