Skip to content

Commit 50c5805

Browse files
Remove custom lwc from Migrate, Assess and Reports (#282)
1 parent 3b60d48 commit 50c5805

File tree

5 files changed

+39
-27
lines changed

5 files changed

+39
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,4 @@
426426

427427

428428

429-
## 1.2.2 (2022-06-13)
430-
431-
432-
429+
## 1.2.2 (2022-06-13)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ OPTIONS
6464
6565
```
6666

67+
> **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.
68+
6769
Terms:
6870
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.
6971
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.

src/commands/omnistudio/migration/assess.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { Messages } from '@salesforce/core';
44
import OmniStudioBaseCommand from '../../basecommand';
55
import { AssessmentInfo } from '../../../utils/interfaces';
66
import { AssessmentReporter } from '../../../utils/resultsbuilder/assessmentReporter';
7-
import { LwcMigration } from '../../../migration/related/LwcMigration';
7+
// TODO: Uncomment code once MVP for migration is completed
8+
// import { LwcMigration } from '../../../migration/related/LwcMigration';
89
import { ApexMigration } from '../../../migration/related/ApexMigration';
910
import { OmniScriptExportType, OmniScriptMigrationTool } from '../../../migration/omniscript';
1011
import { CardMigrationTool } from '../../../migration/flexcard';
@@ -63,7 +64,8 @@ export default class Assess extends OmniStudioBaseCommand {
6364
Logger.initialiseLogger(this.ux, this.logger);
6465
const projectDirectory = OmnistudioRelatedObjectMigrationFacade.intializeProject();
6566
conn.setApiVersion(apiVersion);
66-
const lwcparser = new LwcMigration(projectDirectory, namespace, this.org);
67+
// TODO: Uncomment code once MVP for migration is completed
68+
// const lwcparser = new LwcMigration(projectDirectory, namespace, this.org);
6769
const apexMigrator = new ApexMigration(projectDirectory, namespace, this.org);
6870
const osMigrator = new OmniScriptMigrationTool(
6971
OmniScriptExportType.All,
@@ -88,7 +90,9 @@ export default class Assess extends OmniStudioBaseCommand {
8890
const omniAssessmentInfo = await osMigrator.assess(dataRaptorAssessmentInfos, flexCardAssessmentInfos);
8991

9092
const assesmentInfo: AssessmentInfo = {
91-
lwcAssessmentInfos: lwcparser.assessment(),
93+
// TODO: Uncomment code once MVP for migration is completed, passing empty array
94+
// lwcAssessmentInfos: lwcparser.assessment(),
95+
lwcAssessmentInfos: [],
9296
apexAssessmentInfos: apexMigrator.assess(),
9397
dataRaptorAssessmentInfos,
9498
flexCardAssessmentInfos,

src/migration/related/OmnistudioRelatedObjectMigrationFacade.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import { LwcMigration } from './LwcMigration';
2323
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
2424
// or any library that is using the messages framework can also be loaded this way.
2525
// const messages = Messages.loadMessages('@salesforce/plugin-omnistudio-related-object-migration-tool', 'migrate');
26-
const LWCTYPE = 'LightningComponentBundle';
26+
// TODO: Uncomment code once MVP for migration is completed
27+
// const LWCTYPE = 'LightningComponentBundle';
2728
const APEXCLASS = 'Apexclass';
2829

2930
const defaultProjectName = 'omnistudio_migration';
@@ -61,9 +62,10 @@ export default class OmnistudioRelatedObjectMigrationFacade {
6162
projectPath = process.cwd() + '/' + defaultProjectName;
6263
const pwd = shell.pwd();
6364
shell.cd(projectPath);
64-
if (relatedObjects.includes('lwc')) {
65-
sfProject.retrieve(LWCTYPE, this.org.getUsername());
66-
}
65+
// TODO: Uncomment code once MVP for migration is completed
66+
// if (relatedObjects.includes('lwc')) {
67+
// sfProject.retrieve(LWCTYPE, this.org.getUsername());
68+
// }
6769
if (relatedObjects.includes('apex')) {
6870
sfProject.retrieve(APEXCLASS, this.org.getUsername());
6971
}
@@ -87,9 +89,10 @@ export default class OmnistudioRelatedObjectMigrationFacade {
8789
debugTimer.start();
8890
// Initialize migration tools based on the relatedObjects parameter
8991
const apexMigrator = this.createApexClassMigrationTool(projectDirectory, targetApexNamespace);
90-
const lwcMigrator = this.createLWCComponentMigrationTool(this.namespace, projectDirectory);
92+
// TODO: Uncomment code once MVP for migration is completed
93+
// const lwcMigrator = this.createLWCComponentMigrationTool(this.namespace, projectDirectory);
9194
let apexAssessmentInfos: ApexAssessmentInfo[] = [];
92-
let lwcAssessmentInfos: LWCAssessmentInfo[] = [];
95+
const lwcAssessmentInfos: LWCAssessmentInfo[] = [];
9396
// Proceed with migration logic
9497
try {
9598
if (relatedObjects.includes('apex')) {
@@ -99,14 +102,15 @@ export default class OmnistudioRelatedObjectMigrationFacade {
99102
// Log the error
100103
Logger.logger.error(Error.message);
101104
}
102-
try {
103-
if (relatedObjects.includes('lwc')) {
104-
lwcAssessmentInfos = lwcMigrator.migrate();
105-
}
106-
} catch (Error) {
107-
// Log the error
108-
Logger.logger.error(Error.message);
109-
}
105+
// TODO: Uncomment code once MVP for migration is completed
106+
/* try {
107+
if (relatedObjects.includes('lwc')) {
108+
lwcAssessmentInfos = lwcMigrator.migrate();
109+
}
110+
} catch (Error) {
111+
// Log the error
112+
Logger.logger.error(Error.message);
113+
} */
110114

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

122126
// Factory methods to create instances of specific tools
127+
// @ts-expect-error - LWC functionality temporarily disabled
123128
private createLWCComponentMigrationTool(namespace: string, projectPath: string): LwcMigration {
124129
// Return an instance of LWCComponentMigrationTool when implemented
125130
return new LwcMigration(projectPath, this.namespace, this.org);

src/utils/resultsbuilder/assessmentReporter.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export class AssessmentReporter {
2929
const integrationProcedureAssessmentFilePath = basePath + '/integration_procedure_assessment.html';
3030
const dataMapperAssessmentFilePath = basePath + '/datamapper_assessment.html';
3131
const apexAssessmentFilePath = basePath + '/apex_assessment.html';
32-
const lwcAssessmentFilePath = basePath + '/lwc_assessment.html';
32+
// TODO: Uncomment code once MVP for migration is completed
33+
// const lwcAssessmentFilePath = basePath + '/lwc_assessment.html';
3334
const orgDetails: ReportHeaderFormat[] = this.formattedOrgDetails(omnistudioOrgDetails);
3435

3536
this.createDocument(
@@ -49,7 +50,8 @@ export class AssessmentReporter {
4950
DRAssessmentReporter.generateDRAssesment(result.dataRaptorAssessmentInfos, instanceUrl, orgDetails)
5051
);
5152
this.createDocument(apexAssessmentFilePath, this.generateApexAssesment(result.apexAssessmentInfos));
52-
this.createDocument(lwcAssessmentFilePath, this.generateLwcAssesment(result.lwcAssessmentInfos));
53+
// TODO: Uncomment code once MVP for migration is completed
54+
// this.createDocument(lwcAssessmentFilePath, this.generateLwcAssesment(result.lwcAssessmentInfos));
5355
const nameUrls = [
5456
{
5557
name: 'omnscript assessment report',
@@ -71,10 +73,11 @@ export class AssessmentReporter {
7173
name: 'Apex assessment report',
7274
location: 'apex_assessment.html',
7375
},
74-
{
75-
name: 'LWC assessment report',
76-
location: 'lwc_assessment.html',
77-
},
76+
// TODO: Uncomment code once MVP for migration is completed
77+
// {
78+
// name: 'LWC assessment report',
79+
// location: 'lwc_assessment.html',
80+
// },
7881
];
7982

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

0 commit comments

Comments
 (0)