mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Add checklist items to activity log
This commit is contained in:
parent
01928bfe5a
commit
2b9bc5d046
4 changed files with 28 additions and 10 deletions
|
|
@ -32,6 +32,12 @@ template(name="boardActivities")
|
||||||
+viewer
|
+viewer
|
||||||
= checklist.title
|
= checklist.title
|
||||||
|
|
||||||
|
if($eq activityType 'addChecklistItem')
|
||||||
|
| {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
|
||||||
|
.activity-checklist(href="{{ card.absoluteUrl }}")
|
||||||
|
+viewer
|
||||||
|
= checklistItem.title
|
||||||
|
|
||||||
if($eq activityType 'archivedCard')
|
if($eq activityType 'archivedCard')
|
||||||
| {{{_ 'activity-archived' cardLink}}}.
|
| {{{_ 'activity-archived' cardLink}}}.
|
||||||
|
|
||||||
|
|
@ -117,6 +123,11 @@ template(name="cardActivities")
|
||||||
.activity-checklist
|
.activity-checklist
|
||||||
+viewer
|
+viewer
|
||||||
= checklist.title
|
= checklist.title
|
||||||
|
if($eq activityType 'addChecklistItem')
|
||||||
|
| {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
|
||||||
|
.activity-checklist(href="{{ card.absoluteUrl }}")
|
||||||
|
+viewer
|
||||||
|
= checklistItem.title
|
||||||
|
|
||||||
if($eq activityType 'addComment')
|
if($eq activityType 'addComment')
|
||||||
+inlinedForm(classNames='js-edit-comment')
|
+inlinedForm(classNames='js-edit-comment')
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
"activity-sent": "sent %s to %s",
|
"activity-sent": "sent %s to %s",
|
||||||
"activity-unjoined": "unjoined %s",
|
"activity-unjoined": "unjoined %s",
|
||||||
"activity-checklist-added": "added checklist to %s",
|
"activity-checklist-added": "added checklist to %s",
|
||||||
|
"activity-checklist-item-added": "added checklist item to '%s' in %s",
|
||||||
"add": "Add",
|
"add": "Add",
|
||||||
"add-attachment": "Add Attachment",
|
"add-attachment": "Add Attachment",
|
||||||
"add-board": "Add Board",
|
"add-board": "Add Board",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ Activities.helpers({
|
||||||
checklist() {
|
checklist() {
|
||||||
return Checklists.findOne(this.checklistId);
|
return Checklists.findOne(this.checklistId);
|
||||||
},
|
},
|
||||||
|
checklistItem() {
|
||||||
|
return Checklists.findOne(this.checklistId).getItem(this.checklistItemId);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Activities.before.insert((userId, doc) => {
|
Activities.before.insert((userId, doc) => {
|
||||||
|
|
|
||||||
|
|
@ -161,16 +161,19 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO: so there will be no activity for adding item into checklist, maybe will be implemented in the future.
|
//TODO: so there will be no activity for adding item into checklist, maybe will be implemented in the future.
|
||||||
// Checklists.after.update((userId, doc) => {
|
// The future is now
|
||||||
// console.log('update:', doc)
|
Checklists.after.update((userId, doc, fieldNames, modifier) => {
|
||||||
// Activities.insert({
|
if (fieldNames.includes('items')) {
|
||||||
// userId,
|
Activities.insert({
|
||||||
// activityType: 'addChecklist',
|
userId,
|
||||||
// boardId: doc.boardId,
|
activityType: 'addChecklistItem',
|
||||||
// cardId: doc.cardId,
|
cardId: doc.cardId,
|
||||||
// checklistId: doc._id,
|
boardId: Cards.findOne(doc.cardId).boardId,
|
||||||
// });
|
checklistId: doc._id,
|
||||||
// });
|
checklistItemId: modifier.$addToSet.items._id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Checklists.before.remove((userId, doc) => {
|
Checklists.before.remove((userId, doc) => {
|
||||||
const activity = Activities.findOne({ checklistId: doc._id });
|
const activity = Activities.findOne({ checklistId: doc._id });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue