Skip to content

Commit 5e00eb9

Browse files
authored
Merge pull request #4543 from topcoder-platform/issue-4537
Issue #4537 : Challenge Details - Registrants data bind
2 parents a0b524f + d44d120 commit 5e00eb9

File tree

1 file changed

+12
-12
lines changed
  • src/shared/components/challenge-detail/Registrants

1 file changed

+12
-12
lines changed

src/shared/components/challenge-detail/Registrants/index.jsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function formatDate(date) {
2020
}
2121

2222
function getDate(arr, handle) {
23-
const results = arr.filter(a => _.toString(a.submitter || a.handle) === _.toString(handle))
23+
const results = arr.filter(a => _.toString(a.submitter || a.memberHandle) === _.toString(handle))
2424
.sort((a, b) => new Date(b.submissionTime || b.submissionDate).getTime()
2525
- new Date(a.submissionTime || a.submissionDate).getTime());
2626
return results[0] ? (results[0].submissionTime || results[0].submissionDate) : '';
@@ -32,7 +32,7 @@ function passedCheckpoint(checkpoints, handle, results) {
3232
}
3333

3434
function getPlace(results, handle, places) {
35-
const found = _.find(results, w => _.toString(w.handle) === _.toString(handle)
35+
const found = _.find(results, w => _.toString(w.memberHandle) === _.toString(handle)
3636
&& w.placement <= places && w.submissionStatus !== 'Failed Review');
3737

3838
if (found) {
@@ -99,7 +99,7 @@ export default class Registrants extends React.Component {
9999

100100
let checkpoint;
101101
if (twoRounds) {
102-
checkpoint = getDate(checkpoints, registrant.handle);
102+
checkpoint = getDate(checkpoints, registrant.memberHandle);
103103
if (!checkpoint
104104
&& moment(registrant.submissionDate).isBefore(checkpointDate)) {
105105
checkpoint = registrant.submissionDate;
@@ -188,8 +188,8 @@ export default class Registrants extends React.Component {
188188
break;
189189
}
190190
case 'Username': {
191-
valueA = `${a.handle}`.toLowerCase();
192-
valueB = `${b.handle}`.toLowerCase();
191+
valueA = `${a.memberHandle}`.toLowerCase();
192+
valueB = `${b.memberHandle}`.toLowerCase();
193193
valueIsString = true;
194194
break;
195195
}
@@ -381,7 +381,7 @@ export default class Registrants extends React.Component {
381381
<div styleName="body" role="rowgroup">
382382
{
383383
sortedRegistrants.map((r) => {
384-
const placement = getPlace(results, r.handle, places);
384+
const placement = getPlace(results, r.memberHandle, places);
385385
const colorStyle = JSON.parse(r.colorStyle.replace(/(\w+):\s*([^;]*)/g, '{"$1": "$2"}'));
386386
let checkpoint = this.getCheckPoint(r);
387387
if (checkpoint) {
@@ -395,7 +395,7 @@ export default class Registrants extends React.Component {
395395
}
396396

397397
return (
398-
<div styleName="row" key={r.handle} role="row">
398+
<div styleName="row" key={r.memberHandle} role="row">
399399
{
400400
!isDesign && !isF2F && !isBugHunt && (
401401
<div styleName="col-2">
@@ -413,19 +413,19 @@ export default class Registrants extends React.Component {
413413
<div styleName="col-3">
414414
<span role="cell">
415415
<a
416-
href={`${window.origin}/members/${r.handle}`}
416+
href={`${window.origin}/members/${r.memberHandle}`}
417417
style={colorStyle}
418418
target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}
419419
>
420-
{r.handle}
420+
{r.memberHandle}
421421
</a>
422422
</span>
423423
</div>
424424
<div styleName="col-4">
425425
<div styleName="sm-only title">
426426
Registration Date
427427
</div>
428-
<span role="cell">{formatDate(r.registrationDate)}</span>
428+
<span role="cell">{formatDate(r.created)}</span>
429429
</div>
430430
{
431431
twoRounds
@@ -439,7 +439,7 @@ export default class Registrants extends React.Component {
439439
{checkpoint}
440440
</span>
441441
{
442-
passedCheckpoint(checkpoints, r.handle, checkpointResults)
442+
passedCheckpoint(checkpoints, r.memberHandle, checkpointResults)
443443
&& <CheckMark styleName="passed" />
444444
}
445445
</div>
@@ -484,7 +484,7 @@ Registrants.propTypes = {
484484
challenge: PT.shape({
485485
phases: PT.arrayOf(PT.shape({
486486
actualEndDate: PT.string,
487-
phaseType: PT.string.isRequired,
487+
name: PT.string.isRequired,
488488
scheduledEndDate: PT.string,
489489
})).isRequired,
490490
allPhases: PT.arrayOf(PT.shape()),

0 commit comments

Comments
 (0)