From bfa15d471953471b4cb6fd478cb4170f064ed70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20Engstr=C3=B6m?= Date: Sun, 12 Nov 2023 09:59:35 +0100 Subject: [PATCH 1/2] Added missing activity Type: restoredList --- models/lists.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/models/lists.js b/models/lists.js index 789f0f2de..04ef81b4c 100644 --- a/models/lists.js +++ b/models/lists.js @@ -465,6 +465,17 @@ if (Meteor.isServer) { // list is deleted title: doc.title, }); + } else { + Activities.insert({ + userId, + type: 'list', + activityType: 'restoredList', + listId: doc._id, + boardId: doc.boardId, + // this preserves the name so that the activity can be useful after the + // list is deleted + title: doc.title, + }); } }); } From 1dd97ebd49b44e454f3faf779a28ccbd84a264e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20Engstr=C3=B6m?= Date: Sun, 12 Nov 2023 20:42:25 +0100 Subject: [PATCH 2/2] Added restore list and change list title to webhooks --- models/lists.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/models/lists.js b/models/lists.js index 04ef81b4c..49b456f2a 100644 --- a/models/lists.js +++ b/models/lists.js @@ -453,8 +453,19 @@ if (Meteor.isServer) { }); }); - Lists.after.update((userId, doc) => { - if (doc.archived) { + Lists.after.update((userId, doc, fieldNames) => { + if (fieldNames.includes('title')) { + Activities.insert({ + userId, + type: 'list', + activityType: 'changedListTitle', + listId: doc._id, + boardId: doc.boardId, + // this preserves the name so that the activity can be useful after the + // list is deleted + title: doc.title, + }); + } else if (doc.archived) { Activities.insert({ userId, type: 'list', @@ -465,7 +476,7 @@ if (Meteor.isServer) { // list is deleted title: doc.title, }); - } else { + } else if (fieldNames.includes('archived')) { Activities.insert({ userId, type: 'list',