summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.meteor/packages1
-rw-r--r--.meteor/versions1
-rw-r--r--client/components/activities/activities.js2
-rw-r--r--models/activities.js6
-rw-r--r--models/attachments.js21
5 files changed, 9 insertions, 22 deletions
diff --git a/.meteor/packages b/.meteor/packages
index ba278f34..b0df2be8 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -98,3 +98,4 @@ percolate:synced-cron
easylogic:summernote
cfs:filesystem
ostrio:cookies
+ostrio:files
diff --git a/.meteor/versions b/.meteor/versions
index 5157f679..23aa4804 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -134,6 +134,7 @@ observe-sequence@1.0.16
ongoworks:speakingurl@1.1.0
ordered-dict@1.1.0
ostrio:cookies@2.6.0
+ostrio:files@1.14.2
peerlibrary:assert@0.3.0
peerlibrary:base-component@0.16.0
peerlibrary:blaze-components@0.15.1
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index 72af4c35..186200ec 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -163,7 +163,7 @@ BlazeComponent.extendComponent({
href: link,
target: '_blank',
},
- attachment.name(),
+ attachment.name,
),
)) ||
this.currentData().activity.attachmentName
diff --git a/models/activities.js b/models/activities.js
index df207bca..2663dd29 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -217,11 +217,7 @@ if (Meteor.isServer) {
}
if (activity.attachmentId) {
const attachment = activity.attachment();
- if (attachment.original) {
- params.attachment = attachment.original.name;
- } else {
- params.attachment = attachment.versions.original.name;
- }
+ params.attachment = attachment.name;
params.attachmentId = attachment._id;
}
if (activity.checklistId) {
diff --git a/models/attachments.js b/models/attachments.js
index cab3d9e3..d469f702 100644
--- a/models/attachments.js
+++ b/models/attachments.js
@@ -8,8 +8,7 @@ Attachments = new FilesCollection({
allowClientCode: true,
collectionName: 'attachments2',
onAfterUpload: onAttachmentUploaded,
- onBeforeRemove: onAttachmentRemoving,
- onAfterRemove: onAttachmentRemoved
+ onBeforeRemove: onAttachmentRemoving
});
if (Meteor.isServer) {
@@ -41,9 +40,9 @@ function onAttachmentUploaded(fileRef) {
type: 'card',
activityType: 'addAttachment',
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
- attachmentName: fileRef.versions.original.name,
+ attachmentName: fileRef.name,
boardId: fileRef.meta.boardId,
cardId: fileRef.meta.cardId,
listId: fileRef.meta.listId,
@@ -73,9 +72,9 @@ function onAttachmentRemoving(cursor) {
type: 'card',
activityType: 'deleteAttachment',
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
- attachmentName: file.versions.original.name,
+ attachmentName: file.name,
boardId: meta.boardId,
cardId: meta.cardId,
listId: meta.listId,
@@ -84,14 +83,4 @@ function onAttachmentRemoving(cursor) {
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;