@@ -148,7 +148,11 @@ class ChallengeEditor extends Component {
148
148
}
149
149
150
150
onLaunchChallenge ( ) {
151
- this . setState ( { showLaunchModal : true } )
151
+ if ( ! this . props . isBillingAccountExpired ) {
152
+ this . setState ( { showLaunchModal : true } )
153
+ } else {
154
+ this . setState ( { showLaunchModal : true , launchError : 'Unable to activate challenge as Billing Account is not active.' } )
155
+ }
152
156
}
153
157
154
158
onCloseTask ( ) {
@@ -236,6 +240,7 @@ class ChallengeEditor extends Component {
236
240
const {
237
241
match,
238
242
isLoading,
243
+ isBillingAccountExpired,
239
244
isProjectLoading,
240
245
// challengeDetails,
241
246
challengeResources,
@@ -288,6 +293,7 @@ class ChallengeEditor extends Component {
288
293
errorMessage = { this . state . launchError }
289
294
onCancel = { this . closeLaunchModal }
290
295
onConfirm = { this . activateChallenge }
296
+ disableConfirmButton = { isBillingAccountExpired }
291
297
/>
292
298
const closeTaskModal = < ConfirmationModal
293
299
title = 'Confirm Close Task'
@@ -316,6 +322,7 @@ class ChallengeEditor extends Component {
316
322
< ChallengeEditorComponent
317
323
isLoading = { isLoading }
318
324
challengeDetails = { challengeDetails }
325
+ isBillingAccountExpired = { isBillingAccountExpired }
319
326
challengeResources = { challengeResources }
320
327
metadata = { metadata }
321
328
projectId = { _ . get ( match . params , 'projectId' , null ) }
@@ -343,6 +350,7 @@ class ChallengeEditor extends Component {
343
350
render = { ( { match } ) => ( (
344
351
< ChallengeEditorComponent
345
352
isLoading = { isLoading }
353
+ isBillingAccountExpired = { isBillingAccountExpired }
346
354
challengeDetails = { challengeDetails }
347
355
challengeResources = { challengeResources }
348
356
metadata = { metadata }
@@ -371,6 +379,7 @@ class ChallengeEditor extends Component {
371
379
render = { ( { match } ) => ( (
372
380
< ChallengeViewComponent
373
381
isLoading = { isLoading }
382
+ isBillingAccountExpired = { isBillingAccountExpired }
374
383
metadata = { metadata }
375
384
projectDetail = { projectDetail }
376
385
challenge = { challengeDetails }
@@ -418,6 +427,7 @@ ChallengeEditor.propTypes = {
418
427
challengeTypes : PropTypes . array
419
428
} ) ,
420
429
isLoading : PropTypes . bool ,
430
+ isBillingAccountExpired : PropTypes . bool ,
421
431
createAttachments : PropTypes . func ,
422
432
attachments : PropTypes . arrayOf ( PropTypes . shape ( ) ) ,
423
433
token : PropTypes . string ,
@@ -441,6 +451,7 @@ const mapStateToProps = ({ projects, challenges: { challengeDetails, challengeRe
441
451
challengeResources,
442
452
metadata,
443
453
isLoading,
454
+ isBillingAccountExpired : projects . isBillingAccountExpired ,
444
455
isProjectLoading : projects . isLoading ,
445
456
attachments,
446
457
token,
0 commit comments