mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Ref: original & and use fileObj.meta
fileObj.meta is part of the ostrio:files API and be passed to the constructor. This is less hacky than trying tu update a persistet object after the fact.
This commit is contained in:
parent
16506e7a6a
commit
e702f17c7b
10 changed files with 124 additions and 159 deletions
|
|
@ -162,23 +162,21 @@ Utils = {
|
|||
})
|
||||
);
|
||||
},
|
||||
getCommonAttachmentMetaFrom(card) {
|
||||
let meta;
|
||||
if (card.isLinkedCard()) {
|
||||
meta.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
meta.cardId = card.linkedId;
|
||||
} else {
|
||||
meta.boardId = card.boardId;
|
||||
meta.swimlaneId = card.swimlaneId;
|
||||
meta.listId = card.listId;
|
||||
meta.cardId = card._id;
|
||||
}
|
||||
return meta;
|
||||
},
|
||||
MAX_IMAGE_PIXEL: Meteor.settings.public.MAX_IMAGE_PIXEL,
|
||||
COMPRESS_RATIO: Meteor.settings.public.IMAGE_COMPRESS_RATIO,
|
||||
addCommonMetaToAttachment(card, file) {
|
||||
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 = file.name;
|
||||
}
|
||||
},
|
||||
shrinkImage(options) {
|
||||
// shrink image to certain size
|
||||
const dataurl = options.dataurl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue