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

Commit 21526ac

Browse files
committed
Update search challenges api and fix some jslint error.
1 parent b74658e commit 21526ac

10 files changed

+47
-48
lines changed

actions/challengeRegistration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ var projectTrack = function (api, userId, challengeId, componentInfo, dbConnecti
306306
function (cb) {
307307
//Rating
308308
var rating = componentInfo.rating;
309-
309+
310310
if (rating > 0) {
311311
persistResourceInfo(api, resourceId, 4, componentInfo.rating, userId, dbConnectionMap, cb);
312312
} else {

actions/docusign.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ exports.generateDocusignViewURL = {
415415
});
416416
}
417417

418-
textTabs.push({tabLabel :'TopCoder Handle', value: user.handle});
418+
textTabs.push({tabLabel : 'TopCoder Handle', value: user.handle});
419419

420420
//Prepare the POST parameters
421421
reqParams = {
@@ -477,8 +477,7 @@ exports.generateDocusignViewURL = {
477477
var url, returnURL, reqParams;
478478

479479
//Create the return url
480-
returnURL = _.template(connection.params.returnUrl ?
481-
connection.params.returnUrl : api.config.tcConfig.docusign.returnURL)({envelopeId: envelopeId});
480+
returnURL = _.template(connection.params.returnUrl || api.config.tcConfig.docusign.returnURL)({envelopeId: envelopeId});
482481

483482
//Request recipient view
484483
url = baseURL + "/envelopes/" + envelopeId + "/views/recipient";

actions/reports.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ var clientChallengeCosts = function (api, connection, next) {
538538
cb(new NotFoundError('Client not found'));
539539
return;
540540
}
541-
if(type === helper.ListType.ACTIVE) {
541+
if (type === helper.ListType.ACTIVE) {
542542
api.dataAccess.executeQuery("active_client_challenges_costs", sqlParameters, dbConnectionMap, cb);
543543
} else {
544544
api.dataAccess.executeQuery("past_client_challenges_costs", sqlParameters, dbConnectionMap, cb);
@@ -649,8 +649,8 @@ exports.getClientActiveChallengeCosts = {
649649
api.dataAccess.executeQuery("get_client_active_challenge_costs", sqlParameters, dbConnectionMap, cb);
650650
}, function (results, cb) {
651651
costs = _.map(results, function (item) {
652-
var duration = item.challenge_duration ? parseFloat(item.challenge_duration.toFixed(1)) : 0;
653-
var currentPhaseText = item.current_phase;
652+
var duration = item.challenge_duration ? parseFloat(item.challenge_duration.toFixed(1)) : 0,
653+
currentPhaseText = item.current_phase;
654654
/* currentPhaseArray = [];
655655
656656
if (currentPhaseText) {

actions/srmProblems.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var ForbiddenError = require('../errors/ForbiddenError');
3131
*/
3232
function parseProblem(item) {
3333
var type = {id: item.problem_type_id, description: item.problem_type_desc},
34-
status = {id: item.status_id, description: item.status_desc};
34+
status = {id: item.status_id, description: item.status_desc};
3535
return {id: item.problem_id, name: item.name, proposedDivisionId: item.division_id, type: type, status: status};
3636
}
3737

@@ -65,7 +65,7 @@ var listRoundProblems = function (api, connection, dbConnectionMap, next) {
6565
_.each(results, function (item) {
6666
var division = {id: item.division_id, desc: item.division_desc},
6767
problem = parseProblem(item);
68-
problem.roundId = roundId;
68+
problem.roundId = roundId;
6969
result.push({division: division, problemData: problem});
7070
});
7171

actions/srmRoundComponentsAndTerms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function checkComponents(api, dbConnectionMap, components, callback) {
9999
}, function (results, cb) {
100100
if (!error) {
101101
if (results.length === 0) {
102-
error = new IllegalArgumentError("The componentId "+ component.componentId + " does not exist in database.");
102+
error = new IllegalArgumentError("The componentId " + component.componentId + " does not exist in database.");
103103
}
104104
}
105105

@@ -348,4 +348,4 @@ exports.setRoundTerms = {
348348
api.helper.handleNoConnection(api, connection, next);
349349
}
350350
}
351-
};
351+
};

actions/srmRoundManagement.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,18 @@ exports.createSRMContestRound = {
430430
function (roundId, cbx) {
431431
params.id = roundId;
432432
api.dataAccess.executeQuery('insert_srm_contest_round',
433-
{
434-
contest_id: params.contest_id,
435-
round_id: params.id,
436-
round_type_id: params.type.id,
437-
registration_limit: params.registrationLimit,
438-
invitational: params.invitationalType,
439-
region_id: params.region.region_id,
440-
name: params.name,
441-
status: params.status,
442-
short_name: params.short_name
443-
},
444-
dbConnectionMap, cbx);
433+
{
434+
contest_id: params.contest_id,
435+
round_id: params.id,
436+
round_type_id: params.type.id,
437+
registration_limit: params.registrationLimit,
438+
invitational: params.invitationalType,
439+
region_id: params.region.region_id,
440+
name: params.name,
441+
status: params.status,
442+
short_name: params.short_name
443+
},
444+
dbConnectionMap, cbx);
445445
}
446446
], cb);
447447
},
@@ -781,4 +781,4 @@ exports.deleteSRMContestRound = {
781781
next(connection, true);
782782
});
783783
}
784-
};
784+
};

