@@ -32,7 +32,8 @@ import {
3232 CREATE_CHALLENGE_RESOURCE_FAILURE ,
3333 DELETE_CHALLENGE_SUCCESS ,
3434 DELETE_CHALLENGE_FAILURE ,
35- DELETE_CHALLENGE_PENDING
35+ DELETE_CHALLENGE_PENDING ,
36+ MULTI_ROUND_CHALLENGE_TEMPLATE_ID
3637} from '../config/constants'
3738
3839const initialState = {
@@ -108,7 +109,7 @@ export default function (state = initialState, action) {
108109 ...state ,
109110 challengeDetails : { ...action . payload ,
110111 // 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+ phases : ( action . payload . timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID && action . payload . phases . length === 8 ) ? [
112113 action . payload . phases . find ( x => x . name === 'Registration' ) ,
113114 action . payload . phases . find ( x => x . name === 'Checkpoint Submission' ) ,
114115 action . payload . phases . find ( x => x . name === 'Checkpoint Screening' ) ,
@@ -161,7 +162,18 @@ export default function (state = initialState, action) {
161162 return {
162163 ...state ,
163164 challenges : updatedChallenges ,
164- challengeDetails : action . challengeDetails ,
165+ challengeDetails : { ...action . challengeDetails ,
166+ // change the phase order for the design challenge with multiple phases
167+ phases : ( action . challengeDetails . timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID && action . challengeDetails . phases . length === 8 ) ? [
168+ action . challengeDetails . phases . find ( x => x . name === 'Registration' ) ,
169+ action . challengeDetails . phases . find ( x => x . name === 'Checkpoint Submission' ) ,
170+ action . challengeDetails . phases . find ( x => x . name === 'Checkpoint Screening' ) ,
171+ action . challengeDetails . phases . find ( x => x . name === 'Checkpoint Review' ) ,
172+ action . challengeDetails . phases . find ( x => x . name === 'Submission' ) ,
173+ action . challengeDetails . phases . find ( x => x . name === 'Screening' ) ,
174+ action . challengeDetails . phases . find ( x => x . name === 'Review' ) ,
175+ action . challengeDetails . phases . find ( x => x . name === 'Approval' ) ] : action . challengeDetails . phases
176+ } ,
165177 isLoading : false ,
166178 attachments : _ . has ( action . challengeDetails , 'attachments' ) ? action . challengeDetails . attachments : [ ] ,
167179 failedToLoad : false
0 commit comments