Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
Merged
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ In this configuration, we'll run the direct app in a docker container locally bu

---

## Test Users

direct_user/topcoder2001 (Use this user to login to Direct and create challenges in the Topcoder DEV environment. You can alsoo use this user to manipulate challenges in Online Review)

## **old** instructions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006 - 2016 TopCoder Inc., All Rights Reserved.
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.management.project;

Expand Down Expand Up @@ -44,8 +44,13 @@
* - Add property {@link #PRIVATE_PROJECT}
* </p>
*
* <p>
* Version 1.2.7 (TOPCODER DIRECT - ADD OPTIONAL CHALLENGE PROPERTY - PRODUCT)
* - Add property {@link #PRODUCT_SKU}
* </p>
*
* @author tuenm, iamajia, flytoj2ee, tangzx, GreatKevin, TCSCODER
* @version 1.2.6
* @version 1.2.7
* @since 1.0
*/
public class ProjectPropertyType implements Serializable {
Expand Down Expand Up @@ -366,6 +371,13 @@ public class ProjectPropertyType implements Serializable {
*/
public static final String PRIVATE_PROJECT = "Private Project Status";

/**
* Represent "Product SKU" project property type
*
* @since 1.2.7
*/
public static final String PRODUCT_SKU = "Product SKU";

/**
* Represents the id of this instance. Only values greater than zero is
* allowed. This variable is initialized in the constructor and can be
Expand Down
23 changes: 0 additions & 23 deletions docker-compose.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1996,17 +1996,13 @@ private void checkProjectData(ProjectData projectData, boolean isCreate) throws
throw logException(new IllegalArgumentFault("The name attribute of the project data can not be null."));
} else if (name.trim().length() == 0) {
throw logException(new IllegalArgumentFault("The name attribute of the project data can not be empty."));
} else if (!Pattern.matches(NAME_PATTERN, name)) {
throw logException(new IllegalArgumentFault("The name attribute of the project data is not following pattern as - " + NAME_PATTERN));
}

String description = projectData.getDescription();
if (null == description) {
throw logException(new IllegalArgumentFault("The description attribute of the project data can not be null."));
} else if (description.trim().length() == 0) {
throw logException(new IllegalArgumentFault("The description attribute of the project data can not be empty."));
} else if (!Pattern.matches(NAME_PATTERN, description)) {
throw logException(new IllegalArgumentFault("The description attribute of the project data is not following pattern as - " + NAME_PATTERN));
}

//added in version 2.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 - 2016 TopCoder Inc., All Rights Reserved.
* Copyright (C) 2010 - 2017 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.direct.services.view.action.contest.launch;

Expand Down Expand Up @@ -265,8 +265,16 @@
* <li>Updated {@link #executeAction()}</li>
* </ul>
* </p>
* @author fabrizyo, FireIce, Veve, isv, GreatKevin, flexme, frozenfx, bugbuka, GreatKevin, Veve
* @version 2.3
*
* <p>
* Version 2.4 (TOPCODER DIRECT - SUPPORT CHALLENGES WITH ZERO PRIZE):
* <ul>
* <li>Updated {@link #populateCompetition(SoftwareCompetition)} method to accept zero prize</li>
* </ul>
* </p>
*
* @author fabrizyo, FireIce, Veve, isv, GreatKevin, flexme, frozenfx, bugbuka, TCSCODER
* @version 2.4
*/
public class SaveDraftContestAction extends ContestAction {
/**
Expand Down Expand Up @@ -964,7 +972,7 @@ public boolean evaluate(Object object) {
List<Prize> newPrizes = new ArrayList<Prize>();
if (prizes != null) {
for (Prize prize : prizes) {
if (prize.getPrizeAmount() > 0) {
if (prize.getPrizeAmount() >= 0) {
if (projectId > 0) {
prize.setProjectId(projectId);
} else {
Expand Down Expand Up @@ -1037,6 +1045,11 @@ public boolean evaluate(Object object) {
}
}
}
if ((softwareCompetition.getProjectHeader().getProperty(ProjectPropertyType.PRODUCT_SKU) == null ||
"".equals(softwareCompetition.getProjectHeader().getProperty(ProjectPropertyType.PRODUCT_SKU))) &&
softwareCompetition.getProjectHeader().getProperties().containsKey(ProjectPropertyType.PRODUCT_SKU)){
softwareCompetition.getProjectHeader().getProperties().remove(ProjectPropertyType.PRODUCT_SKU);
}
}

/**
Expand Down
18 changes: 17 additions & 1 deletion src/web/WEB-INF/includes/contest/editTab.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<td class="first_tab_type"><strong>Billing Account</strong></td>
<td class="sec_tab_type"><strong>: <span id="rBillingAccount"></span></strong></td>
</tr>
<tr></tr>
<%--
<tr>
<td class="first_tab_type"><strong>Private Group</strong></td>
Expand All @@ -118,6 +119,13 @@
<td class="sec_tab_type"><strong>: <span id="rProjectMilestone"></span></strong></td>
</tr>
<tr></tr>
<%--
<tr>
<td class="first_tab_type"><strong>Product</strong></td>
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
</tr>
<tr></tr>
--%>
<tr>
<td class="first_tab_type"><strong>Copilot</strong></td>
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
Expand Down Expand Up @@ -251,7 +259,15 @@
</select>
</div>
</div>
<br /> <br />
<br /> <br /><br />
<%--
<span class="name fixWidthName"><strong>Product</strong></span>
<span class="value">
<input type="text" class="bigin" id="productName" />
<span id="productNameText"></span>
</span>
<br/><br/>
--%>
<!-- Review Scorecard -->
<div id="reviewScorecardDivEdit">
<br />
Expand Down
17 changes: 16 additions & 1 deletion src/web/WEB-INF/includes/contest/editTabMarathon.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
<td class="sec_tab_type"><strong>: <span id="rProjectName"><c:out value="${sessionData.currentProjectContext.name}" /></span></strong></td>
</tr>
<tr></tr>
<%--
<tr>
<td class="first_tab_type"><strong>Product</strong></td>
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
</tr>
<tr></tr>
--%>
<tr>
<td class="first_tab_type"><strong>Copilot</strong></td>
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
Expand Down Expand Up @@ -206,7 +213,15 @@
</select>
</div>
</div>
<br /><br />
<br /><br /><br />
<%--
<span class="name fixWidthName"><strong>Product</strong></span>
<span class="value">
<input type="text" class="bigin" id="productName" />
<span id="productNameText"></span>
</span>
<br/><br/>
--%>
<div id="copilotEditDiv">
<br />
<span class="name fixWidthName"><strong>Copilot</strong></span>
Expand Down
18 changes: 16 additions & 2 deletions src/web/WEB-INF/includes/contest/editTabSoftware.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@
<td class="sec_tab_type"><strong>: <span id="rProjectMilestone"></span></strong></td>
</tr>
<tr></tr>
<%--
<tr>
<td class="first_tab_type"><strong>Product</strong></td>
<td class="sec_tab_type"><strong>: <span id="rProduct"></span></strong></td>
</tr>
<tr></tr>
--%>
<tr>
<td class="first_tab_type"><strong>Copilot</strong></td>
<td class="sec_tab_type"><strong>: <span id="rCopilots"></span></strong></td>
Expand Down Expand Up @@ -274,8 +281,15 @@
</div>
<div class="clearFix"></div>
</div>


<br/><br/>
<%--
<span class="name fixWidthName"><strong>Product</strong></span>
<span class="value">
<input type="text" class="bigin" id="productName" />
<span id="productNameText"></span>
</span>
<br/><br/>
---%>
<div id="copilotEditDiv" class="editDropDown">
<span class="name fixWidthName"><strong>Copilot</strong></span>

Expand Down
7 changes: 7 additions & 0 deletions src/web/WEB-INF/includes/launch/contestSelection.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@
<a href="javascript:;" target="_blank" class="addMilestone hide">Manage Project Milestones</a>
</div>

<!-- product -->
<%--
<div class="row">
<label>Product :</label>
<input id="productName" name="productName" type="text" class="text"/>
</div>
--%>
<!-- Copilot for Software Contest -->
<div class="row">
<label>Copilot :</label>
Expand Down
3 changes: 0 additions & 3 deletions src/web/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ function limitContestProjectNameChars(maxChars) {
var textArea = $(this);
var content = textArea.val();
var invalid = false;
if (content.search(invalidCharsRegExp, '') > -1) {
invalid = true;
}
if (content.length <= maxChars && !invalid) {
ori = content;
}
Expand Down
10 changes: 8 additions & 2 deletions src/web/scripts/launch/contestDetailSoftware.js
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,13 @@ function populateTypeSection() {

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

//display
//product
/*
if (mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_SKU] != null){
$("#rProduct").text(mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_SKU]);
$("#productName").val(mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_SKU]);
}
*/
$('#rContestTypeName').text($("#contestTypes option[value=" + mainWidget.competitionType + mainWidget.softwareCompetition.projectHeader.projectCategory.id +"]").text());

loadReviewScorecardList(null);
Expand Down Expand Up @@ -1513,7 +1519,7 @@ function validateFieldsTypeSection() {
if (categoryId == SOFTWARE_CATEGORY_ID_F2F) {
// set review scorecard.
mainWidget.softwareCompetition.projectHeader.iterativeReviewScorecardId = parseInt($('select#reviewScorecardSelects').val());
} else {
} else if (categoryId != ALGORITHM_CATEGORY_ID_MARATHON){
// set iterative review scorecard
mainWidget.softwareCompetition.projectHeader.reviewScorecardId = parseInt($('select#reviewScorecardSelects').val());
}
Expand Down
2 changes: 2 additions & 0 deletions src/web/scripts/launch/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ var STUDIO_IDEA_GENERATION = 22;
var DRAFT_STATUS = "Draft";
var ACTIVE_STATUS = "Active";

var PRODUCT_SKU ="Product SKU";

var projectCategoryArray = [
{id:SOFTWARE_CATEGORY_ID_CONCEPT, name:'CONCEPTUALIZATION', label:'Software Conceptualization', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true},
{id:SOFTWARE_CATEGORY_ID_SPEC, name:'SPECIFICATION', label:'Software Specification', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true},
Expand Down
8 changes: 7 additions & 1 deletion src/web/scripts/launch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,13 @@ function saveAsDraftRequest() {

mainWidget.softwareCompetition.projectHeader.properties['Review Type'] = reviewType;
}

/*
if ($("#productName").val().trim().length > 0) {
mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_SKU] = $("#productName").val().trim();
}else{
mainWidget.softwareCompetition.projectHeader.properties[PRODUCT_SKU] = "";
}
*/

var request;

Expand Down