Skip to content

Commit d02c0db

Browse files
committed
legacy v5 task
1 parent 0dfc40b commit d02c0db

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ 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
{

src/components/ChallengeEditor/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ class ChallengeEditor extends Component {
851851
groups: []
852852
// prizeSets: this.getDefaultPrizeSets()
853853
}
854+
if (isTask) {
855+
newChallenge.legacy.pureV5Task = true
856+
}
854857
if (projectDetail.terms) {
855858
const currTerms = new Set(newChallenge.terms.map(term => term.id))
856859
newChallenge.terms.push(

src/components/ChallengesComponent/ChallengeCard/index.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
100100
const communityAppUrl = `${COMMUNITY_APP_URL}/challenges/${challenge.id}`
101101
const directUrl = `${DIRECT_PROJECT_URL}/contest/detail?projectId=${challenge.legacyId}`
102102
const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}`
103+
const isTask = _.get(challenge, 'task.isTask', false)
103104

104105
// NEW projects never have Legacy challenge created, so don't show links and "Activate" button for them at all
105106
if (challenge.status.toUpperCase() === CHALLENGE_STATUS.NEW) {
@@ -114,11 +115,13 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
114115
<div className={styles.linkGroup}>
115116
<div className={styles.linkGroupLeft}>
116117
<a className={styles.link} href={communityAppUrl} target='_blank'>View Challenge</a>
117-
<div className={styles.linkGroupLeftBottom}>
118-
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
119-
<span className={styles.linkDivider}>|</span>
120-
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
121-
</div>
118+
{!isTask && (
119+
<div className={styles.linkGroupLeftBottom}>
120+
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
121+
<span className={styles.linkDivider}>|</span>
122+
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
123+
</div>
124+
)}
122125
</div>
123126
{challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT && (
124127
<button className={styles.activateButton} onClick={() => onUpdateLaunch()}>
@@ -130,15 +133,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
130133
<div className={styles.linkGroup}>
131134
<div className={styles.linkGroupLeft}>
132135
<a className={styles.link} href={communityAppUrl}>View Challenge</a>
133-
<div className={styles.linkGroupLeftBottom}>
134-
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
135-
<span className={styles.link}>Direct</span>
136-
</Tooltip>
137-
<span className={styles.linkDivider}>|</span>
138-
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
139-
<span className={styles.link}>OR</span>
140-
</Tooltip>
141-
</div>
136+
{!isTask && (
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>
146+
)}
142147
</div>
143148
{
144149
challenge.status === 'Draft' && (

0 commit comments

Comments
 (0)