Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions messages/assess.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"allVersionsDescription": "Migrate all versions of a component",
"changeMessage": "The %s %s will be changed from %s to %s",
"angularOSWarning": "We couldn't migrate Angular Omniscripts. Convert all Angular Omniscripts to LWC Omniscripts, and try again.",
"customLabelMigrationErrorMessage": "We couldn’t complete the Custom Labels migration. Check your org configuration and confirm it meets the requirements outlined <a href='https://help.salesforce.com/s/articleView?id=xcloud.os_migrate_oma_prereq.htm&type=5' target='_blank'>here</a>.",
"relatedObjectGA": "Select the component type that you want to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, 'flexipage' for FlexiPages, 'expsites' for Experience Sites, or 'apex, lwc, flexipage, expsites' if you want to include all types.",
"noPackageInstalled": "No valid package found in your org.",
"alreadyStandardModel": "Your org already uses the standard data model.",
Expand Down
8 changes: 4 additions & 4 deletions src/migration/dataraptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
const transformedDataRaptor = this.mapDataRaptorRecord(dr);

// Verify duplicated names before trying to submitt
if (duplicatedNames.has(transformedDataRaptor['Name'])) {
if (duplicatedNames.has(transformedDataRaptor['Name'].toLowerCase())) {
this.setRecordErrors(dr, this.messages.getMessage('duplicatedDrName', [transformedDataRaptor['Name']]));
originalDrRecords.set(recordId, dr);
continue;
Expand Down Expand Up @@ -226,7 +226,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
if (drUploadResponse && drUploadResponse.success === true) {
// Append the processed DM name into duplicateNames Map
const dataMapperName = transformedDataRaptor[DRBundleMappings.Name];
duplicatedNames.add(dataMapperName);
duplicatedNames.add(dataMapperName.toLowerCase());

const items = await this.getItemsForDataRaptor(dataRaptorItemsData, name, drUploadResponse.id);
drUploadResponse.newName = dataMapperName;
Expand Down Expand Up @@ -398,11 +398,11 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
assessmentStatus = 'Needs manual intervention';
}

if (existingDataRaptorNames.has(existingDRNameVal.cleanName())) {
if (existingDataRaptorNames.has(existingDRNameVal.cleanName().toLowerCase())) {
warnings.push(this.messages.getMessage('duplicatedName') + ' ' + existingDRNameVal.cleanName());
assessmentStatus = 'Needs manual intervention';
} else {
existingDataRaptorNames.add(existingDRNameVal.cleanName());
existingDataRaptorNames.add(existingDRNameVal.cleanName().toLowerCase());
}
const apexDependencies = [];
if (dataRaptor[this.getBundleFieldKey('CustomInputClass__c')]) {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/customLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export class CustomLabelsUtil {
const name = label.Name;
const value = label.Value;
const id = label.Id;

const externalString = externalStrings.find((es) => es.Name === name);
const externalString = externalStrings.find((es) => es.Name.toLowerCase() === name.toLowerCase());
let assessmentStatus = 'Ready for migration';
let summary = '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('DataRaptor Standard Data Model (Metadata API Disabled) - Assessment an
});

it('should detect duplicate DataRaptor names and require manual intervention', async () => {
const existingNames = new Set(['CustomerDataLoader']);
const existingNames = new Set(['customerdataloader']); // Use lowercase to match the actual implementation
const mockDataRaptor = {
Id: 'dr4',
Name: 'Customer-Data@Loader!', // This will clean to CustomerDataLoader (duplicate)
Expand All @@ -168,8 +168,9 @@ describe('DataRaptor Standard Data Model (Metadata API Disabled) - Assessment an
const result = await (dataRaptorTool as any).processDataMappers(mockDataRaptor, existingNames, new Map(), []);

// Should require manual intervention for duplicated names
// Note: When there's both a name cleaning warning AND a duplicate, 'Needs manual intervention' takes precedence
expect(result.migrationStatus).to.equal('Needs manual intervention');
expect(result.warnings).to.have.length.greaterThan(0);
expect(result.warnings).to.have.length.greaterThan(1); // Should have both name change warning and duplicate warning
expect(result.warnings.some((warning) => warning.includes('Duplicated'))).to.be.true;
});

Expand Down
Loading
Loading