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

Release dev to qa #439

Merged
merged 8 commits into from
Jun 15, 2015
Merged
8 changes: 6 additions & 2 deletions actions/challengeRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,12 @@ var sendNotificationEmail = function (api, componentInfo, userId, activeForumCat
forumURL = api.config.tcConfig.studioForumsUrlPrefix + activeForumCategoryId;
submitURL = process.env.TC_STUDIO_SERVER_NAME + '/?module=ViewContestDetails&ct=' + challengeId;
}

template = 'registration_notification_email';

if (componentInfo.review_type && componentInfo.review_type == 'PEER')
template = 'peer_review_registration';
else
template = 'registration_notification_email';

if (challengeType === CHALLENGE_TYPE.DESIGN) {
template = 'design_registration_notification_email';
// Get forum type
Expand Down
8 changes: 2 additions & 6 deletions actions/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,9 @@ var addFilter = function (sql, filter, isMyChallenges, helper, caller) {

if (_.isDefined(filter.review)) {
review = "'" + filter.review.toUpperCase().replace(/,/g, "','") + "'";
sql.count = editSql(sql.count, REVIEW_FILTER, review);
sql.data = editSql(sql.data, REVIEW_FILTER, review);
}
else {
review = "'COMMUNITY','INTERNAL'";
}

sql.count = editSql(sql.count, REVIEW_FILTER, review);
sql.data = editSql(sql.data, REVIEW_FILTER, review);

if (isMyChallenges) {
sql.count = editSql(sql.count, MY_CHALLENGES_FILTER, null);
Expand Down
18 changes: 16 additions & 2 deletions actions/memberRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var bignum = require("bignum");
var _ = require("underscore");
var IllegalArgumentError = require('../errors/IllegalArgumentError');
var BadRequestError = require('../errors/BadRequestError');
var request = require('request');

/**
* The max surname length
Expand Down Expand Up @@ -1150,8 +1151,21 @@ exports.memberRegister = {
if (err) {
api.helper.handleError(api, connection, err);
} else {
api.log("Member registration succeeded.", "debug");
connection.response = {userId : result};
var finalize = function() {
api.log("Member registration succeeded.", "debug");
connection.response = {userId : result};
};

if (connection.params.regSource !== null && connection.params.regSource === 'apple') {
request.post({
headers: { 'Authorization' : 'Bearer ' + connection.rawConnection.req.headers.authorization },
url: 'https://api.' + api.config.tcConfig.oauthDomain + '.com/v3/memberCert/registrations/' + result + '/programs/3445'
},
function(error, response, body) {
finalize();
});
}
else finalize();
}

next(connection, true);
Expand Down
14 changes: 14 additions & 0 deletions mail_templates/peer_registration/html.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<p>Hi <%= userName %>,</p>

<p>Congratulations! You are now registered for <%= projectName %> Challenge.</p>

<p>You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early!</p>

<p>The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored.</p>

<p>Need more information? Visit the Help Center at http://help.topcoder.com.</p>

<p>Do you have questions or technical problems? Please contact support@topcoder.com.</p>

<p>Good luck!</p>
<p>The topcoder Team</p>
3 changes: 3 additions & 0 deletions mail_templates/peer_registration/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1 {
color: red;
}
14 changes: 14 additions & 0 deletions mail_templates/peer_registration/text.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Hi <%= userName %>,

Congratulations! You are now registered for <%= projectName %> Challenge.

You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early!

The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored.

Need more information? Visit the Help Center at http://help.topcoder.com.

Do you have questions or technical problems? Please contact support@topcoder.com.

Good luck!
The topcoder Team
17 changes: 15 additions & 2 deletions mail_templates/registration_notification_email/text.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Here is the registration notification email
Hi <%= userName %>,

Have fun!
Congratulations! You are now registered for <%= projectName %> Challenge.

You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early!

The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored.

Additional tasks for this challenge can be accessed in Online Review. This is where you can unregister, contact a manager, view your review scorecard, submit appeals and final fixes, and other important tasks. <%= reviewURL %>

Need more information about competing? Visit the Help Center at http://help.topcoder.com.

Do you have questions or technical problems? Please contact support@topcoder.com.

Good luck!
The topcoder Team
14 changes: 10 additions & 4 deletions queries/get_component_info
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ SELECT
-- the project category id, e.g. Logo Design, Developemnt, Assembly
(select project_category_id from project where project_id = @challengeId@ ) as project_category_id,
-- the project name.
(select value from project_info where project_id = @challengeId@ AND project_info_type_id = 6 ) as project_name
(select value from project_info where project_id = @challengeId@ AND project_info_type_id = 6 ) as project_name,
pi79.value as review_type
FROM comp_versions c
INNER JOIN project_info p ON c.component_id = p.value
INNER JOIN project_phase d ON d.project_id = @challengeId@ and phase_type_id = 2
, project_info p
, project_phase d
, project_info pi79
WHERE
p.project_info_type_id = 2
AND c.phase_id IN (112, 113)
AND p.project_id = @challengeId@
AND c.component_id = p.value
AND p.project_id = @challengeId@
AND d.project_id = @challengeId@ and d.phase_type_id = 2
AND pi79.project_info_type_id = 79
AND pi79.project_id = @challengeId@