Skip to content

Commit a06f522

Browse files
committed
fix: added comments
1 parent 6f5cc50 commit a06f522

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

messages/assess.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"invalidNamespace": "The namespace you have passed is not valid namespace, the valid namespace of your org is ",
3434
"noPackageInstalled": "No package installed on given org.",
3535
"alreadyStandardModel": "The org is already on standard data model.",
36-
"invalidRelatedObjectsOptionGA": "Invalid option provided for -r: %s. Valid options are apex, lwc, expsites, flexipage.",
37-
"invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid option is apex.",
36+
"invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid options are apex, lwc, expsites, flexipage.",
3837
"formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
3938
"errorDuringFlexCardAssessment": "Error during FlexCard assessment",
4039
"errorDuringOmniScriptAssessment": "Error during OmniScript assessment",

messages/migrate.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"invalidNamespace": "The namespace you have passed is not valid namespace, the valid namespace of your org is ",
3535
"noPackageInstalled": "No package installed on given org.",
3636
"alreadyStandardModel": "The org is already on standard data model.",
37-
"invalidRelatedObjectsOptionGA": "Invalid option provided for -r: %s. Valid options are apex, lwc, expsites, flexipage.",
38-
"invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid option is apex.",
37+
"invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid options are apex, lwc, expsites, flexipage.",
3938
"userConsentMessage": "By proceeding further, you hereby consent to the use, accept changes to your custom code and the accompanying terms and conditions associated with the use of the OmniStudio Migration Tool. Do you want to proceed? [y/n]",
4039
"userDeclinedConsent": "User declined consent, will not process %s .",
4140
"userConsentedToProceed": "User consented to proceed",

src/commands/omnistudio/migration/assess.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class Assess extends OmniStudioBaseCommand {
7676
const apiVersion = conn.getApiVersion();
7777
const orgs: OmnistudioOrgDetails = await OrgUtils.getOrgDetails(conn);
7878

79-
if (!orgs.hasValidNamespace && this.flags.namespace) {
79+
if (!orgs.hasValidNamespace) {
8080
Logger.warn(messages.getMessage('invalidNamespace') + orgs.packageDetails.namespace);
8181
}
8282

@@ -146,7 +146,7 @@ export default class Assess extends OmniStudioBaseCommand {
146146
// Validate input
147147
for (const obj of objectsToProcess) {
148148
if (!validOptions.includes(obj)) {
149-
Logger.error(messages.getMessage('invalidRelatedObjectsOptionGA', [String(obj)]));
149+
Logger.error(messages.getMessage('invalidRelatedObjectsOption', [String(obj)]));
150150
process.exit(1);
151151
}
152152
}

src/commands/omnistudio/migration/migrate.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export default class Migrate extends OmniStudioBaseCommand {
7979
}
8080

8181
// eslint-disable-next-line @typescript-eslint/no-explicit-any
82-
// eslint-disable-next-line complexity
8382
public async runMigration(): Promise<any> {
8483
const migrateOnly = (this.flags.only || '') as string;
8584
const allVersions = this.flags.allversions || (false as boolean);
@@ -266,7 +265,7 @@ export default class Migrate extends OmniStudioBaseCommand {
266265
// Validate input
267266
for (const obj of objectsToProcess) {
268267
if (!validOptions.includes(obj)) {
269-
Logger.error(messages.getMessage('invalidRelatedObjectsOptionGA', [obj]));
268+
Logger.error(messages.getMessage('invalidRelatedObjectsOption', [obj]));
270269
process.exit(1);
271270
}
272271
}

src/migration/omniscript.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
206206
flexCardAssessmentInfos: FlexCardAssessmentInfo[]
207207
): Promise<OmniAssessmentInfo> {
208208
try {
209-
const exportComponentType =
210-
this.exportType === OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
209+
const exportComponentType = this.getName() as ComponentType;
211210
Logger.log(this.messages.getMessage('startingOmniScriptAssessment', [exportComponentType]));
212211
const omniscripts = await this.getAllOmniScripts();
213212
Logger.log(this.messages.getMessage('foundOmniScriptsToAssess', [omniscripts.length, exportComponentType]));
@@ -242,8 +241,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
242241
const existingDataRaptorNames = new Set(dataRaptorAssessmentInfos.map((info) => info.name));
243242
const existingFlexCardNames = new Set(flexCardAssessmentInfos.map((info) => info.name));
244243

245-
const progressBarType: ComponentType =
246-
this.exportType === OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
244+
const progressBarType: ComponentType = this.getName() as ComponentType;
247245
const progressBar = createProgressBar('Assessing', progressBarType);
248246
let progressCounter = 0;
249247
progressBar.start(omniscripts.length, progressCounter);
@@ -304,9 +302,6 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
304302
}
305303
if (omniAssessmentInfo.type === 'OmniScript') {
306304
const type = omniscript[this.namespacePrefix + 'IsLwcEnabled__c'] ? 'LWC' : 'Angular';
307-
if (type === 'Angular') {
308-
omniAssessmentInfo.warnings.unshift(this.messages.getMessage('angularOSWarning'));
309-
}
310305
const osAssessmentInfo: OSAssessmentInfo = {
311306
name: omniAssessmentInfo.name,
312307
type: type,
@@ -664,7 +659,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
664659
// Variables to be returned After Migration
665660
let originalOsRecords = new Map<string, any>();
666661
let osUploadInfo = new Map<string, UploadRecordResult>();
667-
const exportComponentType = this.exportType === OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
662+
const exportComponentType = this.getName() as ComponentType;
668663
Logger.log(this.messages.getMessage('foundOmniScriptsToMigrate', [omniscripts.length, exportComponentType]));
669664
const progressBarType: ComponentType = exportComponentType;
670665
const progressBar = createProgressBar('Migrating', progressBarType);

0 commit comments

Comments
 (0)