Skip to content

Commit 6267321

Browse files
authored
Merge pull request #4837 from topcoder-platform/release-v5-develop
Release v5 develop
2 parents 4c6d74b + 9c1aa4b commit 6267321

File tree

6 files changed

+18
-72
lines changed

6 files changed

+18
-72
lines changed

src/server/tc-communities/tco19/metadata.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"challengeFilter": {
3-
"groupIds": ["20000078"],
4-
"or": [{
5-
"tags": ["TCO", "TCO19"]
6-
}]
3+
"events": ["tco19"]
74
},
85
"communityId": "tco19",
96
"communityName": "TCO19",

src/shared/components/ReviewOpportunityDetailsPage/ChallengeSpecTab/index.jsx

-18
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@ const ChallengeSpecTab = ({ challenge }) => (
2929
</article>
3030
)
3131
}
32-
{
33-
challenge.finalSubmissionGuidelines
34-
&& (
35-
<article>
36-
<h2 styleName="h2">
37-
Final Submission Guidelines
38-
</h2>
39-
<div
40-
/* eslint-disable react/no-danger */
41-
dangerouslySetInnerHTML={{
42-
__html: challenge.finalSubmissionGuidelines,
43-
}}
44-
/* eslint-enable react/no-danger */
45-
styleName="rawHtml"
46-
/>
47-
</article>
48-
)
49-
}
5032
</div>
5133
);
5234

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MySubmissionsView extends React.Component {
4141
}
4242

4343
if (isMM) {
44-
loadMMSubmissions(challenge.id, challenge.registrants, auth.tokenV3);
44+
loadMMSubmissions(challenge.id, auth.tokenV3);
4545
}
4646
}
4747

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

