Skip to content

Commit f864147

Browse files
committed
fix: mvp bugs
1 parent 31b274d commit f864147

20 files changed

+554
-255
lines changed

src/commands/omnistudio/migration/assess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default class Assess extends OmniStudioBaseCommand {
119119
// Assess related objects if specified
120120
if (relatedObjects) {
121121
// To-Do: Add LWC to valid options when GA is released
122-
const validOptions = [Constants.Apex];
122+
const validOptions = [Constants.Apex, Constants.LWC];
123123
objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
124124

125125
// Validate input

src/commands/omnistudio/migration/migrate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ export default class Migrate extends OmniStudioBaseCommand {
186186
conn.instanceUrl,
187187
orgs,
188188
messages,
189-
actionItems
189+
actionItems,
190+
objectsToProcess
190191
);
191192

192193
// Return results needed for --json flag

src/migration/dataraptor.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
253253
type: dataRaptor[this.namespacePrefix + 'Type__c'] || '',
254254
formulaChanges: [],
255255
infos: [],
256-
warnings: [this.messages.getMessage('unexpectedError')],
256+
warnings: [],
257+
errors: [this.messages.getMessage('unexpectedError')],
257258
apexDependencies: [],
259+
migrationStatus: 'Failed',
258260
});
259261
const error = e as Error;
260262
Logger.error('Error processing data mapper', error);
@@ -276,6 +278,7 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
276278
Logger.info(this.messages.getMessage('processingDataRaptor', [drName]));
277279
const warnings: string[] = [];
278280
const existingDRNameVal = new StringVal(drName, 'name');
281+
let assessmentStatus = 'Can be Automated';
279282

280283
if (!existingDRNameVal.isNameCleaned()) {
281284
warnings.push(
@@ -285,9 +288,11 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
285288
existingDRNameVal.cleanName(),
286289
])
287290
);
291+
assessmentStatus = 'Has Warnings';
288292
}
289293
if (existingDataRaptorNames.has(existingDRNameVal.cleanName())) {
290294
warnings.push(this.messages.getMessage('duplicatedName') + ' ' + existingDRNameVal.cleanName());
295+
assessmentStatus = 'Need Manual Intervention';
291296
} else {
292297
existingDataRaptorNames.add(existingDRNameVal.cleanName());
293298
}
@@ -330,6 +335,8 @@ export class DataRaptorMigrationTool extends BaseMigrationTool implements Migrat
330335
infos: [],
331336
apexDependencies: apexDependencies,
332337
warnings: warnings,
338+
errors: [],
339+
migrationStatus: assessmentStatus,
333340
};
334341
return dataRaptorAssessmentInfo;
335342
}

src/migration/flexcard.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
123123
} catch (e) {
124124
flexCardAssessmentInfos.push({
125125
name: flexCard['Name'],
126+
oldName: flexCard['Name'],
126127
id: flexCard['Id'],
127128
dependenciesIP: [],
128129
dependenciesDR: [],
@@ -131,7 +132,9 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
131132
dependenciesLWC: [],
132133
dependenciesApexRemoteAction: [],
133134
infos: [],
134-
warnings: [this.messages.getMessage('unexpectedError')],
135+
warnings: [],
136+
errors: [this.messages.getMessage('unexpectedError')],
137+
migrationStatus: 'Failed',
135138
});
136139
const error = e as Error;
137140
Logger.error('Error processing flex card', error);
@@ -147,6 +150,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
147150
Logger.info(this.messages.getMessage('processingFlexCard', [flexCardName]));
148151
const flexCardAssessmentInfo: FlexCardAssessmentInfo = {
149152
name: flexCardName,
153+
oldName: flexCardName,
150154
id: flexCard['Id'],
151155
dependenciesIP: [],
152156
dependenciesDR: [],
@@ -156,20 +160,26 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
156160
dependenciesApexRemoteAction: [],
157161
infos: [],
158162
warnings: [],
163+
errors: [],
164+
migrationStatus: '',
159165
};
160166

161167
// Check for name changes due to API naming requirements
162168
const originalName: string = flexCardName;
163169
const cleanedName: string = this.cleanName(originalName);
170+
let assessmentStatus = 'Can be Automated';
171+
flexCardAssessmentInfo.name = cleanedName;
164172
if (cleanedName !== originalName) {
165173
flexCardAssessmentInfo.warnings.push(
166174
this.messages.getMessage('cardNameChangeMessage', [originalName, cleanedName])
167175
);
176+
assessmentStatus = 'Has Warnings';
168177
}
169178

170179
// Check for duplicate names
171180
if (uniqueNames.has(cleanedName)) {
172181
flexCardAssessmentInfo.warnings.push(this.messages.getMessage('duplicateCardNameMessage', [cleanedName]));
182+
assessmentStatus = 'Need Manual Intervention';
173183
}
174184
uniqueNames.add(cleanedName);
175185

@@ -181,9 +191,11 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
181191
flexCardAssessmentInfo.warnings.push(
182192
this.messages.getMessage('authordNameChangeMessage', [originalAuthor, cleanedAuthor])
183193
);
194+
assessmentStatus = 'Has Warnings';
184195
}
185196
}
186197

