Skip to content

Commit 523816f

Browse files
refactor: addressed comments
1 parent c328d72 commit 523816f

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

messages/assess.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
"manualInterventionForExperienceSite": "We couldn’t process the %s component because no key was found.",
170170
"manualInterventionForExperienceSiteAsFailure": "We couldn’t process the %s component. ",
171171
"manualInterventionForExperienceSiteAsDuplicateKey": "We couldn’t process the %s component because a duplicate key was found. ",
172+
"manualInterventionForExperienceSiteConfiguration": "We couldn’t process the %s Experience site because of some issue in the experience site configuration.",
172173
"updatingStorageForOmniscipt": "Preparing storage for Omniscripts",
173174
"keyAlreadyInStorage": "The %s %s name already exists in storage.",
174175
"flexcardStorageProcessingStarted": "Preparing storage for Flexcards.",

src/migration/omniscript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
663663
const keyObject: OmniScriptStandardKey = {
664664
type: nameMapping.oldType,
665665
subtype: nameMapping.oldSubtype,
666-
language: this.cleanLanguageName(nameMapping.oldLanguage),
666+
language: nameMapping.oldLanguage,
667667
};
668668
StorageUtil.addStandardOmniScriptToStorage(storage, keyObject, value);
669669
}
@@ -1191,7 +1191,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
11911191
const keyObject: OmniScriptStandardKey = {
11921192
type: oldrecord[this.getFieldKey('Type__c')],
11931193
subtype: oldrecord[this.getFieldKey('SubType__c')],
1194-
language: this.cleanLanguageName(oldrecord[this.getFieldKey('Language__c')]),
1194+
language: oldrecord[this.getFieldKey('Language__c')],
11951195
};
11961196
StorageUtil.addStandardOmniScriptToStorage(storage, keyObject, value);
11971197
}

src/migration/related/ExperienceSiteMigration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
257257

258258
if (this.IS_STANDARD_DATA_MODEL) {
259259
// Check for new LWC components that need reference updates
260-
if (this.isOmnistudioComponent(component.componentName)) {
260+
if (this.isOmnistudioStandardWrapper(component.componentName)) {
261261
Logger.logVerbose(`Found Omnistudio component: ${component.componentName}`);
262262
experienceSiteAssessmentInfo.hasOmnistudioContent = true;
263263

@@ -380,7 +380,7 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
380380
/**
381381
* Check if component is an Omnistudio LWC component
382382
*/
383-
private isOmnistudioComponent(componentName: string): boolean {
383+
private isOmnistudioStandardWrapper(componentName: string): boolean {
384384
return (
385385
componentName === TARGET_COMPONENT_NAME_OS ||
386386
componentName === TARGET_COMPONENT_NAME_FC ||
@@ -424,6 +424,11 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
424424
const currentLanguage = attributes['language'] as string;
425425

426426
if (!currentType || !currentSubType || !currentLanguage) {
427+
const warningMsg = this.messages.getMessage('manualInterventionForExperienceSiteConfiguration', [
428+
`${currentType}_${currentSubType}_${currentLanguage}`,
429+
]);
430+
experienceSiteAssessmentInfo.warnings.push(warningMsg);
431+
experienceSiteAssessmentInfo.status = type === this.ASSESS ? 'Needs Manual Intervention' : 'Skipped';
427432
return;
428433
}
429434

src/utils/storageUtil.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ export class StorageUtil {
4242
return this.omnistudioAssessmentStorage;
4343
}
4444

45-
/**
46-
* Serialize OmniScriptStandardKey to string for Map storage
47-
*/
48-
public static serializeOmniScriptKey(key: OmniScriptStandardKey): string {
49-
return JSON.stringify(key);
50-
}
51-
5245
/**
5346
* Add Standard OmniScript to storage
5447
*/
@@ -81,6 +74,13 @@ export class StorageUtil {
8174
this.printStorage(this.omnistudioAssessmentStorage);
8275
}
8376

77+
/**
78+
* Serialize OmniScriptStandardKey to string for Map storage
79+
*/
80+
private static serializeOmniScriptKey(key: OmniScriptStandardKey): string {
81+
return JSON.stringify(key);
82+
}
83+
8484
private static printStorage(storage: MigrationStorage): void {
8585
try {
8686
Logger.logVerbose('Printing the storage');

0 commit comments

Comments
 (0)