diff --git a/package.json b/package.json
index f1606001..1f0c041e 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/src/components/ChallengeEditor/ChallengeView/index.js b/src/components/ChallengeEditor/ChallengeView/index.js
index 802ff8ae..3dbd0de1 100644
--- a/src/components/ChallengeEditor/ChallengeView/index.js
+++ b/src/components/ChallengeEditor/ChallengeView/index.js
@@ -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,
@@ -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
const showTimeline = false // disables the timeline for time being https://github.com/topcoder-platform/challenge-engine-ui/issues/706
diff --git a/src/components/ChallengeEditor/ReviewType-Field/index.js b/src/components/ChallengeEditor/ReviewType-Field/index.js
index f938f4ee..139ea0a3 100644
--- a/src/components/ChallengeEditor/ReviewType-Field/index.js
+++ b/src/components/ChallengeEditor/ReviewType-Field/index.js
@@ -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) => (
diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js
index 66aa6cb6..935b65ad 100644
--- a/src/components/ChallengeEditor/index.js
+++ b/src/components/ChallengeEditor/index.js
@@ -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
}
@@ -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)
@@ -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 => {
diff --git a/src/config/constants.js b/src/config/constants.js
index cdaf8b13..d1e4aef0 100644
--- a/src/config/constants.js
+++ b/src/config/constants.js
@@ -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