Skip to content
Merged
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,4 @@



## 1.2.2 (2022-06-13)



## 1.2.2 (2022-06-13)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ OPTIONS

```

> **Note:** LWC (Lightning Web Components) migration functionality is temporarily disabled in the current version. This includes LWC migration, assessment, and report generation features. These features will be re-enabled in a future release. Apex migration functionality remains fully available. The `--relatedobjects` flag accepts all values ('apex', 'lwc', 'apex,lwc'), but LWC-related operations will not be executed.

Terms:
Notwithstanding anything stated in the terms and conditions agreed between Salesforce (‘SFDC’) and you (‘Customer’), the use of the OmniStudio Migration Tool (‘Tool’) is designed to facilitate the migration and it’s going to modify your custom code and by deploying and using the Tool you hereby provide your consent to automate the migration process and enable a smooth transition. Customer shall access and use the Tool only as permitted to the Customer and shall not compromise, break or circumvent any technical processes or security measures associated with the services provided by SFDC.
The Customer agrees to hold harmless, indemnify, and defend SFDC, and its officers, directors, agents, employees, licensees, successors and assigns (collectively, the “Indemnified Parties”) against any and all damages, penalties, losses, liabilities, judgments, settlements, awards, costs, and expenses (including reasonable attorneys’ fees and expenses) to the extent arising out of or in connection with any claims related to the Customers use of the Tool or any willful misconduct, fraud or grossly negligent acts or omissions by the Customer.
10 changes: 7 additions & 3 deletions src/commands/omnistudio/migration/assess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Messages } from '@salesforce/core';
import OmniStudioBaseCommand from '../../basecommand';
import { AssessmentInfo } from '../../../utils/interfaces';
import { AssessmentReporter } from '../../../utils/resultsbuilder/assessmentReporter';
import { LwcMigration } from '../../../migration/related/LwcMigration';
// TODO: Uncomment code once MVP for migration is completed
// import { LwcMigration } from '../../../migration/related/LwcMigration';
import { ApexMigration } from '../../../migration/related/ApexMigration';
import { OmniScriptExportType, OmniScriptMigrationTool } from '../../../migration/omniscript';
import { CardMigrationTool } from '../../../migration/flexcard';
Expand Down Expand Up @@ -63,7 +64,8 @@ export default class Assess extends OmniStudioBaseCommand {
Logger.initialiseLogger(this.ux, this.logger);
const projectDirectory = OmnistudioRelatedObjectMigrationFacade.intializeProject();
conn.setApiVersion(apiVersion);
const lwcparser = new LwcMigration(projectDirectory, namespace, this.org);
// TODO: Uncomment code once MVP for migration is completed
// const lwcparser = new LwcMigration(projectDirectory, namespace, this.org);
const apexMigrator = new ApexMigration(projectDirectory, namespace, this.org);
const osMigrator = new OmniScriptMigrationTool(
OmniScriptExportType.All,
Expand All @@ -88,7 +90,9 @@ export default class Assess extends OmniStudioBaseCommand {
const omniAssessmentInfo = await osMigrator.assess(dataRaptorAssessmentInfos, flexCardAssessmentInfos);

const assesmentInfo: AssessmentInfo = {
lwcAssessmentInfos: lwcparser.assessment(),
// TODO: Uncomment code once MVP for migration is completed, passing empty array
// lwcAssessmentInfos: lwcparser.assessment(),
lwcAssessmentInfos: [],
apexAssessmentInfos: apexMigrator.assess(),
dataRaptorAssessmentInfos,
flexCardAssessmentInfos,
Expand Down
33 changes: 19 additions & 14 deletions src/migration/related/OmnistudioRelatedObjectMigrationFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { LwcMigration } from './LwcMigration';
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
// const messages = Messages.loadMessages('@salesforce/plugin-omnistudio-related-object-migration-tool', 'migrate');
const LWCTYPE = 'LightningComponentBundle';
// TODO: Uncomment code once MVP for migration is completed
// const LWCTYPE = 'LightningComponentBundle';
const APEXCLASS = 'Apexclass';

const defaultProjectName = 'omnistudio_migration';
Expand Down Expand Up @@ -61,9 +62,10 @@ export default class OmnistudioRelatedObjectMigrationFacade {
projectPath = process.cwd() + '/' + defaultProjectName;
const pwd = shell.pwd();
shell.cd(projectPath);
if (relatedObjects.includes('lwc')) {
sfProject.retrieve(LWCTYPE, this.org.getUsername());
}
// TODO: Uncomment code once MVP for migration is completed
// if (relatedObjects.includes('lwc')) {
// sfProject.retrieve(LWCTYPE, this.org.getUsername());
// }
if (relatedObjects.includes('apex')) {
sfProject.retrieve(APEXCLASS, this.org.getUsername());
}
Expand All @@ -87,9 +89,10 @@ export default class OmnistudioRelatedObjectMigrationFacade {
debugTimer.start();
// Initialize migration tools based on the relatedObjects parameter
const apexMigrator = this.createApexClassMigrationTool(projectDirectory, targetApexNamespace);
const lwcMigrator = this.createLWCComponentMigrationTool(this.namespace, projectDirectory);
// TODO: Uncomment code once MVP for migration is completed
// const lwcMigrator = this.createLWCComponentMigrationTool(this.namespace, projectDirectory);
let apexAssessmentInfos: ApexAssessmentInfo[] = [];
let lwcAssessmentInfos: LWCAssessmentInfo[] = [];
const lwcAssessmentInfos: LWCAssessmentInfo[] = [];
// Proceed with migration logic
try {
if (relatedObjects.includes('apex')) {
Expand All @@ -99,14 +102,15 @@ export default class OmnistudioRelatedObjectMigrationFacade {
// Log the error
Logger.logger.error(Error.message);
}
try {
if (relatedObjects.includes('lwc')) {
lwcAssessmentInfos = lwcMigrator.migrate();
}
} catch (Error) {
// Log the error
Logger.logger.error(Error.message);
}
// TODO: Uncomment code once MVP for migration is completed
/* try {
if (relatedObjects.includes('lwc')) {
lwcAssessmentInfos = lwcMigrator.migrate();
}
} catch (Error) {
// Log the error
Logger.logger.error(Error.message);
} */

// Truncate existing objects if necessary
// Stop the debug timer
Expand All @@ -120,6 +124,7 @@ export default class OmnistudioRelatedObjectMigrationFacade {
}

// Factory methods to create instances of specific tools
// @ts-expect-error - LWC functionality temporarily disabled
private createLWCComponentMigrationTool(namespace: string, projectPath: string): LwcMigration {
// Return an instance of LWCComponentMigrationTool when implemented
return new LwcMigration(projectPath, this.namespace, this.org);
Expand Down
16 changes: 10 additions & 6 deletions src/utils/resultsbuilder/assessmentReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export class AssessmentReporter {
const integrationProcedureAssessmentFilePath = basePath + '/integration_procedure_assessment.html';
const dataMapperAssessmentFilePath = basePath + '/datamapper_assessment.html';
const apexAssessmentFilePath = basePath + '/apex_assessment.html';
const lwcAssessmentFilePath = basePath + '/lwc_assessment.html';
// TODO: Uncomment code once MVP for migration is completed
// const lwcAssessmentFilePath = basePath + '/lwc_assessment.html';
const orgDetails: ReportHeaderFormat[] = this.formattedOrgDetails(omnistudioOrgDetails);

this.createDocument(
Expand All @@ -49,7 +50,8 @@ export class AssessmentReporter {
DRAssessmentReporter.generateDRAssesment(result.dataRaptorAssessmentInfos, instanceUrl)
);
this.createDocument(apexAssessmentFilePath, this.generateApexAssesment(result.apexAssessmentInfos));
this.createDocument(lwcAssessmentFilePath, this.generateLwcAssesment(result.lwcAssessmentInfos));
// TODO: Uncomment code once MVP for migration is completed
// this.createDocument(lwcAssessmentFilePath, this.generateLwcAssesment(result.lwcAssessmentInfos));
const nameUrls = [
{
name: 'omnscript assessment report',
Expand All @@ -71,10 +73,11 @@ export class AssessmentReporter {
name: 'Apex assessment report',
location: 'apex_assessment.html',
},
{
name: 'LWC assessment report',
location: 'lwc_assessment.html',
},
// TODO: Uncomment code once MVP for migration is completed
// {
// name: 'LWC assessment report',
// location: 'lwc_assessment.html',
// },
];

await this.createMasterDocument(nameUrls, basePath);
Expand Down Expand Up @@ -185,6 +188,7 @@ export class AssessmentReporter {
const doc = this.generateDocument(htmlBody);
fs.writeFileSync(filePath, doc);
}
// @ts-expect-error - LWC functionality temporarily disabled
private static generateLwcAssesment(lwcAssessmentInfos: LWCAssessmentInfo[]): string {
let tableBody = '';
tableBody += `
Expand Down
Loading