Skip to content

Prod Update - P0s #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"sass-loader": "7.1.0",
"simplemde": "^1.11.2",
"style-loader": "0.23.0",
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4",
"terser": "^3.16.1",
"terser-webpack-plugin": "1.1.0",
"topcoder-healthcheck-dropin": "^1.0.3",
Expand Down
8 changes: 4 additions & 4 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import LegacyLinks from '../../LegacyLinks'
import AssignedMemberField from '../AssignedMember-Field'
import { getResourceRoleByName } from '../../../util/tc'
import Tooltip from '../../Tooltip'
import { MESSAGE } from '../../../config/constants'
import { MESSAGE, REVIEW_TYPES } from '../../../config/constants'

const ChallengeView = ({
projectDetail,
Expand Down Expand Up @@ -59,9 +59,9 @@ const ChallengeView = ({
copilot = copilot || copilotFromResources
reviewer = reviewer || reviewerFromResources

const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : 'community'
const isCommunity = reviewType === 'community'
const isInternal = reviewType === 'internal'
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : REVIEW_TYPES.COMMUNITY
const isCommunity = reviewType === REVIEW_TYPES.COMMUNITY
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
const timeLineTemplate = _.find(metadata.timelineTemplates, { id: challenge.timelineTemplateId })
if (isLoading || _.isEmpty(metadata.challengePhases) || challenge.id !== challengeId) return <Loader />
const showTimeline = false // disables the timeline for time being https://github.com/topcoder-platform/challenge-engine-ui/issues/706
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChallengeEditor/ReviewType-Field/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ReviewTypeField = ({ reviewers, challenge, onUpdateOthers, onUpdateSelect
const isDesignChallenge = challenge.trackId === DES_TRACK_ID
const isQAChallenge = challenge.trackId === QA_TRACK_ID
const defaultReviewType = isDesignChallenge ? REVIEW_TYPES.INTERNAL : REVIEW_TYPES.COMMUNITY
const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : defaultReviewType
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : defaultReviewType
const isCommunity = reviewType === REVIEW_TYPES.COMMUNITY
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
const communityOption = (disabled) => (<div className={styles.tcRadioButton}>
Expand Down
15 changes: 11 additions & 4 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@ class ChallengeEditor extends Component {
return !!name && !!trackId && !!typeId
}

const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : 'community'
const isInternal = reviewType === 'internal'
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : REVIEW_TYPES.COMMUNITY
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
if (isInternal && !challenge.reviewer) {
return false
}
Expand Down Expand Up @@ -809,8 +809,7 @@ class ChallengeEditor extends Component {
},
descriptionFormat: 'markdown',
timelineTemplateId: defaultTemplate.id,
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }],
phases: this.getTemplatePhases(defaultTemplate)
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }]
// prizeSets: this.getDefaultPrizeSets()
}
const discussions = this.getDiscussionsConfig(newChallenge)
Expand Down Expand Up @@ -841,6 +840,14 @@ class ChallengeEditor extends Component {
}
}

/*
TODO

IMPORTANT!!!

This method might be wrong. We might need to fix it when enabling editing phases UI.
See issue which caused by using of this method https://github.com/topcoder-platform/work-manager/issues/1012
*/
getTemplatePhases (template) {
const timelinePhaseIds = template.phases.map(timelinePhase => timelinePhase.phaseId || timelinePhase)
const validPhases = _.cloneDeep(this.props.metadata.challengePhases).filter(challengePhase => {
Expand Down
4 changes: 2 additions & 2 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export const PRIZE_SETS_TYPE = {
}

export const REVIEW_TYPES = {
INTERNAL: 'internal',
COMMUNITY: 'community'
INTERNAL: 'INTERNAL',
COMMUNITY: 'COMMUNITY'
}

// List of subtracks that should be considered as Marathon Matches
Expand Down