@@ -9,9 +9,9 @@ import { ProgressState, ProgressStatus } from '../components/progress/progress-d
99import { DisplayPlanStateTransition , RenderEvent , RenderState , Reporter } from './reporter.js' ;
1010
1111const ProgressLabelMapping = {
12- [ ProcessName . APPLY ] : 'Codify plan ' ,
12+ [ ProcessName . APPLY ] : 'Codify apply ' ,
1313 [ ProcessName . PLAN ] : 'Codify plan' ,
14- [ SubProcessName . APPLY_RESOURCE ] : 'Applying resource' ,
14+ [ SubProcessName . APPLYING_RESOURCE ] : 'Applying resource' ,
1515 [ SubProcessName . GENERATE_PLAN ] : 'Refresh states and generating plan' ,
1616 [ SubProcessName . INITIALIZE_PLUGINS ] : 'Initializing plugins' ,
1717 [ SubProcessName . PARSE ] : 'Parsing configs' ,
@@ -29,8 +29,8 @@ export class DefaultReporter implements Reporter {
2929 ctx . on ( Event . OUTPUT , ( args ) => this . log ( args ) ) ;
3030 ctx . on ( Event . PROCESS_START , ( name ) => this . onProcessStartEvent ( name ) )
3131 ctx . on ( Event . PROCESS_FINISH , ( name ) => this . onProcessFinishEvent ( name ) )
32- ctx . on ( Event . SUB_PROCESS_START , ( name ) => this . onSubprocessStartEvent ( name ) ) ;
33- ctx . on ( Event . SUB_PROCESS_FINISH , ( name ) => this . onSubprocessFinishEvent ( name ) )
32+ ctx . on ( Event . SUB_PROCESS_START , ( name , additionalName ) => this . onSubprocessStartEvent ( name , additionalName ) ) ;
33+ ctx . on ( Event . SUB_PROCESS_FINISH , ( name , additionalName ) => this . onSubprocessFinishEvent ( name , additionalName ) )
3434 }
3535
3636 displayPlan ( plan : PlanResponseData [ ] ) : void {
@@ -58,9 +58,10 @@ export class DefaultReporter implements Reporter {
5858 this . renderEmitter . emit ( RenderEvent . STATE_TRANSITION , {
5959 nextState : RenderState . APPLYING ,
6060 } ) ;
61+
62+ this . log ( 'Do you want to apply the above changes? -> "Yes"' )
6163 }
6264
63- this . log ( `Do you want to apply the above changes? -> ${ continueApply ? '"Yes"' : '"No"' } ` )
6465 return continueApply ;
6566 }
6667
@@ -92,25 +93,31 @@ export class DefaultReporter implements Reporter {
9293
9394 }
9495
95- private onSubprocessStartEvent ( name : SubProcessName ) : void {
96- const label = ProgressLabelMapping [ name ] ;
96+ private onSubprocessStartEvent ( name : SubProcessName , additionalName ?: string ) : void {
97+ const label = ProgressLabelMapping [ name ] + ( additionalName
98+ ? ' ' + additionalName
99+ : ''
100+ ) ;
97101
98102 this . progressState ?. subProgresses ?. push ( {
99103 label,
100- name,
104+ name : name + additionalName ,
101105 status : ProgressStatus . IN_PROGRESS ,
102106 } ) ;
103107
104108 this . log ( `${ label } started` )
105109 this . renderEmitter . emit ( RenderEvent . PROGRESS_UPDATE , this . progressState ) ;
106110 }
107111
108- private onSubprocessFinishEvent ( name : SubProcessName ) : void {
109- const label = ProgressLabelMapping [ name ] ;
112+ private onSubprocessFinishEvent ( name : SubProcessName , additionalName ?: string ) : void {
113+ const label = ProgressLabelMapping [ name ] + ( additionalName
114+ ? ' ' + additionalName
115+ : ''
116+ ) ;
110117
111118 const subProgress = this . progressState
112119 ?. subProgresses
113- ?. find ( ( p ) => p . name === name ) ;
120+ ?. find ( ( p ) => p . name === name + additionalName ) ;
114121
115122 if ( ! subProgress ) {
116123 return ;
0 commit comments