mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Attachment activities merging done
This commit is contained in:
parent
c3458855bd
commit
012ca39a8d
5 changed files with 9 additions and 22 deletions
|
|
@ -98,3 +98,4 @@ percolate:synced-cron
|
||||||
easylogic:summernote
|
easylogic:summernote
|
||||||
cfs:filesystem
|
cfs:filesystem
|
||||||
ostrio:cookies
|
ostrio:cookies
|
||||||
|
ostrio:files
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ observe-sequence@1.0.16
|
||||||
ongoworks:speakingurl@1.1.0
|
ongoworks:speakingurl@1.1.0
|
||||||
ordered-dict@1.1.0
|
ordered-dict@1.1.0
|
||||||
ostrio:cookies@2.6.0
|
ostrio:cookies@2.6.0
|
||||||
|
ostrio:files@1.14.2
|
||||||
peerlibrary:assert@0.3.0
|
peerlibrary:assert@0.3.0
|
||||||
peerlibrary:base-component@0.16.0
|
peerlibrary:base-component@0.16.0
|
||||||
peerlibrary:blaze-components@0.15.1
|
peerlibrary:blaze-components@0.15.1
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ BlazeComponent.extendComponent({
|
||||||
href: link,
|
href: link,
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
},
|
},
|
||||||
attachment.name(),
|
attachment.name,
|
||||||
),
|
),
|
||||||
)) ||
|
)) ||
|
||||||
this.currentData().activity.attachmentName
|
this.currentData().activity.attachmentName
|
||||||
|
|
|
||||||
|
|
@ -217,11 +217,7 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
if (activity.attachmentId) {
|
if (activity.attachmentId) {
|
||||||
const attachment = activity.attachment();
|
const attachment = activity.attachment();
|
||||||
if (attachment.original) {
|
params.attachment = attachment.name;
|
||||||
params.attachment = attachment.original.name;
|
|
||||||
} else {
|
|
||||||
params.attachment = attachment.versions.original.name;
|
|
||||||
}
|
|
||||||
params.attachmentId = attachment._id;
|
params.attachmentId = attachment._id;
|
||||||
}
|
}
|
||||||
if (activity.checklistId) {
|
if (activity.checklistId) {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ Attachments = new FilesCollection({
|
||||||
allowClientCode: true,
|
allowClientCode: true,
|
||||||
collectionName: 'attachments2',
|
collectionName: 'attachments2',
|
||||||
onAfterUpload: onAttachmentUploaded,
|
onAfterUpload: onAttachmentUploaded,
|
||||||
onBeforeRemove: onAttachmentRemoving,
|
onBeforeRemove: onAttachmentRemoving
|
||||||
onAfterRemove: onAttachmentRemoved
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
|
@ -41,9 +40,9 @@ function onAttachmentUploaded(fileRef) {
|
||||||
type: 'card',
|
type: 'card',
|
||||||
activityType: 'addAttachment',
|
activityType: 'addAttachment',
|
||||||
attachmentId: fileRef._id,
|
attachmentId: fileRef._id,
|
||||||
// this preserves the name so that notifications can be meaningful after
|
// this preserves the name so that notifications can be meaningful after
|
||||||
// this file is removed
|
// this file is removed
|
||||||
attachmentName: fileRef.versions.original.name,
|
attachmentName: fileRef.name,
|
||||||
boardId: fileRef.meta.boardId,
|
boardId: fileRef.meta.boardId,
|
||||||
cardId: fileRef.meta.cardId,
|
cardId: fileRef.meta.cardId,
|
||||||
listId: fileRef.meta.listId,
|
listId: fileRef.meta.listId,
|
||||||
|
|
@ -73,9 +72,9 @@ function onAttachmentRemoving(cursor) {
|
||||||
type: 'card',
|
type: 'card',
|
||||||
activityType: 'deleteAttachment',
|
activityType: 'deleteAttachment',
|
||||||
attachmentId: file._id,
|
attachmentId: file._id,
|
||||||
// this preserves the name so that notifications can be meaningful after
|
// this preserves the name so that notifications can be meaningful after
|
||||||
// this file is removed
|
// this file is removed
|
||||||
attachmentName: file.versions.original.name,
|
attachmentName: file.name,
|
||||||
boardId: meta.boardId,
|
boardId: meta.boardId,
|
||||||
cardId: meta.cardId,
|
cardId: meta.cardId,
|
||||||
listId: meta.listId,
|
listId: meta.listId,
|
||||||
|
|
@ -84,14 +83,4 @@ function onAttachmentRemoving(cursor) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAttachmentRemoved(files) {
|
|
||||||
// Don't know why we need to remove the activity
|
|
||||||
/* for (let i in files) {
|
|
||||||
let doc = files[i];
|
|
||||||
Activities.remove({
|
|
||||||
attachmentId: doc._id,
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Attachments;
|
export default Attachments;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue