@@ -359,7 +359,7 @@ export class TutorialHint extends data.Component<ISettingsProps, TutorialHintSta
359359interface TutorialCardState {
360360 showHint ?: boolean ;
361361 showSeeMore ?: boolean ;
362- showUnusedBlockMessage ?: boolean ;
362+ showTutorialValidationMessage ?: boolean ;
363363}
364364
365365interface TutorialCardProps extends ISettingsProps {
@@ -381,7 +381,7 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
381381 this . state = {
382382 showSeeMore : false ,
383383 showHint : options . tutorialStepInfo [ this . prevStep ] . showHint ,
384- showUnusedBlockMessage : false
384+ showTutorialValidationMessage : false
385385 }
386386
387387 this . toggleHint = this . toggleHint . bind ( this ) ;
@@ -396,8 +396,8 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
396396 this . toggleExpanded = this . toggleExpanded . bind ( this ) ;
397397 this . onMarkdownDidRender = this . onMarkdownDidRender . bind ( this ) ;
398398 this . handleResize = this . handleResize . bind ( this ) ;
399- this . showUnusedBlocksMessageOnClick = this . showUnusedBlocksMessageOnClick . bind ( this ) ;
400- this . showUnusedBlocksMessage = this . showUnusedBlocksMessage . bind ( this ) ;
399+ this . showTutorialValidationMessageOnClick = this . showTutorialValidationMessageOnClick . bind ( this ) ;
400+ this . closeTutorialValidationMessage = this . closeTutorialValidationMessage . bind ( this ) ;
401401 this . doubleClickedNextStep = this . doubleClickedNextStep . bind ( this ) ;
402402 this . validationTelemetry = this . validationTelemetry . bind ( this ) ;
403403 }
@@ -412,7 +412,7 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
412412
413413 pxt . tickEvent ( `tutorial.previous` , { tutorial : options . tutorial , step : previousStep } , { interactiveConsent : true } ) ;
414414 this . props . parent . setTutorialStep ( previousStep ) ;
415- this . setState ( { showUnusedBlockMessage : false } ) ;
415+ this . setState ( { showTutorialValidationMessage : false } ) ;
416416 }
417417
418418 nextTutorialStep ( ) {
@@ -427,8 +427,8 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
427427 this . props . parent . setTutorialStep ( nextStep ) ;
428428
429429 const tutorialCodeValidationIsOn = options . metadata . tutorialCodeValidation ;
430- if ( tutorialCodeValidationIsOn && this . state . showUnusedBlockMessage ) { // disables tutorial validation pop-up if next buttion is clicked
431- this . setState ( { showUnusedBlockMessage : false } ) ;
430+ if ( tutorialCodeValidationIsOn && this . state . showTutorialValidationMessage ) { // disables tutorial validation pop-up if next buttion is clicked
431+ this . setState ( { showTutorialValidationMessage : false } ) ;
432432 }
433433 }
434434
@@ -571,8 +571,8 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
571571 }
572572 }
573573
574- private showUnusedBlocksMessageOnClick ( evt ?: any ) {
575- this . setState ( { showUnusedBlockMessage : true } ) ;
574+ private showTutorialValidationMessageOnClick ( evt ?: any ) {
575+ this . setState ( { showTutorialValidationMessage : true } ) ;
576576 }
577577
578578 private expandedHintOnClick ( evt ?: any ) {
@@ -635,12 +635,12 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
635635 }
636636 th . showHint ( visible , showFullText ) ;
637637 if ( visible ) {
638- this . setState ( { showUnusedBlockMessage : false } ) ;
638+ this . setState ( { showTutorialValidationMessage : false } ) ;
639639 }
640640 }
641641
642- showUnusedBlocksMessage ( ) {
643- this . setState ( { showUnusedBlockMessage : false } ) ;
642+ closeTutorialValidationMessage ( ) {
643+ this . setState ( { showTutorialValidationMessage : false } ) ;
644644 }
645645
646646 isCodeValidated ( rules : pxt . tutorial . TutorialRuleStatus [ ] ) {
@@ -697,10 +697,10 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
697697 const showDialog = stepInfo . showDialog ;
698698 const validationEnabled = ( stepInfo . listOfValidationRules != undefined ) ;
699699 const tutorialCodeValidated = this . isCodeValidated ( stepInfo . listOfValidationRules ) ;
700- const showMissingBlockPopupMessage = this . state . showUnusedBlockMessage && validationEnabled ;
700+ const showTutorialValidationMessage = this . state . showTutorialValidationMessage && validationEnabled ;
701701 const strictRulePresent = this . areStrictRulesPresent ( stepInfo . listOfValidationRules ) ;
702702 const nextOnClick = ( ! validationEnabled || ! strictRulePresent || ( tutorialCodeValidated && strictRulePresent ) ) ? this . nextTutorialStep :
703- ( this . state . showUnusedBlockMessage ) ? this . doubleClickedNextStep : this . showUnusedBlocksMessageOnClick ;
703+ ( this . state . showTutorialValidationMessage ) ? this . doubleClickedNextStep : this . showTutorialValidationMessageOnClick ;
704704
705705 const tutorialAriaLabel = lf ( "Press Space or Enter to show a hint." ) ;
706706 const tutorialHintTooltip = lf ( "Click to show a hint!" ) ;
@@ -715,7 +715,6 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
715715 const isRtl = pxt . Util . isUserLanguageRtl ( ) ;
716716 return < div id = "tutorialcard" className = { `ui ${ tutorialStepExpanded ? 'tutorialExpanded' : '' } ${ tutorialReady ? 'tutorialReady' : '' } ${ this . state . showSeeMore ? 'seemore' : '' } ${ ! this . state . showHint ? 'showTooltip' : '' } ${ hasHint ? 'hasHint' : '' } ` } style = { tutorialStepExpanded ? this . getExpandedCardStyle ( 'height' ) : null } >
717717 { hasHint && this . state . showHint && ! showDialog && < div className = "mask" role = "region" onClick = { this . closeHint } > </ div > }
718-
719718 < div className = 'ui buttons' >
720719 { hasPrevious ? < sui . Button icon = { `${ isRtl ? 'right' : 'left' } chevron large` } className = { `prevbutton left attached ${ ! hasPrevious ? 'disabled' : '' } ` } text = { lf ( "Back" ) } textClass = "widedesktop only" ariaLabel = { lf ( "Go to the previous step of the tutorial." ) } onClick = { this . previousTutorialStep } onKeyDown = { sui . fireClickOnEnter } /> : undefined }
721720 < div className = "ui segment attached tutorialsegment" >
@@ -740,8 +739,8 @@ export class TutorialCard extends data.Component<TutorialCardProps, TutorialCard
740739 </ div >
741740 { hasNext ? < sui . Button icon = { `${ isRtl ? 'left' : 'right' } chevron large` } className = { `nextbutton right attached ${ ! hasNext ? 'disabled' : '' } ${ tutorialCodeValidated ? 'isValidated' : '' } ` } text = { lf ( "Next" ) } textClass = "widedesktop only" ariaLabel = { lf ( "Go to the next step of the tutorial." ) }
742741 onClick = { nextOnClick } onKeyDown = { sui . fireClickOnEnter } /> : undefined }
743- { showMissingBlockPopupMessage &&
744- < TutorialCodeValidation . ShowValidationMessage onYesButtonClick = { this . nextTutorialStep } onNoButtonClick = { this . showUnusedBlocksMessage } initialVisible = { this . state . showUnusedBlockMessage } isTutorialCodeInvalid = { ! tutorialCodeValidated } ruleComponents = { stepInfo . listOfValidationRules } areStrictRulesPresent = { strictRulePresent } validationTelemetry = { this . validationTelemetry } parent = { this . props . parent } /> }
742+ { showTutorialValidationMessage &&
743+ < TutorialCodeValidation . ShowValidationMessage onYesButtonClick = { this . nextTutorialStep } onNoButtonClick = { this . closeTutorialValidationMessage } initialVisible = { this . state . showTutorialValidationMessage } isTutorialCodeInvalid = { ! tutorialCodeValidated } ruleComponents = { stepInfo . listOfValidationRules } areStrictRulesPresent = { strictRulePresent } validationTelemetry = { this . validationTelemetry } parent = { this . props . parent } /> }
745744 { hasFinish ? < sui . Button icon = "left checkmark" className = { `orange right attached ${ ! tutorialReady ? 'disabled' : '' } ` } text = { lf ( "Finish" ) } ariaLabel = { lf ( "Finish the tutorial." ) } onClick = { this . finishTutorial } onKeyDown = { sui . fireClickOnEnter } /> : undefined }
746745 </ div >
747746 </ div > ;
0 commit comments