Skip to content

Commit

Permalink
Merge pull request #1075 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Prod Release - 0.5.2
  • Loading branch information
vikasrohit authored Feb 23, 2021
2 parents 703e2e3 + 0dfc40b commit e36e09b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const ChallengeTotalField = ({ challenge }) => {
challengeTotal = _.flatten(challenge.prizeSets.map(p => p.prizes))
.map(p => p.value)
.map(v => convertDollarToInteger(v, '$'))
.map(v => +v)
.reduce((prev, next) => prev + next, 0)
}
return (
Expand Down
16 changes: 7 additions & 9 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,14 @@ const ChallengeView = ({
<span><span className={styles.fieldTitle}>Groups:</span> {groups}</span>
</div>
</div>
{isBetaMode() && (
<div className={styles.row}>
<div className={styles.col}>
<span>
<span className={styles.fieldTitle}>Billing Account Id:</span>
{projectDetail.billingAccountId}
</span>
</div>
<div className={styles.row}>
<div className={styles.col}>
<span>
<span className={styles.fieldTitle}>Billing Account Id:</span>
{projectDetail.billingAccountId}
</span>
</div>
)}
</div>
{isBetaMode() && (
<UseSchedulingAPIField challenge={challenge} readOnly />
)}
Expand Down
20 changes: 9 additions & 11 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,15 +851,15 @@ class ChallengeEditor extends Component {
groups: []
// prizeSets: this.getDefaultPrizeSets()
}
if (isBetaMode() && projectDetail.terms) {
if (projectDetail.terms) {
const currTerms = new Set(newChallenge.terms.map(term => term.id))
newChallenge.terms.push(
...projectDetail.terms
.filter(term => !currTerms.has(term))
.map(term => ({ id: term, roleId: SUBMITTER_ROLE_UUID }))
)
}
if (isBetaMode() && projectDetail.groups) {
if (projectDetail.groups) {
newChallenge.groups.push(...projectDetail.groups)
}
const discussions = this.getDiscussionsConfig(newChallenge)
Expand Down Expand Up @@ -1419,16 +1419,14 @@ class ChallengeEditor extends Component {
{/* remove terms field and use default term */}
{false && (<TermsField terms={metadata.challengeTerms} challenge={challenge} onUpdateMultiSelect={this.onUpdateMultiSelect} />)}
<GroupsField onUpdateMultiSelect={this.onUpdateMultiSelect} challenge={challenge} />
{isBetaMode() && (
<div className={styles.row}>
<div className={styles.col}>
<span>
<span className={styles.fieldTitle}>Billing Account Id:</span>
{projectDetail.billingAccountId}
</span>
</div>
<div className={styles.row}>
<div className={styles.col}>
<span>
<span className={styles.fieldTitle}>Billing Account Id:</span>
{projectDetail.billingAccountId}
</span>
</div>
)}
</div>
{isBetaMode() && (
<UseSchedulingAPIField challenge={challenge} toggleUseSchedulingAPI={this.toggleUseSchedulingAPI} />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/util/input-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const validateValue = (value, checkType = '', prefix = '') => {
*/
export const convertDollarToInteger = (value, prefix = '') => {
if (value) {
return parseInt(('' + value).replace(prefix, '').replace(' ', '').replace(/[^0-9]/g, ''))
return parseInt(('' + value).replace(prefix, '').replace(' ', '').replace(/[^0-9.,]/g, ''))
}
return 0
}

0 comments on commit e36e09b

Please sign in to comment.