Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 8a2ff0b

Browse files
author
Vikas Agarwal
committed
Github issue#893, CoderBot message changes
1 parent 25a3a6e commit 8a2ff0b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/common/constants.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ module.exports = {
150150
created: {
151151
title: 'Your project has been created, and we\'re ready for your specification',
152152
content: data => `Hello, Coder here! Your project '${data.projectName}' has been created successfully. For your next step, please head over to the <a href="${data.projectUrl}specification/" rel="nofollow">Specification</a> section and answer all of the required questions. If you already have a document with your requirements, just verify it against our checklist and then upload it. Once you're done, hit the "Submit for Review" button on the Specification. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.`,
153+
disabled: true,
153154
},
154155
submittedForReview: {
155-
title: 'Your project has been submitted for review',
156-
content: data => `Hello, it's Coder again. Thanks for submitting your project <a href="${data.projectUrl}" rel="nofollow">${data.projectName}</a>! I've used my super computational powers to route it to one of our trusty humans. They'll get back to you in 1-2 business days.`,
156+
title: 'Your project is being reviewed. Provide additional info if you have it.',
157+
content: data => `Hello, Coder here! Thanks for submitting your project <a href="${data.projectUrl}" rel="nofollow">${data.projectName}</a>! I've used my super computational powers to route it to one of our trusty humans. They'll get back to you in 1-2 business days. Meanwhile, if have any additional project information or documents to upload, please head over to the <a href="${data.projectUrl}specification/" rel="nofollow">Specification</a> section. Get stuck or need help? Email us at <a href="mailto:support@topcoder.com?subject=Question%20Regarding%20My%20New%20Topcoder%20Connect%20Project" rel="nofollow">support@topcoder.com</a>.`,
157158
},
158159
activated: {
159160
title: 'Work on your project has begun',

src/handlers/projectEvents.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@ const util = require('./util');
1818
* @return {Array} the array of notifications
1919
*/
2020
function projectDraftCreated(logger, project) {
21+
const notifications = {
22+
discourse: [],
23+
};
2124
const topic = constants.notifications.discourse.project.created;
2225
const topicData = {
2326
projectName: project.name,
2427
projectUrl: `https://connect.${config.get('AUTH_DOMAIN')}/projects/${project.id}/`,
2528
};
26-
// return notificaiton object with discourse data
27-
const notifications = {
28-
discourse: [{
29+
if (topic && !topic.disabled) {
30+
// return notificaiton object with discourse data
31+
notifications.discourse.push({
2932
projectId: project.id,
3033
title: topic.title,
3134
content: topic.content(topicData),
32-
}],
33-
};
35+
});
36+
}
3437
return notifications;
3538
}
3639

@@ -88,8 +91,8 @@ function* projectUpdated(logger, data) {
8891
topic = constants.notifications.discourse.project.completed;
8992
}
9093

91-
// post to discourse if topic is set
92-
if (topic) {
94+
// post to discourse if topic is set and is not disabled
95+
if (topic && !topic.disabled) {
9396
const topicData = {
9497
projectName: project.name,
9598
projectUrl: `https://connect.${config.get('AUTH_DOMAIN')}/projects/${project.id}/`,

0 commit comments

Comments
 (0)