in src/app/content-attachment-activity.js [37:74]
renderAttachmentThumbnail(activity, attachment) {
const uniqueKey = `${activity.id}${attachment.id}`;
const trimAttachmentsContext = url => {
const attachmentsPrefix = 'api/files';
return attachmentsPrefix + (url || '').split(attachmentsPrefix).pop();
};
const attachmentHref = `${filter.youTrackUrl}${trimAttachmentsContext(attachment.url)}`;
const hasPreview = previewWhiteList.indexOf(attachment.mimeType);
if (hasPreview >= 0) {
const thumbnailURL = `${filter.youTrackUrl}${trimAttachmentsContext(attachment.thumbnailURL)}`;
return (
<div
className="aw__activity__attachment__added-panel__thumbnail"
key={uniqueKey}
>
<Link
target={'_blank'}
href={attachmentHref}
>
<img width={96} height={64} src={thumbnailURL} alt={'preview'}/>
</Link>
</div>
);
} else {
return (
<Link
key={uniqueKey}
target={'_blank'}
href={attachmentHref}
>
{attachment.name}
</Link>
);
}
}