Skip to content

Commit 5f5a824

Browse files
Merge pull request #341 from sf-kishore-kurri/prerelease/develop-ga
feat: Merge of prerelease/alpha changes into GA branch
2 parents e0bf2fc + 5375ac0 commit 5f5a824

31 files changed

+423
-214
lines changed

messages/assess.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
1515
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
1616
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
17-
"couldNotTruncate": "Could not truncate {0}",
17+
"couldNotTruncate": "Could not truncate %s",
1818
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",
1919
"invalidNameTypeSubtypeOrLanguage": "Not a valid Name, Type, SubType or Language",
2020
"invalidOrRepeatingOmniscriptElementNames": "Invalid or Repeating Element Names for Same OmniScript",
@@ -87,23 +87,23 @@
8787
"processingLwcsForAssessment": "Processing LWCs for assessment",
8888
"successfullyProcessedLwcsForAssessment": "Successfully processed %s LWCs for assessment",
8989
"lwcAssessmentResults": "LWC assessment results: %s",
90-
"errorReadingFiles": "Error in reading files: %s",
91-
"errorProcessingFiles": "Error in processing files: %s",
90+
"errorReadingFiles": "Error in reading files",
91+
"errorProcessingFiles": "Error in processing files",
9292
"startingProcessRelatedObjects": "Starting processRelatedObjects for %s in project path: %s",
9393
"errorProcessingApexFile": "Error processing Apex file: %s",
9494
"fileUpdatedToAllowRemoteCalls": "File will be updated to allow remote calls",
9595
"fileUpdatedToAllowCalls": "File will be updated to allow calls",
9696
"fileImplementsVlocityOpenInterface": "File %s implements VlocityOpenInterface no changes will be applied",
9797
"methodCallBundleNameUpdated": "Method call bundle name will be updated in %s for class %s method %s",
98-
"cardNameChangeMessage": "Card name will be changed from {0} to {1} to follow API naming standards",
99-
"authordNameChangeMessage": "Author name will be changed from {0} to {1} to follow API naming standards",
98+
"cardNameChangeMessage": "Card name will be changed from %s to %s to follow API naming standards",
99+
"authordNameChangeMessage": "Author name will be changed from %s to %s to follow API naming standards",
100+
"omniScriptNameChangeMessage": "OmniScript reference part %s will be changed to %s during migration.",
101+
"dataRaptorNameChangeMessage": "DataRaptor reference %s will be changed to %s during migration.",
102+
"integrationProcedureNameChangeMessage": "Integration Procedure reference %s will be changed to %s during migration.",
103+
"integrationProcedureManualUpdateMessage": "Integration Procedure reference %s may need manual updates after migration.",
104+
"duplicateCardNameMessage": "Potential duplicate: Another card has the same name %s after name cleaning. This may cause conflicts during migration",
100105
"globalAutoNumberNameChangeMessage": "GlobalAutoNumber name will be changed from %s to %s to follow API naming standards",
101106
"duplicateGlobalAutoNumberNameMessage": "Potential duplicate: Another Global Auto Number has the same name %s after name cleaning. This may cause conflicts during migration",
102-
"omniScriptNameChangeMessage": "OmniScript reference part {0} will be changed to {1} during migration.",
103-
"dataRaptorNameChangeMessage": "DataRaptor reference {0} will be changed to {1} during migration.",
104-
"integrationProcedureNameChangeMessage": "Integration Procedure reference {0} will be changed to {1} during migration.",
105-
"integrationProcedureManualUpdateMessage": "Integration Procedure reference {0} may need manual updates after migration.",
106-
"duplicateCardNameMessage": "Potential duplicate: Another card has the same name {0} after name cleaning. This may cause conflicts during migration",
107107
"existingApexPrompt": "Do you have a sfdc project that already contains the APEX classes retrieved from your org? [y/n]",
108108
"enterExistingProjectPath": "Enter the path to the project folder that contains the retrieved APEX classes:",
109109
"invalidProjectFolderPath": "Provided project folder does not exist. Please provide a valid project folder path",
@@ -117,14 +117,14 @@
117117
"failedToGetValidProjectPath": "Failed to get valid project path",
118118
"errorRunningAssess": "Error running assess",
119119
"enableVerboseOutput": "Enable verbose output",
120-
"apexFileChangesIdentifiedNotApplied": "Changes identified for Apex class {0} but not applied (assessment mode)",
121-
"apexFileHasMultipleInterfaces": "File {0} has multiple interfaces including Callable, standardizing to System.Callable only",
122-
"apexFileImplementsVlocityOpenInterface2": "File {0} implements VlocityOpenInterface2, replacing with System.Callable",
120+
"apexFileChangesIdentifiedNotApplied": "Changes identified for Apex class %s but not applied (assessment mode)",
121+
"apexFileHasMultipleInterfaces": "File %s has multiple interfaces including Callable, standardizing to System.Callable only",
122+
"apexFileImplementsVlocityOpenInterface2": "File %s implements VlocityOpenInterface2, replacing with System.Callable",
123123
"errorParsingHtmlTemplate": "Error while parsing template",
124124
"errorParsingData": "Error while parsing data for template",
125-
"errorGeneratingHTML": "Error while generating HTML from template for {} with properties {}",
125+
"errorGeneratingHTML": "Error while generating HTML from template for %s with properties %s",
126126
"unexpectedError": "Unexpected Assessment error",
127-
"errorEvaluatingExpression": "Error evaluating expression: {0}, {1}",
127+
"errorEvaluatingExpression": "Error evaluating expression: %s, %s",
128128
"retrievingFlexiPages": "Retrieving FlexiPages",
129129
"successfullyRetrievedFlexiPages": "Successfully retrieved %s FlexiPages",
130130
"assessingFlexiPages": "Assessing FlexiPages",

messages/migrate.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
1818
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
1919
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
20-
"couldNotTruncate": "Could not truncate {0}",
20+
"couldNotTruncate": "Could not truncate %s",
2121
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",
2222
"invalidNameTypeSubtypeOrLanguage": "Not a valid Name, Type, SubType or Language",
2323
"invalidOrRepeatingOmniscriptElementNames": "Invalid or Repeating Element Names for Same OmniScript",
@@ -97,22 +97,25 @@
9797
"packageSelectionPrompt": "Enter the number of the package to use (1-%s):",
9898
"invalidPackageSelection": "Invalid selection. Please enter a number between 1 and %s.",
9999
"selectedPackage": "Selected package: %s (Version: %s)",
100-
"dataRaptorNameChangeMessage": "DataRaptor reference {0} will be changed to {1} during migration.",
101-
"integrationProcedureNameChangeMessage": "Integration Procedure reference {0} will be changed to {1} during migration.",
102-
"integrationProcedureManualUpdateMessage": "Integration Procedure reference {0} may need manual updates after migration.",
103-
"cardAuthorNameChangeMessage": "Card author name has been modified to fit naming rules: {0}",
104-
"cardNameChangeMessage": "Card name has been modified to fit naming rules: {0}",
105-
"duplicateCardNameMessage": "Potential duplicate: Another card has the same name {0} after name cleaning. This may cause conflicts during migration",
100+
"dataRaptorNameChangeMessage": "DataRaptor reference %s will be changed to %s during migration.",
101+
"integrationProcedureNameChangeMessage": "Integration Procedure reference %s will be changed to %s during migration.",
102+
"integrationProcedureManualUpdateMessage": "Integration Procedure reference %s may need manual updates after migration.",
103+
"cardAuthorNameChangeMessage": "Card author name has been modified to fit naming rules: %s",
104+
"cardNameChangeMessage": "Card name has been modified to fit naming rules: %s",
105+
"duplicateCardNameMessage": "Potential duplicate: Another card has the same name %s after name cleaning. This may cause conflicts during migration",
106106
"angularOmniscriptWarningMessage": " Angular OmniScript will not be migrated, please convert this to LWC based Omniscript",
107-
"apexFileChangesApplied": "Applied changes to Apex class {0}",
107+
"apexFileChangesApplied": "Applied changes to Apex class %s",
108108
"generatingComponentReports": "Generating report for components",
109109
"generatingRelatedObjectReports": "Generating report for related objects",
110110
"generatingMigrationReportDashboard": "Generating migration report dashboard",
111111
"errorParsingHtmlTemplate": "Error while parsing template",
112112
"errorParsingData": "Error while parsing data for template",
113-
"errorGeneratingHTML": "Error while generating HTML from template for {} with properties {}",
114-
"errorEvaluatingExpression": "Error evaluating expression: {0}, {1}",
113+
"errorGeneratingHTML": "Error while generating HTML from template for %s with properties %s",
114+
"errorEvaluatingExpression": "Error evaluating expression: %s, %s",
115115
"manuallySwitchDesignerToStandardDataModel": "To complete the setup, please manually run the required Apex code to configure OmniStudio Designers to use the Standard Data Model <br> https://help.salesforce.com/s/articleView?id=xcloud.os_migrate_change_the_sobject_data_model_after_migration.htm&type=5",
116+
"labelStatusSkipped": "Skipped",
117+
"labelStatusFailed": "Failed",
118+
"labelStatusComplete": "Complete",
116119
"retrievingFlexiPages": "Retrieving FlexiPages",
117120
"successfullyRetrievedFlexiPages": "Successfully retrieved %s FlexiPages",
118121
"migratingFlexiPages": "Migrating FlexiPages",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"nyc": "^15.1.0",
5858
"prettier": "^2.8.8",
5959
"pretty-quick": "^3.3.1",
60+
"puppeteer": "^24.12.1",
6061
"sinon": "10.0.0",
6162
"ts-node": "^10.9.2",
6263
"typescript": "^4.9.5"