initializers/configurator.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
*/
77
"use strict";
88

9-
exports.configurator = function(api, next){
9+
exports.configurator = function (api, next) {
1010

11-
api.configurator = {
12-
_start: function(api, next){
13-
this.configWeb(api);
14-
next();
15-
},
16-
configWeb: function(api){
17-
if(!api.servers || !api.servers.servers['web'] || !api.servers.servers['web'].server) {
18-
api.log('[configurator] web server has not been created.', 'warning');
19-
return;
20-
}
21-
22-
var timeout = api.config.servers.web.timeout || 10 * 60 * 1000;
23-
24-
api.servers.servers['web'].server.timeout = timeout;
25-
api.log('[configurator] web.server#timeout => '+timeout, 'info');
26-
}
27-
};
11+
api.configurator = {
12+
_start: function (api, next) {
13+
this.configWeb(api);
14+
next();
15+
},
16+
configWeb: function (api) {
17+
if (!api.servers || !api.servers.servers.web || !api.servers.servers.web.server) {
18+
api.log('[configurator] web server has not been created.', 'warning');
19+
return;
20+
}
2821

29-
next();
30-
}
22+
var timeout = api.config.servers.web.timeout || 10 * 60 * 1000;
23+
24+
api.servers.servers.web.server.timeout = timeout;
25+
api.log('[configurator] web.server#timeout => ' + timeout, 'info');
26+
}
27+
};
28+
29+
next();
30+
};

queries/challenge_details

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ SELECT
139139
AND pi52.project_id = p.project_id
140140
AND pi78.project_info_type_id = 78 -- forum type
141141
AND pi78.project_id = p.project_id
142-
AND p.project_Id = nd_phase.project_id
142+
AND p.project_id = nd_phase.project_id
143143
AND nd_phase.phase_type_id = (SELECT MIN(phase_type_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id not in (13,14))
144144
AND p.project_category_id = pcl.project_category_id
145145
AND pcl.project_type_id IN (@project_type_id@)

queries/search_software_studio_challenges

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ FIRST @pageSize@
9595
AND pi4.project_id = p.project_id
9696
AND pi4.project_info_type_id = 4 --forum id
9797
AND p.project_Id = nd_phase.project_id
98-
AND nd_phase.project_phase_id = (SELECT MAX(project_phase_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12))
98+
AND nd_phase.phase_type_id = (SELECT MIN(phase_type_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id not in (13,14))
9999
AND p.project_category_id = pcl.project_category_id
100100
-- Filter out the challenge that user is not belong to.
101101
AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id)

routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ exports.routes = {
330330
{ path: "/:apiVersion/data/srm/problems", action: "listSRMProblems" },
331331
{ path: "/:apiVersion/data/srm/rounds/:roundId/problems", action: "listRoundProblems" },
332332
{ path: "/:apiVersion/data/srm/rounds/:roundId/:problemId/:divisionId/components", action: "listRoundProblemComponents" },
333-
{ path: "/:apiVersion/data/srm/rounds/:roundId/components", action: "listRoundProblemComponents" },
334-
{ path: "/:apiVersion/data/srm/rounds/:contestId", action: "listSRMContestRounds" },
333+
{ path: "/:apiVersion/data/srm/rounds/:roundId/components", action: "listRoundProblemComponents" },
334+
{ path: "/:apiVersion/data/srm/rounds/:contestId", action: "listSRMContestRounds" },
335335
{ path: "/:apiVersion/auth0/callback", action: "auth0Callback" },
336336

337337
//Stubs APIs

0 commit comments

Comments
 (0)