@@ -148,7 +148,11 @@ class ChallengeEditor extends Component {
148148 }
149149
150150 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+ }
152156 }
153157
154158 onCloseTask ( ) {
@@ -236,6 +240,7 @@ class ChallengeEditor extends Component {
236240 const {
237241 match,
238242 isLoading,
243+ isBillingAccountExpired,
239244 isProjectLoading,
240245 // challengeDetails,
241246 challengeResources,
@@ -288,6 +293,7 @@ class ChallengeEditor extends Component {
288293 errorMessage = { this . state . launchError }
289294 onCancel = { this . closeLaunchModal }
290295 onConfirm = { this . activateChallenge }
296+ disableConfirmButton = { isBillingAccountExpired }
291297 />
292298 const closeTaskModal = < ConfirmationModal
293299 title = 'Confirm Close Task'
@@ -316,6 +322,7 @@ class ChallengeEditor extends Component {
316322 < ChallengeEditorComponent
317323 isLoading = { isLoading }
318324 challengeDetails = { challengeDetails }
325+ isBillingAccountExpired = { isBillingAccountExpired }
319326 challengeResources = { challengeResources }
320327 metadata = { metadata }
321328 projectId = { _ . get ( match . params , 'projectId' , null ) }
@@ -343,6 +350,7 @@ class ChallengeEditor extends Component {
343350 render = { ( { match } ) => ( (
344351 < ChallengeEditorComponent
345352 isLoading = { isLoading }
353+ isBillingAccountExpired = { isBillingAccountExpired }
346354 challengeDetails = { challengeDetails }
347355 challengeResources = { challengeResources }
348356 metadata = { metadata }
@@ -371,6 +379,7 @@ class ChallengeEditor extends Component {
371379 render = { ( { match } ) => ( (
372380 < ChallengeViewComponent
373381 isLoading = { isLoading }
382+ isBillingAccountExpired = { isBillingAccountExpired }
374383 metadata = { metadata }
375384 projectDetail = { projectDetail }
376385 challenge = { challengeDetails }
@@ -418,6 +427,7 @@ ChallengeEditor.propTypes = {
418427 challengeTypes : PropTypes . array
419428 } ) ,
420429 isLoading : PropTypes . bool ,
430+ isBillingAccountExpired : PropTypes . bool ,
421431 createAttachments : PropTypes . func ,
422432 attachments : PropTypes . arrayOf ( PropTypes . shape ( ) ) ,
423433 token : PropTypes . string ,
@@ -441,6 +451,7 @@ const mapStateToProps = ({ projects, challenges: { challengeDetails, challengeRe
441451 challengeResources,
442452 metadata,
443453 isLoading,
454+ isBillingAccountExpired : projects . isBillingAccountExpired ,
444455 isProjectLoading : projects . isLoading ,
445456 attachments,
446457 token,
0 commit comments