Skip to content

Commit 3ebd534

Browse files
authored
Merge pull request #372 from sf-kishore-kurri/u/kkurri/W-18480496
feat: @W-18480496 : Assessment report issues
2 parents 568ba7a + 57cbcb8 commit 3ebd534

File tree

9 files changed

+365
-55
lines changed

9 files changed

+365
-55
lines changed

messages/migrate.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@
205205
"startingComponentPreProcessing": "Pre-processing components for name mapping",
206206
"completeComponentMappingMessage": "Registered name mappings for %s components",
207207
"componentMappingNotFound": "No registry mapping found for %s component: %s, using fallback cleaning",
208-
"flexCardWithAngularOmniScriptWarning": "FlexCard has dependencies on Angular OmniScript(s) which are not migrated. Please convert OmniScript(s) to LWC before migrating this FlexCard.",
209-
"angularOmniScriptDependencyWarning": "Element '%s' references Angular OmniScript '%s' which will not be migrated. Consider converting the referenced OmniScript to LWC",
210-
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping FlexCard %s due to Angular OmniScript dependencies",
208+
"flexCardWithAngularOmniScriptWarning": "FlexCard has dependencies on Angular Omniscript(s) which are not migrated. Please convert OmniScript(s) to LWC before migrating this FlexCard.",
209+
"angularOmniScriptDependencyWarning": "Element '%s' references Angular Omniscript '%s' which will not be migrated. Consider converting the referenced OmniScript to LWC",
210+
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping FlexCard %s due to Angular Omniscript dependencies",
211211
"flexCardMigrationProcessingMessage": "Processing %s FlexCards for migration (%s skipped due to Angular dependencies)",
212212
"noMetadataToDeploy": "No metadata to deploy",
213213
"manifestDeployementStarted": "Manifest deployment started with id: %s",
@@ -231,4 +231,4 @@
231231
"enableStandardRuntimeAfterDesigner": "Standard designer setup successful, proceeding with Standard Runtime enablement",
232232
"skipStandardRuntimeDueToFailure": "Skipping Standard Runtime enablement due to designer setup failure",
233233
"errorCheckingStandardDesigner": "Failed to check standard designer status for package %s: %s"
234-
}
234+
}

src/migration/dataraptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
302302
}
303303
if (existingDataRaptorNames.has(existingDRNameVal.cleanName())) {
304304
warnings.push(this.messages.getMessage('duplicatedName') + ' ' + existingDRNameVal.cleanName());
305-
assessmentStatus = 'Need Manual Intervention';
305+
assessmentStatus = 'Needs Manual Intervention';
306306
} else {
307307
existingDataRaptorNames.add(existingDRNameVal.cleanName());
308308
}

src/migration/flexcard.ts

Lines changed: 224 additions & 37 deletions
Large diffs are not rendered by default.

src/migration/omniscript.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
478478
for (const osDep of dependencyOS) {
479479
if (this.nameRegistry.isAngularOmniScript(osDep.name)) {
480480
warnings.push(this.messages.getMessage('angularOmniScriptDependencyWarning', [osDep.location, osDep.name]));
481-
assessmentStatus = 'Need Manual Intervention';
481+
assessmentStatus = 'Needs Manual Intervention';
482482
}
483483
}
484484

@@ -534,7 +534,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
534534
}
535535
if (existingOmniscriptNames.has(recordName)) {
536536
warnings.push(this.messages.getMessage('duplicatedName') + ' ' + recordName);
537-
assessmentStatus = 'Warnings';
537+
assessmentStatus = 'Needs Manual Intervention';
538538
} else {
539539
existingOmniscriptNames.add(recordName);
540540
}
@@ -557,7 +557,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
557557
const type = omniscript[this.namespacePrefix + 'IsLwcEnabled__c'] ? 'LWC' : 'Angular';
558558
if (type === 'Angular') {
559559
warnings.unshift(this.messages.getMessage('angularOSWarning'));
560-
assessmentStatus = 'Need Manual Intervention';
560+
assessmentStatus = 'Needs Manual Intervention';
561561
}
562562
}
563563

