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

Commit 7be4237

Browse files
authored
Merge pull request #322 from deedee/new_fields_challenge_page
add field: environment and code repo to project_info
2 parents fbfc7d8 + 34fb061 commit 7be4237

File tree

7 files changed

+115
-17
lines changed

7 files changed

+115
-17
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@
159159
<td class="sec_tab_type"><strong>: <span id="rswGroups"></span></strong></td>
160160
</tr>
161161
<tr></tr>
162+
163+
<tr>
164+
<td class="first_tab_type"><strong>Environment :</strong></td>
165+
<td class="sec_tab_type"><strong>: <span id="rswEnvironment"></span></strong></td>
166+
</tr>
167+
<tr></tr>
168+
<tr>
169+
<td class="first_tab_type"><strong>Code Repo :</strong></td>
170+
<td class="sec_tab_type"><strong>: <span id="rswRepo"></span></strong></td>
171+
</tr>
172+
<tr></tr>
173+
162174
<tr>
163175
<td class="first_tab_type"><strong>Created By</strong></td>
164176
<td class="sec_tab_type"><strong>: <span id="rChallengeCreator"></span></strong></td>
@@ -333,6 +345,20 @@
333345
<div class="ms-group-div"><div id="groups"></div></div>
334346
</div>
335347
<br/><br/>
348+
349+
350+
<span class="name fixWidthName"><strong>Environment</strong></span>
351+
<span class="value">
352+
<input type="text" class="bigin" id="environmentEdit" />
353+
</span>
354+
<br /><br />
355+
356+
<span class="name fixWidthName"><strong>Code Repo</strong></span>
357+
<span class="value">
358+
<input type="text" class="bigin" id="repoEdit" />
359+
</span>
360+
<br /><br />
361+
336362
<span class="name fixWidthName"><strong>Created By</strong></span>
337363
<span class ='small_info_spec' id="challegneCreatorLabel"></span>
338364
</div>

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@
119119
<td class="sec_tab_type"><strong>: <span id="rswGroups"></span></strong></td>
120120
</tr>
121121
<tr></tr>
122+
<tr>
123+
<td class="first_tab_type"><strong>Environment :</strong></td>
124+
<td class="sec_tab_type"><strong>: <span id="rswEnvironment"></span></strong></td>
125+
</tr>
126+
<tr></tr>
127+
<tr>
128+
<td class="first_tab_type"><strong>Code Repo :</strong></td>
129+
<td class="sec_tab_type"><strong>: <span id="rswRepo"></span></strong></td>
130+
</tr>
131+
<tr></tr>
122132
<tr>
123133
<td class="first_tab_type"><strong>Created By</strong></td>
124134
<td class="sec_tab_type"><strong>: <span id="rChallengeCreator"></span></strong></td>
@@ -261,6 +271,17 @@
261271
<div id="groupDiv"><div id="groups"></div></div>
262272
</div>
263273
<br/><br/>
274+
<span class="name fixWidthName"><strong>Environment</strong></span>
275+
<span class="value">
276+
<input type="text" class="bigin" id="environmentEdit" />
277+
</span>
278+
<br /><br />
279+
280+
<span class="name fixWidthName"><strong>Code Repo</strong></span>
281+
<span class="value">
282+
<input type="text" class="bigin" id="repoEdit" />
283+
</span>
284+
<br /><br />
264285
<span class="name fixWidthName"><strong>Created By</strong></span>
265286
<span class ='small_info_spec' id="challegneCreatorLabel"></span>
266287
<br/>

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@
178178
<td class="sec_tab_type"><strong>: <span id="rswGroups"></span></strong></td>
179179
</tr>
180180
<tr></tr>
181+
<tr>
182+
<td class="first_tab_type"><strong>Environment :</strong></td>
183+
<td class="sec_tab_type"><strong>: <span id="rswEnvironment"></span></strong></td>
184+
</tr>
185+
<tr></tr>
186+
<tr>
187+
<td class="first_tab_type"><strong>Code Repo :</strong></td>
188+
<td class="sec_tab_type"><strong>: <span id="rswRepo"></span></strong></td>
189+
</tr>
190+
<tr></tr>
181191
<tr>
182192
<td class="first_tab_type"><strong>Created By</strong></td>
183193
<td class="sec_tab_type"><strong>: <span id="rChallengeCreator"></span></strong></td>
@@ -356,6 +366,17 @@
356366
<div class="ms-group-div"><div id="groups"></div></div>
357367
</div>
358368
<br/>
369+
<span class="name fixWidthName"><strong>Environment</strong></span>
370+
<span class="value">
371+
<input type="text" class="bigin" id="environmentEdit" />
372+
</span>
373+
<br /><br />
374+
375+
<span class="name fixWidthName"><strong>Code Repo</strong></span>
376+
<span class="value">
377+
<input type="text" class="bigin" id="repoEdit" />
378+
</span>
379+
<br /><br />
359380
<div>
360381

361382
<span class="name fixWidthName"><strong>Created By</strong></span>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@
217217
<div id="groups"></div>
218218
</div>
219219
</div>
220+
221+
<!-- Environment -->
222+
<div class="row">
223+
<label>Environment :</label>
224+
<input id="environment" name="environmentEdit" type="text" class="text" maxlength="500"/>
225+
</div>
226+
227+
<!-- repo -->
228+
<div class="row">
229+
<label>Code Repo :</label>
230+
<input id="repoEdit" name="repo" type="text" class="text" maxlength="500"/>
231+
</div>
232+
220233
</div>
221234
<!-- end .addNewContest -->
222235
</form>

