Skip to content

Commit 07f5ed3

Browse files
committed
Phase ordering fix
1 parent 2b6f6b3 commit 07f5ed3

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,14 @@ const ChallengeView = ({
207207
</>
208208
)}
209209
{
210-
_.sortBy(phases, ['scheduledEndDate']).map((phase, index) => (
210+
challenge.legacy.subTrack === 'WEB_DESIGNS' && challenge.phases.length === 8 ? phases.map((phase, index) => (
211+
<PhaseInput
212+
phase={phase}
213+
phaseIndex={index}
214+
key={index}
215+
readOnly
216+
/>
217+
)) : _.sortBy(phases, ['scheduledEndDate']).map((phase, index) => (
211218
<PhaseInput
212219
phase={phase}
213220
phaseIndex={index}

src/reducers/challenges.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,18 @@ export default function (state = initialState, action) {
106106
case LOAD_CHALLENGE_DETAILS_SUCCESS: {
107107
return {
108108
...state,
109-
challengeDetails: action.payload,
109+
challengeDetails: { ...action.payload,
110+
// change the phase order for the design challenge with multiple phases
111+
phases: (action.payload.legacy.subTrack === 'WEB_DESIGNS' && action.payload.phases.length === 8) ? [
112+
action.payload.phases.find(x => x.name === 'Registration'),
113+
action.payload.phases.find(x => x.name === 'Checkpoint Submission'),
114+
action.payload.phases.find(x => x.name === 'Checkpoint Screening'),
115+
action.payload.phases.find(x => x.name === 'Checkpoint Review'),
116+
action.payload.phases.find(x => x.name === 'Submission'),
117+
action.payload.phases.find(x => x.name === 'Screening'),
118+
action.payload.phases.find(x => x.name === 'Review'),
119+
action.payload.phases.find(x => x.name === 'Approval')] : action.payload.phases
120+
},
110121
isLoading: false,
111122
attachments: _.has(action.payload, 'attachments') ? action.payload.attachments : [],
112123
failedToLoad: false

0 commit comments

Comments
 (0)