From e2d7832e263aade16680536bb072c11932cc065d Mon Sep 17 00:00:00 2001 From: maxceem Date: Thu, 29 Apr 2021 21:41:01 +0300 Subject: [PATCH 1/4] Revert "Revert "Pure V5 task"" --- .../ChallengeEditor/ChallengeView/index.js | 10 +++--- src/components/ChallengeEditor/index.js | 5 ++- .../ChallengeCard/index.js | 35 +++++++++++-------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/components/ChallengeEditor/ChallengeView/index.js b/src/components/ChallengeEditor/ChallengeView/index.js index 37c26c79..1d25750b 100644 --- a/src/components/ChallengeEditor/ChallengeView/index.js +++ b/src/components/ChallengeEditor/ChallengeView/index.js @@ -86,15 +86,17 @@ const ChallengeView = ({ return (
-
- -
+ {!isTask && ( +
+ +
+ )}
View Details
{ challenge.status === 'Draft' && (
- {challenge.legacyId ? ( + {(challenge.legacyId || isTask) ? ( ) : ( diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index 25ed660c..72f65940 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -877,6 +877,9 @@ class ChallengeEditor extends Component { groups: [] // prizeSets: this.getDefaultPrizeSets() } + if (isTask) { + newChallenge.legacy.pureV5Task = true + } if (projectDetail.terms) { const currTerms = new Set(newChallenge.terms.map(term => term.id)) newChallenge.terms.push( @@ -1371,7 +1374,7 @@ class ChallengeEditor extends Component {
{isDraft && (
- {challenge.legacyId ? ( + {challenge.legacyId || isTask ? ( ) : ( diff --git a/src/components/ChallengesComponent/ChallengeCard/index.js b/src/components/ChallengesComponent/ChallengeCard/index.js index 0ed1fe4c..5a1258ae 100644 --- a/src/components/ChallengesComponent/ChallengeCard/index.js +++ b/src/components/ChallengesComponent/ChallengeCard/index.js @@ -104,6 +104,7 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => { const communityAppUrl = `${COMMUNITY_APP_URL}/challenges/${challenge.id}` const directUrl = `${DIRECT_PROJECT_URL}/contest/detail?projectId=${challenge.legacyId}` const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}` + const isTask = _.get(challenge, 'task.isTask', false) // NEW projects never have Legacy challenge created, so don't show links and "Activate" button for them at all if (challenge.status.toUpperCase() === CHALLENGE_STATUS.NEW) { @@ -114,15 +115,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => { ) } - return challenge.legacyId ? ( + return challenge.legacyId || isTask ? (
View Challenge -
- Direct - | - OR -
+ {!isTask && ( +
+ Direct + | + OR +
+ )}
{challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT && (