Skip to content

Commit a0f5a07

Browse files
Merge pull request #1398 from topcoder-platform/develop
Prod release
2 parents 8b0d771 + 98340c5 commit a0f5a07

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/components/ChallengeEditor/ChallengeViewTabs/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const ChallengeViewTabs = ({
8888
const isDraft = challenge.status.toUpperCase() === CHALLENGE_STATUS.DRAFT
8989
const isSelfServiceCopilot = challenge.legacy.selfServiceCopilot === loggedInUser.handle
9090
const isAdmin = checkAdmin(token)
91-
const canApprove = isSelfServiceCopilot && isDraft && isSelfService
91+
const canApprove = (isSelfServiceCopilot || enableEdit) && isDraft && isSelfService
9292
const hasBillingAccount = _.get(projectDetail, 'billingAccountId') !== null
9393
// only challenges that have a billing account can be launched AND
9494
// if this isn't self-service, permit launching if the challenge is draft
@@ -97,7 +97,7 @@ const ChallengeViewTabs = ({
9797
// b) the challenge is approved
9898
const canLaunch = hasBillingAccount &&
9999
((!isSelfService && isDraft) ||
100-
((isSelfServiceCopilot || isAdmin) &&
100+
((isSelfServiceCopilot || enableEdit || isAdmin) &&
101101
challenge.status.toUpperCase() === CHALLENGE_STATUS.APPROVED))
102102

103103
return (
@@ -168,10 +168,10 @@ const ChallengeViewTabs = ({
168168
)}
169169
</div>
170170
)}
171-
{enableEdit && !isSelfService && (
171+
{enableEdit && (
172172
<PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} />
173173
)}
174-
{isSelfService && isDraft && (isAdmin || isSelfServiceCopilot) && (
174+
{isSelfService && isDraft && (isAdmin || isSelfServiceCopilot || enableEdit) && (
175175
<div className={styles.button}>
176176
<PrimaryButton
177177
text='Reject challenge'

src/components/ChallengeEditor/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,7 @@ class ChallengeEditor extends Component {
828828
for (let index = 0; index < phases.length; ++index) {
829829
newChallenge.phases[index].isDurationActive =
830830
moment(newChallenge.phases[index]['scheduledEndDate']).isAfter()
831-
newChallenge.phases[index].isStartTimeActive = index > 0 ? false
832-
: moment(newChallenge.phases[0]['scheduledStartDate']).isAfter()
831+
newChallenge.phases[index].isStartTimeActive = index <= 0
833832
newChallenge.phases[index].isOpen =
834833
newChallenge.phases[index].isDurationActive
835834
}

src/containers/ChallengeEditor/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,14 @@ class ChallengeEditor extends Component {
175175
if (isAdmin) {
176176
return true
177177
}
178-
if (!hasProjectAccess) {
179-
return false
180-
}
181178
const userRoles = _.filter(
182179
challengeResources,
183180
cr => cr.memberId === `${loggedInUser.userId}`
184181
)
185182
const userResourceRoles = _.filter(resourceRoles, rr =>
186183
_.some(userRoles, ur => ur.roleId === rr.id)
187184
)
188-
return _.some(
185+
return hasProjectAccess || _.some(
189186
userResourceRoles,
190187
urr => urr.fullWriteAccess && urr.isActive
191188
)

0 commit comments

Comments
 (0)