198+
flexCardAssessmentInfo.migrationStatus = assessmentStatus;
187199
this.updateDependencies(flexCard, flexCardAssessmentInfo);
188200

189201
return flexCardAssessmentInfo;
@@ -210,6 +222,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
210222
flexCardAssessmentInfo.warnings.push(
211223
this.messages.getMessage('dataRaptorNameChangeMessage', [originalBundle, cleanedBundle])
212224
);
225+
flexCardAssessmentInfo.migrationStatus = 'Has Warnings';
213226
}
214227
}
215228
} else if (dataSource.type === Constants.IntegrationProcedurePluralName) {
@@ -226,13 +239,15 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
226239
flexCardAssessmentInfo.warnings.push(
227240
this.messages.getMessage('integrationProcedureNameChangeMessage', [originalIpMethod, cleanedIpMethod])
228241
);
242+
flexCardAssessmentInfo.migrationStatus = 'Has Warnings';
229243
}
230244

231245
// Add warning for IP references with more than 2 parts (which potentially need manual updates)
232246
if (parts.length > 2) {
233247
flexCardAssessmentInfo.warnings.push(
234248
this.messages.getMessage('integrationProcedureManualUpdateMessage', [originalIpMethod])
235249
);
250+
flexCardAssessmentInfo.migrationStatus = 'Need Manual Intervention';
236251
}
237252
}
238253
} else if (dataSource.type === Constants.ApexRemoteComponentName) {
@@ -319,6 +334,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
319334
flexCardAssessmentInfo.warnings.push(
320335
this.messages.getMessage('omniScriptNameChangeMessage', [parts[i], cleanedParts[i]])
321336
);
337+
flexCardAssessmentInfo.migrationStatus = 'Has Warnings';
322338
}
323339
}
324340
}
@@ -349,6 +365,7 @@ export class CardMigrationTool extends BaseMigrationTool implements MigrationToo
349365
flexCardAssessmentInfo.warnings.push(
350366
this.messages.getMessage('omniScriptNameChangeMessage', [parts[i], cleanedParts[i]])
351367
);
368+
flexCardAssessmentInfo.migrationStatus = 'Has Warnings';
352369
}
353370
}
354371
}

src/migration/omniscript.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
243243
infos: [],
244244
warnings: [],
245245
errors: [this.messages.getMessage('unexpectedError')],
246-
migrationStatus: 'Can be Automated',
246+
migrationStatus: 'Failed',
247247
type: 'OmniScript',
248248
missingIP: [],
249249
missingDR: [],
@@ -262,6 +262,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
262262
warnings: [],
263263
errors: [this.messages.getMessage('unexpectedError')],
264264
path: '',
265+
migrationStatus: 'Failed',
265266
});
266267
}
267268
const error = e as Error;
@@ -305,6 +306,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
305306
dependenciesRemoteAction: omniAssessmentInfo.dependenciesRemoteAction,
306307
infos: [],
307308
warnings: omniAssessmentInfo.warnings,
309+
migrationStatus: omniAssessmentInfo.migrationStatus,
308310
errors: [],
309311
path: '',
310312
};
@@ -414,6 +416,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
414416
const existingSubTypeVal = new StringVal(existingSubType, 'sub type');
415417
const omniScriptName = omniscript[this.namespacePrefix + 'Name'];
416418
const existingOmniScriptNameVal = new StringVal(omniScriptName, 'name');
419+
let assessmentStatus = 'Can be Automated';
417420