-32
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default function ChallengeDetailsView(props) {
4545
legacy,
4646
legacyId,
4747
documents,
48-
finalSubmissionGuidelines,
4948
userDetails,
5049
metadata,
5150
events,
@@ -196,35 +195,6 @@ export default function ChallengeDetailsView(props) {
196195
</article>
197196
)
198197
}
199-
{
200-
finalSubmissionGuidelines
201-
&& (
202-
<article>
203-
<h2>
204-
Final Submission Guidelines
205-
</h2>
206-
{
207-
editMode ? (
208-
<Editor
209-
connector={toolbarConnector}
210-
id="submissionGuidelines"
211-
initialMode={EDITOR_MODES.WYSIWYG}
212-
ref={n => n && n.setHtml(finalSubmissionGuidelines)}
213-
/>
214-
) : (
215-
<div
216-
/* eslint-disable react/no-danger */
217-
dangerouslySetInnerHTML={{
218-
__html: finalSubmissionGuidelines,
219-
}}
220-
/* eslint-enable react/no-danger */
221-
styleName="rawHtml"
222-
/>
223-
)
224-
}
225-
</article>
226-
)
227-
}
228198
</div>
229199
)
230200
: (
@@ -408,7 +378,6 @@ ChallengeDetailsView.defaultProps = {
408378
track: 'design',
409379
reviewType: undefined,
410380
numberOfCheckpointsPrizes: 0,
411-
finalSubmissionGuidelines: '',
412381
environment: '',
413382
descriptionFormat: 'HTML',
414383
codeRepo: '',
@@ -438,7 +407,6 @@ ChallengeDetailsView.propTypes = {
438407
groups: PT.any,
439408
reviewType: PT.string,
440409
numberOfCheckpointsPrizes: PT.number,
441-
finalSubmissionGuidelines: PT.string,
442410
environment: PT.string,
443411
codeRepo: PT.string,
444412
userDetails: PT.shape({

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SubmissionsComponent extends React.Component {
5454
}
5555

5656
if (isMM) {
57-
loadMMSubmissions(challenge.id, challenge.registrants, auth.tokenV3);
57+
loadMMSubmissions(challenge.id, auth.tokenV3);
5858
}
5959
this.updateSortedSubmissions();
6060
}
@@ -175,13 +175,16 @@ class SubmissionsComponent extends React.Component {
175175
valueA = `${a.member || ''}`.toLowerCase();
176176
valueB = `${b.member || ''}`.toLowerCase();
177177
} else {
178-
valueA = _.get(a.registrant, 'memberHandle', '');
179-
valueB = _.get(b.registrant, 'memberHandle', '');
178+
valueA = _.get(a.registrant, 'memberHandle', '').toLowerCase();
179+
valueB = _.get(b.registrant, 'memberHandle', '').toLowerCase();
180180
}
181181
valueIsString = true;
182182
break;
183183
}
184184
case 'Time':
185+
valueA = new Date(a.submissions && a.submissions[0].submissionTime);
186+
valueB = new Date(b.submissions && b.submissions[0].submissionTime);
187+
break;
185188
case 'Submission Date': {
186189
valueA = new Date(a.created);
187190
valueB = new Date(b.created);
@@ -247,7 +250,7 @@ class SubmissionsComponent extends React.Component {
247250

248251
let isReviewPhaseComplete = false;
249252
_.forEach(allPhases, (phase) => {
250-
if (phase.name === 'Review' && !phase.isOpen) {
253+
if (phase.name === 'Review' && !phase.isOpen && moment(phase.scheduledStartDate).isBefore()) {
251254
isReviewPhaseComplete = true;
252255
}
253256
});

src/shared/containers/challenge-detail/index.jsx

+9-13
Original file line numberDiff line numberDiff line change
@@ -728,31 +728,27 @@ function mapStateToProps(state, props) {
728728
if (!_.isEmpty(mmSubmissions)) {
729729
mmSubmissions = mmSubmissions.map((submission) => {
730730
let registrant;
731-
let { member } = submission;
732-
if (auth.user.handle === submission.member) {
731+
const { memberId } = submission;
732+
let member = memberId;
733+
if (`${auth.user.userId}` === `${memberId}`) {
733734
mySubmissions = submission.submissions || [];
734735
mySubmissions.forEach((mySubmission, index) => {
735736
mySubmissions[index].id = mySubmissions.length - index;
736737
});
737738
}
738-
let submissionDetail = _.find(challenge.submissions, { createdBy: submission.createdBy });
739-
if (!submissionDetail) {
740-
// get submission detail from submissions challenge detail
741-
submissionDetail = _.find(challenge.submissions, s => (`${s.memberId}` === `${submission.memberId}`));
742-
}
739+
const submissionDetail = _.find(challenge.submissions, s => (`${s.memberId}` === `${submission.memberId}`));
743740

744741
if (submissionDetail) {
745742
member = submissionDetail.createdBy;
746743
({ registrant } = submissionDetail);
747744
}
748745

749746
if (!registrant) {
750-
registrant = _.find(challenge.registrants, { handle: submission.member });
747+
registrant = _.find(challenge.registrants, r => `${r.memberId}` === `${memberId}`);
751748
}
752749

753-
if (!submissionDetail && registrant) {
754-
// sometime member is member id, do this to make sure it's alway member handle
755-
member = registrant.handle;
750+
if (registrant) {
751+
member = registrant.memberHandle;
756752
}
757753

758754
return ({
@@ -926,10 +922,10 @@ const mapDispatchToProps = (dispatch) => {
926922
dispatch(a.updateChallengeInit(uuid));
927923
dispatch(a.updateChallengeDone(uuid, challenge, tokenV3));
928924
},
929-
loadMMSubmissions: (challengeId, registrants, tokenV3) => {
925+
loadMMSubmissions: (challengeId, tokenV3) => {
930926
const a = actions.challenge;
931927
dispatch(a.getMmSubmissionsInit(challengeId));
932-
dispatch(a.getMmSubmissionsDone(challengeId, registrants, tokenV3));
928+
dispatch(a.getMmSubmissionsDone(challengeId, tokenV3));
933929
},
934930
loadSubmissionInformation: (challengeId, submissionId, tokenV3) => {
935931
const a = actions.challenge;

0 commit comments

Comments
 (0)