Skip to content

Commit e2d7832

Browse files
authored
Revert "Revert "Pure V5 task""
1 parent 9c94454 commit e2d7832

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ const ChallengeView = ({
8686
return (
8787
<div className={styles.wrapper}>
8888
<Helmet title='View Details' />
89-
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
90-
<LegacyLinks challenge={challenge} />
91-
</div>
89+
{!isTask && (
90+
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
91+
<LegacyLinks challenge={challenge} />
92+
</div>
93+
)}
9294
<div className={styles.title}>View Details</div>
9395
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsRight)}>
9496
{
9597
challenge.status === 'Draft' && (
9698
<div className={styles.button}>
97-
{challenge.legacyId ? (
99+
{(challenge.legacyId || isTask) ? (
98100
<PrimaryButton text={'Launch'} type={'info'} onClick={onLaunchChallenge} />
99101
) : (
100102
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>

src/components/ChallengeEditor/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,9 @@ class ChallengeEditor extends Component {
877877
groups: []
878878
// prizeSets: this.getDefaultPrizeSets()
879879
}
880+
if (isTask) {
881+
newChallenge.legacy.pureV5Task = true
882+
}
880883
if (projectDetail.terms) {
881884
const currTerms = new Set(newChallenge.terms.map(term => term.id))
882885
newChallenge.terms.push(
@@ -1371,7 +1374,7 @@ class ChallengeEditor extends Component {
13711374
</div>
13721375
{isDraft && (
13731376
<div className={styles.button}>
1374-
{challenge.legacyId ? (
1377+
{challenge.legacyId || isTask ? (
13751378
<PrimaryButton text={'Launch as Active'} type={'info'} onClick={this.toggleLaunch} />
13761379
) : (
13771380
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>

src/components/ChallengesComponent/ChallengeCard/index.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
104104
const communityAppUrl = `${COMMUNITY_APP_URL}/challenges/${challenge.id}`
105105
const directUrl = `${DIRECT_PROJECT_URL}/contest/detail?projectId=${challenge.legacyId}`
106106
const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}`
107+
const isTask = _.get(challenge, 'task.isTask', false)
107108

108109
// NEW projects never have Legacy challenge created, so don't show links and "Activate" button for them at all
109110
if (challenge.status.toUpperCase() === CHALLENGE_STATUS.NEW) {
@@ -114,15 +115,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
114115
)
115116
}
116117

117-
return challenge.legacyId ? (
118+
return challenge.legacyId || isTask ? (
118119
<div className={styles.linkGroup}>
119120
<div className={styles.linkGroupLeft}>
120121
<a className={styles.link} href={communityAppUrl} target='_blank'>View Challenge</a>
121-
<div className={styles.linkGroupLeftBottom}>
122-
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
123-
<span className={styles.linkDivider}>|</span>
124-
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
125-
</div>
122+
{!isTask && (
123+
<div className={styles.linkGroupLeftBottom}>
124+
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
125+
<span className={styles.linkDivider}>|</span>
126+
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
127+
</div>
128+
)}
126129
</div>
127130
{challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT && (
128131
<button className={styles.activateButton} onClick={() => onUpdateLaunch()}>
@@ -134,15 +137,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
134137
<div className={styles.linkGroup}>
135138
<div className={styles.linkGroupLeft}>
136139
<a className={styles.link} href={communityAppUrl}>View Challenge</a>
137-
<div className={styles.linkGroupLeftBottom}>
138-
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
139-
<span className={styles.link}>Direct</span>
140-
</Tooltip>
141-
<span className={styles.linkDivider}>|</span>
142-
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
143-
<span className={styles.link}>OR</span>
144-
</Tooltip>
145-
</div>
140+
{!isTask && (
141+
<div className={styles.linkGroupLeftBottom}>
142+
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
143+
<span className={styles.link}>Direct</span>
144+
</Tooltip>
145+
<span className={styles.linkDivider}>|</span>
146+
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
147+
<span className={styles.link}>OR</span>
148+
</Tooltip>
149+
</div>
150+
)}
146151
</div>
147152
{
148153
challenge.status === 'Draft' && (

0 commit comments

Comments
 (0)