Skip to content

Commit c9f94ba

Browse files
authored
Merge pull request #1015 from topcoder-platform/develop
Prod Update - P0s
2 parents 900918c + 6a1758e commit c9f94ba

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"sass-loader": "7.1.0",
9292
"simplemde": "^1.11.2",
9393
"style-loader": "0.23.0",
94-
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
94+
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4",
9595
"terser": "^3.16.1",
9696
"terser-webpack-plugin": "1.1.0",
9797
"topcoder-healthcheck-dropin": "^1.0.3",

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import LegacyLinks from '../../LegacyLinks'
2222
import AssignedMemberField from '../AssignedMember-Field'
2323
import { getResourceRoleByName } from '../../../util/tc'
2424
import Tooltip from '../../Tooltip'
25-
import { MESSAGE } from '../../../config/constants'
25+
import { MESSAGE, REVIEW_TYPES } from '../../../config/constants'
2626

2727
const ChallengeView = ({
2828
projectDetail,
@@ -59,9 +59,9 @@ const ChallengeView = ({
5959
copilot = copilot || copilotFromResources
6060
reviewer = reviewer || reviewerFromResources
6161

62-
const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : 'community'
63-
const isCommunity = reviewType === 'community'
64-
const isInternal = reviewType === 'internal'
62+
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : REVIEW_TYPES.COMMUNITY
63+
const isCommunity = reviewType === REVIEW_TYPES.COMMUNITY
64+
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
6565
const timeLineTemplate = _.find(metadata.timelineTemplates, { id: challenge.timelineTemplateId })
6666
if (isLoading || _.isEmpty(metadata.challengePhases) || challenge.id !== challengeId) return <Loader />
6767
const showTimeline = false // disables the timeline for time being https://github.com/topcoder-platform/challenge-engine-ui/issues/706

src/components/ChallengeEditor/ReviewType-Field/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ReviewTypeField = ({ reviewers, challenge, onUpdateOthers, onUpdateSelect
1010
const isDesignChallenge = challenge.trackId === DES_TRACK_ID
1111
const isQAChallenge = challenge.trackId === QA_TRACK_ID
1212
const defaultReviewType = isDesignChallenge ? REVIEW_TYPES.INTERNAL : REVIEW_TYPES.COMMUNITY
13-
const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : defaultReviewType
13+
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : defaultReviewType
1414
const isCommunity = reviewType === REVIEW_TYPES.COMMUNITY
1515
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
1616
const communityOption = (disabled) => (<div className={styles.tcRadioButton}>

src/components/ChallengeEditor/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ class ChallengeEditor extends Component {
651651
return !!name && !!trackId && !!typeId
652652
}
653653

654-
const reviewType = challenge.reviewType ? challenge.reviewType.toLowerCase() : 'community'
655-
const isInternal = reviewType === 'internal'
654+
const reviewType = challenge.reviewType ? challenge.reviewType.toUpperCase() : REVIEW_TYPES.COMMUNITY
655+
const isInternal = reviewType === REVIEW_TYPES.INTERNAL
656656
if (isInternal && !challenge.reviewer) {
657657
return false
658658
}
@@ -809,8 +809,7 @@ class ChallengeEditor extends Component {
809809
},
810810
descriptionFormat: 'markdown',
811811
timelineTemplateId: defaultTemplate.id,
812-
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }],
813-
phases: this.getTemplatePhases(defaultTemplate)
812+
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }]
814813
// prizeSets: this.getDefaultPrizeSets()
815814
}
816815
const discussions = this.getDiscussionsConfig(newChallenge)
@@ -841,6 +840,14 @@ class ChallengeEditor extends Component {
841840
}
842841
}
843842

843+
/*
844+
TODO
845+
846+
IMPORTANT!!!
847+
848+
This method might be wrong. We might need to fix it when enabling editing phases UI.
849+
See issue which caused by using of this method https://github.com/topcoder-platform/work-manager/issues/1012
850+
*/
844851
getTemplatePhases (template) {
845852
const timelinePhaseIds = template.phases.map(timelinePhase => timelinePhase.phaseId || timelinePhase)
846853
const validPhases = _.cloneDeep(this.props.metadata.challengePhases).filter(challengePhase => {

src/config/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export const PRIZE_SETS_TYPE = {
111111
}
112112

113113
export const REVIEW_TYPES = {
114-
INTERNAL: 'internal',
115-
COMMUNITY: 'community'
114+
INTERNAL: 'INTERNAL',
115+
COMMUNITY: 'COMMUNITY'
116116
}
117117

118118
// List of subtracks that should be considered as Marathon Matches

0 commit comments

Comments
 (0)