mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Move In Progress ostrio-files changes to separate branch, and revert ostrio-files changes, so that:
- Export to CSV/TSV with custom fields works - Attachments are not exported to disk - It is possible to build arm64/s390x versions again. Thanks to xet7 ! Related #3110
This commit is contained in:
parent
23dcd084a4
commit
d52affe658
22 changed files with 385 additions and 757 deletions
|
|
@ -61,38 +61,30 @@ Utils = {
|
|||
},
|
||||
MAX_IMAGE_PIXEL: Meteor.settings.public.MAX_IMAGE_PIXEL,
|
||||
COMPRESS_RATIO: Meteor.settings.public.IMAGE_COMPRESS_RATIO,
|
||||
processUploadedAttachment(card, fileObj, callbacks) {
|
||||
if (!card) {
|
||||
return onUploaded();
|
||||
}
|
||||
let settings = {
|
||||
file: fileObj,
|
||||
streams: 'dynamic',
|
||||
chunkSize: 'dynamic',
|
||||
};
|
||||
settings.meta = {
|
||||
uploading: true
|
||||
};
|
||||
if (card.isLinkedCard()) {
|
||||
settings.meta.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
settings.meta.cardId = card.linkedId;
|
||||
} else {
|
||||
settings.meta.boardId = card.boardId;
|
||||
settings.meta.swimlaneId = card.swimlaneId;
|
||||
settings.meta.listId = card.listId;
|
||||
settings.meta.cardId = card._id;
|
||||
}
|
||||
settings.meta.userId = Meteor.userId();
|
||||
if (typeof callbacks === 'function') {
|
||||
settings.onEnd = callbacks;
|
||||
} else {
|
||||
for (const key in callbacks) {
|
||||
if (key.substring(0, 2) === 'on') {
|
||||
settings[key] = callbacks[key];
|
||||
}
|
||||
processUploadedAttachment(card, fileObj, callback) {
|
||||
const next = attachment => {
|
||||
if (typeof callback === 'function') {
|
||||
callback(attachment);
|
||||
}
|
||||
};
|
||||
if (!card) {
|
||||
return next();
|
||||
}
|
||||
Attachments.insert(settings);
|
||||
const file = new FS.File(fileObj);
|
||||
if (card.isLinkedCard()) {
|
||||
file.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
file.cardId = card.linkedId;
|
||||
} else {
|
||||
file.boardId = card.boardId;
|
||||
file.swimlaneId = card.swimlaneId;
|
||||
file.listId = card.listId;
|
||||
file.cardId = card._id;
|
||||
}
|
||||
file.userId = Meteor.userId();
|
||||
if (file.original) {
|
||||
file.original.name = fileObj.name;
|
||||
}
|
||||
return next(Attachments.insert(file));
|
||||
},
|
||||
shrinkImage(options) {
|
||||
// shrink image to certain size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue