Skip to content

Commit f163926

Browse files
chore: minor fixes
1 parent feb8e1d commit f163926

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/migration/premigrate.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
/* eslint-disable */
2-
31
import { Connection, Messages } from '@salesforce/core';
42
import { UX } from '@salesforce/command';
53
import { Logger } from '../utils/logger';
64
import { Constants } from '../utils/constants/stringContants';
75
import { OrgPreferences } from '../utils/orgPreferences';
8-
import { BaseMigrationTool } from './base';
96
import { askStringWithTimeout } from '../utils/promptUtil';
7+
import { YES_SHORT, YES_LONG, NO_SHORT, NO_LONG } from '../utils/projectPathUtil';
8+
import { BaseMigrationTool } from './base';
109

1110
export class PreMigrate extends BaseMigrationTool {
1211
// Source Custom Object Names
13-
constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages, ux: UX) {
12+
public constructor(namespace: string, connection: Connection, logger: Logger, messages: Messages, ux: UX) {
1413
super(namespace, connection, logger, messages, ux);
1514
}
1615

@@ -55,8 +54,9 @@ export class PreMigrate extends BaseMigrationTool {
5554
// This needs to be behind timeout
5655
private async getExpSiteMetadataEnableConsent(): Promise<boolean> {
5756
const question = this.messages.getMessage('consentForExperienceSites');
57+
const validResponse = false;
5858

59-
while (true) {
59+
while (!validResponse) {
6060
try {
6161
// Get string input from user with timeout
6262
const userInput = await askStringWithTimeout(
@@ -68,19 +68,18 @@ export class PreMigrate extends BaseMigrationTool {
6868
// Validate and convert the input
6969
const normalizedInput = userInput.trim().toLowerCase();
7070

71-
if (normalizedInput === 'y' || normalizedInput === 'yes') {
71+
if (normalizedInput === YES_SHORT || normalizedInput === YES_LONG) {
7272
return true;
73-
} else if (normalizedInput === 'n' || normalizedInput === 'no') {
73+
} else if (normalizedInput === NO_SHORT || normalizedInput === NO_LONG) {
7474
return false;
7575
} else {
7676
// Invalid input - show error and continue loop to re-prompt
7777
Logger.error(this.messages.getMessage('invalidYesNoResponse'));
78-
Logger.log('Please enter "y" or "yes" to consent, "n" or "no" to decline.');
7978
}
8079
} catch (error) {
8180
// Handle timeout or other errors
82-
Logger.error(this.messages.getMessage('failedToGetConsentError', [error.message]));
83-
throw error; // Re-throw to let caller handle timeout
81+
Logger.error(this.messages.getMessage('requestTimedOut'));
82+
process.exit(1);
8483
}
8584
}
8685
}

src/migration/related/ExperienceSiteMigration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
287287
if (this.shouldAddWarning(targetDataFromStorageFC)) {
288288
const warningMsg: string = this.getWarningMessage(flexcardName, targetDataFromStorageFC);
289289
experienceSiteAssessmentInfo.warnings.push(warningMsg);
290+
experienceSiteAssessmentInfo.status = 'Errors';
290291
} else {
291292
component.componentName = TARGET_COMPONENT_NAME_FC;
292293

src/utils/resultsbuilder/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export class ResultsBuilder {
251251
},
252252
assessmentDate: new Date().toString(),
253253
total: result.length,
254-
filterGroups: [createFilterGroupParam('Filter by Status', 'status', ['Can be Automated', 'Error'])],
254+
filterGroups: [createFilterGroupParam('Filter by Status', 'status', ['Can be Automated', 'Errors'])],
255255
headerGroups: [
256256
{
257257
header: [

0 commit comments

Comments
 (0)