2021-04-12 11:44:28 +02:00
|
|
|
import Boards from '/models/boards';
|
|
|
|
|
import Actions from '/models/actions';
|
|
|
|
|
import Triggers from '/models/triggers';
|
|
|
|
|
import Rules from '/models/rules';
|
2026-01-28 13:20:28 +02:00
|
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
2021-04-12 11:44:28 +02: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
|
|
|
Meteor.publish('rules', async function(ruleId) {
|
2018-09-16 01:50:36 +03:00
|
|
|
check(ruleId, String);
|
2026-01-18 20:18:38 +02:00
|
|
|
|
|
|
|
|
if (!this.userId) {
|
|
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const rule = await ReactiveCache.getRule(ruleId);
|
2026-01-18 20:18:38 +02:00
|
|
|
if (!rule) {
|
|
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const board = await ReactiveCache.getBoard(rule.boardId);
|
2026-01-18 20:18:38 +02:00
|
|
|
if (!board || !board.isVisibleBy(this.userId)) {
|
|
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const ret = await ReactiveCache.getRules(
|
2023-03-12 18:17:23 +01:00
|
|
|
{
|
|
|
|
|
_id: ruleId,
|
|
|
|
|
},
|
|
|
|
|
{},
|
|
|
|
|
true,
|
|
|
|
|
);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2018-08-03 19:47:20 +02: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
|
|
|
Meteor.publish('allRules', async function() {
|
|
|
|
|
if (!this.userId || !(await ReactiveCache.getUser(this.userId)).isAdmin) {
|
2026-01-18 20:18:38 +02:00
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const ret = await ReactiveCache.getRules({}, {}, true);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2018-08-03 19:47:20 +02: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
|
|
|
Meteor.publish('allTriggers', async function() {
|
|
|
|
|
if (!this.userId || !(await ReactiveCache.getUser(this.userId)).isAdmin) {
|
2026-01-18 20:18:38 +02:00
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const ret = await ReactiveCache.getTriggers({}, {}, true);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2018-08-03 19:47:20 +02:00
|
|
|
});
|
2018-09-14 16:49:06 +02: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
|
|
|
Meteor.publish('allActions', async function() {
|
|
|
|
|
if (!this.userId || !(await ReactiveCache.getUser(this.userId)).isAdmin) {
|
2026-01-18 20:18:38 +02:00
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const ret = await ReactiveCache.getActions({}, {}, true);
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2018-09-16 01:50:36 +03:00
|
|
|
});
|
2021-04-12 11:44:28 +02: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
|
|
|
Meteor.publish('rulesReport', async function() {
|
|
|
|
|
if (!this.userId || !(await ReactiveCache.getUser(this.userId)).isAdmin) {
|
2026-01-18 20:18:38 +02:00
|
|
|
return this.ready();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const rules = await ReactiveCache.getRules({}, {}, true);
|
2021-04-12 11:44:28 +02:00
|
|
|
const actionIds = [];
|
|
|
|
|
const triggerIds = [];
|
|
|
|
|
const boardIds = [];
|
|
|
|
|
|
|
|
|
|
rules.forEach(rule => {
|
|
|
|
|
actionIds.push(rule.actionId);
|
|
|
|
|
triggerIds.push(rule.triggerId);
|
|
|
|
|
boardIds.push(rule.boardId);
|
|
|
|
|
});
|
|
|
|
|
|
2023-03-11 19:32:16 +01:00
|
|
|
const ret = [
|
2021-04-12 11:44:28 +02:00
|
|
|
rules,
|
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
|
|
|
await ReactiveCache.getActions({ _id: { $in: actionIds } }, {}, true),
|
|
|
|
|
await ReactiveCache.getTriggers({ _id: { $in: triggerIds } }, {}, true),
|
|
|
|
|
await ReactiveCache.getBoards({ _id: { $in: boardIds } }, { fields: { title: 1 } }, true),
|
2021-04-12 11:44:28 +02:00
|
|
|
];
|
2023-03-11 19:32:16 +01:00
|
|
|
return ret;
|
2021-04-12 11:44:28 +02:00
|
|
|
});
|