[MM-55165] Remove target=_blank from file preview links (#25317)

This commit is contained in:
Devin Binnie 2023-11-09 09:21:13 -05:00 committed by GitHub
parent dc269f244e
commit 8bf0c19714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -4,10 +4,9 @@ exports[`components/FileInfoPreview should match snapshot, can download files 1`
<div <div
className="file-details__container" className="file-details__container"
> >
<ExternalLink <a
className="file-details__preview" className="file-details__preview"
href="https://pre-release.mattermost.com/api/v4/files/rqir81f7a7ft8m6j6ej7g1txuo" href="https://pre-release.mattermost.com/api/v4/files/rqir81f7a7ft8m6j6ej7g1txuo"
location="file_info_preview"
> >
<span <span
className="file-details__preview-helper" className="file-details__preview-helper"
@ -16,7 +15,7 @@ exports[`components/FileInfoPreview should match snapshot, can download files 1`
alt="file preview" alt="file preview"
src={null} src={null}
/> />
</ExternalLink> </a>
<div <div
className="file-details" className="file-details"
> >

View File

@ -5,8 +5,6 @@ import React from 'react';
import type {FileInfo} from '@mattermost/types/files'; import type {FileInfo} from '@mattermost/types/files';
import ExternalLink from 'components/external_link';
import * as Utils from 'utils/utils'; import * as Utils from 'utils/utils';
type Props = { type Props = {
@ -36,17 +34,16 @@ export default class FileInfoPreview extends React.PureComponent<Props> {
let preview = null; let preview = null;
if (this.props.canDownloadFiles) { if (this.props.canDownloadFiles) {
preview = ( preview = (
<ExternalLink <a
className='file-details__preview' className='file-details__preview'
href={fileUrl} href={fileUrl}
location='file_info_preview'
> >
<span className='file-details__preview-helper'/> <span className='file-details__preview-helper'/>
<img <img
alt={'file preview'} alt={'file preview'}
src={Utils.getFileIconPath(fileInfo)} src={Utils.getFileIconPath(fileInfo)}
/> />
</ExternalLink> </a>
); );
} else { } else {
preview = ( preview = (