src/commands/omnistudio/migration/assess.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ export default class Assess extends OmniStudioBaseCommand {
5757
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
5858
return await this.runAssess();
5959
} catch (error) {
60-
Logger.error(messages.getMessage('errorRunningAssess'));
61-
Logger.error(error);
60+
Logger.error(messages.getMessage('errorRunningAssess'), error);
6261
process.exit(1);
6362
}
6463
}

src/commands/omnistudio/migration/info.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export default class Org extends SfdxCommand {
5454
try {
5555
return await this.runInfo();
5656
} catch (error) {
57-
Logger.error('Error running info');
58-
Logger.error(error);
57+
Logger.error(messages.getMessage('errorRunningInfo'), error);
5958
process.exit(1);
6059
}
6160
}

src/commands/omnistudio/migration/migrate.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ export default class Migrate extends OmniStudioBaseCommand {
7373
return await this.runMigration();
7474
} catch (e) {
7575
const error = e as Error;
76-
Logger.error(`Error running migrate ${error.message}`);
77-
Logger.error(error);
76+
Logger.error(messages.getMessage('errorRunningMigrate'), error);
7877
process.exit(1);
7978
}
8079
}
@@ -172,9 +171,6 @@ export default class Migrate extends OmniStudioBaseCommand {
172171
objectMigrationResults = await this.migrateObjects(migrationObjects, debugTimer);
173172
}
174173

175-
// Stop the debug timer
176-
const timer = DebugTimer.getInstance().stop();
177-
178174
const omnistudioRelatedObjectsMigration = new OmnistudioRelatedObjectMigrationFacade(
179175
namespace,
180176
migrateOnly,
@@ -216,9 +212,6 @@ export default class Migrate extends OmniStudioBaseCommand {
216212
actionItems
217213
);
218214

219-
// save timer to debug logger
220-
Logger.logVerbose(timer.toString());
221-
222215
// Return results needed for --json flag
223216
return { objectMigrationResults };
224217
}
@@ -316,8 +309,7 @@ export default class Migrate extends OmniStudioBaseCommand {
316309
})
317310
);
318311
} catch (ex: any) {
319-
Logger.error(JSON.stringify(ex));
320-
Logger.error(ex.stack);
312+
Logger.error('Error migrating object', ex);
321313
objectMigrationResults.push({
322314
name: cls.getName(),
323315
data: [],
@@ -444,7 +436,7 @@ export default class Migrate extends OmniStudioBaseCommand {
444436
const obj = {
445437
id: record['Id'],
446438
name: migrationTool.getRecordName(record),
447-
status: 'Skipped',
439+
status: messages.getMessage('labelStatusSkipped'),
448440
errors: record['errors'],
449441
migratedId: undefined,
450442
warnings: [],
@@ -457,7 +449,10 @@ export default class Migrate extends OmniStudioBaseCommand {
457449
let errors: any[] = obj.errors || [];
458450
errors = errors.concat(recordResults.errors || []);
459451

460-
obj.status = !recordResults || recordResults.hasErrors ? 'Error' : 'Complete';
452+
obj.status =
453+
!recordResults || recordResults.hasErrors
454+
? messages.getMessage('labelStatusFailed')
455+
: messages.getMessage('labelStatusComplete');
461456
obj.errors = errors;
462457
obj.migratedId = recordResults.id;
463458
obj.warnings = recordResults.warnings;

src/javascripts/reportGeneratorUtility.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ function filterAndSearchTable(tableId) {
5555
const visibleRows = Array.from(table.rows).filter(
5656
(row) => row.style.display !== 'none' && row.id !== 'no-rows-message'
5757
);
58-
reportTable.querySelector('#row-count').textContent = `Showing ${visibleRows.length} record${
59-
visibleRows.length !== 1 ? 's' : ''
60-
}`;
58+
reportTable.querySelector('#row-count').textContent = `Total Records: ${visibleRows.length}`;
6159
return;
6260
}
6361

src/migration/dataraptor.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
8181
);
8282
drItem[this.namespacePrefix + 'Formula__c'] = originalString;
8383
} catch (ex) {
84-
Logger.error(JSON.stringify(ex));
85-
Logger.error(ex.stack);
84+
Logger.error('Error updating formula for data mapper', ex);
8685
Logger.logVerbose(
8786
this.messages.getMessage('formulaSyntaxError', [drItem[this.namespacePrefix + 'Formula__c']])
8887
);
@@ -216,8 +215,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
216215
const dataRaptorAssessmentInfos = this.processDRComponents(dataRaptors);
217216
return dataRaptorAssessmentInfos;
218217
} catch (err) {
219-
Logger.error(JSON.stringify(err));
220-
Logger.error(err.stack);
218+
Logger.error('Error assessing data mapper', err);
221219
}
222220
}
223221

@@ -259,8 +257,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
259257
apexDependencies: [],
260258
});
261259
const error = e as Error;
262-
Logger.error(JSON.stringify(error));
263-
Logger.error(error.stack);
260+
Logger.error('Error processing data mapper', error);
264261
}
265262
progressBar.update(++progressCounter);
266263
}
@@ -318,8 +315,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
318315
});
319316
}
320317
} catch (ex) {
321-
Logger.error(JSON.stringify(ex));
322-
Logger.error(ex.stack);
318+
Logger.error('Error processing formula for data mapper', ex);
323319
Logger.logVerbose(this.messages.getMessage('formulaSyntaxError', [formula]));
324320
}
325321
}

