Skip to content

Release v5 develop #4837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/server/tc-communities/tco19/metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"challengeFilter": {
"groupIds": ["20000078"],
"or": [{
"tags": ["TCO", "TCO19"]
}]
"events": ["tco19"]
},
"communityId": "tco19",
"communityName": "TCO19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ const ChallengeSpecTab = ({ challenge }) => (
</article>
)
}
{
challenge.finalSubmissionGuidelines
&& (
<article>
<h2 styleName="h2">
Final Submission Guidelines
</h2>
<div
/* eslint-disable react/no-danger */
dangerouslySetInnerHTML={{
__html: challenge.finalSubmissionGuidelines,
}}
/* eslint-enable react/no-danger */
styleName="rawHtml"
/>
</article>
)
}
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MySubmissionsView extends React.Component {
}

if (isMM) {
loadMMSubmissions(challenge.id, challenge.registrants, auth.tokenV3);
loadMMSubmissions(challenge.id, auth.tokenV3);
}
}

Expand Down
32 changes: 0 additions & 32 deletions src/shared/components/challenge-detail/Specification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function ChallengeDetailsView(props) {
legacy,
legacyId,
documents,
finalSubmissionGuidelines,
userDetails,
metadata,
events,
Expand Down Expand Up @@ -196,35 +195,6 @@ export default function ChallengeDetailsView(props) {
</article>
)
}
{
finalSubmissionGuidelines
&& (
<article>
<h2>
Final Submission Guidelines
</h2>
{
editMode ? (
<Editor
connector={toolbarConnector}
id="submissionGuidelines"
initialMode={EDITOR_MODES.WYSIWYG}
ref={n => n && n.setHtml(finalSubmissionGuidelines)}
/>
) : (
<div
/* eslint-disable react/no-danger */
dangerouslySetInnerHTML={{
__html: finalSubmissionGuidelines,
}}
/* eslint-enable react/no-danger */
styleName="rawHtml"
/>
)
}
</article>
)
}
</div>
)
: (
Expand Down Expand Up @@ -408,7 +378,6 @@ ChallengeDetailsView.defaultProps = {
track: 'design',
reviewType: undefined,
numberOfCheckpointsPrizes: 0,
finalSubmissionGuidelines: '',
environment: '',
descriptionFormat: 'HTML',
codeRepo: '',
Expand Down Expand Up @@ -438,7 +407,6 @@ ChallengeDetailsView.propTypes = {
groups: PT.any,
reviewType: PT.string,
numberOfCheckpointsPrizes: PT.number,
finalSubmissionGuidelines: PT.string,
environment: PT.string,
codeRepo: PT.string,
userDetails: PT.shape({
Expand Down
11 changes: 7 additions & 4 deletions src/shared/components/challenge-detail/Submissions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SubmissionsComponent extends React.Component {
}

if (isMM) {
loadMMSubmissions(challenge.id, challenge.registrants, auth.tokenV3);
loadMMSubmissions(challenge.id, auth.tokenV3);
}
this.updateSortedSubmissions();
}
Expand Down Expand Up @@ -175,13 +175,16 @@ class SubmissionsComponent extends React.Component {
valueA = `${a.member || ''}`.toLowerCase();
valueB = `${b.member || ''}`.toLowerCase();
} else {
valueA = _.get(a.registrant, 'memberHandle', '');
valueB = _.get(b.registrant, 'memberHandle', '');
valueA = _.get(a.registrant, 'memberHandle', '').toLowerCase();
valueB = _.get(b.registrant, 'memberHandle', '').toLowerCase();
}
valueIsString = true;
break;
}
case 'Time':
valueA = new Date(a.submissions && a.submissions[0].submissionTime);
valueB = new Date(b.submissions && b.submissions[0].submissionTime);
break;
case 'Submission Date': {
valueA = new Date(a.created);
valueB = new Date(b.created);
Expand Down Expand Up @@ -247,7 +250,7 @@ class SubmissionsComponent extends React.Component {

let isReviewPhaseComplete = false;
_.forEach(allPhases, (phase) => {
if (phase.name === 'Review' && !phase.isOpen) {
if (phase.name === 'Review' && !phase.isOpen && moment(phase.scheduledStartDate).isBefore()) {
isReviewPhaseComplete = true;
}
});
Expand Down
22 changes: 9 additions & 13 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -728,31 +728,27 @@ function mapStateToProps(state, props) {
if (!_.isEmpty(mmSubmissions)) {
mmSubmissions = mmSubmissions.map((submission) => {
let registrant;
let { member } = submission;
if (auth.user.handle === submission.member) {
const { memberId } = submission;
let member = memberId;
if (`${auth.user.userId}` === `${memberId}`) {
mySubmissions = submission.submissions || [];
mySubmissions.forEach((mySubmission, index) => {
mySubmissions[index].id = mySubmissions.length - index;
});
}
let submissionDetail = _.find(challenge.submissions, { createdBy: submission.createdBy });
if (!submissionDetail) {
// get submission detail from submissions challenge detail
submissionDetail = _.find(challenge.submissions, s => (`${s.memberId}` === `${submission.memberId}`));
}
const submissionDetail = _.find(challenge.submissions, s => (`${s.memberId}` === `${submission.memberId}`));

if (submissionDetail) {
member = submissionDetail.createdBy;
({ registrant } = submissionDetail);
}

if (!registrant) {
registrant = _.find(challenge.registrants, { handle: submission.member });
registrant = _.find(challenge.registrants, r => `${r.memberId}` === `${memberId}`);
}

if (!submissionDetail && registrant) {
// sometime member is member id, do this to make sure it's alway member handle
member = registrant.handle;
if (registrant) {
member = registrant.memberHandle;
}

return ({
Expand Down Expand Up @@ -926,10 +922,10 @@ const mapDispatchToProps = (dispatch) => {
dispatch(a.updateChallengeInit(uuid));
dispatch(a.updateChallengeDone(uuid, challenge, tokenV3));
},
loadMMSubmissions: (challengeId, registrants, tokenV3) => {
loadMMSubmissions: (challengeId, tokenV3) => {
const a = actions.challenge;
dispatch(a.getMmSubmissionsInit(challengeId));
dispatch(a.getMmSubmissionsDone(challengeId, registrants, tokenV3));
dispatch(a.getMmSubmissionsDone(challengeId, tokenV3));
},
loadSubmissionInformation: (challengeId, submissionId, tokenV3) => {
const a = actions.challenge;
Expand Down