@@ -104,7 +104,6 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
104104 this . showOutputOnScreenWorkflowsAndExtension ( [
105105 { module : 'Entries Changed Multiple Fields' , missingRefs : missingMultipleFields } ,
106106 ] ) ;
107-
108107 }
109108 this . showOutputOnScreenWorkflowsAndExtension ( [ { module : 'Summary' , missingRefs : this . summaryDataToPrint } ] ) ;
110109
@@ -186,7 +185,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
186185 fix : this . currentCommand === 'cm:stacks:audit:fix' ,
187186 } ;
188187
189- let dataModuleWise : Record < string , any > = await new ModuleDataReader ( cloneDeep ( constructorParam ) ) . run ( ) ;
188+ let dataModuleWise : Record < string , any > = await new ModuleDataReader ( cloneDeep ( constructorParam ) ) . run ( ) ;
190189 for ( const module of this . sharedConfig . flags . modules || this . sharedConfig . modules ) {
191190 print ( [
192191 {
@@ -449,15 +448,16 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
449448 . map ( ( key : string ) => ( {
450449 value : key ,
451450 formatter : ( cellValue : any ) => {
452- if ( key === 'fixStatus' || key === 'Fixable' ) {
451+ if ( key === 'fixStatus' || key === 'Fixable' || key === 'Fixed' ) {
453452 return chalk . green ( typeof cellValue === 'object' ? JSON . stringify ( cellValue ) : cellValue ) ;
454453 } else if (
455454 key === 'content_types' ||
456455 key === 'branches' ||
457456 key === 'missingCTSelectFieldValues' ||
458457 key === 'missingFieldUid' ||
459458 key === 'action' ||
460- key === 'Non-Fixable'
459+ key === 'Non-Fixable' ||
460+ key === 'Not-Fixed'
461461 ) {
462462 return chalk . red ( typeof cellValue === 'object' ? JSON . stringify ( cellValue ) : cellValue ) ;
463463 } else {
@@ -590,27 +590,45 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
590590
591591 for ( const [ key , refs ] of missingRefs ) {
592592 const uids = Object . keys ( refs ) ;
593- if ( key !== 'missingTitleFields' ) {
594- uids . forEach ( ( uid ) => uidSet . add ( uid ) ) ;
595- } else {
593+
594+ if (
595+ key === 'missingTitleFields' ||
596+ ( ! this . sharedConfig . fixSelectField &&
597+ key === 'missingSelectFeild' &&
598+ this . currentCommand === 'cm:stacks:audit:fix' )
599+ ) {
596600 uids . forEach ( ( uid ) => {
597601 if ( uidSet . has ( uid ) ) {
598602 uidSet . delete ( uid ) ;
599603 nonFixable . add ( uid ) ;
604+ } else {
605+ nonFixable . add ( uid ) ;
600606 }
601607 } ) ;
608+ } else {
609+ uids . forEach ( ( uid ) => uidSet . add ( uid ) ) ;
602610 }
603611 }
604612
605- result . Passed = dataExported . Total - uidSet . size ;
606- result . Fixable = uidSet . size - nonFixable . size ;
607- result [ 'Non-Fixable' ] = nonFixable . size ;
613+ result . Passed = dataExported . Total - ( uidSet . size + nonFixable . size ) ;
614+ if ( this . currentCommand === 'cm:stacks:audit:fix' ) {
615+ result . Fixed = uidSet . size ;
616+ result [ 'Not-Fixed' ] = nonFixable . size ;
617+ } else {
618+ result . Fixable = uidSet . size ;
619+ result [ 'Non-Fixable' ] = nonFixable . size ;
620+ }
608621 } else {
609622 const missingCount = Object . keys ( listOfMissingRefs ) . length ;
610623 result . Passed = dataExported . Total - missingCount ;
611624
612- result . Fixable = missingCount > 0 && isFixable ? missingCount : 0 ;
613- result [ 'Non-Fixable' ] = missingCount > 0 && ! isFixable ? missingCount : 0 ;
625+ if ( this . currentCommand === 'cm:stacks:audit:fix' ) {
626+ result . Fixed = missingCount > 0 && isFixable ? missingCount : 0 ;
627+ result [ 'Not-Fixed' ] = missingCount > 0 && ! isFixable ? missingCount : 0 ;
628+ } else {
629+ result . Fixable = missingCount > 0 && isFixable ? missingCount : 0 ;
630+ result [ 'Non-Fixable' ] = missingCount > 0 && ! isFixable ? missingCount : 0 ;
631+ }
614632 }
615633
616634 this . summaryDataToPrint . push ( result ) ;
0 commit comments