src/migration/flexcard.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
113113
const flexCardsAssessmentInfos = this.processCardComponents(flexCards);
114114
return flexCardsAssessmentInfos;
115115
} catch (err) {
116-
Logger.error(this.messages.getMessage('errorDuringFlexCardAssessment'));
117-
Logger.error(JSON.stringify(err));
118-
Logger.error(err.stack);
116+
Logger.error(this.messages.getMessage('errorDuringFlexCardAssessment'), err);
119117
}
120118
}
121119

@@ -145,8 +143,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
145143
warnings: [this.messages.getMessage('unexpectedError')],
146144
});
147145
const error = e as Error;
148-
Logger.error(JSON.stringify(error));
149-
Logger.error(error.stack);
146+
Logger.error('Error processing flex card', error);
150147
}
151148
progressBar.update(++progressCounter);
152149
}
@@ -610,9 +607,6 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
610607
let oldrecord = originalRecords.get(key);
611608
let newrecord = cardsUploadInfo.get(key);
612609

613-
Logger.logVerbose('Oldrecord - ' + JSON.stringify(oldrecord));
614-
Logger.logVerbose('Newrecord - ' + JSON.stringify(newrecord));
615-
616610
let value: FlexcardStorage = {
617611
name: newrecord['newName'],
618612
isDuplicate: false,

src/migration/omniscript.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
202202
);
203203
return omniAssessmentInfos;
204204
} catch (err) {
205-
Logger.error(this.messages.getMessage('errorDuringOmniScriptAssessment'));
206-
Logger.error(JSON.stringify(err));
207-
Logger.error(err.stack);
205+
Logger.error(this.messages.getMessage('errorDuringOmniScriptAssessment'), err);
208206
}
209207
}
210208

@@ -275,8 +273,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
275273
});
276274
}
277275
const error = e as Error;
278-
Logger.error(JSON.stringify(error));
279-
Logger.error(error.stack);
276+
Logger.error('Error processing omniscripts', error);
280277
continue;
281278
}
282279
if (omniAssessmentInfo.type === 'OmniScript') {
@@ -573,8 +570,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
573570
);
574571
ipElement[`${this.namespacePrefix}PropertySet__c`] = originalString;
575572
} catch (ex) {
576-
Logger.error(JSON.stringify(ex));
577-
Logger.error(ex.stack);
573+
Logger.error('Error processing formula for integration procedure', ex);
578574
Logger.logVerbose(
579575
this.messages.getMessage('formulaSyntaxError', [ipElement[`${this.namespacePrefix}PropertySet__c`]])
580576
);

0 commit comments

Comments
 (0)