@@ -51,11 +51,70 @@ function importProjectButtonClick() {
5151 } ) ;
5252}
5353
54+ function navigateToStep ( step : number ) {
55+ document . querySelectorAll ( '.wizard-step' ) . forEach ( ( el ) => {
56+ ( el as HTMLElement ) . classList . remove ( 'active' ) ;
57+ } ) ;
58+
59+ const targetStep = document . getElementById ( `step-${ step } ` ) ;
60+ if ( targetStep ) {
61+ targetStep . classList . add ( 'active' ) ;
62+ }
63+
64+ document . querySelectorAll ( '.progress-step' ) . forEach ( ( el ) => {
65+ const stepNumber = parseInt ( ( el as HTMLElement ) . getAttribute ( 'data-step' ) || '0' , 10 ) ;
66+
67+ ( el as HTMLElement ) . classList . remove ( 'active' , 'completed' ) ;
68+
69+ if ( stepNumber === step ) {
70+ ( el as HTMLElement ) . classList . add ( 'active' ) ;
71+ } else if ( stepNumber < step ) {
72+ ( el as HTMLElement ) . classList . add ( 'completed' ) ;
73+ }
74+ } ) ;
75+
76+ if ( step === 3 ) {
77+ updateSummary ( ) ;
78+ }
79+ }
80+
81+ function updateSummary ( ) {
82+ const summarySource = document . getElementById ( 'summary-source' ) ;
83+ const summaryDestination = document . getElementById ( 'summary-destination' ) ;
84+ const summaryTeam = document . getElementById ( 'summary-team' ) ;
85+
86+ if ( summarySource ) {
87+ const gradle2025Input = document . getElementById ( 'gradle2025Input' ) as HTMLInputElement ;
88+ summarySource . textContent = gradle2025Input . value || 'Not selected' ;
89+ }
90+
91+ if ( summaryDestination ) {
92+ const projectFolder = document . getElementById ( 'projectFolder' ) as HTMLInputElement ;
93+ const projectName = document . getElementById ( 'projectName' ) as HTMLInputElement ;
94+ const newFolder = document . getElementById ( 'newFolderCB' ) as HTMLInputElement ;
95+
96+ let destination = projectFolder . value || 'Not selected' ;
97+ if ( newFolder . checked && projectName . value ) {
98+ destination += `/${ projectName . value } ` ;
99+ }
100+ summaryDestination . textContent = destination ;
101+ }
102+
103+ if ( summaryTeam ) {
104+ const teamNumber = document . getElementById ( 'teamNumber' ) as HTMLInputElement ;
105+ summaryTeam . textContent = teamNumber . value || 'Not specified' ;
106+ }
107+ }
108+
54109window . addEventListener ( 'message' , ( event ) => {
55110 const data = event . data as IGradle2025IPCSend ;
56111 switch ( data . type ) {
57112 case 'gradle2025' :
58113 ( document . getElementById ( 'gradle2025Input' ) as HTMLInputElement ) . value = data . data ;
114+ const nextButton = document . getElementById ( 'next-to-step-2' ) as HTMLButtonElement ;
115+ if ( nextButton ) {
116+ nextButton . disabled = false ;
117+ }
59118 break ;
60119 case 'projectname' :
61120 const doc = document . getElementById ( 'projectName' ) as HTMLInputElement ;
@@ -88,5 +147,12 @@ window.addEventListener('load', (_: Event) => {
88147 document . getElementById ( 'romiCB' ) ! . onchange = validateXrpRomi ;
89148 document . getElementById ( 'xrpCB' ) ! . onchange = validateXrpRomi ;
90149
150+ document . getElementById ( 'next-to-step-2' ) ! . onclick = ( ) => navigateToStep ( 2 ) ;
151+ document . getElementById ( 'next-to-step-3' ) ! . onclick = ( ) => navigateToStep ( 3 ) ;
152+ document . getElementById ( 'back-to-step-1' ) ! . onclick = ( ) => navigateToStep ( 1 ) ;
153+ document . getElementById ( 'back-to-step-2' ) ! . onclick = ( ) => navigateToStep ( 2 ) ;
154+
155+ navigateToStep ( 1 ) ;
156+
91157 vscode . postMessage ( { type : 'loaded' } ) ;
92158} ) ;
0 commit comments