Skip to content

Commit 7c9e05d

Browse files
author
Vikas Agarwal
committed
feat: git#867-Add an Activate button to the challenge details screen for Draft challenges
— disabling the Activate button when the legacy is not ready
1 parent c248d93 commit 7c9e05d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/ChallengeEditor/ChallengeView/ChallengeView.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@
245245
.actionButtonsRight {
246246
right: 20px;
247247

248-
button:not(:last-child),
248+
249+
.button:not(:last-child),
249250
a:not(:last-child) {
250251
margin-right: 20px;
251252
}

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import PhaseInput from '../../PhaseInput'
2121
import LegacyLinks from '../../LegacyLinks'
2222
import AssignedMemberField from '../AssignedMember-Field'
2323
import { getResourceRoleByName } from '../../../util/tc'
24+
import Tooltip from '../../Tooltip'
2425

2526
const ChallengeView = ({
2627
projectDetail,
@@ -73,7 +74,16 @@ const ChallengeView = ({
7374
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsRight)}>
7475
{
7576
challenge.status === 'Draft' && (
76-
<PrimaryButton text={'Launch'} type={'info'} onClick={onLaunchChallenge} />
77+
<div className={styles.button}>
78+
{challenge.legacyId ? (
79+
<PrimaryButton text={'Launch'} type={'info'} onClick={onLaunchChallenge} />
80+
) : (
81+
<Tooltip content='Legacy project is not yet created'>
82+
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
83+
<PrimaryButton text={'Launch'} type={'disabled'} />
84+
</Tooltip>
85+
)}
86+
</div>
7787
)
7888
}
7989
{ enableEdit && <PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} /> }

0 commit comments

Comments
 (0)