Skip to content
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
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
}