418421
const warnings: string[] = [];
419422

@@ -437,6 +440,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
437440
existingTypeVal.cleanName(),
438441
])
439442
);
443+
assessmentStatus = 'Has Warnings';
440444
}
441445
if (!existingSubTypeVal.isNameCleaned()) {
442446
warnings.push(
@@ -446,6 +450,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
446450
existingSubTypeVal.cleanName(),
447451
])
448452
);
453+
assessmentStatus = 'Has Warnings';
449454
}
450455
if (!existingOmniScriptNameVal.isNameCleaned()) {
451456
warnings.push(
@@ -455,9 +460,11 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
455460
existingOmniScriptNameVal.cleanName(),
456461
])
457462
);
463+
assessmentStatus = 'Has Warnings';
458464
}
459465
if (existingOmniscriptNames.has(recordName)) {
460466
warnings.push(this.messages.getMessage('duplicatedName') + ' ' + recordName);
467+
assessmentStatus = 'Has Warnings';
461468
} else {
462469
existingOmniscriptNames.add(recordName);
463470
}
@@ -474,7 +481,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
474481
infos: [],
475482
warnings: warnings,
476483
errors: [],
477-
migrationStatus: 'Can be Automated',
484+
migrationStatus: assessmentStatus,
478485
type: omniProcessType,
479486
missingDR: missingDR,
480487
missingIP: missingIP,

