2023-01-16 23:00:10 +01:00
|
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
|
|
2020-03-27 11:35:03 -06:00
|
|
|
// We use these when displaying notifications in the notificationsDrawer
|
|
|
|
|
|
|
|
|
|
// gets all activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationActivities', async () => {
|
|
|
|
|
const ret = await activities();
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all attachments associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationAttachments', async function() {
|
|
|
|
|
const ret = (await ReactiveCache.getAttachments(
|
2023-03-12 18:33:38 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 18:33:38 +01:00
|
|
|
.map(v => v.attachmentId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{},
|
|
|
|
|
true,
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
)).cursor;
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all cards associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationCards', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getCards(
|
2023-03-12 11:25:15 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 11:25:15 +01:00
|
|
|
.map(v => v.cardId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 11:25:15 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all checklistItems associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationChecklistItems', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getChecklistItems(
|
2023-03-12 18:06:39 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 18:06:39 +01:00
|
|
|
.map(v => v.checklistItemId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 18:06:39 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all checklists associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationChecklists', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getChecklists(
|
2023-03-12 18:07:50 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 18:07:50 +01:00
|
|
|
.map(v => v.checklistId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 18:07:50 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all comments associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationComments', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getCardComments(
|
2023-03-12 18:28:39 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 18:28:39 +01:00
|
|
|
.map(v => v.commentId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 18:28:39 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all lists associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationLists', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getLists(
|
2023-03-12 11:52:31 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 11:52:31 +01:00
|
|
|
.map(v => v.listId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 11:52:31 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all swimlanes associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationSwimlanes', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getSwimlanes(
|
2023-03-12 11:55:40 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 11:55:40 +01:00
|
|
|
.map(v => v.swimlaneId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2023-03-12 11:55:40 +01:00
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// gets all users associated with activities associated with the current user
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
Meteor.publish('notificationUsers', async function() {
|
|
|
|
|
const ret = await ReactiveCache.getUsers(
|
2023-03-12 11:59:23 +01:00
|
|
|
{
|
|
|
|
|
_id: {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
$in: (await activities())
|
2023-03-12 11:59:23 +01:00
|
|
|
.map(v => v.userId)
|
|
|
|
|
.filter(v => !!v),
|
|
|
|
|
},
|
2020-03-27 11:35:03 -06:00
|
|
|
},
|
2026-02-19 23:25:39 +02:00
|
|
|
{
|
|
|
|
|
fields: {
|
|
|
|
|
username: 1,
|
|
|
|
|
'profile.fullname': 1,
|
|
|
|
|
'profile.avatarUrl': 1,
|
|
|
|
|
'profile.initials': 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-03-12 11:59:23 +01:00
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
});
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function activities() {
|
|
|
|
|
const activityIds = (await ReactiveCache.getCurrentUser())?.profile?.notifications?.map(v => v.activity) || [];
|
2023-03-26 09:50:00 +02:00
|
|
|
let ret = [];
|
|
|
|
|
if (activityIds.length > 0) {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ret = await ReactiveCache.getActivities(
|
2023-03-12 18:27:27 +01:00
|
|
|
{
|
|
|
|
|
_id: { $in: activityIds },
|
|
|
|
|
},
|
|
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-26 09:50:00 +02:00
|
|
|
}
|
2023-03-12 18:27:27 +01:00
|
|
|
return ret;
|
2020-03-27 11:35:03 -06:00
|
|
|
}
|