src/utils/resultsbuilder/FlexcardAssessmentReporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class FlexcardAssessmentReporter {
8383
rowspan: 2,
8484
},
8585
{
86-
name: 'OmniScript Dependencies',
86+
name: 'Omniscript Dependencies',
8787
colspan: 1,
8888
rowspan: 2,
8989
},

src/utils/resultsbuilder/LWCAssessmentReporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ export class LWCAssessmentReporter {
9494
createRowDataParam(
9595
'comments',
9696
lwcAssessmentInfo.errors && lwcAssessmentInfo.errors.length > 0
97-
? 'Need Manual Intervention'
97+
? 'Needs Manual Intervention'
9898
: 'Can be Automated',
9999
false,
100100
changeInfosCount,
101101
1,
102102
false,
103103
undefined,
104104
lwcAssessmentInfo.errors && lwcAssessmentInfo.errors.length > 0
105-
? 'Need Manual Intervention'
105+
? 'Needs Manual Intervention'
106106
: 'Can be Automated',
107107
lwcAssessmentInfo.errors && lwcAssessmentInfo.errors.length > 0 ? 'text-error' : 'text-success'
108108
),

src/utils/resultsbuilder/OSAssessmentReporter.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export class OSAssessmentReporter {
4646
cssClass: 'text-success',
4747
},
4848
{
49-
name: 'Need Manual Intervention',
49+
name: 'Needs Manual Intervention',
5050
count: osAssessmentInfos.filter(
51-
(osAssessmentInfo) => osAssessmentInfo.migrationStatus === 'Need Manual Intervention'
51+
(osAssessmentInfo) => osAssessmentInfo.migrationStatus === 'Needs Manual Intervention'
5252
).length,
5353
cssClass: 'text-warning',
5454
},
@@ -57,7 +57,7 @@ export class OSAssessmentReporter {
5757
count: osAssessmentInfos.filter(
5858
(osAssessmentInfo) =>
5959
osAssessmentInfo.migrationStatus !== 'Ready for migration' &&
60-
osAssessmentInfo.migrationStatus !== 'Need Manual Intervention'
60+
osAssessmentInfo.migrationStatus !== 'Needs Manual Intervention'
6161
).length,
6262
cssClass: 'text-error',
6363
},
@@ -189,7 +189,7 @@ export class OSAssessmentReporter {
189189
rowspan: 2,
190190
},
191191
{
192-
name: 'OmniScript Dependencies',
192+
name: 'Omniscript Dependencies',
193193
colspan: 1,
194194
rowspan: 2,
195195
},
@@ -204,12 +204,12 @@ export class OSAssessmentReporter {
204204
rowspan: 2,
205205
},
206206
{
207-
name: 'Remote action Dependencies',
207+
name: 'Remote Action Dependencies',
208208
colspan: 1,
209209
rowspan: 2,
210210
},
211211
{
212-
name: 'Custom LWCs Dependencies',
212+
name: 'Custom LWC Dependencies',
213213
colspan: 1,
214214
rowspan: 2,
215215
},

test/migration/flexcard-dependencies.test.ts

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,4 +543,127 @@ describe('FlexCard Dependency Updates with NameMappingRegistry', () => {
543543
expect(definition.states[0].omniscripts[0].subtype).to.equal('UnknownSubType');
544544
});
545545
});
546+
547+
describe('Omni-Flyout Element Updates', () => {
548+
it('should update omni-flyout flyoutOmniScript.osName using registry', () => {
549+
const testCard: any = {
550+
Id: 'card1',
551+
Name: 'Test Card',
552+
vlocity_ins__Definition__c: JSON.stringify({
553+
states: [
554+
{
555+
components: {
556+
comp1: {
557+
element: 'omni-flyout',
558+
property: {
559+
flyoutOmniScript: {
560+
osName: 'Customer-Profile/Account-View/English',
561+
},
562+
},
563+
},
564+
},
565+
},
566+
],
567+
}),
568+
};
569+
570+
const result = (cardTool as any).mapVlocityCardRecord(testCard, new Map(), new Map());
571+
const definition = JSON.parse(result['PropertySetConfig']);
572+
573+
expect(definition.states[0].components.comp1.property.flyoutOmniScript.osName).to.equal(
574+
'CustomerProfile/AccountView/English'
575+
);
576+
});
577+
578+
it('should update omni-flyout flyoutOmniScript.osName using fallback when registry has no mapping', () => {
579+
const testCard: any = {
580+
Id: 'card1',
581+
Name: 'Test Card',
582+
vlocity_ins__Definition__c: JSON.stringify({
583+
states: [
584+
{
585+
components: {
586+
comp1: {
587+
element: 'omni-flyout',
588+
property: {
589+
flyoutOmniScript: {
590+
osName: 'Unknown-OmniScript/Type-Test/English',
591+
},
592+
},
593+
},
594+
},
595+
},
596+
],
597+
}),
598+
};
599+
600+
const result = (cardTool as any).mapVlocityCardRecord(testCard, new Map(), new Map());
601+
const definition = JSON.parse(result['PropertySetConfig']);
602+
603+
expect(definition.states[0].components.comp1.property.flyoutOmniScript.osName).to.equal(
604+
'UnknownOmniScript/TypeTest/English'
605+
);
606+
});
607+
608+
it('should update nested omni-flyout elements in children', () => {
609+
const testCard: any = {
610+
Id: 'card1',
611+
Name: 'Test Card',
612+
vlocity_ins__Definition__c: JSON.stringify({
613+
states: [
614+
{
615+
components: {
616+
parent: {
617+
children: [
618+
{
619+
element: 'omni-flyout',
620+
property: {
621+
flyoutOmniScript: {
622+
osName: 'Customer-Profile/Account-View/English',
623+
},
624+
},
625+
},
626+
],
627+
},
628+
},
629+
},
630+
],
631+
}),
632+
};
633+
634+
const result = (cardTool as any).mapVlocityCardRecord(testCard, new Map(), new Map());
635+
const definition = JSON.parse(result['PropertySetConfig']);
636+
637+
expect(definition.states[0].components.parent.children[0].property.flyoutOmniScript.osName).to.equal(
638+
'CustomerProfile/AccountView/English'
639+
);
640+
});
641+
642+
it('should handle omni-flyout elements without flyoutOmniScript property gracefully', () => {
643+
const testCard: any = {
644+
Id: 'card1',
645+
Name: 'Test Card',
646+
vlocity_ins__Definition__c: JSON.stringify({
647+
states: [
648+
{
649+
components: {
650+
comp1: {
651+
element: 'omni-flyout',
652+
property: {
653+
someOtherProperty: 'value',
654+
},
655+
},
656+
},
657+
},
658+
],
659+
}),
660+
};
661+
662+
const result = (cardTool as any).mapVlocityCardRecord(testCard, new Map(), new Map());
663+
const definition = JSON.parse(result['PropertySetConfig']);
664+
665+
expect(definition.states[0].components.comp1.property.someOtherProperty).to.equal('value');
666+
expect(definition.states[0].components.comp1.property.flyoutOmniScript).to.be.undefined;
667+
});
668+
});
546669
});

test/migration/omniscript-angular-dependencies.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('OmniScript Angular Dependency Validation', () => {
119119
expect(result.warnings).to.have.length(2);
120120
expect(result.warnings[0]).to.include('CustomerProfile_AngularView_English');
121121
expect(result.warnings[1]).to.include('ProductCatalog_Legacy_Spanish');
122-
expect(result.migrationStatus).to.equal('Need Manual Intervention');
122+
expect(result.migrationStatus).to.equal('Needs Manual Intervention');
123123
});
124124

125125
it('should not add warnings for LWC OmniScript dependencies', async () => {

0 commit comments

Comments
 (0)