Skip to content

Commit

Permalink
Merge pull request #1155 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Prod minor release - 0.8.0
  • Loading branch information
vikasrohit authored May 18, 2021
2 parents 6012e9e + 32f3d47 commit 0df6294
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the base image with Node.js
FROM node:latest
FROM node:10
ARG NODE_ENV
ARG BABEL_ENV

Expand Down
10 changes: 6 additions & 4 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ const ChallengeView = ({
return (
<div className={styles.wrapper}>
<Helmet title='View Details' />
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
<LegacyLinks challenge={challenge} />
</div>
{!isTask && (
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
<LegacyLinks challenge={challenge} />
</div>
)}
<div className={styles.title}>View Details</div>
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsRight)}>
{
challenge.status === 'Draft' && (
<div className={styles.button}>
{challenge.legacyId ? (
{(challenge.legacyId || isTask) ? (
<PrimaryButton text={'Launch'} type={'info'} onClick={onLaunchChallenge} />
) : (
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
Expand Down
7 changes: 5 additions & 2 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -1037,6 +1040,7 @@ class ChallengeEditor extends Component {
newChallenge.status = status
try {
const challengeId = this.getCurrentChallengeId()
const action = await updateChallengeDetails(challengeId, challenge)
// state can have updated assigned member (in cases where user changes assignments without refreshing the page)
const { challenge: { copilot, reviewer, type }, assignedMemberDetails: assignedMember } = this.state
const oldMemberHandle = _.get(oldAssignedMember, 'handle')
Expand All @@ -1045,7 +1049,6 @@ class ChallengeEditor extends Component {
if (assignedMemberHandle !== oldMemberHandle) {
await this.updateResource(challengeId, 'Submitter', assignedMemberHandle, oldMemberHandle)
}
const action = await updateChallengeDetails(challengeId, challenge)
const { copilot: previousCopilot, reviewer: previousReviewer } = this.state.draftChallenge.data
if (copilot !== previousCopilot) await this.updateResource(challengeId, 'Copilot', copilot, previousCopilot)
if (type === 'First2Finish' || type === 'Task') {
Expand Down Expand Up @@ -1371,7 +1374,7 @@ class ChallengeEditor extends Component {
</div>
{isDraft && (
<div className={styles.button}>
{challenge.legacyId ? (
{challenge.legacyId || isTask ? (
<PrimaryButton text={'Launch as Active'} type={'info'} onClick={this.toggleLaunch} />
) : (
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@
display: flex;
justify-content: center;
align-items: center;
background-color: $tc-red;
border-color: $tc-red;
cursor: pointer;

Expand All @@ -274,7 +273,7 @@
font-size: 14px;
font-weight: 400;
line-height: 17px;
color: $white;
color: $tc-red;
text-transform: capitalize;
display: flex;
justify-content: center;
Expand Down
35 changes: 20 additions & 15 deletions src/components/ChallengesComponent/ChallengeCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -114,15 +115,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
)
}

return challenge.legacyId ? (
return challenge.legacyId || isTask ? (
<div className={styles.linkGroup}>
<div className={styles.linkGroupLeft}>
<a className={styles.link} href={communityAppUrl} target='_blank'>View Challenge</a>
<div className={styles.linkGroupLeftBottom}>
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
<span className={styles.linkDivider}>|</span>
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
</div>
{!isTask && (
<div className={styles.linkGroupLeftBottom}>
<a className={styles.link} href={directUrl} target='_blank'>Direct</a>
<span className={styles.linkDivider}>|</span>
<a className={styles.link} href={orUrl} target='_blank'>OR</a>
</div>
)}
</div>
{challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT && (
<button className={styles.activateButton} onClick={() => onUpdateLaunch()}>
Expand All @@ -134,15 +137,17 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
<div className={styles.linkGroup}>
<div className={styles.linkGroupLeft}>
<a className={styles.link} href={communityAppUrl}>View Challenge</a>
<div className={styles.linkGroupLeftBottom}>
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
<span className={styles.link}>Direct</span>
</Tooltip>
<span className={styles.linkDivider}>|</span>
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
<span className={styles.link}>OR</span>
</Tooltip>
</div>
{!isTask && (
<div className={styles.linkGroupLeftBottom}>
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
<span className={styles.link}>Direct</span>
</Tooltip>
<span className={styles.linkDivider}>|</span>
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
<span className={styles.link}>OR</span>
</Tooltip>
</div>
)}
</div>
{
challenge.status === 'Draft' && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.container {
height: 22px;
width: 86px;
border-radius: 11.5px;
border-radius: 3px;
display: flex;
justify-content: center;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.tag {
display: inline-block;
padding: 0 15px;
border-radius: 10px;
border-radius: 3px;
background-color: $lighter-gray;
min-width: 54px;
text-align: center;
Expand Down

0 comments on commit 0df6294

Please sign in to comment.