@@ -2,13 +2,7 @@ import fs from 'fs';
22import open from 'open' ;
33import { Logger } from '@salesforce/core' ;
44import { pushAssestUtilites } from '../file/fileUtil' ;
5- import {
6- ApexAssessmentInfo ,
7- LWCAssessmentInfo ,
8- MigratedObject ,
9- MigratedRecordInfo ,
10- RelatedObjectAssesmentInfo ,
11- } from '../interfaces' ;
5+ import { ApexAssessmentInfo , MigratedObject , MigratedRecordInfo , RelatedObjectAssesmentInfo } from '../interfaces' ;
126import { generateHtmlTable } from '../reportGenerator/reportGenerator' ;
137import {
148 ComponentDetail ,
@@ -27,7 +21,7 @@ const omniScriptConstants = {
2721 title : 'OmniScripts / IP Migration Result' ,
2822} ;
2923const apexConstants = { componentName : 'apex' , title : 'Apex Classes Migration Result' } ;
30- const lwcConstants = { componentName : 'lwc' , title : 'LWC Components Migration Result' } ;
24+ // const lwcConstants = { componentName: 'lwc', title: 'LWC Components Migration Result' };
3125const migrationResultCSSfileName = 'reportGenerator.css' ;
3226const migrationReportHTMLfileName = 'migration_report.html' ;
3327
@@ -442,94 +436,94 @@ export class ResultsBuilder {
442436 fs . writeFileSync ( resultsDir + '/' + apexConstants . componentName + '.html' , html ) ;
443437 }
444438
445- private static generateReportForLwcResult (
446- result : LWCAssessmentInfo [ ] ,
447- instanceUrl : string ,
448- orgDetails : OmnistudioOrgDetails
449- ) : void {
450- const headerColumns : HeaderColumn [ ] = [
451- {
452- label : 'Component Name' ,
453- key : 'name' ,
454- } ,
455- {
456- label : 'File Reference' ,
457- key : 'path' ,
458- } ,
459- {
460- label : 'Diff' ,
461- key : 'diff' ,
462- } ,
463- {
464- label : 'Errors' ,
465- key : 'errors' ,
466- } ,
467- ] ;
439+ // private static generateReportForLwcResult(
440+ // result: LWCAssessmentInfo[],
441+ // instanceUrl: string,
442+ // orgDetails: OmnistudioOrgDetails
443+ // ): void {
444+ // const headerColumns: HeaderColumn[] = [
445+ // {
446+ // label: 'Component Name',
447+ // key: 'name',
448+ // },
449+ // {
450+ // label: 'File Reference',
451+ // key: 'path',
452+ // },
453+ // {
454+ // label: 'Diff',
455+ // key: 'diff',
456+ // },
457+ // {
458+ // label: 'Errors',
459+ // key: 'errors',
460+ // },
461+ // ];
468462
469- const columns : Array < TableColumn < LWCAssessmentInfo > > = [
470- {
471- key : 'name' ,
472- cell : ( record : LWCAssessmentInfo ) : string => record . name ,
473- filterValue : ( record : LWCAssessmentInfo ) : string => record . name ,
474- title : ( record : LWCAssessmentInfo ) : string => record . name ,
475- skip : ( record : LWCAssessmentInfo , index : number ) : boolean =>
476- ! ( record . changeInfos && record . changeInfos . length > 0 && index === 0 ) ,
477- rowspan : ( record : LWCAssessmentInfo ) : number =>
478- record . changeInfos && record . changeInfos . length > 0 ? record . changeInfos . length : 1 ,
479- } ,
480- {
481- key : 'path' ,
482- filterValue : ( record : LWCAssessmentInfo , index : number ) : string => record . changeInfos [ index ] . path ,
483- title : ( record : LWCAssessmentInfo , index : number ) : string => record . changeInfos [ index ] . path ,
484- cell : ( record : LWCAssessmentInfo , index : number ) : string =>
485- record . changeInfos [ index ] . path
486- ? `<a href="${ instanceUrl } /${ record . changeInfos [ index ] . path } ">${ record . changeInfos [ index ] . name } </a>`
487- : '' ,
488- } ,
489- {
490- key : 'diff' ,
491- cell : ( record : LWCAssessmentInfo , index : number ) : string => record . changeInfos [ index ] . diff ,
492- filterValue : ( record : LWCAssessmentInfo , index : number ) : string => record . changeInfos [ index ] . diff ,
493- } ,
494- {
495- key : 'errors' ,
496- cell : ( record : LWCAssessmentInfo ) : string => ( record . errors ? record . errors . join ( ', ' ) : '' ) ,
497- filterValue : ( record : LWCAssessmentInfo ) : string =>
498- record . errors && record . errors . length > 0 ? 'Has Errors' : 'Has No Errors' ,
499- rowspan : ( record : LWCAssessmentInfo ) : number =>
500- record . changeInfos && record . changeInfos . length > 0 ? record . changeInfos . length : 1 ,
501- skip : ( record : LWCAssessmentInfo , index : number ) : boolean =>
502- ! ( record . changeInfos && record . changeInfos . length > 0 && index === 0 ) ,
503- } ,
504- ] ;
463+ // const columns: Array<TableColumn<LWCAssessmentInfo>> = [
464+ // {
465+ // key: 'name',
466+ // cell: (record: LWCAssessmentInfo): string => record.name,
467+ // filterValue: (record: LWCAssessmentInfo): string => record.name,
468+ // title: (record: LWCAssessmentInfo): string => record.name,
469+ // skip: (record: LWCAssessmentInfo, index: number): boolean =>
470+ // !(record.changeInfos && record.changeInfos.length > 0 && index === 0),
471+ // rowspan: (record: LWCAssessmentInfo): number =>
472+ // record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
473+ // },
474+ // {
475+ // key: 'path',
476+ // filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
477+ // title: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
478+ // cell: (record: LWCAssessmentInfo, index: number): string =>
479+ // record.changeInfos[index].path
480+ // ? `<a href="${instanceUrl}/${record.changeInfos[index].path}">${record.changeInfos[index].name}</a>`
481+ // : '',
482+ // },
483+ // {
484+ // key: 'diff',
485+ // cell: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
486+ // filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
487+ // },
488+ // {
489+ // key: 'errors',
490+ // cell: (record: LWCAssessmentInfo): string => (record.errors ? record.errors.join(', ') : ''),
491+ // filterValue: (record: LWCAssessmentInfo): string =>
492+ // record.errors && record.errors.length > 0 ? 'Has Errors' : 'Has No Errors',
493+ // rowspan: (record: LWCAssessmentInfo): number =>
494+ // record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
495+ // skip: (record: LWCAssessmentInfo, index: number): boolean =>
496+ // !(record.changeInfos && record.changeInfos.length > 0 && index === 0),
497+ // },
498+ // ];
505499
506- const filters : Filter [ ] = [
507- {
508- label : 'Errors' ,
509- key : 'errors' ,
510- filterOptions : [ 'Has Errors' , 'Has No Errors' ] ,
511- } ,
512- ] ;
500+ // const filters: Filter[] = [
501+ // {
502+ // label: 'Errors',
503+ // key: 'errors',
504+ // filterOptions: ['Has Errors', 'Has No Errors'],
505+ // },
506+ // ];
513507
514- const html = `<html>
515- ${ this . createHeadWithScript ( `${ lwcConstants . title } Migration Report` ) }
516- <body>
517- <div class="slds-m-around_medium">
518- <div class="slds-text-heading_large">${ lwcConstants . title } </div>
519- ${ generateHtmlTable (
520- headerColumns ,
521- columns ,
522- result ,
523- this . formattedOrgDetails ( orgDetails ) ,
524- filters ,
525- undefined ,
526- '' ,
527- 'changeInfos' ,
528- false
529- ) }
530- </div>
531- </body>
532- </html>` ;
533- fs . writeFileSync ( resultsDir + '/' + lwcConstants . componentName + '.html' , html ) ;
534- }
508+ // const html = `<html>
509+ // ${this.createHeadWithScript(`${lwcConstants.title} Migration Report`) }
510+ // <body>
511+ // <div class="slds-m-around_medium">
512+ // <div class="slds-text-heading_large">${lwcConstants.title}</div>
513+ // ${generateHtmlTable(
514+ // headerColumns,
515+ // columns,
516+ // result,
517+ // this.formattedOrgDetails(orgDetails),
518+ // filters,
519+ // undefined,
520+ // '',
521+ // 'changeInfos',
522+ // false
523+ // )}
524+ // </div>
525+ // </body>
526+ // </html>`;
527+ // fs.writeFileSync(resultsDir + '/' + lwcConstants.componentName + '.html', html);
528+ // }
535529}
0 commit comments