Merge pull request #1977 from hmhealey/plt1685

PLT-1685 Fixed handling of files with no extension
Этот коммит содержится в:
Corey Hulen
2016-01-25 10:40:39 -05:00
родитель d20f9f6ae1 68285cf1a9
Коммит 5478ea34e4
3 изменённых файлов: 32 добавлений и 8 удалений

Просмотреть файл

@@ -5,11 +5,16 @@ import * as Utils from '../utils/utils.jsx';
export default function FileInfoPreview({filename, fileUrl, fileInfo}) {
// non-image files include a section providing details about the file
let infoString = 'File type ' + fileInfo.extension.toUpperCase();
if (fileInfo.size > 0) {
infoString += ', Size ' + Utils.fileSizeToString(fileInfo.size);
const infoParts = [];
if (fileInfo.extension !== '') {
infoParts.push('File type ' + fileInfo.extension.toUpperCase());
}
infoParts.push('Size ' + Utils.fileSizeToString(fileInfo.size));
const infoString = infoParts.join(', ');
const name = decodeURIComponent(Utils.getFileName(filename));
return (