src/web/scripts/launch/contestDetailSoftware.js

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,13 @@ $(document).ready(function(){
207207
});
208208

209209
$(".cancel_text").click(function(){
210+
groupCancel = true;
210211
jQuery_1_11_1("#groups").magicSuggest().clear();
211-
if (mainWidget.softwareCompetition.groups.length > 0){
212-
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
213-
}
212+
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
213+
groupCancel = false;
214+
214215
jQuery_1_11_1("#preRegisterUsers").magicSuggest().clear();
215-
if (mainWidget.softwareCompetition.registrants.length > 0) {
216-
jQuery_1_11_1("#preRegisterUsers").magicSuggest().setValue(mainWidget.softwareCompetition.registrants);
217-
}
216+
jQuery_1_11_1("#preRegisterUsers").magicSuggest().setValue(mainWidget.softwareCompetition.registrants);
218217
populateTypeSection();
219218
showTypeSectionDisplay();
220219
});
@@ -875,6 +874,7 @@ function initContest(contestJson) {
875874
}
876875

877876
mainWidget.softwareCompetition.groups = contestJson.groupIds;
877+
mainWidget.softwareCompetition.groupNames = contestJson.groupNames;
878878

879879
var projectHeader = mainWidget.softwareCompetition.projectHeader;
880880
projectHeader.tcDirectProjectId = contestJson.tcDirectProjectId;
@@ -1212,6 +1212,17 @@ function initContest(contestJson) {
12121212
}
12131213

12141214
$(".drHide").hide();
1215+
1216+
if (securityGroups.length < 1 && mainWidget.softwareCompetition.groups.length > 0) {
1217+
var allGroups = [];
1218+
$.each(mainWidget.softwareCompetition.groups, function(i, val){
1219+
allGroups.push({id: val, name: mainWidget.softwareCompetition.groupNames[i]});
1220+
});
1221+
jQuery_1_11_1("#groups").magicSuggest().setData(allGroups);
1222+
}
1223+
1224+
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
1225+
12151226
}
12161227

12171228

@@ -1270,8 +1281,6 @@ function populateTypeSection() {
12701281
$('#rProjectName').text(mainWidget.softwareCompetition.projectHeader.tcDirectProjectName);
12711282
}
12721283

1273-
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
1274-
12751284
if (isF2F() || isDesignF2F()) {
12761285
var privateProject = p[TASK_FLAG];
12771286
var registrants = [];
@@ -1387,16 +1396,12 @@ function populateTypeSection() {
13871396

13881397
}
13891398

1390-
var groupMap = {};
1391-
$.each(securityGroups, function(i, val){
1392-
groupMap[''+val.id]=val.name;
1393-
});
1394-
var selectedGroupName = [];
1395-
$.each(mainWidget.softwareCompetition.groups, function(i, val){
1396-
selectedGroupName.push(groupMap[val]);
1397-
});
1399+
$('#rswGroups').html(mainWidget.softwareCompetition.groupNames.join(", "));
13981400

1399-
$('#rswGroups').html(selectedGroupName.join(", "));
1401+
$('#rswEnvironment').html(mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT]);
1402+
$('#environmentEdit').val(mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT]);
1403+
$('#rswRepo').html(mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO]);
1404+
$('#repoEdit').val(mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO]);
14001405
}
14011406

14021407
/**
@@ -1453,6 +1458,11 @@ function saveTypeSection() {
14531458
success: function (jsonResult) {
14541459
handleSaveAsDraftContestResult(jsonResult);
14551460
mainWidget.softwareCompetition.groups = jQuery_1_11_1("#groups").magicSuggest().getValue();
1461+
mainWidget.softwareCompetition.groupNames=[];
1462+
$.each(jQuery_1_11_1("#groups").magicSuggest().getSelection(), function(i, val){
1463+
mainWidget.softwareCompetition.groupNames.push(val.name);
1464+
})
1465+
mainWidget.softwareCompetition.registrants = jQuery_1_11_1("#preRegisterUsers").magicSuggest().getSelection().slice();
14561466
populateTypeSection();
14571467
populateRoundSection();
14581468
if (mainWidget.competitionType == "SOFTWARE") {

src/web/scripts/launch/entity.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ var TASK_FLAG = "Private Project Status";
201201

202202
var PRODUCT_SKU ="Product SKU";
203203

204+
var ENVIRONMENT = "Environment";
205+
var CODE_REPO = "Code Repo";
206+
204207
var projectCategoryArray = [
205208
{id:SOFTWARE_CATEGORY_ID_CONCEPT, name:'CONCEPTUALIZATION', label:'Software Conceptualization', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true},
206209
{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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,10 @@ function saveAsDraftRequest() {
11801180
if(copilotCost > 0 && (copilotCost != parseFloat(copilotFees[getContestType(true)[1]]["copilotFee"]))){
11811181
request["customCopilotFee"] = mainWidget.softwareCompetition.copilotCost;
11821182
}
1183+
1184+
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = $("#environmentEdit").val().trim();
1185+
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = $("#repoEdit").val().trim();
1186+
11831187
return request;
11841188
}
11851189

0 commit comments

Comments
 (0)