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

Commit 9cae161

Browse files
authored
Merge pull request #232 from skyhit/support_project_challenge_property
support product challenge property
2 parents a30ed53 + a0cbec0 commit 9cae161

File tree

10 files changed

+76
-30
lines changed

10 files changed

+76
-30
lines changed

components/project_management/src/java/main/com/topcoder/management/project/ProjectPropertyType.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 - 2016 TopCoder Inc., All Rights Reserved.
2+
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
33
*/
44
package com.topcoder.management.project;
55

@@ -44,8 +44,13 @@
4444
* - Add property {@link #PRIVATE_PROJECT}
4545
* </p>
4646
*
47+
* <p>
48+
* Version 1.2.7 (TOPCODER DIRECT - ADD OPTIONAL CHALLENGE PROPERTY - PRODUCT)
49+
* - Add property {@link #PRODUCT_TYPE}
50+
* </p>
51+
*
4752
* @author tuenm, iamajia, flytoj2ee, tangzx, GreatKevin, TCSCODER
48-
* @version 1.2.6
53+
* @version 1.2.7
4954
* @since 1.0
5055
*/
5156
public class ProjectPropertyType implements Serializable {
@@ -366,6 +371,13 @@ public class ProjectPropertyType implements Serializable {
366371
*/
367372
public static final String PRIVATE_PROJECT = "Private Project Status";
368373

374+
/**
375+
* Represent "Product Type" project property type
376+
*
377+
* @since 1.2.7
378+
*/
379+
public static final String PRODUCT_TYPE = "Product Type";
380+
369381
/**
370382
* Represents the id of this instance. Only values greater than zero is
371383
* allowed. This variable is initialized in the constructor and can be

docker-compose.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/java/main/com/topcoder/direct/services/view/action/contest/launch/SaveDraftContestAction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,11 @@ public boolean evaluate(Object object) {
10451045
}
10461046
}
10471047
}
1048+
if ((softwareCompetition.getProjectHeader().getProperty(ProjectPropertyType.PRODUCT_TYPE) == null ||
1049+
"".equals(softwareCompetition.getProjectHeader().getProperty(ProjectPropertyType.PRODUCT_TYPE))) &&
1050+
softwareCompetition.getProjectHeader().getProperties().containsKey(ProjectPropertyType.PRODUCT_TYPE)){
1051+
softwareCompetition.getProjectHeader().getProperties().remove(ProjectPropertyType.PRODUCT_TYPE);
1052+
}
10481053
}
10491054

10501055
/**

src/web/WEB-INF/includes/contest/editTab.jsp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
<td class="first_tab_type"><strong>Billing Account</strong></td>
9797
<td class="sec_tab_type"><strong>: <span id="rBillingAccount"></span></strong></td>
9898
</tr>
99+
<tr></tr>
99100
<%--
100101
<tr>
101102
<td class="first_tab_type"><strong>Private Group</strong></td>
@@ -118,6 +119,11 @@
118119
<td class="sec_tab_type"><strong>: <span id="rProjectMilestone"></span></strong></td>
119120
</tr>
120121
<tr></tr>
122+
<tr>
123+
<td class="first_tab_type"><strong>Product</strong></td>
124+
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
125+
</tr>
126+
<tr></tr>
121127
<tr>
122128
<td class="first_tab_type"><strong>Copilot</strong></td>
123129
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
@@ -251,7 +257,13 @@
251257
</select>
252258
</div>
253259
</div>
254-
<br /> <br />
260+
<br /> <br /><br />
261+
<span class="name fixWidthName"><strong>Product</strong></span>
262+
<span class="value">
263+
<input type="text" class="bigin" id="productName" />
264+
<span id="productNameText"></span>
265+
</span>
266+
<br/><br/>
255267
<!-- Review Scorecard -->
256268
<div id="reviewScorecardDivEdit">
257269
<br />

src/web/WEB-INF/includes/contest/editTabMarathon.jsp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
<td class="sec_tab_type"><strong>: <span id="rProjectName"><c:out value="${sessionData.currentProjectContext.name}" /></span></strong></td>
8888
</tr>
8989
<tr></tr>
90+
<tr>
91+
<td class="first_tab_type"><strong>Product</strong></td>
92+
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
93+
</tr>
94+
<tr></tr>
9095
<tr>
9196
<td class="first_tab_type"><strong>Copilot</strong></td>
9297
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
@@ -206,7 +211,13 @@
206211
</select>
207212
</div>
208213
</div>
209-
<br /><br />
214+
<br /><br /><br />
215+
<span class="name fixWidthName"><strong>Product</strong></span>
216+
<span class="value">
217+
<input type="text" class="bigin" id="productName" />
218+
<span id="productNameText"></span>
219+
</span>
220+
<br/><br/>
210221
<div id="copilotEditDiv">
211222
<br />
212223
<span class="name fixWidthName"><strong>Copilot</strong></span>

src/web/WEB-INF/includes/contest/editTabSoftware.jsp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@
139139
<td class="sec_tab_type"><strong>: <span id="rProjectMilestone"></span></strong></td>
140140
</tr>
141141
<tr></tr>
142+
<tr>
143+
<td class="first_tab_type"><strong>Product</strong></td>
144+
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
145+
</tr>
146+
<tr></tr>
142147
<tr>
143148
<td class="first_tab_type"><strong>Copilot</strong></td>
144149
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
@@ -274,7 +279,13 @@
274279
</div>
275280
<div class="clearFix"></div>
276281
</div>
277-
282+
<br/><br/>
283+
<span class="name fixWidthName"><strong>Product</strong></span>
284+
<span class="value">
285+
<input type="text" class="bigin" id="productName" />
286+
<span id="productNameText"></span>
287+
</span>
288+
<br/><br/>
278289

279290
<div id="copilotEditDiv" class="editDropDown">
280291
<span class="name fixWidthName"><strong>Copilot</strong></span>

src/web/WEB-INF/includes/launch/contestSelection.jsp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@
158158
<a href="javascript:;" target="_blank" class="addMilestone hide">Manage Project Milestones</a>
159159
</div>
160160

161+
<!-- product -->
162+
<div class="row">
163+
<label>Product :</label>
164+
<input id="productName" name="productName" type="text" class="text"/>
165+
</div>
166+
161167
<!-- Copilot for Software Contest -->
162168
<div class="row">
163169
<label>Copilot :</label>

src/web/scripts/launch/contestDetailSoftware.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,11 @@ function populateTypeSection() {
12221222

12231223
$('#chkboxCCA').attr('checked', mainWidget.softwareCompetition.projectHeader.isLccchecked());
12241224

1225-
//display
1225+
//product
1226+
if (mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_TYPE] != null){
1227+
$("#rProduct").text(mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_TYPE]);
1228+
$("#productName").val(mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_TYPE]);
1229+
}
12261230
$('#rContestTypeName').text($("#contestTypes option[value=" + mainWidget.competitionType + mainWidget.softwareCompetition.projectHeader.projectCategory.id +"]").text());
12271231

12281232
loadReviewScorecardList(null);
@@ -1513,7 +1517,7 @@ function validateFieldsTypeSection() {
15131517
if (categoryId == SOFTWARE_CATEGORY_ID_F2F) {
15141518
// set review scorecard.
15151519
mainWidget.softwareCompetition.projectHeader.iterativeReviewScorecardId = parseInt($('select#reviewScorecardSelects').val());
1516-
} else {
1520+
} else if (categoryId != ALGORITHM_CATEGORY_ID_MARATHON){
15171521
// set iterative review scorecard
15181522
mainWidget.softwareCompetition.projectHeader.reviewScorecardId = parseInt($('select#reviewScorecardSelects').val());
15191523
}

src/web/scripts/launch/entity.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ var STUDIO_IDEA_GENERATION = 22;
194194
var DRAFT_STATUS = "Draft";
195195
var ACTIVE_STATUS = "Active";
196196

197+
var PRODUCT_TYPE ="Product Type" ;
198+
197199
var projectCategoryArray = [
198200
{id:SOFTWARE_CATEGORY_ID_CONCEPT, name:'CONCEPTUALIZATION', label:'Software Conceptualization', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true},
199201
{id:SOFTWARE_CATEGORY_ID_SPEC, name:'SPECIFICATION', label:'Software Specification', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true},

src/web/scripts/launch/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,12 @@ function saveAsDraftRequest() {
10401040
mainWidget.softwareCompetition.projectHeader.properties['Review Type'] = reviewType;
10411041
}
10421042

1043+
if ($("#productName").val().trim().length > 0) {
1044+
mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_TYPE] = $("#productName").val().trim();
1045+
}else{
1046+
mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_TYPE] = "";
1047+
}
1048+
10431049

10441050
var request;
10451051

0 commit comments

Comments
 (0)