File tree Expand file tree Collapse file tree 5 files changed +26
-8
lines changed
Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class ImportOrchestrator {
7373 const importResult = await ImportOrchestrator . getImportedConfigs ( pluginManager , valuesToImport )
7474
7575 ctx . processFinished ( ProcessName . IMPORT )
76- reporter . displayImportResult ( importResult ) ;
76+ reporter . displayImportResult ( importResult , false ) ;
7777
7878 const additionalResourceInfo = await pluginManager . getMultipleResourceInfo ( project . resourceConfigs . map ( ( r ) => r . type ) ) ;
7979 resourceInfoList . push ( ...additionalResourceInfo ) ;
@@ -151,7 +151,13 @@ ${JSON.stringify(unsupportedTypeIds)}`);
151151 } else if ( promptResult === 'In a new file' ) {
152152 const newFileName = await ImportOrchestrator . generateNewImportFileName ( ) ;
153153 await ImportOrchestrator . saveNewFile ( newFileName , importResult ) ;
154+
154155 } else if ( promptResult === 'No' ) {
156+ reporter . displayImportResult ( importResult , true ) ;
157+ reporter . displayMessage ( '\n🎉 Imported completed 🎉' )
158+
159+ await sleep ( 100 ) ;
160+ process . exit ( 0 ) ;
155161 }
156162 }
157163
Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ export function DefaultComponent(props: {
9595 }
9696 {
9797 renderStatus === RenderStatus . DISPLAY_IMPORT_RESULT && (
98- < Static items = { [ renderData as ImportResult ] } > {
99- ( importResult , idx ) => < ImportResultComponent importResult = { importResult } key = { idx } />
98+ < Static items = { [ renderData as { importResult : ImportResult ; showConfigs : boolean } ] } > {
99+ ( renderData , idx ) => < ImportResultComponent importResult = { renderData . importResult } key = { idx } showConfigs = { renderData . showConfigs } />
100100 } </ Static >
101101 )
102102 }
Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ import React from 'react';
55import { ImportResult } from '../../../orchestrators/import.js' ;
66
77export function ImportResultComponent ( props : {
8- importResult : ImportResult
8+ importResult : ImportResult ;
9+ showConfigs : boolean
910} ) {
1011 const { result, errors } = props . importResult
1112
1213 return < Box flexDirection = "column" >
1314 < Text > </ Text >
1415 {
15- result . length > 0 && ( < Box flexDirection = "column" >
16+ result . length > 0 && ! props . showConfigs && ( < Box flexDirection = "column" >
1617 < Text bold = { true } color = { 'green' } > Successfully imported the following configs:</ Text >
1718 < OrderedList >
1819 {
@@ -23,6 +24,17 @@ export function ImportResultComponent(props: {
2324 </ OrderedList >
2425 </ Box > )
2526 }
27+ {
28+ props . showConfigs && (
29+ < Box flexDirection = "column" >
30+ < Box borderColor = "green" borderStyle = "round" >
31+ < Text > Codify Import</ Text >
32+ </ Box >
33+ < br />
34+ < Text > { JSON . stringify ( result . map ( ( r ) => r . raw ) , null , 2 ) } </ Text >
35+ </ Box >
36+ )
37+ }
2638 < Text > </ Text >
2739 {
2840 errors . length > 0 && ( < Box flexDirection = "column" >
Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ export class DefaultReporter implements Reporter {
9999 }
100100 }
101101
102- displayImportResult ( importResult : ImportResult ) : void {
103- this . updateRenderState ( RenderStatus . DISPLAY_IMPORT_RESULT , importResult ) ;
102+ displayImportResult ( importResult : ImportResult , showConfigs : boolean ) : void {
103+ this . updateRenderState ( RenderStatus . DISPLAY_IMPORT_RESULT , { importResult, showConfigs } ) ;
104104 store . set ( store . progressState , null ) ;
105105 }
106106
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export interface Reporter {
4949
5050 promptUserForValues ( resources : Array < ResourceInfo > , promptType : PromptType ) : Promise < ResourceConfig [ ] > ;
5151
52- displayImportResult ( importResult : ImportResult ) : void ;
52+ displayImportResult ( importResult : ImportResult , showConfigs : boolean ) : void ;
5353
5454 displayFileModification ( diff : string ) : void
5555
You can’t perform that action at this time.
0 commit comments