File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
components/ChallengeEditor Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -31,5 +31,6 @@ module.exports = {
31
31
DES_TRACK_ID : '5fa04185-041f-49a6-bfd1-fe82533cd6c8' ,
32
32
DS_TRACK_ID : 'c0f5d461-8219-4c14-878a-c3a3f356466d' ,
33
33
QA_TRACK_ID : '36e6a8d0-7e1e-4608-a673-64279d99c115' ,
34
- SEGMENT_API_KEY : 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n'
34
+ SEGMENT_API_KEY : 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n' ,
35
+ CREATE_FORUM_TYPE_IDS : [ '927abff4-7af9-4145-8ba1-577c16e64e2e' , 'dc876fa4-ef2d-4eee-b701-b555fcc6544c' ]
35
36
}
Original file line number Diff line number Diff line change @@ -31,5 +31,6 @@ module.exports = {
31
31
DES_TRACK_ID : '5fa04185-041f-49a6-bfd1-fe82533cd6c8' ,
32
32
DS_TRACK_ID : 'c0f5d461-8219-4c14-878a-c3a3f356466d' ,
33
33
QA_TRACK_ID : '36e6a8d0-7e1e-4608-a673-64279d99c115' ,
34
- SEGMENT_API_KEY : 'QSQAW5BWmZfLoKFNRgNKaqHvLDLJoGqF'
34
+ SEGMENT_API_KEY : 'QSQAW5BWmZfLoKFNRgNKaqHvLDLJoGqF' ,
35
+ CREATE_FORUM_TYPE_IDS : [ '927abff4-7af9-4145-8ba1-577c16e64e2e' , 'dc876fa4-ef2d-4eee-b701-b555fcc6544c' ]
35
36
}
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import {
15
15
PRIZE_SETS_TYPE ,
16
16
DEFAULT_TERM_UUID ,
17
17
DEFAULT_NDA_UUID ,
18
- SUBMITTER_ROLE_UUID
18
+ SUBMITTER_ROLE_UUID ,
19
+ CREATE_FORUM_TYPE_IDS
19
20
} from '../../config/constants'
20
21
import { PrimaryButton , OutlineButton } from '../Buttons'
21
22
import TrackField from './Track-Field'
@@ -767,6 +768,10 @@ class ChallengeEditor extends Component {
767
768
phases : this . getTemplatePhases ( defaultTemplate )
768
769
// prizeSets: this.getDefaultPrizeSets()
769
770
}
771
+ const discussions = this . getDiscussionsConfig ( newChallenge )
772
+ if ( discussions ) {
773
+ newChallenge . discussions = discussions
774
+ }
770
775
try {
771
776
const action = await createChallenge ( newChallenge )
772
777
const draftChallenge = {
@@ -779,6 +784,18 @@ class ChallengeEditor extends Component {
779
784
}
780
785
}
781
786
787
+ getDiscussionsConfig ( challenge ) {
788
+ if ( _ . includes ( CREATE_FORUM_TYPE_IDS , challenge . typeId ) ) {
789
+ return ( [
790
+ {
791
+ name : `${ challenge . name } Discussion` ,
792
+ type : 'challenge' ,
793
+ provider : 'vanilla'
794
+ }
795
+ ] )
796
+ }
797
+ }
798
+
782
799
getTemplatePhases ( template ) {
783
800
const timelinePhaseIds = template . phases . map ( timelinePhase => timelinePhase . phaseId || timelinePhase )
784
801
const validPhases = _ . cloneDeep ( this . props . metadata . challengePhases ) . filter ( challengePhase => {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const {
16
16
QA_TRACK_ID ,
17
17
SEGMENT_API_KEY
18
18
} = process . env
19
+ export const CREATE_FORUM_TYPE_IDS = typeof process . env . CREATE_FORUM_TYPE_IDS === 'string' ? process . env . CREATE_FORUM_TYPE_IDS . split ( ',' ) : process . env . CREATE_FORUM_TYPE_IDS
19
20
20
21
// Actions
21
22
export const LOAD_PROJECTS_SUCCESS = 'LOAD_PROJECTS_SUCCESS'
You can’t perform that action at this time.
0 commit comments