Skip to content

Commit d814cf4

Browse files
author
vikasrohit
authored
Merge pull request #80 from topcoder-platform/dev
Missing changes for Connect 2.4.8 supporting release
2 parents 5bcb288 + 945ba69 commit d814cf4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

connect/connectNotificationServer.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ notificationServer.setConfig({ LOG_LEVEL: 'debug' });
275275
// logger object used to log in parent thread
276276
// the callback is function(error, userIds), where userIds is an array of user ids to receive notifications
277277
const handler = (topic, message, logger, callback) => {
278+
logger.debug(topic, 'topic');
279+
logger.debug(message, 'message');
278280
const projectId = message.projectId;
279281
if (!projectId) {
280282
return callback(new Error('Missing projectId in the event message.'));
@@ -324,20 +326,22 @@ const handler = (topic, message, logger, callback) => {
324326
// if message has userId such messages will likely need userHandle and user full name
325327
// so let's get it
326328
const ids = [message.initiatorUserId];
329+
logger.debug(message.userId, 'message.userId');
327330
if (message.userId) {
328331
ids.push(message.userId);
329-
return service.getUsersById(ids);
330332
}
331-
return [];
333+
return service.getUsersById(ids);
334+
// return [];
332335
}).then((users) => {
336+
logger.debug(users, 'users');
333337
_.map(allNotifications, (notification) => {
334338
notification.version = eventConfig.version;
335339
notification.contents.projectName = project.name;
336340
notification.contents.timestamp = (new Date()).toISOString();
337341
// if found a user then add user handle
338342
if (users.length) {
339-
const affectedUser = _.find(users, u => u.userId === message.userId);
340-
const initiatorUser = _.find(users, u => u.userId === message.initiatorUserId);
343+
const affectedUser = _.find(users, u => `${u.userId}` === message.userId);
344+
const initiatorUser = _.find(users, u => `${u.userId}` === message.initiatorUserId);
341345
if (affectedUser) {
342346
notification.contents.userHandle = affectedUser.handle;
343347
notification.contents.userFullName = `${affectedUser.firstName} ${affectedUser.lastName}`;

emails/src/partials/invites.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<table class="main-child">
3131
<tr>
3232
<td class="empty-child-one"></td>
33-
<td>You are invited to join the <strong>{{projectName}}</strong> on Topcoder Connect. To join the project, please register for a Topcoder account using <strong>Register</strong> button below.</td>
33+
<td>You have been invited to a project by {{initiator.firstName}} {{initiator.lastName}}. To join, please register with Topcoder.</td>
3434
</tr>
3535
</table>
3636
</td>

0 commit comments

Comments
 (0)