Skip to content

Missing changes for Connect 2.4.8 supporting release #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions connect/connectNotificationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ notificationServer.setConfig({ LOG_LEVEL: 'debug' });
// logger object used to log in parent thread
// the callback is function(error, userIds), where userIds is an array of user ids to receive notifications
const handler = (topic, message, logger, callback) => {
logger.debug(topic, 'topic');
logger.debug(message, 'message');
const projectId = message.projectId;
if (!projectId) {
return callback(new Error('Missing projectId in the event message.'));
Expand Down Expand Up @@ -324,20 +326,22 @@ const handler = (topic, message, logger, callback) => {
// if message has userId such messages will likely need userHandle and user full name
// so let's get it
const ids = [message.initiatorUserId];
logger.debug(message.userId, 'message.userId');
if (message.userId) {
ids.push(message.userId);
return service.getUsersById(ids);
}
return [];
return service.getUsersById(ids);
// return [];
}).then((users) => {
logger.debug(users, 'users');
_.map(allNotifications, (notification) => {
notification.version = eventConfig.version;
notification.contents.projectName = project.name;
notification.contents.timestamp = (new Date()).toISOString();
// if found a user then add user handle
if (users.length) {
const affectedUser = _.find(users, u => u.userId === message.userId);
const initiatorUser = _.find(users, u => u.userId === message.initiatorUserId);
const affectedUser = _.find(users, u => `${u.userId}` === message.userId);
const initiatorUser = _.find(users, u => `${u.userId}` === message.initiatorUserId);
if (affectedUser) {
notification.contents.userHandle = affectedUser.handle;
notification.contents.userFullName = `${affectedUser.firstName} ${affectedUser.lastName}`;
Expand Down
2 changes: 1 addition & 1 deletion emails/src/partials/invites.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<table class="main-child">
<tr>
<td class="empty-child-one"></td>
<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>
<td>You have been invited to a project by {{initiator.firstName}} {{initiator.lastName}}. To join, please register with Topcoder.</td>
</tr>
</table>
</td>
Expand Down