Fixing file uploads and previews for new /team/ URL structure
Этот коммит содержится в:
@@ -19,6 +19,7 @@ module.exports = React.createClass({
|
|||||||
var filenameSplit = filename.split('.');
|
var filenameSplit = filename.split('.');
|
||||||
var ext = filenameSplit[filenameSplit.length-1];
|
var ext = filenameSplit[filenameSplit.length-1];
|
||||||
var type = utils.getFileType(ext);
|
var type = utils.getFileType(ext);
|
||||||
|
filename = window.location.origin + "/api/v1/files/get" + filename;
|
||||||
|
|
||||||
if (type === "image") {
|
if (type === "image") {
|
||||||
previews.push(
|
previews.push(
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ module.exports = React.createClass({
|
|||||||
var type = utils.getFileType(fileInfo.ext);
|
var type = utils.getFileType(fileInfo.ext);
|
||||||
|
|
||||||
// This is a temporary patch to fix issue with old files using absolute paths
|
// This is a temporary patch to fix issue with old files using absolute paths
|
||||||
if (fileInfo.path.indexOf("/api/v1/files/get") == -1) {
|
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
|
||||||
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
|
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
|
||||||
}
|
}
|
||||||
fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
|
fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
|
||||||
@@ -109,7 +109,7 @@ module.exports = React.createClass({
|
|||||||
var type = utils.getFileType(fileInfo.ext);
|
var type = utils.getFileType(fileInfo.ext);
|
||||||
|
|
||||||
// This is a temporary patch to fix issue with old files using absolute paths
|
// This is a temporary patch to fix issue with old files using absolute paths
|
||||||
if (fileInfo.path.indexOf("/api/v1/files/get") == -1) {
|
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
|
||||||
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
|
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
|
||||||
}
|
}
|
||||||
fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
|
fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ module.exports = React.createClass({
|
|||||||
src = this.props.filenames[id];
|
src = this.props.filenames[id];
|
||||||
} else {
|
} else {
|
||||||
var fileInfo = utils.splitFileLocation(this.props.filenames[id]);
|
var fileInfo = utils.splitFileLocation(this.props.filenames[id]);
|
||||||
|
// This is a temporary patch to fix issue with old files using absolute paths
|
||||||
|
if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
|
||||||
|
fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
|
||||||
|
}
|
||||||
|
fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
|
||||||
src = fileInfo['path'] + '_preview.jpg';
|
src = fileInfo['path'] + '_preview.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user