Skip to content

Commit 418fa85

Browse files
Merge pull request topcoder-platform#4915 from topcoder-platform/issue-4910
Added !isEmpty check before call phaseStartDate and phaseEndDate
2 parents 08fb3c3 + 8e8d071 commit 418fa85

File tree

2 files changed

+5
-5
lines changed
  • src/shared
    • components/challenge-listing/Tooltips/ProgressBarTooltip
    • utils/challenge-listing

2 files changed

+5
-5
lines changed

src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ function Tip(props) {
101101
const submissionPhase = allPhases.find(phase => phase.name === 'Submission') || {};
102102
const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission') || {};
103103

104-
if (registrationPhase) {
104+
if (!_.isEmpty(registrationPhase)) {
105105
steps.push({
106106
date: phaseStartDate(registrationPhase),
107107
name: 'Start',
108108
});
109109
}
110-
if (checkpointPhase) {
110+
if (!_.isEmpty(checkpointPhase)) {
111111
steps.push({
112112
date: phaseEndDate(checkpointPhase),
113113
name: 'Checkpoint',
@@ -119,7 +119,7 @@ function Tip(props) {
119119
date: phaseEndDate(iterativeReviewPhase),
120120
name: 'Iterative Review',
121121
});
122-
} else if (submissionPhase) {
122+
} else if (!_.isEmpty(submissionPhase)) {
123123
steps.push({
124124
date: phaseEndDate(submissionPhase),
125125
name: 'Submission',

src/shared/utils/challenge-listing/sort.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import moment from 'moment';
6-
import { find, sumBy } from 'lodash';
6+
import { find, sumBy, isEmpty } from 'lodash';
77
import { phaseStartDate, phaseEndDate } from './helper';
88

99
export const SORTS = {
@@ -59,7 +59,7 @@ export default {
5959
const registrationPhase = find(challenge.phases, p => p.name === 'Registration') || {};
6060
const submissionPhase = find(challenge.phases, p => p.name === 'Submission') || {};
6161
// registration phase exists
62-
if (registrationPhase) {
62+
if (!isEmpty(registrationPhase)) {
6363
return moment(phaseStartDate(registrationPhase));
6464
}
6565
// registration phase doesnt exist, This is possibly a F2F or TSK. Take submission phase

0 commit comments

Comments
 (0)