Skip to content

Commit

Permalink
Merge pull request #1019 from gchq/dev/update-release-file-sectio
Browse files Browse the repository at this point in the history
resolved issue with file names on releases having long names
  • Loading branch information
ARADDCC002 authored Jan 23, 2024
2 parents 2d957f3 + 4ca505d commit 54ce172
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions frontend/src/model/beta/releases/ReleaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,32 +167,29 @@ export default function ReleaseForm({
)}
{isReadOnly &&
formData.files.map((file) => (
<Grid container spacing={1} alignItems='center' key={file.name}>
<Grid item xs>
{isFileInterface(file) && (
<Tooltip title={file.name}>
<Link
href={`/api/v2/model/${model.id}/file/${file._id}/download`}
data-test={`fileLink-${file.name}`}
>
<Typography noWrap textOverflow='ellipsis' display='inline'>
{file.name}
</Typography>
</Link>
</Tooltip>
)}
{!isFileInterface(file) && (
<Tooltip title='There was a problem finding the ID for this file.'>
<Typography noWrap textOverflow='ellipsis' display='inline'>
{file.name}
</Typography>
</Tooltip>
)}
</Grid>
<Grid item xs={1} textAlign='right'>
<Typography variant='caption'>{prettyBytes(file.size)}</Typography>
</Grid>
</Grid>
<>
{isFileInterface(file) && (
<Grid container spacing={1} alignItems='center' key={file.name}>
<Grid item xs={11}>
{isFileInterface(file) && (
<Tooltip title={file.name}>
<Link
href={`/api/v2/model/${model.id}/file/${file._id}/download`}
data-test={`fileLink-${file.name}`}
>
<Typography noWrap textOverflow='ellipsis'>
{file.name}
</Typography>
</Link>
</Tooltip>
)}
</Grid>
<Grid item xs={1} textAlign='right'>
<Typography variant='caption'>{prettyBytes(file.size)}</Typography>
</Grid>
</Grid>
)}
</>
))}
{isReadOnly && formData.files.length === 0 && <ReadOnlyAnswer value='No files' />}
</Stack>
Expand Down

0 comments on commit 54ce172

Please sign in to comment.