@@ -32,7 +32,8 @@ import {
32
32
CREATE_CHALLENGE_RESOURCE_FAILURE ,
33
33
DELETE_CHALLENGE_SUCCESS ,
34
34
DELETE_CHALLENGE_FAILURE ,
35
- DELETE_CHALLENGE_PENDING
35
+ DELETE_CHALLENGE_PENDING ,
36
+ MULTI_ROUND_CHALLENGE_TEMPLATE_ID
36
37
} from '../config/constants'
37
38
38
39
const initialState = {
@@ -108,7 +109,7 @@ export default function (state = initialState, action) {
108
109
...state ,
109
110
challengeDetails : { ...action . payload ,
110
111
// 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 ) ? [
112
113
action . payload . phases . find ( x => x . name === 'Registration' ) ,
113
114
action . payload . phases . find ( x => x . name === 'Checkpoint Submission' ) ,
114
115
action . payload . phases . find ( x => x . name === 'Checkpoint Screening' ) ,
@@ -161,7 +162,18 @@ export default function (state = initialState, action) {
161
162
return {
162
163
...state ,
163
164
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
+ } ,
165
177
isLoading : false ,
166
178
attachments : _ . has ( action . challengeDetails , 'attachments' ) ? action . challengeDetails . attachments : [ ] ,
167
179
failedToLoad : false
0 commit comments