Prettier & eslint project style update

This commit is contained in:
Justin Reynolds 2019-06-28 12:52:09 -05:00
parent a0a482aa8e
commit 3eb4d2c341
116 changed files with 6216 additions and 5240 deletions

View file

@ -8,7 +8,18 @@ const postCatchError = Meteor.wrapAsync((url, options, resolve) => {
});
});
const webhooksAtbts = ( (process.env.WEBHOOKS_ATTRIBUTES && process.env.WEBHOOKS_ATTRIBUTES.split(',') ) || ['cardId', 'listId', 'oldListId', 'boardId', 'comment', 'user', 'card', 'commentId', 'swimlaneId']);
const webhooksAtbts = (process.env.WEBHOOKS_ATTRIBUTES &&
process.env.WEBHOOKS_ATTRIBUTES.split(',')) || [
'cardId',
'listId',
'oldListId',
'boardId',
'comment',
'user',
'card',
'commentId',
'swimlaneId',
];
Meteor.methods({
outgoingWebhooks(integrations, description, params) {
@ -18,13 +29,29 @@ Meteor.methods({
// label activity did not work yet, see wekan/models/activities.js
const quoteParams = _.clone(params);
['card', 'list', 'oldList', 'board', 'oldBoard', 'comment', 'checklist', 'swimlane', 'oldSwimlane', 'label', 'attachment'].forEach((key) => {
[
'card',
'list',
'oldList',
'board',
'oldBoard',
'comment',
'checklist',
'swimlane',
'oldSwimlane',
'label',
'attachment',
].forEach(key => {
if (quoteParams[key]) quoteParams[key] = `"${params[key]}"`;
});
const userId = (params.userId) ? params.userId : integrations[0].userId;
const userId = params.userId ? params.userId : integrations[0].userId;
const user = Users.findOne(userId);
const text = `${params.user} ${TAPi18n.__(description, quoteParams, user.getLanguage())}\n${params.url}`;
const text = `${params.user} ${TAPi18n.__(
description,
quoteParams,
user.getLanguage(),
)}\n${params.url}`;
if (text.length === 0) return;
@ -32,7 +59,7 @@ Meteor.methods({
text: `${text}`,
};
webhooksAtbts.forEach((key) => {
webhooksAtbts.forEach(key => {
if (params[key]) value[key] = params[key];
});
value.description = description;
@ -45,7 +72,7 @@ Meteor.methods({
data: value,
};
integrations.forEach((integration) => {
integrations.forEach(integration => {
const response = postCatchError(integration.url, options);
if (response && response.statusCode && response.statusCode === 200) {