@@ -138,8 +138,6 @@ class ChallengeEditor extends Component {
138138 this . onDeleteChallenge = this . onDeleteChallenge . bind ( this )
139139 this . deleteModalLaunch = this . deleteModalLaunch . bind ( this )
140140 this . toggleForumOnCreate = this . toggleForumOnCreate . bind ( this )
141- this . onSelectForum = this . onSelectForum . bind ( this )
142- this . toggleForumOnCreate = this . toggleForumOnCreate . bind ( this )
143141 }
144142
145143 componentDidMount ( ) {
@@ -593,10 +591,6 @@ class ChallengeEditor extends Component {
593591 this . setState ( { hasForum : ! hasForum } )
594592 }
595593
596- onSelectForum ( hasForum ) {
597- this . setState ( { hasForum } )
598- }
599-
600594 toggleAdvanceSettings ( ) {
601595 const { isOpenAdvanceSettings } = this . state
602596 this . setState ( { isOpenAdvanceSettings : ! isOpenAdvanceSettings } )
@@ -929,14 +923,7 @@ class ChallengeEditor extends Component {
929923 if ( projectDetail . groups ) {
930924 newChallenge . groups . push ( ...projectDetail . groups )
931925 }
932- if ( isTask ) {
933- if ( this . state . hasForum ) {
934- const discussions = this . getDiscussionsConfig ( newChallenge )
935- if ( discussions ) {
936- newChallenge . discussions = discussions
937- }
938- }
939- } else {
926+ if ( ! isTask || this . state . hasForum ) {
940927 const discussions = this . getDiscussionsConfig ( newChallenge )
941928 if ( discussions ) {
942929 newChallenge . discussions = discussions
@@ -1461,7 +1448,7 @@ class ChallengeEditor extends Component {
14611448 )
14621449 }
14631450 </ React . Fragment >
1464- const useTask = _ . find ( metadata . challengeTypes , { id : challenge . typeId , isTask : true } )
1451+ // const useTask = _.find(metadata.challengeTypes, { id: challenge.typeId, isTask: true })
14651452 const selectedType = _ . find ( metadata . challengeTypes , { id : challenge . typeId } )
14661453 const challengeTrack = _ . find ( metadata . challengeTracks , { id : challenge . trackId } )
14671454 const selectedMilestone = _ . find ( projectPhases ,
@@ -1481,7 +1468,7 @@ class ChallengeEditor extends Component {
14811468 < TypeField types = { metadata . challengeTypes } onUpdateSelect = { this . onUpdateSelect } challenge = { challenge } />
14821469 < ChallengeNameField challenge = { challenge } onUpdateInput = { this . onUpdateInput } />
14831470 { projectDetail . version === 'v4' && < MilestoneField milestones = { activeProjectMilestones } onUpdateSelect = { this . onUpdateSelect } projectId = { projectDetail . id } selectedMilestoneId = { selectedMilestoneId } /> }
1484- { useTask && ( < DiscussionField hasForum = { hasForum } toggleForum = { this . toggleForumOnCreate } /> ) }
1471+ { isTask && ( < DiscussionField hasForum = { hasForum } toggleForum = { this . toggleForumOnCreate } /> ) }
14851472 </ div >
14861473 { showDesignChallengeWarningModel && designChallengeModal }
14871474 { errorContainer }
0 commit comments