File tree Expand file tree Collapse file tree 3 files changed +12
-24
lines changed
contentstack-import/src/commands/cm/stacks
contentstack-utilities/src/progress-summary Expand file tree Collapse file tree 3 files changed +12
-24
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,14 @@ export default class ImportCommand extends Command {
148148 const moduleImporter = new ModuleImporter ( managementAPIClient , importConfig ) ;
149149 const result = await moduleImporter . start ( ) ;
150150 backupDir = importConfig . backupDir ;
151- //Note: Final summary is now handled by summary manager
151+
152+ if ( ! result ?. noSuccessMsg ) {
153+ const successMessage = importConfig . stackName
154+ ? `Successfully imported the content to the stack named ${ importConfig . stackName } with the API key ${ importConfig . apiKey } .`
155+ : `The content has been imported to the stack ${ importConfig . apiKey } successfully!` ;
156+ log . success ( successMessage , importConfig . context ) ;
157+ }
158+
152159 CLIProgressManager . printGlobalSummary ( ) ;
153160 this . logSuccessAndBackupMessages ( backupDir , importConfig ) ;
154161 // Clear progress module setting now that import is complete
Original file line number Diff line number Diff line change @@ -108,16 +108,6 @@ export default class CLIProgressManager {
108108 CLIProgressManager . globalSummary . printFinalSummary ( ) ;
109109 }
110110
111- /**
112- * Check if there are any failures in the global summary
113- */
114- static hasFailures ( ) : boolean {
115- if ( ! CLIProgressManager . globalSummary ) {
116- return false ;
117- }
118- return CLIProgressManager . globalSummary . hasFailures ( ) ;
119- }
120-
121111 /**
122112 * Apply strategy-based corrections to module data
123113 */
Original file line number Diff line number Diff line change @@ -131,12 +131,10 @@ export default class SummaryManager {
131131
132132 // Final Status
133133 console . log ( '\n' + chalk . bold ( 'Final Status:' ) ) ;
134- if ( ! this . hasFailures ( ) && failedModules === 0 ) {
135- console . log ( chalk . bold . green ( `✅ ${ this . operationName } completed successfully!` ) ) ;
136- } else if ( this . hasFailures ( ) || failedModules > 0 ) {
137- console . log (
138- chalk . bold . yellow ( `⚠️ ${ this . operationName } completed with failures, see the logs for more details.` ) ,
139- ) ;
134+ if ( failedModules === 0 ) {
135+ console . log ( chalk . bold . green ( `🎉 ${ this . operationName } completed successfully!` ) ) ;
136+ } else if ( completedModules > 0 ) {
137+ console . log ( chalk . bold . yellow ( `⚠️ ${ this . operationName } completed with ${ failedModules } failed modules` ) ) ;
140138 } else {
141139 console . log ( chalk . bold . red ( `❌ ${ this . operationName } failed` ) ) ;
142140 }
@@ -148,13 +146,6 @@ export default class SummaryManager {
148146 this . printFailureSummaryWithLogReference ( ) ;
149147 }
150148
151- /**
152- * Check if there are any failures across all modules
153- */
154- hasFailures ( ) : boolean {
155- return Array . from ( this . modules . values ( ) ) . some ( ( m ) => m . failures . length > 0 || m . failureCount > 0 ) ;
156- }
157-
158149 private printFailureSummaryWithLogReference ( ) : void {
159150 const modulesWithFailures = Array . from ( this . modules . values ( ) ) . filter ( ( m ) => m . failures . length > 0 ) ;
160151
You can’t perform that action at this time.
0 commit comments