Skip to content

Commit

Permalink
Merge pull request #895 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Update NDA and Resource Roles
  • Loading branch information
vikasrohit authored Nov 10, 2020
2 parents 5c36237 + 55bc7bf commit 26852da
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

*.env
4 changes: 2 additions & 2 deletions config/constants/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = {
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
DIRECT_PROJECT_URL: `https://www.${DOMAIN}/direct`,
ONLINE_REVIEW_URL: `https://software.${DOMAIN}`,
DEFAULT_TERM_UUID: '9ef9dec4-dddb-48c9-9cce-659db68bc5ac', // Terms & Conditions of Use at TopCoder
DEFAULT_NDA_UUID: '876e9802-eb2c-4779-a2a8-8dd8e7fb783d', // Appirio NDA v2.0
DEFAULT_TERM_UUID: '564a981e-6840-4a5c-894e-d5ad22e9cd6f', // Terms & Conditions of Use at TopCoder
DEFAULT_NDA_UUID: 'c41e90e5-4d0e-4811-bd09-38ff72674490', // Appirio NDA v2.0
SUBMITTER_ROLE_UUID: '732339e7-8e30-49d7-9198-cccf9451e221',
DEV_TRACK_ID: '9b6fc876-f4d9-4ccb-9dfd-419247628825',
DES_TRACK_ID: '5fa04185-041f-49a6-bfd1-fe82533cd6c8',
Expand Down
9 changes: 9 additions & 0 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ const ChallengeView = ({
readOnly
/>
)}
<div>
{ challenge.discussions && challenge.discussions.map(d => (
<div key={d.id} className={cn(styles.row, styles.topRow)}>
<div className={styles.col}>
<span><span className={styles.fieldTitle}>Forum:</span> <a href={d.url} target='_blank' rel='noopener noreferrer'>{d.name}</a></span>
</div>
</div>
))}
</div>
</div>
<div className={styles.group}>
<div className={styles.title}>Public specification <span>*</span></div>
Expand Down
20 changes: 5 additions & 15 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ class ChallengeEditor extends Component {
return <div>Error loading challenge</div>
}
const isTask = _.get(challenge, 'task.isTask', false)
console.log(this.props.assignedMemberDetails)
const { assignedMemberDetails, error } = this.state
let isActive = false
let isDraft = false
Expand Down Expand Up @@ -1098,33 +1099,22 @@ class ChallengeEditor extends Component {
*/
if (isCloseTask && !isConfirm) {
const taskPrize = _.get(_.find(challenge.prizeSets, { type: 'placement' }), 'prizes[0].value')
const assignedMember = assignedMemberDetails ? assignedMemberDetails.handle : `User id: ${_.get(challenge, 'task.memberId')}`
const copilotFee = _.get(_.find(challenge.prizeSets, { type: 'copilot' }), 'prizes[0].value')
const copilot = challenge.copilot
const assignedMemberId = _.get(assignedMemberDetails, 'userId')
const assignedMember = _.get(assignedMemberDetails, 'handle', `User Id: ${assignedMemberId}`)

const validationErrors = []
if (!_.get(challenge, 'task.memberId')) {
if (!assignedMemberId) {
validationErrors.push('assign task member')
}

if (!copilot) {
validationErrors.push('select copilot')
}

if (!copilotFee) {
validationErrors.push('set copilot fee')
}

// if all data for closing task is there, show confirmation modal
if (validationErrors.length === 0) {
closeTaskModal = (
<ConfirmationModal
title='Close Task Confirmation'
message={
<p>
Are you sure want to close task <strong>"{challenge.name}"</strong> with the prize <strong>${taskPrize}</strong> for <strong>{assignedMember}</strong>
{' '}
and copilot fee <strong>${copilotFee}</strong> for <strong>{copilot}</strong>?
Are you sure want to close task <strong>"{challenge.name}"</strong> with the prize <strong>${taskPrize}</strong> for <strong>{assignedMember}</strong>?
</p>
}
theme={theme}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ChallengeEditor extends Component {
}
const userRoles = _.filter(challengeResources, cr => cr.memberId === `${loggedInUser.userId}`)
const userResourceRoles = _.filter(resourceRoles, rr => _.some(userRoles, ur => ur.roleId === rr.id))
return _.some(userResourceRoles, urr => urr.fullAccess && urr.isActive)
return _.some(userResourceRoles, urr => urr.fullWriteAccess && urr.isActive)
}

render () {
Expand Down

0 comments on commit 26852da

Please sign in to comment.