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

Commit ad860ba

Browse files
committed
Merge pull request #174 from LazyChild/add_search_columns
Challenge API update
2 parents a52843f + 5a87501 commit ad860ba

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

actions/challenges.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved.
33
*
4-
* @version 1.18
4+
* @version 1.19
55
* @author Sky_, mekanizumu, TCSASSEMBLER, freegod, Ghost_141, kurtrips, xjtufreeman, ecnu_haozi, hesibo, LazyChild
66
* @changes from 1.0
77
* merged with Member Registration API
@@ -44,6 +44,8 @@
4444
* add API for submitting to design challenge
4545
* changes in 1.18:
4646
* add clientSelection flag in studio results
47+
* changes in 1.19:
48+
* add new allowed sort columns.
4749
*/
4850
"use strict";
4951
/*jslint stupid: true, unparam: true, continue: true */
@@ -90,7 +92,8 @@ var ALLOWABLE_QUERY_PARAMETER = [
9092
*/
9193
var ALLOWABLE_SORT_COLUMN = [
9294
"challengeName", "challengeType", "challengeId", "cmcTaskId", "registrationEndDate",
93-
"submissionEndDate", "finalFixEndDate", "prize1", "currentStatus", "digitalRunPoints"
95+
"submissionEndDate", "finalFixEndDate", "prize1", "currentStatus", "digitalRunPoints",
96+
"postingDate", "numSubmissions", "numRegistrants", "currentPhaseRemainingTime", "currentPhaseName", "registrationOpen"
9497
];
9598

9699
/**
@@ -357,7 +360,8 @@ function transferResult(src, helper) {
357360
digitalRunPoints: row.digital_run_points,
358361
prize: [],
359362
reliabilityBonus: helper.getReliabilityBonus(row.prize1),
360-
challengeCommunity: row.is_studio ? 'design' : 'develop'
363+
challengeCommunity: row.is_studio ? 'design' : 'develop',
364+
registrationOpen: row.registration_open
361365
});
362366

363367
for (i = 1; i < 10; i = i + 1) {

initializers/helper.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ var apiName2dbNameMap = {
153153
numberofsubmissions: 'number_of_submissions',
154154
numberofreviewpositionsavailable: 'number_of_review_positions_available',
155155
round2scheduledstartdate: 'round_2_scheduled_start_date',
156-
round1scheduledstartdate: 'round_1_scheduled_start_date'
156+
round1scheduledstartdate: 'round_1_scheduled_start_date',
157+
postingdate: 'posting_date',
158+
numsubmissions: 'num_submissions',
159+
numregistrants: 'num_registrants',
160+
currentphaseremainingtime: 'current_phase_remaining_time',
161+
currentphasename: 'current_phase_name',
162+
registrationopen: 'registration_open'
157163
};
158164

159165
/**

queries/search_software_studio_challenges

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ FIRST @pageSize@
4747
, (SELECT event_short_desc from event e where e.event_id = nvl((SELECT max(event_id) from contest_project_xref x, contest c where project_id = p.project_id and c.contest_id = x.contest_id), 0)) as event_name
4848
, technology_list(pi1.value) AS technology
4949
, platform_list(p.project_id) as platforms
50+
, CASE WHEN (pp1.phase_status_id = 2) THEN 'Yes' ELSE 'No' END AS registration_open
5051
FROM project p
5152
, project_status_lu pstatus
5253
, project_phase pp1 --registration phase

0 commit comments

Comments
 (0)