Skip to content

Commit 6ecbc74

Browse files
committed
Only show dashboard checkbox for DS challenges and dev / MM
#1420
1 parent 03a7495 commit 6ecbc74

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

config/constants/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
DS_TRACK_ID: 'c0f5d461-8219-4c14-878a-c3a3f356466d',
3535
QA_TRACK_ID: '36e6a8d0-7e1e-4608-a673-64279d99c115',
3636
CHALLENGE_TYPE_ID: '927abff4-7af9-4145-8ba1-577c16e64e2e',
37+
MARATHON_TYPE_ID: '929bc408-9cf2-4b3e-ba71-adfbf693046c',
3738
SEGMENT_API_KEY: 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n',
3839
CREATE_FORUM_TYPE_IDS: ['927abff4-7af9-4145-8ba1-577c16e64e2e', 'dc876fa4-ef2d-4eee-b701-b555fcc6544c', 'ecd58c69-238f-43a4-a4bb-d172719b9f31'],
3940
FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY,

config/constants/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
DS_TRACK_ID: 'c0f5d461-8219-4c14-878a-c3a3f356466d',
3535
QA_TRACK_ID: '36e6a8d0-7e1e-4608-a673-64279d99c115',
3636
CHALLENGE_TYPE_ID: '927abff4-7af9-4145-8ba1-577c16e64e2e',
37+
MARATHON_TYPE_ID: '929bc408-9cf2-4b3e-ba71-adfbf693046c',
3738
SEGMENT_API_KEY: 'QSQAW5BWmZfLoKFNRgNKaqHvLDLJoGqF',
3839
CREATE_FORUM_TYPE_IDS: ['927abff4-7af9-4145-8ba1-577c16e64e2e', 'dc876fa4-ef2d-4eee-b701-b555fcc6544c', 'ecd58c69-238f-43a4-a4bb-d172719b9f31'],
3940
FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY,

src/components/ChallengeEditor/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import {
2020
MESSAGE,
2121
COMMUNITY_APP_URL,
2222
DES_TRACK_ID,
23+
DEV_TRACK_ID,
2324
CHALLENGE_TYPE_ID,
25+
MARATHON_TYPE_ID,
2426
REVIEW_TYPES,
2527
MILESTONE_STATUS,
2628
PHASE_PRODUCT_CHALLENGE_ID_FIELD,
@@ -955,6 +957,10 @@ class ChallengeEditor extends Component {
955957
const { timelineTemplates } = metadata
956958
const isDesignChallenge = trackId === DES_TRACK_ID
957959
const isDataScience = trackId === DS_TRACK_ID
960+
const isChallengeType = typeId === CHALLENGE_TYPE_ID
961+
const isDevChallenge = trackId === DEV_TRACK_ID
962+
const isMM = typeId === MARATHON_TYPE_ID
963+
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM)
958964

959965
// indicate that creating process has started
960966
this.setState({ isSaving: true })
@@ -1012,7 +1018,7 @@ class ChallengeEditor extends Component {
10121018
newChallenge.discussions = discussions
10131019
}
10141020
}
1015-
if (isDataScience) {
1021+
if (showDashBoard) {
10161022
if (!newChallenge.metadata) {
10171023
newChallenge.metadata = []
10181024
}
@@ -1561,10 +1567,12 @@ class ChallengeEditor extends Component {
15611567
const showTimeline = false // disables the timeline for time being https://github.com/topcoder-platform/challenge-engine-ui/issues/706
15621568
const copilotResources = metadata.members || challengeResources
15631569
const isDesignChallenge = challenge.trackId === DES_TRACK_ID
1570+
const isDevChallenge = challenge.trackId === DEV_TRACK_ID
1571+
const isMM = challenge.typeId === MARATHON_TYPE_ID
15641572
const isChallengeType = challenge.typeId === CHALLENGE_TYPE_ID
15651573
const showRoundType = isDesignChallenge && isChallengeType
15661574
const showCheckpointPrizes = challenge.timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID
1567-
const isDataScience = challenge.trackId === DS_TRACK_ID
1575+
const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM)
15681576
const useDashboardData = _.find(challenge.metadata, { name: 'show_data_dashboard' })
15691577
const useDashboard = useDashboardData ? useDashboardData.value : true
15701578

@@ -1584,7 +1592,7 @@ class ChallengeEditor extends Component {
15841592
}
15851593
<ChallengeNameField challenge={challenge} onUpdateInput={this.onUpdateInput} />
15861594
{
1587-
isDataScience && (
1595+
showDashBoard && (
15881596
<div className={styles.row}>
15891597
<div className={cn(styles.field, styles.col1)}>
15901598
<label htmlFor='isDashboardEnabled'>Use data dashboard :</label>
@@ -1635,7 +1643,7 @@ class ChallengeEditor extends Component {
16351643

16361644
<ChallengeNameField challenge={challenge} onUpdateInput={this.onUpdateInput} />
16371645
{
1638-
isDataScience && (
1646+
showDashBoard && (
16391647
<div className={styles.row}>
16401648
<div className={cn(styles.field, styles.col1)}>
16411649
<label htmlFor='isDashboardEnabled'>Use data dashboard :</label>

src/config/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const {
1717
DS_TRACK_ID,
1818
QA_TRACK_ID,
1919
CHALLENGE_TYPE_ID,
20+
MARATHON_TYPE_ID,
2021
SEGMENT_API_KEY,
2122
MULTI_ROUND_CHALLENGE_TEMPLATE_ID
2223
} = process.env

0 commit comments

Comments
 (0)