@@ -209,7 +209,11 @@ class ChallengeCard extends React.Component {
209
209
210
210
onUpdateLaunch ( ) {
211
211
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
+ }
213
217
}
214
218
}
215
219
@@ -272,7 +276,7 @@ class ChallengeCard extends React.Component {
272
276
273
277
render ( ) {
274
278
const { isLaunch, isConfirm, isSaving, isDeleteLaunch, isCheckChalengePermission, hasEditChallengePermission } = this . state
275
- const { challenge, shouldShowCurrentPhase, reloadChallengeList } = this . props
279
+ const { challenge, shouldShowCurrentPhase, reloadChallengeList, isBillingAccountExpired } = this . props
276
280
const { phaseMessage, endTime } = getPhaseInfo ( challenge )
277
281
const deleteMessage = isCheckChalengePermission
278
282
? 'Checking permissions...'
@@ -305,6 +309,7 @@ class ChallengeCard extends React.Component {
305
309
errorMessage = { this . state . error }
306
310
onCancel = { this . resetModal }
307
311
onConfirm = { this . onLaunchChallenge }
312
+ disableConfirmButton = { isBillingAccountExpired }
308
313
/>
309
314
)
310
315
}
@@ -364,7 +369,8 @@ ChallengeCard.propTypes = {
364
369
shouldShowCurrentPhase : PropTypes . bool ,
365
370
reloadChallengeList : PropTypes . func ,
366
371
partiallyUpdateChallengeDetails : PropTypes . func . isRequired ,
367
- deleteChallenge : PropTypes . func . isRequired
372
+ deleteChallenge : PropTypes . func . isRequired ,
373
+ isBillingAccountExpired : PropTypes . bool
368
374
}
369
375
370
376
export default withRouter ( ChallengeCard )
0 commit comments