mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 01:28:49 +01:00
add a notification drawer like trello
This commit is contained in:
parent
29d62440a5
commit
9819c9f801
20 changed files with 701 additions and 257 deletions
100
server/publications/notifications.js
Normal file
100
server/publications/notifications.js
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
// We use these when displaying notifications in the notificationsDrawer
|
||||
|
||||
// gets all activities associated with the current user
|
||||
Meteor.publish('notificationActivities', () => {
|
||||
return activities();
|
||||
});
|
||||
|
||||
// gets all attachments associated with activities associated with the current user
|
||||
Meteor.publish('notificationAttachments', function() {
|
||||
return Attachments.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.attachmentId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all cards associated with activities associated with the current user
|
||||
Meteor.publish('notificationCards', function() {
|
||||
return Cards.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.cardId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all checklistItems associated with activities associated with the current user
|
||||
Meteor.publish('notificationChecklistItems', function() {
|
||||
return ChecklistItems.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.checklistItemId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all checklists associated with activities associated with the current user
|
||||
Meteor.publish('notificationChecklists', function() {
|
||||
return Checklists.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.checklistId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all comments associated with activities associated with the current user
|
||||
Meteor.publish('notificationComments', function() {
|
||||
return CardComments.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.commentId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all lists associated with activities associated with the current user
|
||||
Meteor.publish('notificationLists', function() {
|
||||
return Lists.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.listId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all swimlanes associated with activities associated with the current user
|
||||
Meteor.publish('notificationSwimlanes', function() {
|
||||
return Swimlanes.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.swimlaneId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// gets all users associated with activities associated with the current user
|
||||
Meteor.publish('notificationUsers', function() {
|
||||
return Users.find({
|
||||
_id: {
|
||||
$in: activities()
|
||||
.map(v => v.userId)
|
||||
.filter(v => !!v),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
function activities() {
|
||||
return Activities.find({
|
||||
_id: { $in: Meteor.user().profile.notifications.map(v => v.activity) },
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue