Skip to content

Commit 6a1758e

Browse files
committed
fix: don't create wrong phases in new challenges
API creates them automatically by "timelineTemplateId"
1 parent d2f1512 commit 6a1758e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/ChallengeEditor/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,7 @@ class ChallengeEditor extends Component {
809809
},
810810
descriptionFormat: 'markdown',
811811
timelineTemplateId: defaultTemplate.id,
812-
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }],
813-
phases: this.getTemplatePhases(defaultTemplate)
812+
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }]
814813
// prizeSets: this.getDefaultPrizeSets()
815814
}
816815
const discussions = this.getDiscussionsConfig(newChallenge)
@@ -841,6 +840,14 @@ class ChallengeEditor extends Component {
841840
}
842841
}
843842

843+
/*
844+
TODO
845+
846+
IMPORTANT!!!
847+
848+
This method might be wrong. We might need to fix it when enabling editing phases UI.
849+
See issue which caused by using of this method https://github.com/topcoder-platform/work-manager/issues/1012
850+
*/
844851
getTemplatePhases (template) {
845852
const timelinePhaseIds = template.phases.map(timelinePhase => timelinePhase.phaseId || timelinePhase)
846853
const validPhases = _.cloneDeep(this.props.metadata.challengePhases).filter(challengePhase => {

0 commit comments

Comments
 (0)