From 794d819846edae2a8a07f2d47ac1446288cfcdd0 Mon Sep 17 00:00:00 2001 From: abhinavkumar2 Date: Wed, 25 Sep 2024 08:35:24 +0530 Subject: [PATCH 1/3] feat: updated filtering --- src/migration/related/ApexMigration.ts | 4 ++-- src/migration/related/LwcMigration.ts | 2 +- src/utils/resultsbuilder/assessmentReporter.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/migration/related/ApexMigration.ts b/src/migration/related/ApexMigration.ts index 59896f1..47af865 100644 --- a/src/migration/related/ApexMigration.ts +++ b/src/migration/related/ApexMigration.ts @@ -30,7 +30,7 @@ export class ApexMigration extends BaseRelatedObjectMigration implements Related private readonly callableInterface: InterfaceImplements; private readonly vlocityOpenInterface2: InterfaceImplements; private readonly vlocityOpenInterface: InterfaceImplements; - private updatedNamespace = this.namespace; + private updatedNamespace = 'omnistudio'; public constructor(projectPath: string, namespace: string, org: Org) { super(projectPath, namespace, org); this.callableInterface = new InterfaceImplements(CALLABLE, this.namespace); @@ -71,7 +71,7 @@ export class ApexMigration extends BaseRelatedObjectMigration implements Related if (file.ext !== '.cls') continue; try { const apexAssementInfo = this.processApexFile(file); - if (apexAssementInfo && apexAssementInfo.diff && apexAssementInfo.diff.length === 0) continue; + if (apexAssementInfo && apexAssementInfo.diff.length === 0) continue; fileAssessmentInfo.push(apexAssementInfo); } catch (err) { Logger.logger.error(`Error processing ${file.name}`); diff --git a/src/migration/related/LwcMigration.ts b/src/migration/related/LwcMigration.ts index 9dd18a6..6d9008b 100644 --- a/src/migration/related/LwcMigration.ts +++ b/src/migration/related/LwcMigration.ts @@ -59,7 +59,7 @@ export class LwcMigration extends BaseRelatedObjectMigration { const jsonData: LWCAssessmentInfo[] = []; fileMap.forEach((fileList, dir) => { const changeInfos: FileChangeInfo[] = []; - if (dir !== 'lwc') { + if (dir !== 'lwc' && !dir.endsWith('English') && !dir.includes('_')) { for (const file of fileList) { if (this.isValideFile(file.name)) { const processor = FileProcessorFactory.getFileProcessor(file.ext); diff --git a/src/utils/resultsbuilder/assessmentReporter.ts b/src/utils/resultsbuilder/assessmentReporter.ts index 027140d..9415e06 100644 --- a/src/utils/resultsbuilder/assessmentReporter.ts +++ b/src/utils/resultsbuilder/assessmentReporter.ts @@ -6,8 +6,8 @@ export class AssessmentReporter { public static async generate(result: AssessmentInfo, instanceUrl: string): Promise { let htmlBody = ''; - htmlBody += '
' + this.generateLwcAssesment(result.lwcAssessmentInfos); htmlBody += '
' + this.generateApexAssesment(result.apexAssessmentInfos); + htmlBody += '
' + this.generateLwcAssesment(result.lwcAssessmentInfos); const doc = this.generateDocument(htmlBody); const fileUrl = process.cwd() + '/assessmentresults.html'; From e7c24324d83754d01c33e8ac9fbd131598af5473 Mon Sep 17 00:00:00 2001 From: abhinavkumar2 Date: Mon, 28 Oct 2024 16:48:32 +0530 Subject: [PATCH 2/3] fix: some changes --- src/migration/related/LwcMigration.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/migration/related/LwcMigration.ts b/src/migration/related/LwcMigration.ts index 6d9008b..043c7a8 100644 --- a/src/migration/related/LwcMigration.ts +++ b/src/migration/related/LwcMigration.ts @@ -25,7 +25,7 @@ export class LwcMigration extends BaseRelatedObjectMigration { const type = 'assessment'; const pwd = shell.pwd(); shell.cd(this.projectPath); - // sfProject.retrieve(LWCTYPE, this.org.getUsername()); + sfProject.retrieve(LWCTYPE, this.org.getUsername()); const filesMap = this.processLwcFiles(this.projectPath); shell.cd(pwd); return this.processFiles(filesMap, type); @@ -59,7 +59,7 @@ export class LwcMigration extends BaseRelatedObjectMigration { const jsonData: LWCAssessmentInfo[] = []; fileMap.forEach((fileList, dir) => { const changeInfos: FileChangeInfo[] = []; - if (dir !== 'lwc' && !dir.endsWith('English') && !dir.includes('_')) { + if (dir !== 'lwc' && !dir.endsWith('English') && !dir.includes('_') && !dir.includes('cf')) { for (const file of fileList) { if (this.isValideFile(file.name)) { const processor = FileProcessorFactory.getFileProcessor(file.ext); From 5a6baaba18589cada58a40bb38a1b2a84ea5c390 Mon Sep 17 00:00:00 2001 From: abhinavkumar2 Date: Tue, 29 Oct 2024 16:53:24 +0530 Subject: [PATCH 3/3] fix: cleaned up assessment report --- src/migration/omniscript.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/migration/omniscript.ts b/src/migration/omniscript.ts index a726673..b11aef6 100644 --- a/src/migration/omniscript.ts +++ b/src/migration/omniscript.ts @@ -229,27 +229,27 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat const language = propertySet['Language']; const osName = type + '_' + subtype + '_' + language; dependencyOS.push(osName + ' ( ' + nameVal + ' )
'); - /* if (!existingOmniscriptNames.has(nameVal)) { - missingOS.push(nameVal); - }*/ + if (!existingOmniscriptNames.has(nameVal)) { + missingOS.push(nameVal); + } } // Check for Integration Procedure Action dependencies if (type === 'Integration Procedure Action') { const nameVal = `${elemName}_Integration Procedure Action`; - // if (!existingOmniscriptNames.has(nameVal) && !existingFlexCardNames.has(nameVal)) { dependencyIP.push(propertySet['integrationProcedureKey'] + ' (' + nameVal + ')
'); - // missingIP.push(nameVal); - // } + if (!existingOmniscriptNames.has(nameVal) && !existingFlexCardNames.has(nameVal)) { + missingIP.push(nameVal); + } } // Check for DataRaptor dependencies if (['DataRaptor Extract Action', 'DataRaptor Turbo Action', 'DataRaptor Post Action'].includes(type)) { const nameVal = `${elemName}_${type}`; - // if (!existingOmniscriptNames.has(nameVal) && !existingDataRaptorNames.has(nameVal)) { dependencyDR.push(propertySet['bundle'] + ' ( ' + nameVal + ' )
'); - // missingDR.push(nameVal); - // } + if (!existingOmniscriptNames.has(nameVal) && !existingDataRaptorNames.has(nameVal)) { + missingDR.push(nameVal); + } } if (type === 'Remote Action') {