@@ -33,7 +33,7 @@ import { createFilterGroupParam, createRowDataParam } from '../reportGenerator/r
3333import { FileDiffUtil } from '../lwcparser/fileutils/FileDiffUtil' ;
3434import { Logger } from '../logger' ;
3535import { getMigrationHeading } from '../stringUtils' ;
36- import { Constants } from '../constants/stringContants' ;
36+ import { Constants , Status } from '../constants/stringContants' ;
3737import { isStandardDataModel , isStandardDataModelWithMetadataAPIEnabled } from '../dataModelService' ;
3838import { CustomLabelMigrationInfo , CustomLabelMigrationReporter } from './CustomLabelMigrationReporter' ;
3939
@@ -56,8 +56,8 @@ export class ResultsBuilder {
5656
5757 private static flexiPageFileSuffix = '.flexipage-meta.xml' ;
5858
59- private static successStatus = [ 'Ready for migration' , ' Complete' , 'Successfully migrated' ] ;
60- private static errorStatus = [ ' Failed' , 'Needs manual intervention' ] ;
59+ private static successStatus = [ Status . ReadyForMigration , Status . Complete , Status . SuccessfullyMigrated ] ;
60+ private static errorStatus = [ Status . Failed , Status . NeedsManualIntervention ] ;
6161
6262 /** Set at report generation start; used to show "Manual deployment needed" when deployment failed */
6363 private static deploymentFailed = false ;
@@ -191,11 +191,11 @@ export class ResultsBuilder {
191191 false ,
192192 undefined ,
193193 undefined ,
194- item . status === 'Successfully migrated' ? 'text-success' : 'text-error'
194+ item . status === Status . SuccessfullyMigrated ? 'text-success' : 'text-error'
195195 ) ,
196196 createRowDataParam (
197197 'errors' ,
198- item . errors ? ' Failed' : 'Has No Errors' ,
198+ item . errors ? Status . Failed : 'Has No Errors' ,
199199 false ,
200200 1 ,
201201 1 ,
@@ -288,11 +288,11 @@ export class ResultsBuilder {
288288 // Handle both old and new data formats
289289 const labelName = record . name || record . labelName ;
290290 const cloneStatus =
291- record . status === ' Complete'
291+ record . status === Status . Complete
292292 ? 'created'
293293 : record . status === 'Error'
294294 ? 'error'
295- : record . status === ' Skipped'
295+ : record . status === Status . Skipped
296296 ? 'duplicate'
297297 : record . status || 'duplicate' ;
298298 const message = record . message || '' ;
@@ -516,7 +516,7 @@ export class ResultsBuilder {
516516 false ,
517517 undefined ,
518518 undefined ,
519- this . resolveStatusCssClass ( item . status )
519+ this . resolveStatusClass ( item . status )
520520 ) ,
521521 createRowDataParam (
522522 'diff' ,
@@ -557,7 +557,9 @@ export class ResultsBuilder {
557557 } ,
558558 assessmentDate : new Date ( ) . toLocaleString ( ) ,
559559 total : result . length ,
560- filterGroups : [ createFilterGroupParam ( 'Filter by Errors' , 'warnings' , [ 'Failed' , 'Successfully Completed' ] ) ] ,
560+ filterGroups : [
561+ createFilterGroupParam ( 'Filter by Errors' , 'warnings' , [ Status . Failed , Status . SuccessfullyCompleted ] ) ,
562+ ] ,
561563 headerGroups : [
562564 {
563565 header : [
@@ -631,7 +633,7 @@ export class ResultsBuilder {
631633 ] ) ,
632634 createRowDataParam (
633635 'warnings' ,
634- item . errors . length > 0 ? ' Failed' : 'Successfully Completed' ,
636+ item . errors . length > 0 ? Status . Failed : Status . SuccessfullyCompleted ,
635637 false ,
636638 1 ,
637639 1 ,
@@ -729,7 +731,7 @@ export class ResultsBuilder {
729731 const commonRowSpan = Math . max ( 1 , lwcAssessmentInfo . changeInfos . length ) ;
730732 const actualStatus = this . getStatusFromErrors ( lwcAssessmentInfo . errors ) ;
731733 const displayStatus = this . resolveDisplayStatus ( actualStatus , messages ) ;
732- const statusCssClass = this . resolveStatusCssClass ( actualStatus ) ;
734+ const statusClass = this . resolveStatusClass ( actualStatus ) ;
733735 for ( const fileChangeInfo of lwcAssessmentInfo . changeInfos ) {
734736 rows . push ( {
735737 rowId : rid ,
@@ -746,7 +748,7 @@ export class ResultsBuilder {
746748 false ,
747749 undefined ,
748750 undefined ,
749- statusCssClass
751+ statusClass
750752 ) ,
751753 ]
752754 : [ ] ) ,
@@ -777,8 +779,8 @@ export class ResultsBuilder {
777779 createRowDataParam (
778780 'comments' ,
779781 lwcAssessmentInfo . warnings && lwcAssessmentInfo . warnings . length > 0
780- ? ' Failed'
781- : 'Successfully Completed' ,
782+ ? Status . Failed
783+ : Status . SuccessfullyCompleted ,
782784 false ,
783785 commonRowSpan ,
784786 1 ,
@@ -985,14 +987,14 @@ export class ResultsBuilder {
985987 let error = 0 ;
986988 let skip = 0 ;
987989 data . forEach ( ( item ) => {
988- if ( item . status === 'Successfully migrated' ) complete ++ ;
989- if ( item . status === ' Failed' ) error ++ ;
990- if ( item . status === ' Skipped' ) skip ++ ;
990+ if ( item . status === Status . SuccessfullyMigrated ) complete ++ ;
991+ if ( item . status === Status . Failed ) error ++ ;
992+ if ( item . status === Status . Skipped ) skip ++ ;
991993 } ) ;
992994 return [
993- { name : 'Successfully migrated' , count : complete , cssClass : 'text-success' } ,
994- { name : ' Skipped' , count : skip , cssClass : 'text-error' } ,
995- { name : ' Failed' , count : error , cssClass : 'text-error' } ,
995+ { name : Status . SuccessfullyMigrated , count : complete , cssClass : 'text-success' } ,
996+ { name : Status . Skipped , count : skip , cssClass : 'text-error' } ,
997+ { name : Status . Failed , count : error , cssClass : 'text-error' } ,
996998 ] ;
997999 }
9981000
@@ -1010,18 +1012,18 @@ export class ResultsBuilder {
10101012 data . forEach ( ( item ) => {
10111013 // Handle both old and new status formats
10121014 const status = item . status || ( item as any ) . cloneStatus ;
1013- if ( status === 'error' || status === 'Error' || status === ' Failed' ) error ++ ;
1014- else if ( status === 'duplicate' || status === ' Skipped' ) duplicate ++ ;
1015+ if ( status === 'error' || status === 'Error' || status === Status . Failed ) error ++ ;
1016+ else if ( status === 'duplicate' || status === Status . Skipped ) duplicate ++ ;
10151017 } ) ;
10161018
10171019 // Use totalCount if provided, otherwise fall back to data length
10181020 const actualTotal = totalCount || data . length ;
10191021 const successfullyMigrated = Math . max ( 0 , actualTotal - error - duplicate ) ;
10201022
10211023 return [
1022- { name : 'Successfully migrated' , count : successfullyMigrated , cssClass : 'text-success' } ,
1023- { name : ' Failed' , count : error , cssClass : 'text-error' } ,
1024- { name : ' Skipped' , count : duplicate , cssClass : 'text-warning' } ,
1024+ { name : Status . SuccessfullyMigrated , count : successfullyMigrated , cssClass : 'text-success' } ,
1025+ { name : Status . Failed , count : error , cssClass : 'text-error' } ,
1026+ { name : Status . Skipped , count : duplicate , cssClass : 'text-warning' } ,
10251027 ] ;
10261028 }
10271029
@@ -1035,9 +1037,9 @@ export class ResultsBuilder {
10351037 else error ++ ;
10361038 } ) ;
10371039 return [
1038- { name : 'Successfully migrated' , count : complete , cssClass : 'text-success' } ,
1039- { name : ' Skipped' , count : 0 , cssClass : 'text-error' } ,
1040- { name : ' Failed' , count : error , cssClass : 'text-error' } ,
1040+ { name : Status . SuccessfullyMigrated , count : complete , cssClass : 'text-success' } ,
1041+ { name : Status . Skipped , count : 0 , cssClass : 'text-error' } ,
1042+ { name : Status . Failed , count : error , cssClass : 'text-error' } ,
10411043 ] ;
10421044 }
10431045
@@ -1048,17 +1050,17 @@ export class ResultsBuilder {
10481050 failed : number ;
10491051 } ) : SummaryItemDetailParam [ ] {
10501052 const result : SummaryItemDetailParam [ ] = [
1051- { name : 'Successfully migrated' , count : counts . completed , cssClass : 'text-success' } ,
1053+ { name : Status . SuccessfullyMigrated , count : counts . completed , cssClass : 'text-success' } ,
10521054 ] ;
10531055 if ( counts . manualDeploymentNeeded > 0 ) {
10541056 result . push ( {
1055- name : 'Manual deployment needed' ,
1057+ name : Status . ManualDeploymentNeeded ,
10561058 count : counts . manualDeploymentNeeded ,
10571059 cssClass : 'text-error' ,
10581060 } ) ;
10591061 }
1060- result . push ( { name : ' Skipped' , count : counts . skipped , cssClass : 'text-error' } ) ;
1061- result . push ( { name : ' Failed' , count : counts . failed , cssClass : 'text-error' } ) ;
1062+ result . push ( { name : Status . Skipped , count : counts . skipped , cssClass : 'text-error' } ) ;
1063+ result . push ( { name : Status . Failed , count : counts . failed , cssClass : 'text-error' } ) ;
10621064 return result ;
10631065 }
10641066
@@ -1075,9 +1077,9 @@ export class ResultsBuilder {
10751077 for ( const status of statuses ) {
10761078 if ( this . isManualDeploymentNeeded ( status ) ) {
10771079 manualDeploymentNeeded ++ ;
1078- } else if ( status === 'Successfully migrated' ) {
1080+ } else if ( status === Status . SuccessfullyMigrated ) {
10791081 completed ++ ;
1080- } else if ( status === ' Skipped' ) {
1082+ } else if ( status === Status . Skipped ) {
10811083 skipped ++ ;
10821084 } else {
10831085 failed ++ ;
@@ -1110,13 +1112,13 @@ export class ResultsBuilder {
11101112 }
11111113
11121114 private static getStatusFromErrors ( errors : string [ ] ) : string {
1113- if ( errors && errors . length > 0 ) return ' Failed' ;
1114- return 'Successfully migrated' ;
1115+ if ( errors && errors . length > 0 ) return Status . Failed ;
1116+ return Status . SuccessfullyMigrated ;
11151117 }
11161118
11171119 /** True when deployment failed but the component was successfully processed locally. */
11181120 private static isManualDeploymentNeeded ( status : string ) : boolean {
1119- return this . deploymentFailed && status === 'Successfully migrated' ;
1121+ return this . deploymentFailed && status === Status . SuccessfullyMigrated ;
11201122 }
11211123
11221124 /** Returns display status — "Manual deployment needed" when deployment failed, original status otherwise. */
@@ -1125,9 +1127,9 @@ export class ResultsBuilder {
11251127 }
11261128
11271129 /** Returns CSS class — error for manual deployment needed, success/error otherwise. */
1128- private static resolveStatusCssClass ( status : string ) : string {
1130+ private static resolveStatusClass ( status : string ) : string {
11291131 if ( this . isManualDeploymentNeeded ( status ) ) return 'text-error' ;
1130- return status === 'Successfully migrated' ? 'text-success' : 'text-error' ;
1132+ return status === Status . SuccessfullyMigrated ? 'text-success' : 'text-error' ;
11311133 }
11321134
11331135 private static getRowsForExperienceSites (
@@ -1158,7 +1160,7 @@ export class ResultsBuilder {
11581160 messages : Messages < string >
11591161 ) : ReportDataParam [ ] {
11601162 const displayStatus = this . resolveDisplayStatus ( page . status , messages ) ;
1161- const statusCssClass = this . resolveStatusCssClass ( page . status ) ;
1163+ const statusClass = this . resolveStatusClass ( page . status ) ;
11621164 return [
11631165 createRowDataParam (
11641166 'name' ,
@@ -1173,7 +1175,7 @@ export class ResultsBuilder {
11731175 ) ,
11741176 createRowDataParam ( 'pageName' , page . name , false , 1 , 1 , false , undefined , undefined ) ,
11751177 createRowDataParam ( 'path' , page . name + this . experienceSiteFileSuffix , false , 1 , 1 , true , page . path ) ,
1176- createRowDataParam ( 'status' , displayStatus , false , 1 , 1 , false , undefined , undefined , statusCssClass ) ,
1178+ createRowDataParam ( 'status' , displayStatus , false , 1 , 1 , false , undefined , undefined , statusClass ) ,
11771179 createRowDataParam (
11781180 'diff' ,
11791181 page . name + 'diff' ,
0 commit comments