Skip to content

Commit f3d98f1

Browse files
Merge pull request #444 from sf-aastha-paruthi/u/aparuthi/blitzfixes
@W-20155340 - [Dev Blitz] OMA Use Case#2 issues
2 parents 0f15781 + 9a1e12a commit f3d98f1

File tree

4 files changed

+445
-9
lines changed

4 files changed

+445
-9
lines changed

src/migration/flexcard.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
935935
}
936936

937937
uploadResult.newName = transformedCardName;
938+
uploadResult.actualName = transformedCard['Name']; // This is required as storage needs name without version, for replacement in other references
938939
if (transformedCard['Name'] !== card['Name']) {
939940
uploadResult.warnings.unshift(this.messages.getMessage('cardNameChangeMessage', [transformedCardName]));
940941
}
@@ -1000,6 +1001,10 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
10001001
if (flexCardAssessmentInfo.errors && flexCardAssessmentInfo.errors.length > 0) {
10011002
value.error = flexCardAssessmentInfo.errors;
10021003
value.migrationSuccess = false;
1004+
} else if (flexCardAssessmentInfo.migrationStatus === 'Needs manual intervention') {
1005+
// Duplicate name and other critical warnings
1006+
value.error = flexCardAssessmentInfo.warnings;
1007+
value.migrationSuccess = false;
10031008
} else {
10041009
value.migrationSuccess = true;
10051010
}
@@ -1059,13 +1064,19 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
10591064

10601065
const originalName: string = oldrecord['Name'];
10611066
let value: FlexcardStorage = {
1062-
name: newrecord?.newName,
1067+
name: newrecord?.actualName,
10631068
isDuplicate: false,
10641069
originalName: originalName,
10651070
};
10661071

10671072
if (newrecord === undefined) {
1068-
value.error = ['Migration Failed'];
1073+
// Card was not migrated - check if original record has error details
1074+
if (oldrecord['errors'] && Array.isArray(oldrecord['errors'])) {
1075+
value.error = oldrecord['errors'];
1076+
} else {
1077+
value.error = ['Migration Failed'];
1078+
}
1079+
value.migrationSuccess = false;
10691080
} else {
10701081
if (newrecord.hasErrors) {
10711082
value.error = newrecord.errors;

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;

src/migration/premigrate.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,21 @@ export class PreMigrate extends BaseMigrationTool {
131131
deploymentConfig.authKey = process.env[authEnvKey];
132132
if (!deploymentConfig.authKey) {
133133
Logger.warn(this.messages.getMessage('authKeyEnvVarNotSet'));
134-
actionItems.push(this.messages.getMessage('authKeyEnvVarNotSet'));
134+
actionItems.push(
135+
`${this.messages.getMessage('authKeyEnvVarNotSet')}\n${this.messages.getMessage('manualDeploymentSteps', [
136+
documentRegistry.manualDeploymentSteps,
137+
])}`
138+
);
135139
}
136140
}
137141

138142
if (!consent) {
139143
Logger.warn(this.messages.getMessage('deploymentConsentNotGiven'));
140-
actionItems.push(this.messages.getMessage('deploymentConsentNotGiven'));
141-
}
142-
143-
if (!consent || (includeLwc && !deploymentConfig.authKey)) {
144-
actionItems.push(this.messages.getMessage('manualDeploymentSteps', [documentRegistry.manualDeploymentSteps]));
144+
actionItems.push(
145+
`${this.messages.getMessage('deploymentConsentNotGiven')}\n${this.messages.getMessage('manualDeploymentSteps', [
146+
documentRegistry.manualDeploymentSteps,
147+
])}`
148+
);
145149
}
146150

147151
return deploymentConfig;

0 commit comments

Comments
 (0)