File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
components/ChallengeEditor Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import {
3030 MULTI_ROUND_CHALLENGE_TEMPLATE_ID , DS_TRACK_ID ,
3131 CHALLENGE_STATUS
3232} from '../../config/constants'
33- import { getDomainTypes , getResourceRoleByName } from '../../util/tc'
33+ import { getDomainTypes , getResourceRoleByName , is2RoundsChallenge } from '../../util/tc'
3434import { PrimaryButton , OutlineButton } from '../Buttons'
3535import TrackField from './Track-Field'
3636import TypeField from './Type-Field'
@@ -838,8 +838,7 @@ class ChallengeEditor extends Component {
838838 const { phases } = this . state . challenge
839839 let newChallenge = _ . cloneDeep ( this . state . challenge )
840840 const isDesignChallenge = newChallenge . trackId === DES_TRACK_ID
841- const is2RoundChallenge =
842- newChallenge . timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID
841+ const is2RoundChallenge = is2RoundsChallenge ( newChallenge )
843842 const is2RoundDesignChallenge = isDesignChallenge && is2RoundChallenge
844843
845844 for ( let index = 0 ; index < phases . length ; ++ index ) {
Original file line number Diff line number Diff line change @@ -269,3 +269,11 @@ export function getChallengeTypeAbbr (track, challengeTypes) {
269269 }
270270 return null
271271}
272+
273+ /**
274+ * Check if challenge is 2 rounds challenge or not
275+ * @param {Object } challenge challenge info
276+ */
277+ export function is2RoundsChallenge ( challenge ) {
278+ return ! ! _ . find ( challenge . phases , { name : 'Checkpoint Submission' } )
279+ }
You can’t perform that action at this time.
0 commit comments