mirror of
https://github.com/wekan/wekan.git
synced 2026-02-20 23:14:07 +01:00
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
69 lines
1.6 KiB
JavaScript
69 lines
1.6 KiB
JavaScript
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
Meteor.publish('globalwebhooks', async () => {
|
|
const boardId = Integrations.Const.GLOBAL_WEBHOOK_ID;
|
|
const ret = await ReactiveCache.getIntegrations(
|
|
{
|
|
boardId,
|
|
},
|
|
{},
|
|
true,
|
|
);
|
|
return ret;
|
|
});
|
|
Meteor.publish('setting', () => {
|
|
const ret = Settings.find(
|
|
{},
|
|
{
|
|
fields: {
|
|
disableRegistration: 1,
|
|
disableForgotPassword: 1,
|
|
productName: 1,
|
|
hideLogo: 1,
|
|
hideCardCounterList: 1,
|
|
hideBoardMemberList: 1,
|
|
customLoginLogoImageUrl: 1,
|
|
customLoginLogoLinkUrl: 1,
|
|
customHelpLinkUrl: 1,
|
|
textBelowCustomLoginLogo: 1,
|
|
automaticLinkedUrlSchemes: 1,
|
|
customTopLeftCornerLogoImageUrl: 1,
|
|
customTopLeftCornerLogoLinkUrl: 1,
|
|
customTopLeftCornerLogoHeight: 1,
|
|
customHTMLafterBodyStart: 1,
|
|
customHTMLbeforeBodyEnd: 1,
|
|
displayAuthenticationMethod: 1,
|
|
defaultAuthenticationMethod: 1,
|
|
spinnerName: 1,
|
|
oidcBtnText: 1,
|
|
mailDomainName: 1,
|
|
legalNotice: 1,
|
|
accessibilityPageEnabled: 1,
|
|
accessibilityTitle: 1,
|
|
accessibilityContent: 1,
|
|
},
|
|
},
|
|
);
|
|
return ret;
|
|
});
|
|
|
|
Meteor.publish('mailServer', async function() {
|
|
const user = await ReactiveCache.getCurrentUser();
|
|
|
|
let ret = []
|
|
if (user && user.isAdmin) {
|
|
ret = Settings.find(
|
|
{},
|
|
{
|
|
fields: {
|
|
'mailServer.host': 1,
|
|
'mailServer.port': 1,
|
|
'mailServer.username': 1,
|
|
'mailServer.enableTLS': 1,
|
|
'mailServer.from': 1,
|
|
},
|
|
},
|
|
);
|
|
}
|
|
return ret;
|
|
});
|