PLT-6924 Added ability to disable file uploads/downloads on old mobile apps (#7117)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
3998659236
Коммит
fb2022fb1c
@@ -1,25 +1,26 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import AudioVideoPreview from './audio_video_preview.jsx';
|
||||
import CodePreview from './code_preview.jsx';
|
||||
import PDFPreview from './pdf_preview.jsx';
|
||||
import FileInfoPreview from './file_info_preview.jsx';
|
||||
import ViewImagePopoverBar from './view_image_popover_bar.jsx';
|
||||
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
import {getFileUrl, getFilePreviewUrl} from 'mattermost-redux/utils/file_utils';
|
||||
|
||||
import Constants from 'utils/constants.jsx';
|
||||
const KeyCodes = Constants.KeyCodes;
|
||||
|
||||
import $ from 'jquery';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {Modal} from 'react-bootstrap';
|
||||
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
|
||||
import * as FileUtils from 'utils/file_utils';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
|
||||
import {KeyCodes} from 'utils/constants.jsx';
|
||||
|
||||
import {getFileUrl, getFilePreviewUrl} from 'mattermost-redux/utils/file_utils';
|
||||
|
||||
import AudioVideoPreview from './audio_video_preview.jsx';
|
||||
import CodePreview from './code_preview.jsx';
|
||||
import FileInfoPreview from './file_info_preview.jsx';
|
||||
import PDFPreview from './pdf_preview.jsx';
|
||||
import ViewImagePopoverBar from './view_image_popover_bar.jsx';
|
||||
|
||||
import loadingGif from 'images/load.gif';
|
||||
|
||||
export default class ViewImageModal extends React.Component {
|
||||
@@ -350,6 +351,10 @@ function ImagePreview({fileInfo, fileUrl}) {
|
||||
previewUrl = fileUrl;
|
||||
}
|
||||
|
||||
if (!FileUtils.canDownloadFiles()) {
|
||||
return <img src={previewUrl}/>;
|
||||
}
|
||||
|
||||
return (
|
||||
<a
|
||||
href={fileUrl}
|
||||
|
||||
Ссылка в новой задаче
Block a user