Skip to content

Commit f0b560b

Browse files
chore: storage fixes
1 parent d3b4a9d commit f0b560b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/migration/flexcard.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
924924
}
925925

926926
uploadResult.newName = transformedCardName;
927+
uploadResult.actualName = transformedCard['Name']; // This is required as storage needs name without version, for replacement in other references
927928
if (transformedCard['Name'] !== card['Name']) {
928929
uploadResult.warnings.unshift(this.messages.getMessage('cardNameChangeMessage', [transformedCardName]));
929930
}
@@ -989,6 +990,10 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
989990
if (flexCardAssessmentInfo.errors && flexCardAssessmentInfo.errors.length > 0) {
990991
value.error = flexCardAssessmentInfo.errors;
991992
value.migrationSuccess = false;
993+
} else if (flexCardAssessmentInfo.migrationStatus === 'Needs manual intervention') {
994+
// Duplicate name and other critical warnings
995+
value.error = flexCardAssessmentInfo.warnings;
996+
value.migrationSuccess = false;
992997
} else {
993998
value.migrationSuccess = true;
994999
}
@@ -1048,15 +1053,21 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
10481053

10491054
const originalName: string = oldrecord['Name'];
10501055
let value: FlexcardStorage = {
1051-
name: newrecord?.newName,
1056+
name: newrecord?.actualName,
10521057
isDuplicate: false,
10531058
originalName: originalName,
10541059
};
10551060

10561061
if (newrecord === undefined) {
1057-
value.error = ['Migration Failed'];
1062+
// Card was not migrated - check if original record has error details
1063+
if (oldrecord['errors'] && Array.isArray(oldrecord['errors'])) {
1064+
value.error = oldrecord['errors'];
1065+
} else {
1066+
value.error = ['Migration Failed'];
1067+
}
1068+
value.migrationSuccess = false;
10581069
} else {
1059-
if (newrecord.hasErrors) {
1070+
if (newrecord.hasErrors || newrecord?.success === false) {
10601071
value.error = newrecord.errors;
10611072
value.migrationSuccess = false;
10621073
} else {

src/migration/interfaces.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export interface ObjectMapping {
3838
export interface UploadRecordResult {
3939
referenceId: string;
4040
id?: string;
41-
newName?: string;
41+
newName?: string; // Display name (may include version suffix for reports)
42+
actualName?: string; // Actual Salesforce Name field (for references/dependencies)
4243
errors: string[];
4344
warnings: string[];
4445
hasErrors: boolean;

0 commit comments

Comments
 (0)