diff --git a/src/components/ChallengeEditor/ChallengeViewTabs/index.js b/src/components/ChallengeEditor/ChallengeViewTabs/index.js index ae890736..eecef944 100644 --- a/src/components/ChallengeEditor/ChallengeViewTabs/index.js +++ b/src/components/ChallengeEditor/ChallengeViewTabs/index.js @@ -88,7 +88,7 @@ const ChallengeViewTabs = ({ const isDraft = challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT const isSelfServiceCopilot = challenge.legacy.selfServiceCopilot === loggedInUser.handle const isAdmin = checkAdmin(token) - const canApprove = isSelfServiceCopilot && isDraft && isSelfService + const canApprove = (isSelfServiceCopilot || enableEdit) && isDraft && isSelfService const hasBillingAccount = _.get(projectDetail, 'billingAccountId') !== null // only challenges that have a billing account can be launched AND // if this isn't self-service, permit launching if the challenge is draft @@ -97,7 +97,7 @@ const ChallengeViewTabs = ({ // b) the challenge is approved const canLaunch = hasBillingAccount && ((!isSelfService && isDraft) || - ((isSelfServiceCopilot || isAdmin) && + ((isSelfServiceCopilot || enableEdit || isAdmin) && challenge.status.toUpperCase() === CHALLENGE_STATUS.APPROVED)) return ( @@ -168,10 +168,10 @@ const ChallengeViewTabs = ({ )} )} - {enableEdit && !isSelfService && ( + {enableEdit && ( )} - {isSelfService && isDraft && (isAdmin || isSelfServiceCopilot) && ( + {isSelfService && isDraft && (isAdmin || isSelfServiceCopilot || enableEdit) && (
0 ? false - : moment(newChallenge.phases[0]['scheduledStartDate']).isAfter() + newChallenge.phases[index].isStartTimeActive = index <= 0 newChallenge.phases[index].isOpen = newChallenge.phases[index].isDurationActive } diff --git a/src/containers/ChallengeEditor/index.js b/src/containers/ChallengeEditor/index.js index b63b44f1..66843d05 100644 --- a/src/containers/ChallengeEditor/index.js +++ b/src/containers/ChallengeEditor/index.js @@ -175,9 +175,6 @@ class ChallengeEditor extends Component { if (isAdmin) { return true } - if (!hasProjectAccess) { - return false - } const userRoles = _.filter( challengeResources, cr => cr.memberId === `${loggedInUser.userId}` @@ -185,7 +182,7 @@ class ChallengeEditor extends Component { const userResourceRoles = _.filter(resourceRoles, rr => _.some(userRoles, ur => ur.roleId === rr.id) ) - return _.some( + return hasProjectAccess || _.some( userResourceRoles, urr => urr.fullWriteAccess && urr.isActive )