@@ -209,7 +209,11 @@ class ChallengeCard extends React.Component {
209209
210210 onUpdateLaunch ( ) {
211211 if ( ! this . state . isLaunch ) {
212- this . setState ( { isLaunch : true } )
212+ if ( ! this . props . isBillingAccountExpired ) {
213+ this . setState ( { isLaunch : true } )
214+ } else {
215+ this . setState ( { isLaunch : true , error : 'Unable to activate challenge as Billing Account is not active.' } )
216+ }
213217 }
214218 }
215219
@@ -272,7 +276,7 @@ class ChallengeCard extends React.Component {
272276
273277 render ( ) {
274278 const { isLaunch, isConfirm, isSaving, isDeleteLaunch, isCheckChalengePermission, hasEditChallengePermission } = this . state
275- const { challenge, shouldShowCurrentPhase, reloadChallengeList } = this . props
279+ const { challenge, shouldShowCurrentPhase, reloadChallengeList, isBillingAccountExpired } = this . props
276280 const { phaseMessage, endTime } = getPhaseInfo ( challenge )
277281 const deleteMessage = isCheckChalengePermission
278282 ? 'Checking permissions...'
@@ -305,6 +309,7 @@ class ChallengeCard extends React.Component {
305309 errorMessage = { this . state . error }
306310 onCancel = { this . resetModal }
307311 onConfirm = { this . onLaunchChallenge }
312+ disableConfirmButton = { isBillingAccountExpired }
308313 />
309314 )
310315 }
@@ -364,7 +369,8 @@ ChallengeCard.propTypes = {
364369 shouldShowCurrentPhase : PropTypes . bool ,
365370 reloadChallengeList : PropTypes . func ,
366371 partiallyUpdateChallengeDetails : PropTypes . func . isRequired ,
367- deleteChallenge : PropTypes . func . isRequired
372+ deleteChallenge : PropTypes . func . isRequired ,
373+ isBillingAccountExpired : PropTypes . bool
368374}
369375
370376export default withRouter ( ChallengeCard )
0 commit comments