File tree 2 files changed +10
-3
lines changed
components/ChallengeEditor
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import {
30
30
MULTI_ROUND_CHALLENGE_TEMPLATE_ID , DS_TRACK_ID ,
31
31
CHALLENGE_STATUS
32
32
} from '../../config/constants'
33
- import { getDomainTypes , getResourceRoleByName } from '../../util/tc'
33
+ import { getDomainTypes , getResourceRoleByName , is2RoundsChallenge } from '../../util/tc'
34
34
import { PrimaryButton , OutlineButton } from '../Buttons'
35
35
import TrackField from './Track-Field'
36
36
import TypeField from './Type-Field'
@@ -838,8 +838,7 @@ class ChallengeEditor extends Component {
838
838
const { phases } = this . state . challenge
839
839
let newChallenge = _ . cloneDeep ( this . state . challenge )
840
840
const isDesignChallenge = newChallenge . trackId === DES_TRACK_ID
841
- const is2RoundChallenge =
842
- newChallenge . timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID
841
+ const is2RoundChallenge = is2RoundsChallenge ( newChallenge )
843
842
const is2RoundDesignChallenge = isDesignChallenge && is2RoundChallenge
844
843
845
844
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) {
269
269
}
270
270
return null
271
271
}
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