src/migration/related/ApexMigration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class ApexMigration extends BaseRelatedObjectMigration {
159159
const warningMessage: string[] = this.processNonReplacableMethodCalls(file, parser);
160160
return {
161161
name: file.name,
162+
errors: [],
162163
warnings: warningMessage,
163164
infos: updateMessages,
164165
path: file.location,

src/migration/related/LwcMigration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export class LwcMigration extends BaseRelatedObjectMigration {
110110
name,
111111
changeInfos,
112112
errors,
113+
warnings: [],
113114
};
114115
if (changeInfos && changeInfos.length > 0) {
115116
jsonData.push(assesmentInfo);

src/migration/related/OmnistudioRelatedObjectMigrationFacade.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const assessMessages = Messages.loadMessages('@salesforce/plugin-omnistudio-migr
1616
const migrateMessages = Messages.loadMessages('@salesforce/plugin-omnistudio-migration-tool', 'migrate');
1717

1818
// TODO: Uncomment code once MVP for migration is completed
19-
// const LWCTYPE = 'LightningComponentBundle';
19+
const LWCTYPE = 'LightningComponentBundle';
2020
const APEXCLASS = 'Apexclass';
2121

2222
const defaultProjectName = 'omnistudio_migration';
@@ -50,7 +50,7 @@ export default class OmnistudioRelatedObjectMigrationFacade {
5050
// Initialize migration instances
5151
this.apexMigration = new ApexMigration(this.projectPath, this.namespace, this.org, targetApexNamespace);
5252
// TODO: Uncomment code once MVP for migration is completed
53-
// this.lwcMigration = new LwcMigration(this.projectPath, this.namespace, this.org);
53+
this.lwcMigration = new LwcMigration(this.projectPath, this.namespace, this.org);
5454
}
5555

5656
private createProject(): string {
@@ -62,9 +62,9 @@ export default class OmnistudioRelatedObjectMigrationFacade {
6262
const pwd = shell.pwd();
6363
shell.cd(this.projectPath);
6464
// TODO: Uncomment code once MVP for migration is completed
65-
// if (relatedObjects.includes(Constants.LWC)) {
66-
// sfProject.retrieve(LWCTYPE, this.org.getUsername());
67-
// }
65+
if (relatedObjects.includes(Constants.LWC)) {
66+
sfProject.retrieve(LWCTYPE, this.org.getUsername());
67+
}
6868
if (relatedObjects.includes(Constants.Apex)) {
6969
sfProject.retrieve(APEXCLASS, this.org.getUsername());
7070
}
@@ -88,7 +88,7 @@ export default class OmnistudioRelatedObjectMigrationFacade {
8888
debugTimer.start();
8989

9090
let apexAssessmentInfos: ApexAssessmentInfo[] = [];
91-
const lwcAssessmentInfos: LWCAssessmentInfo[] = [];
91+
let lwcAssessmentInfos: LWCAssessmentInfo[] = [];
9292

9393
// Proceed with processing logic
9494
try {
@@ -99,15 +99,15 @@ export default class OmnistudioRelatedObjectMigrationFacade {
9999
// Log the error
100100
Logger.error('Error processing related objects', error);
101101
}
102-
// TODO: Uncomment code once MVP for migration is completed
103-
// try {
104-
// if (relatedObjects.includes(Constants.LWC)) {
105-
// lwcAssessmentInfos = isMigration ? this.lwcMigration.migrate() : this.lwcMigration.assessment();
106-
// }
107-
// } catch (Error) {
108-
// // Log the error
109-
// Logger.error(Error.message);
110-
// }
102+
103+
try {
104+
if (relatedObjects.includes(Constants.LWC)) {
105+
Logger.logVerbose(migrateMessages.getMessage('startingLwcMigration', [this.projectPath]));
106+
lwcAssessmentInfos = isMigration ? this.lwcMigration.migrate() : this.lwcMigration.assessment();
107+
}
108+
} catch (Error) {
109+
Logger.error(Error.message);
110+
}
111111

112112
// Stop the debug timer
113113
const timer = debugTimer.stop();

src/styles/reportGenerator.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,6 @@ td {
530530
visibility: visible;
531531
}
532532

533-
ul {
534-
list-style: inside !important;
535-
}
536-
537533
.invalid-icon {
538534
position: relative;
539535
padding-left: 24px; /* space for icon */

src/templates/assessmentReport.template

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<button class="cta-panel-close" onclick="closeCtaPanel()">&times;</button>
2727
</div>
2828
<div class="cta-panel-content">
29-
<ul>
29+
<ul class="slds-list_dotted">
3030
<c:for items=(callToAction) var="cta">
3131
<li> {{cta.message}}: &nbsp <a href="(cta.link)" target="_blank">See More</a></li>
3232
</c:for>
@@ -155,7 +155,7 @@
155155
<td class="(cell.customClass)" data-name="(cell.value)" rowspan="(cell.rowspan)"
156156
colspan="(cell.colspan)" key="(cell.key)" value="(cell.value)">
157157
<c:if exp={Array.isArray($cell.title)}>
158-
<ul>
158+
<ul class="slds-list_dotted">
159159
<c:for items=(cell.title) var="value">
160160
<li>{{value}}</li>
161161
</c:for>
@@ -168,7 +168,7 @@
168168
<td rowspan="(cell.rowspan)" colspan="(cell.colspan)" class="(cell.customClass)"
169169
key="(cell.key)" value="(cell.value)">
170170
<c:if exp={Array.isArray($cell.title)}>
171-
<ul>
171+
<ul class="slds-list_dotted">
172172
<c:for items=(cell.title) var="value">
173173
<li>{{value}}</li>
174174
</c:for>
@@ -183,7 +183,7 @@
183183
<td data-name="(cell.value)" rowspan="(cell.rowspan)" colspan="(cell.colspan)"
184184
class="(cell.customClass)" key="(cell.key)" value="(cell.value)">
185185
<c:if exp={Array.isArray($cell.title)}>
186-
<ul>
186+
<ul class="slds-list_dotted">
187187
<c:for items=(cell.title) var="value">
188188
<li><a href="(cell.uri)" target="_blank">{{value}}</a></li>
189189
</c:for>
@@ -198,7 +198,7 @@
198198
<td rowspan="(cell.rowspan)" colspan="(cell.colspan)" class="(cell.customClass)"
199199
key="(cell.key)" value="(cell.value)">
200200
<c:if exp={Array.isArray($cell.title)}>
201-
<ul>
201+
<ul class="slds-list_dotted">
202202
<c:for items=(cell.title) var="value">
203203
<li><a href="(cell.uri)">{{value}}</a></li>
204204
</c:for>

0 commit comments

Comments
 (0)