@@ -69,14 +69,15 @@ import {
6969 PROJECT_TYPE_COMPLETENESS ,
7070 PROJECT_TYPE_CHANGE_DETECTION ,
7171 PROJECT_TYPE_FOOTPRINT ,
72+ PROJECT_TYPE_STREET ,
7273 ProjectType ,
7374 projectTypeLabelMap ,
7475} from '#utils/common' ;
7576
7677import {
7778 tileServerUrls ,
7879 tutorialFormSchema ,
79- defaultFootprintCustomOptions ,
80+ getDefaultOptions ,
8081 TutorialFormType ,
8182 PartialTutorialFormType ,
8283 PartialInformationPagesType ,
@@ -189,6 +190,11 @@ function getGeoJSONError(
189190 tile_y : 'number' ,
190191 tile_z : 'number' ,
191192 } ,
193+ [ PROJECT_TYPE_STREET ] : {
194+ id : [ 'string' , 'number' ] ,
195+ reference : 'number' ,
196+ screen : 'number' ,
197+ } ,
192198 } ;
193199 const schemaErrors = tutorialTasks . features . map (
194200 ( feature ) => checkSchema (
@@ -341,7 +347,6 @@ const defaultTutorialFormValue: PartialTutorialFormType = {
341347 name : TILE_SERVER_ESRI ,
342348 credits : tileServerDefaultCredits [ TILE_SERVER_ESRI ] ,
343349 } ,
344- customOptions : defaultFootprintCustomOptions ,
345350} ;
346351
347352type SubmissionStatus = 'started' | 'imageUpload' | 'tutorialSubmit' | 'success' | 'failed' ;
@@ -646,6 +651,11 @@ function NewTutorial(props: Props) {
646651 || tutorialSubmissionStatus === 'tutorialSubmit'
647652 ) ;
648653
654+ const tileServerVisible = value . projectType === PROJECT_TYPE_BUILD_AREA
655+ || value . projectType === PROJECT_TYPE_FOOTPRINT
656+ || value . projectType === PROJECT_TYPE_COMPLETENESS
657+ || value . projectType === PROJECT_TYPE_CHANGE_DETECTION ;
658+
649659 const tileServerBVisible = value . projectType === PROJECT_TYPE_CHANGE_DETECTION
650660 || value . projectType === PROJECT_TYPE_COMPLETENESS ;
651661
@@ -716,6 +726,7 @@ function NewTutorial(props: Props) {
716726 setFieldValue ( undefined , 'tutorialTasks' ) ;
717727 setFieldValue ( undefined , 'scenarioPages' ) ;
718728 setFieldValue ( newValue , 'projectType' ) ;
729+ setFieldValue ( getDefaultOptions ( newValue ) , 'customOptions' ) ;
719730 } ,
720731 [ setFieldValue ] ,
721732 ) ;
@@ -761,7 +772,10 @@ function NewTutorial(props: Props) {
761772 autoFocus
762773 />
763774 </ InputSection >
764- { value . projectType === PROJECT_TYPE_FOOTPRINT && (
775+ { (
776+ value . projectType === PROJECT_TYPE_FOOTPRINT
777+ || value . projectType === PROJECT_TYPE_STREET
778+ ) && (
765779 < InputSection
766780 heading = "Custom Options"
767781 actions = { (
@@ -896,17 +910,20 @@ function NewTutorial(props: Props) {
896910 ) }
897911 </ div >
898912 </ InputSection >
899- < InputSection
900- heading = { tileServerBVisible ? 'Tile Server A' : 'Tile Server' }
901- >
902- < TileServerInput
903- name = { 'tileServer' as const }
904- value = { value . tileServer }
905- error = { error ?. tileServer }
906- onChange = { setFieldValue }
907- disabled = { submissionPending || projectTypeEmpty }
908- />
909- </ InputSection >
913+ { tileServerVisible && (
914+ < InputSection
915+ heading = { tileServerBVisible ? 'Tile Server A' : 'Tile Server' }
916+ >
917+ < TileServerInput
918+ name = { 'tileServer' as const }
919+ value = { value . tileServer }
920+ error = { error ?. tileServer }
921+ onChange = { setFieldValue }
922+ disabled = { submissionPending || projectTypeEmpty }
923+ />
924+ </ InputSection >
925+ ) }
926+
910927 { tileServerBVisible && (
911928 < InputSection
912929 heading = "Tile Server B"
0 commit comments