Skip to content

Commit 0adea2f

Browse files
authored
Merge pull request #4871 from topcoder-platform/milestone-v1.3
Milestone-v1.3
2 parents 8b441f5 + ca67b6b commit 0adea2f

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ workflows:
231231
branches:
232232
only:
233233
- develop
234-
- oanh-kiril-tasks
235234
# This is alternate dev env for parallel testing
236235
- "build-test":
237236
context : org-global
@@ -261,6 +260,7 @@ workflows:
261260
filters:
262261
branches:
263262
only:
263+
- milestone-v1.3
264264
- milestone-20200910
265265
- develop
266266
# Production builds are exectuted

src/shared/components/SubmissionManagement/SubmissionManagement/index.jsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import React from 'react';
1919
import PT from 'prop-types';
2020
import moment from 'moment';
2121
import { PrimaryButton } from 'topcoder-react-ui-kit';
22+
import { phaseEndDate } from 'utils/challenge-listing/helper';
2223
import SubmissionsTable from '../SubmissionsTable';
2324

2425
import style from './styles.scss';
@@ -47,9 +48,11 @@ export default function SubmissionManagement(props) {
4748
const currentPhase = challenge.phases
4849
.filter(p => p.name !== 'Registration' && p.isOpen)
4950
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
51+
const submissionPhase = challenge.phases.filter(p => p.name === 'Submission')[0];
52+
const submissionEndDate = submissionPhase && phaseEndDate(submissionPhase);
5053

5154
const now = moment();
52-
const end = moment(currentPhase.scheduledEndDate);
55+
const end = moment(currentPhase && currentPhase.scheduledEndDate);
5356
const diff = end.isAfter(now) ? end.diff(now) : 0;
5457
const timeLeft = moment.duration(diff);
5558

@@ -78,11 +81,15 @@ export default function SubmissionManagement(props) {
7881
</a>
7982
</div>
8083
<div styleName="right-col">
81-
<p styleName="round">
82-
{currentPhase.name}
83-
</p>
8484
{
85-
challenge.status !== 'COMPLETED' ? (
85+
currentPhase && (
86+
<p styleName="round">
87+
{currentPhase.name}
88+
</p>
89+
)
90+
}
91+
{
92+
challenge.status !== 'Completed' ? (
8693
<div>
8794
<p styleName="time-left">
8895
{days > 0 && (`${days}D`)}
@@ -111,7 +118,7 @@ export default function SubmissionManagement(props) {
111118
Manage your submissions
112119
</p>
113120
{
114-
isDesign && (
121+
isDesign && currentPhase && (
115122
<p styleName="round-ends">
116123
<span styleName="ends-label">
117124
{currentPhase.name}
@@ -159,7 +166,7 @@ export default function SubmissionManagement(props) {
159166
)
160167
}
161168
</div>
162-
{now.isBefore(challenge.submissionEndDate) && (
169+
{now.isBefore(submissionEndDate) && (
163170
<div styleName="btn-wrap">
164171
<PrimaryButton
165172
theme={{

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class ChallengeDetailPageContainer extends React.Component {
244244
}
245245

246246
const { track } = nextProps.challenge;
247-
if (track === COMPETITION_TRACKS.DESIGN && thriveArticles.length === 0) {
247+
if (track !== COMPETITION_TRACKS.DESIGN && thriveArticles.length === 0) {
248248
// filter all tags with value 'Other'
249249
const tags = _.filter(nextProps.challenge.tags, tag => tag !== 'Other');
250250
if (tags.length > 0) {
@@ -558,8 +558,8 @@ class ChallengeDetailPageContainer extends React.Component {
558558
hasRegistered={challenge.isRegistered}
559559
unregistering={unregistering}
560560
submissionEnded={submissionEnded}
561-
isMM
562-
isLegacyMM
561+
isMM={isMM}
562+
isLegacyMM={isLegacyMM}
563563
loadingMMSubmissionsForChallengeId={loadingMMSubmissionsForChallengeId}
564564
auth={auth}
565565
loadMMSubmissions={loadMMSubmissions}

0 commit comments

Comments
 (0)