@salesforce/plugin-omnistudio-migration-tool 2.0.0-rc.4 → 2.0.0-rc.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -40
- package/lib/commands/omnistudio/migration/assess.d.ts +1 -1
- package/lib/commands/omnistudio/migration/assess.js +107 -37
- package/lib/commands/omnistudio/migration/assess.js.map +1 -1
- package/lib/commands/omnistudio/migration/info.js +1 -1
- package/lib/commands/omnistudio/migration/info.js.map +1 -1
- package/lib/commands/omnistudio/migration/migrate.d.ts +35 -5
- package/lib/commands/omnistudio/migration/migrate.js +262 -107
- package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
- package/lib/javascripts/reportGeneratorUtility.js +100 -19
- package/lib/migration/NameMappingRegistry.d.ts +130 -0
- package/lib/migration/NameMappingRegistry.js +376 -0
- package/lib/migration/NameMappingRegistry.js.map +1 -0
- package/lib/migration/base.d.ts +4 -2
- package/lib/migration/base.js +8 -1
- package/lib/migration/base.js.map +1 -1
- package/lib/migration/customLabels.d.ts +49 -0
- package/lib/migration/customLabels.js +190 -0
- package/lib/migration/customLabels.js.map +1 -0
- package/lib/migration/dataraptor.js +63 -14
- package/lib/migration/dataraptor.js.map +1 -1
- package/lib/migration/deployer.d.ts +11 -0
- package/lib/migration/deployer.js +59 -0
- package/lib/migration/deployer.js.map +1 -0
- package/lib/migration/flexcard.d.ts +44 -2
- package/lib/migration/flexcard.js +707 -110
- package/lib/migration/flexcard.js.map +1 -1
- package/lib/migration/globalautonumber.d.ts +6 -6
- package/lib/migration/globalautonumber.js +27 -34
- package/lib/migration/globalautonumber.js.map +1 -1
- package/lib/migration/interfaces.d.ts +5 -0
- package/lib/migration/interfaces.js +7 -0
- package/lib/migration/interfaces.js.map +1 -1
- package/lib/migration/omniscript.d.ts +42 -2
- package/lib/migration/omniscript.js +724 -100
- package/lib/migration/omniscript.js.map +1 -1
- package/lib/migration/postMigrate.d.ts +22 -3
- package/lib/migration/postMigrate.js +147 -12
- package/lib/migration/postMigrate.js.map +1 -1
- package/lib/migration/premigrate.d.ts +16 -0
- package/lib/migration/premigrate.js +122 -0
- package/lib/migration/premigrate.js.map +1 -0
- package/lib/migration/related/ApexMigration.d.ts +1 -0
- package/lib/migration/related/ApexMigration.js +143 -22
- package/lib/migration/related/ApexMigration.js.map +1 -1
- package/lib/migration/related/ExperienceSiteMigration.d.ts +12 -4
- package/lib/migration/related/ExperienceSiteMigration.js +127 -59
- package/lib/migration/related/ExperienceSiteMigration.js.map +1 -1
- package/lib/migration/related/FlexipageMigration.d.ts +4 -4
- package/lib/migration/related/FlexipageMigration.js +31 -30
- package/lib/migration/related/FlexipageMigration.js.map +1 -1
- package/lib/migration/related/LwcMigration.js +27 -16
- package/lib/migration/related/LwcMigration.js.map +1 -1
- package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js +30 -24
- package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js.map +1 -1
- package/lib/styles/reportGenerator.css +9 -5
- package/lib/templates/assessmentReport.template +67 -6
- package/lib/templates/migrationReport.template +146 -4
- package/lib/utils/OmnistudioSettingsPrefManager.d.ts +12 -0
- package/lib/utils/OmnistudioSettingsPrefManager.js +82 -0
- package/lib/utils/OmnistudioSettingsPrefManager.js.map +1 -0
- package/lib/utils/XMLUtil.js +2 -1
- package/lib/utils/XMLUtil.js.map +1 -1
- package/lib/utils/apex/parser/apexparser.d.ts +8 -1
- package/lib/utils/apex/parser/apexparser.js +63 -10
- package/lib/utils/apex/parser/apexparser.js.map +1 -1
- package/lib/utils/constants/documentRegistry.d.ts +2 -1
- package/lib/utils/constants/documentRegistry.js +4 -3
- package/lib/utils/constants/documentRegistry.js.map +1 -1
- package/lib/utils/constants/stringContants.d.ts +7 -0
- package/lib/utils/constants/stringContants.js +10 -2
- package/lib/utils/constants/stringContants.js.map +1 -1
- package/lib/utils/customLabels.d.ts +34 -0
- package/lib/utils/customLabels.js +97 -0
- package/lib/utils/customLabels.js.map +1 -0
- package/lib/utils/file/fileUtil.d.ts +3 -1
- package/lib/utils/file/fileUtil.js +11 -4
- package/lib/utils/file/fileUtil.js.map +1 -1
- package/lib/utils/flexipage/flexiPageTransformer.js +14 -10
- package/lib/utils/flexipage/flexiPageTransformer.js.map +1 -1
- package/lib/utils/generatePackageXml.d.ts +4 -2
- package/lib/utils/generatePackageXml.js +17 -23
- package/lib/utils/generatePackageXml.js.map +1 -1
- package/lib/utils/interfaces.d.ts +36 -3
- package/lib/utils/logger.js +3 -1
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/lwcparser/fileutils/FileDiffUtil.js +20 -21
- package/lib/utils/lwcparser/fileutils/FileDiffUtil.js.map +1 -1
- package/lib/utils/lwcparser/xmlParser/XmlParser.js +2 -1
- package/lib/utils/lwcparser/xmlParser/XmlParser.js.map +1 -1
- package/lib/utils/orgPreferences.d.ts +1 -0
- package/lib/utils/orgPreferences.js +11 -8
- package/lib/utils/orgPreferences.js.map +1 -1
- package/lib/utils/orgUtils/index.d.ts +1 -1
- package/lib/utils/orgUtils/index.js +14 -14
- package/lib/utils/orgUtils/index.js.map +1 -1
- package/lib/utils/promptUtil.d.ts +2 -0
- package/lib/utils/promptUtil.js +26 -1
- package/lib/utils/promptUtil.js.map +1 -1
- package/lib/utils/reportGenerator/reportInterfaces.d.ts +9 -0
- package/lib/utils/reportGenerator/reportUtil.d.ts +1 -1
- package/lib/utils/reportGenerator/reportUtil.js +6 -3
- package/lib/utils/reportGenerator/reportUtil.js.map +1 -1
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.d.ts +2 -0
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.js +51 -15
- package/lib/utils/resultsbuilder/ApexAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.d.ts +13 -0
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js +178 -0
- package/lib/utils/resultsbuilder/CustomLabelAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.d.ts +19 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js +239 -0
- package/lib/utils/resultsbuilder/CustomLabelMigrationReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/DRAssessmentReporter.js +43 -11
- package/lib/utils/resultsbuilder/DRAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.d.ts +13 -0
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js +111 -0
- package/lib/utils/resultsbuilder/ExperienceSiteAssessmentReporter.js.map +1 -0
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +51 -12
- package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.d.ts +1 -0
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js +40 -18
- package/lib/utils/resultsbuilder/FlexipageAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js +21 -14
- package/lib/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/IPAssessmentReporter.js +47 -12
- package/lib/utils/resultsbuilder/IPAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.d.ts +14 -0
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.js +143 -139
- package/lib/utils/resultsbuilder/LWCAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/OSAssessmentReporter.js +31 -18
- package/lib/utils/resultsbuilder/OSAssessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/assessmentReporter.d.ts +6 -1
- package/lib/utils/resultsbuilder/assessmentReporter.js +163 -66
- package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
- package/lib/utils/resultsbuilder/index.d.ts +12 -1
- package/lib/utils/resultsbuilder/index.js +343 -84
- package/lib/utils/resultsbuilder/index.js.map +1 -1
- package/lib/utils/resultsbuilder/reportingHelper.d.ts +2 -7
- package/lib/utils/resultsbuilder/reportingHelper.js +0 -43
- package/lib/utils/resultsbuilder/reportingHelper.js.map +1 -1
- package/lib/utils/sfcli/project/sfProject.d.ts +4 -0
- package/lib/utils/sfcli/project/sfProject.js +56 -1
- package/lib/utils/sfcli/project/sfProject.js.map +1 -1
- package/lib/utils/shell/cli.js +3 -7
- package/lib/utils/shell/cli.js.map +1 -1
- package/lib/utils/storageUtil.d.ts +1 -0
- package/lib/utils/storageUtil.js +3 -0
- package/lib/utils/storageUtil.js.map +1 -1
- package/lib/utils/stringUtils.d.ts +9 -0
- package/lib/utils/stringUtils.js +38 -7
- package/lib/utils/stringUtils.js.map +1 -1
- package/lib/utils/templateParser/model/elementNode.js +11 -2
- package/lib/utils/templateParser/model/elementNode.js.map +1 -1
- package/lib/utils/validatorService.d.ts +13 -0
- package/lib/utils/validatorService.js +69 -0
- package/lib/utils/validatorService.js.map +1 -0
- package/messages/assess.json +125 -55
- package/messages/migrate.json +172 -53
- package/oclif.manifest.json +1 -1
- package/package.json +40 -7
- package/lib/utils/OmniGlobalAutoNumberPrefManager.d.ts +0 -40
- package/lib/utils/OmniGlobalAutoNumberPrefManager.js +0 -65
- package/lib/utils/OmniGlobalAutoNumberPrefManager.js.map +0 -1
|
@@ -4,6 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ResultsBuilder = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
11
|
const fs_1 = __importDefault(require("fs"));
|
|
8
12
|
const path_1 = __importDefault(require("path"));
|
|
9
13
|
const open_1 = __importDefault(require("open"));
|
|
@@ -13,9 +17,9 @@ const reportUtil_1 = require("../reportGenerator/reportUtil");
|
|
|
13
17
|
const FileDiffUtil_1 = require("../lwcparser/fileutils/FileDiffUtil");
|
|
14
18
|
const logger_1 = require("../logger");
|
|
15
19
|
const stringUtils_1 = require("../stringUtils");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
20
|
+
const stringContants_1 = require("../constants/stringContants");
|
|
21
|
+
const CustomLabelMigrationReporter_1 = require("./CustomLabelMigrationReporter");
|
|
22
|
+
const resultsDir = path_1.default.join(process.cwd(), stringContants_1.Constants.MigrationReportsFolderName);
|
|
19
23
|
const migrationReportHTMLfileName = 'dashboard.html';
|
|
20
24
|
const flexipageFileName = 'flexipage.html';
|
|
21
25
|
const templateDir = 'templates';
|
|
@@ -25,24 +29,30 @@ const reportTemplateFilePath = path_1.default.join(__dirname, '..', '..', templa
|
|
|
25
29
|
const dashboardTemplateFilePath = path_1.default.join(__dirname, '..', '..', templateDir, dashboardTemplateName);
|
|
26
30
|
const apexFileName = 'apex.html';
|
|
27
31
|
const experienceSiteFileName = 'experienceSite.html';
|
|
32
|
+
const lwcFileName = 'lwc.html';
|
|
28
33
|
class ResultsBuilder {
|
|
29
|
-
static async generateReport(results, relatedObjectMigrationResult, instanceUrl, orgDetails, messages, actionItems) {
|
|
34
|
+
static async generateReport(results, relatedObjectMigrationResult, instanceUrl, orgDetails, messages, actionItems, objectsToProcess) {
|
|
30
35
|
fs_1.default.mkdirSync(resultsDir, { recursive: true });
|
|
31
36
|
logger_1.Logger.info(messages.getMessage('generatingComponentReports'));
|
|
32
37
|
for (const result of results) {
|
|
33
38
|
this.generateReportForResult(result, instanceUrl, orgDetails, messages);
|
|
34
39
|
}
|
|
35
40
|
logger_1.Logger.info(messages.getMessage('generatingRelatedObjectReports'));
|
|
36
|
-
this.generateReportForRelatedObject(relatedObjectMigrationResult, instanceUrl, orgDetails, messages);
|
|
41
|
+
this.generateReportForRelatedObject(relatedObjectMigrationResult, instanceUrl, orgDetails, messages, objectsToProcess);
|
|
37
42
|
logger_1.Logger.info(messages.getMessage('generatingMigrationReportDashboard'));
|
|
38
|
-
this.generateMigrationReportDashboard(orgDetails, results, relatedObjectMigrationResult, messages, actionItems);
|
|
43
|
+
this.generateMigrationReportDashboard(orgDetails, results, relatedObjectMigrationResult, messages, actionItems, objectsToProcess);
|
|
39
44
|
(0, fileUtil_1.pushAssestUtilites)('javascripts', resultsDir);
|
|
40
45
|
(0, fileUtil_1.pushAssestUtilites)('styles', resultsDir);
|
|
41
46
|
await (0, open_1.default)(path_1.default.join(resultsDir, migrationReportHTMLfileName));
|
|
42
47
|
}
|
|
43
48
|
static generateReportForResult(result, instanceUrl, orgDetails, messages) {
|
|
44
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
45
50
|
logger_1.Logger.captureVerboseData(`${result.name} data`, result);
|
|
51
|
+
// Handle Custom Labels migration specifically
|
|
52
|
+
if (result.name.toLowerCase().includes('custom labels')) {
|
|
53
|
+
this.generateCustomLabelsMigrationReport(result, instanceUrl, orgDetails, messages);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
46
56
|
// Determine which rollback flag to use based on component type
|
|
47
57
|
let rollbackFlagNames = [];
|
|
48
58
|
const componentName = result.name.toLowerCase();
|
|
@@ -66,11 +76,9 @@ class ResultsBuilder {
|
|
|
66
76
|
namespace: orgDetails.packageDetails.namespace,
|
|
67
77
|
dataModel: orgDetails.dataModel,
|
|
68
78
|
},
|
|
69
|
-
assessmentDate: new Date().
|
|
79
|
+
assessmentDate: new Date().toLocaleString(),
|
|
70
80
|
total: ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0,
|
|
71
|
-
filterGroups: [
|
|
72
|
-
(0, reportUtil_1.createFilterGroupParam)('Filter By Status', 'status', ['Successfully Completed', 'Error', 'Skipped']),
|
|
73
|
-
],
|
|
81
|
+
filterGroups: [...this.getStatusFilterGroup(((_b = result.data) === null || _b === void 0 ? void 0 : _b.map((item) => item.status)) || [])],
|
|
74
82
|
headerGroups: [
|
|
75
83
|
{
|
|
76
84
|
header: [
|
|
@@ -95,7 +103,7 @@ class ResultsBuilder {
|
|
|
95
103
|
rowspan: 2,
|
|
96
104
|
},
|
|
97
105
|
{
|
|
98
|
-
name: '
|
|
106
|
+
name: 'Summary',
|
|
99
107
|
colspan: 1,
|
|
100
108
|
rowspan: 2,
|
|
101
109
|
},
|
|
@@ -134,9 +142,9 @@ class ResultsBuilder {
|
|
|
134
142
|
(0, reportUtil_1.createRowDataParam)('name', item.name, true, 1, 1, false),
|
|
135
143
|
(0, reportUtil_1.createRowDataParam)('migratedId', item.migratedId, false, 1, 1, true, `${instanceUrl}/${item.migratedId}`),
|
|
136
144
|
(0, reportUtil_1.createRowDataParam)('migratedName', item.migratedName, false, 1, 1, false),
|
|
137
|
-
(0, reportUtil_1.createRowDataParam)('status', item.status
|
|
138
|
-
(0, reportUtil_1.createRowDataParam)('errors', item.errors ? '
|
|
139
|
-
(0, reportUtil_1.createRowDataParam)('
|
|
145
|
+
(0, reportUtil_1.createRowDataParam)('status', item.status, false, 1, 1, false, undefined, undefined, item.status === 'Successfully migrated' ? 'text-success' : 'text-error'),
|
|
146
|
+
(0, reportUtil_1.createRowDataParam)('errors', item.errors ? 'Failed' : 'Has No Errors', false, 1, 1, false, undefined, item.errors || [], item.status === 'Successfully migrated' ? '' : 'text-error'),
|
|
147
|
+
(0, reportUtil_1.createRowDataParam)('summary', item.warnings ? 'Warnings' : 'Has No Warnings', false, 1, 1, false, undefined, item.warnings || [], item.status === 'Successfully migrated' ? '' : 'text-error'),
|
|
140
148
|
],
|
|
141
149
|
})),
|
|
142
150
|
],
|
|
@@ -146,30 +154,83 @@ class ResultsBuilder {
|
|
|
146
154
|
const html = generate_1.TemplateParser.generate(reportTemplate, data, messages);
|
|
147
155
|
fs_1.default.writeFileSync(path_1.default.join(resultsDir, result.name.replace(/ /g, '_').replace(/\//g, '_') + '.html'), html);
|
|
148
156
|
}
|
|
149
|
-
static
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
static generateCustomLabelsMigrationReport(result, instanceUrl, orgDetails, messages) {
|
|
158
|
+
logger_1.Logger.captureVerboseData(`${result.name} data`, result);
|
|
159
|
+
// Convert migration results to CustomLabelMigrationInfo format
|
|
160
|
+
const customLabelMigrationInfos = [];
|
|
161
|
+
if (result.data) {
|
|
162
|
+
result.data.forEach((record, index) => {
|
|
163
|
+
// Handle both old and new data formats
|
|
164
|
+
const labelName = record.name || record.labelName;
|
|
165
|
+
const cloneStatus = record.status === 'Complete'
|
|
166
|
+
? 'created'
|
|
167
|
+
: record.status === 'Error'
|
|
168
|
+
? 'error'
|
|
169
|
+
: record.status === 'Skipped'
|
|
170
|
+
? 'duplicate'
|
|
171
|
+
: record.status || 'duplicate';
|
|
172
|
+
const localizationStatus = record.localizationStatus || {};
|
|
173
|
+
const errors = record.errors || [];
|
|
174
|
+
const warnings = record.warnings || [];
|
|
175
|
+
customLabelMigrationInfos.push({
|
|
176
|
+
labelName,
|
|
177
|
+
cloneStatus,
|
|
178
|
+
localizationStatus,
|
|
179
|
+
errors,
|
|
180
|
+
warnings,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const pageSize = 1000; // Smaller page size for better performance
|
|
185
|
+
const totalLabels = customLabelMigrationInfos.length;
|
|
186
|
+
const totalPages = Math.ceil(totalLabels / pageSize);
|
|
187
|
+
logger_1.Logger.logVerbose(messages.getMessage('generatingCustomLabelsReport', [totalLabels, totalPages, pageSize]));
|
|
188
|
+
// Generate paginated reports
|
|
189
|
+
for (let page = 1; page <= totalPages; page++) {
|
|
190
|
+
const data = CustomLabelMigrationReporter_1.CustomLabelMigrationReporter.getCustomLabelMigrationData(customLabelMigrationInfos, instanceUrl, orgDetails, page, pageSize);
|
|
191
|
+
const reportTemplate = fs_1.default.readFileSync(reportTemplateFilePath, 'utf8');
|
|
192
|
+
// Replace the pagination section with custom generated HTML
|
|
193
|
+
const customPaginationHtml = CustomLabelMigrationReporter_1.CustomLabelMigrationReporter.generateCustomTemplateForPage(page, totalPages);
|
|
194
|
+
const modifiedTemplate = reportTemplate.replace(/<!-- Pagination Navigation -->[\s\S]*?<\/div>\s*<\/div>\s*<\/c:if>/, customPaginationHtml);
|
|
195
|
+
const html = generate_1.TemplateParser.generate(modifiedTemplate, data, messages);
|
|
196
|
+
const fileName = totalPages > 1 ? `Custom_Labels_Page_${page}_of_${totalPages}.html` : 'Custom_Labels.html';
|
|
197
|
+
fs_1.default.writeFileSync(path_1.default.join(resultsDir, fileName), html);
|
|
198
|
+
logger_1.Logger.logVerbose(messages.getMessage('generatedCustomLabelsReportPage', [page, totalPages, data.rows.length]));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
static generateReportForRelatedObject(result, instanceUrl, orgDetails, messages, objectsToProcess) {
|
|
202
|
+
if (objectsToProcess.includes(stringContants_1.Constants.Apex)) {
|
|
203
|
+
this.generateReportForApex(result.apexAssessmentInfos, instanceUrl, orgDetails, messages);
|
|
204
|
+
}
|
|
205
|
+
if (objectsToProcess.includes(stringContants_1.Constants.ExpSites)) {
|
|
206
|
+
this.generateReportForExperienceSites(result.experienceSiteAssessmentInfos, instanceUrl, orgDetails, messages);
|
|
207
|
+
}
|
|
208
|
+
if (objectsToProcess.includes(stringContants_1.Constants.FlexiPage)) {
|
|
209
|
+
this.generateReportForFlexipage(result.flexipageAssessmentInfos, instanceUrl, orgDetails, messages);
|
|
210
|
+
}
|
|
211
|
+
if (objectsToProcess.includes(stringContants_1.Constants.LWC)) {
|
|
212
|
+
this.generateReportForLwc(result.lwcAssessmentInfos, instanceUrl, orgDetails, messages);
|
|
213
|
+
}
|
|
153
214
|
}
|
|
154
215
|
static generateReportForExperienceSites(result, instanceUrl, orgDetails, messages) {
|
|
155
216
|
logger_1.Logger.logVerbose('Generating experience site report');
|
|
156
217
|
const data = {
|
|
157
|
-
title: 'Experience
|
|
158
|
-
heading: 'Experience
|
|
218
|
+
title: 'Experience Sites Migration Report',
|
|
219
|
+
heading: 'Experience Sites Migration Report',
|
|
159
220
|
org: {
|
|
160
221
|
name: orgDetails.orgDetails.Name,
|
|
161
222
|
id: orgDetails.orgDetails.Id,
|
|
162
223
|
namespace: orgDetails.packageDetails.namespace,
|
|
163
224
|
dataModel: orgDetails.dataModel,
|
|
164
225
|
},
|
|
165
|
-
assessmentDate: new Date().
|
|
226
|
+
assessmentDate: new Date().toLocaleString(),
|
|
166
227
|
total: result.length,
|
|
167
|
-
filterGroups: [(
|
|
228
|
+
filterGroups: [...this.getStatusFilterGroup(result.map((item) => item.status))],
|
|
168
229
|
headerGroups: [
|
|
169
230
|
{
|
|
170
231
|
header: [
|
|
171
232
|
{
|
|
172
|
-
name: '
|
|
233
|
+
name: 'Experience Site Name',
|
|
173
234
|
colspan: 1,
|
|
174
235
|
rowspan: 1,
|
|
175
236
|
},
|
|
@@ -179,12 +240,12 @@ class ResultsBuilder {
|
|
|
179
240
|
rowspan: 1,
|
|
180
241
|
},
|
|
181
242
|
{
|
|
182
|
-
name: '
|
|
243
|
+
name: 'Status',
|
|
183
244
|
colspan: 1,
|
|
184
245
|
rowspan: 1,
|
|
185
246
|
},
|
|
186
247
|
{
|
|
187
|
-
name: '
|
|
248
|
+
name: 'Differences',
|
|
188
249
|
colspan: 1,
|
|
189
250
|
rowspan: 1,
|
|
190
251
|
},
|
|
@@ -200,10 +261,10 @@ class ResultsBuilder {
|
|
|
200
261
|
rowId: `${this.rowClass}${this.rowId++}`,
|
|
201
262
|
data: [
|
|
202
263
|
(0, reportUtil_1.createRowDataParam)('name', item.name, true, 1, 1, false),
|
|
203
|
-
(0, reportUtil_1.createRowDataParam)('path', item.
|
|
204
|
-
(0, reportUtil_1.createRowDataParam)('
|
|
205
|
-
(0, reportUtil_1.createRowDataParam)('
|
|
206
|
-
(0, reportUtil_1.createRowDataParam)('
|
|
264
|
+
(0, reportUtil_1.createRowDataParam)('path', `${item.name}${this.experienceSiteFileSuffix}`, false, 1, 1, true, item.path),
|
|
265
|
+
(0, reportUtil_1.createRowDataParam)('status', item.status, false, 1, 1, false, undefined, undefined, item.status === 'Successfully migrated' ? 'text-success' : 'text-error'),
|
|
266
|
+
(0, reportUtil_1.createRowDataParam)('diff', item.name + 'diff', false, 1, 1, false, undefined, FileDiffUtil_1.FileDiffUtil.getDiffHTML(item.diff, this.rowId.toString())),
|
|
267
|
+
(0, reportUtil_1.createRowDataParam)('errors', item.warnings && item.warnings.length > 0 ? 'Failed' : 'Complete', false, 1, 1, false, undefined, item.warnings, item.status === 'Successfully migrated' ? '' : 'text-error'),
|
|
207
268
|
],
|
|
208
269
|
})),
|
|
209
270
|
};
|
|
@@ -215,22 +276,22 @@ class ResultsBuilder {
|
|
|
215
276
|
static generateReportForFlexipage(result, instanceUrl, orgDetails, messages) {
|
|
216
277
|
logger_1.Logger.captureVerboseData('flexipage data', result);
|
|
217
278
|
const data = {
|
|
218
|
-
title: '
|
|
219
|
-
heading: '
|
|
279
|
+
title: 'FlexiPages Migration Report',
|
|
280
|
+
heading: 'FlexiPages Migration Report',
|
|
220
281
|
org: {
|
|
221
282
|
name: orgDetails.orgDetails.Name,
|
|
222
283
|
id: orgDetails.orgDetails.Id,
|
|
223
284
|
namespace: orgDetails.packageDetails.namespace,
|
|
224
285
|
dataModel: orgDetails.dataModel,
|
|
225
286
|
},
|
|
226
|
-
assessmentDate: new Date().
|
|
287
|
+
assessmentDate: new Date().toLocaleString(),
|
|
227
288
|
total: result.length,
|
|
228
|
-
filterGroups: [(
|
|
289
|
+
filterGroups: [...this.getStatusFilterGroup(result.map((item) => item.status))],
|
|
229
290
|
headerGroups: [
|
|
230
291
|
{
|
|
231
292
|
header: [
|
|
232
293
|
{
|
|
233
|
-
name: '
|
|
294
|
+
name: 'FlexiPage Name',
|
|
234
295
|
colspan: 1,
|
|
235
296
|
rowspan: 1,
|
|
236
297
|
},
|
|
@@ -260,11 +321,11 @@ class ResultsBuilder {
|
|
|
260
321
|
rows: result.map((item) => ({
|
|
261
322
|
rowId: `${this.rowClass}${this.rowId++}`,
|
|
262
323
|
data: [
|
|
263
|
-
(0, reportUtil_1.createRowDataParam)('name', item.name, true, 1, 1, false),
|
|
264
|
-
(0, reportUtil_1.createRowDataParam)('path', item.
|
|
265
|
-
(0, reportUtil_1.createRowDataParam)('status', item.status, false, 1, 1, false, undefined, undefined, item.status === '
|
|
324
|
+
(0, reportUtil_1.createRowDataParam)('name', item.name.substring(0, item.name.length - this.flexiPageFileSuffix.length), true, 1, 1, false),
|
|
325
|
+
(0, reportUtil_1.createRowDataParam)('path', item.name, false, 1, 1, true, item.path),
|
|
326
|
+
(0, reportUtil_1.createRowDataParam)('status', item.status, false, 1, 1, false, undefined, undefined, item.status === 'Successfully migrated' ? 'text-success' : 'text-error'),
|
|
266
327
|
(0, reportUtil_1.createRowDataParam)('diff', '', false, 1, 1, false, undefined, FileDiffUtil_1.FileDiffUtil.getDiffHTML(item.diff, item.name)),
|
|
267
|
-
(0, reportUtil_1.createRowDataParam)('error', 'error', false, 1, 1, false, undefined, item.errors, 'text-error'),
|
|
328
|
+
(0, reportUtil_1.createRowDataParam)('error', 'error', false, 1, 1, false, undefined, item.errors, item.status === 'Successfully migrated' ? '' : 'text-error'),
|
|
268
329
|
],
|
|
269
330
|
})),
|
|
270
331
|
};
|
|
@@ -275,17 +336,17 @@ class ResultsBuilder {
|
|
|
275
336
|
static generateReportForApex(result, instanceUrl, orgDetails, messages) {
|
|
276
337
|
logger_1.Logger.captureVerboseData('apex data', result);
|
|
277
338
|
const data = {
|
|
278
|
-
title: 'Apex
|
|
279
|
-
heading: 'Apex
|
|
339
|
+
title: 'Apex Classes Migration Report',
|
|
340
|
+
heading: 'Apex Classes Migration Report',
|
|
280
341
|
org: {
|
|
281
342
|
name: orgDetails.orgDetails.Name,
|
|
282
343
|
id: orgDetails.orgDetails.Id,
|
|
283
344
|
namespace: orgDetails.packageDetails.namespace,
|
|
284
345
|
dataModel: orgDetails.dataModel,
|
|
285
346
|
},
|
|
286
|
-
assessmentDate: new Date().
|
|
347
|
+
assessmentDate: new Date().toLocaleString(),
|
|
287
348
|
total: result.length,
|
|
288
|
-
filterGroups: [(0, reportUtil_1.createFilterGroupParam)('Filter by Errors', 'warnings', ['
|
|
349
|
+
filterGroups: [(0, reportUtil_1.createFilterGroupParam)('Filter by Errors', 'warnings', ['Failed', 'Successfully Completed'])],
|
|
289
350
|
headerGroups: [
|
|
290
351
|
{
|
|
291
352
|
header: [
|
|
@@ -299,6 +360,11 @@ class ResultsBuilder {
|
|
|
299
360
|
colspan: 1,
|
|
300
361
|
rowspan: 1,
|
|
301
362
|
},
|
|
363
|
+
{
|
|
364
|
+
name: 'Status',
|
|
365
|
+
colspan: 1,
|
|
366
|
+
rowspan: 1,
|
|
367
|
+
},
|
|
302
368
|
{
|
|
303
369
|
name: 'Code Difference',
|
|
304
370
|
colspan: 1,
|
|
@@ -322,22 +388,142 @@ class ResultsBuilder {
|
|
|
322
388
|
data: [
|
|
323
389
|
(0, reportUtil_1.createRowDataParam)('name', item.name, true, 1, 1, false),
|
|
324
390
|
(0, reportUtil_1.createRowDataParam)('path', item.name, false, 1, 1, true, item.path, item.name + '.cls'),
|
|
391
|
+
(0, reportUtil_1.createRowDataParam)('status', this.getStatusFromErrors(item.errors), false, 1, 1, false, undefined, undefined, this.getStatusCssClass(item.errors)),
|
|
325
392
|
(0, reportUtil_1.createRowDataParam)('diff', item.name + 'diff', false, 1, 1, false, undefined, FileDiffUtil_1.FileDiffUtil.getDiffHTML(item.diff, item.name)),
|
|
326
|
-
(0, reportUtil_1.createRowDataParam)('infos', item.infos ? item.infos.join(', ') : '', false, 1, 1, false, undefined, item.infos),
|
|
327
|
-
(0, reportUtil_1.createRowDataParam)('warnings', item.warnings ? '
|
|
393
|
+
(0, reportUtil_1.createRowDataParam)('infos', item.infos ? item.infos.join(', ') : '', false, 1, 1, false, undefined, item.infos, this.getStatusCssClass(item.errors, true)),
|
|
394
|
+
(0, reportUtil_1.createRowDataParam)('warnings', item.warnings.length > 0 ? 'Failed' : 'Successfully Completed', false, 1, 1, false, undefined, [...item.warnings, ...item.errors], this.getStatusCssClass(item.errors, true)),
|
|
328
395
|
],
|
|
329
396
|
})),
|
|
330
|
-
rollbackFlags: (orgDetails.rollbackFlags || []).includes('RollbackApexChanges')
|
|
331
|
-
? ['RollbackApexChanges']
|
|
332
|
-
: undefined,
|
|
333
397
|
};
|
|
334
398
|
const reportTemplate = fs_1.default.readFileSync(reportTemplateFilePath, 'utf8');
|
|
335
399
|
const html = generate_1.TemplateParser.generate(reportTemplate, data, messages);
|
|
336
400
|
fs_1.default.writeFileSync(path_1.default.join(resultsDir, apexFileName), html);
|
|
337
401
|
// call generate html from template
|
|
338
402
|
}
|
|
339
|
-
static
|
|
340
|
-
|
|
403
|
+
static generateReportForLwc(result, instanceUrl, orgDetails, messages) {
|
|
404
|
+
logger_1.Logger.captureVerboseData('lwc data', result);
|
|
405
|
+
const data = {
|
|
406
|
+
title: 'Lightning Web Components Migration Report',
|
|
407
|
+
heading: 'Lightning Web Components Migration Report',
|
|
408
|
+
org: {
|
|
409
|
+
name: orgDetails.orgDetails.Name,
|
|
410
|
+
id: orgDetails.orgDetails.Id,
|
|
411
|
+
namespace: orgDetails.packageDetails.namespace,
|
|
412
|
+
dataModel: orgDetails.dataModel,
|
|
413
|
+
},
|
|
414
|
+
assessmentDate: new Date().toLocaleString(),
|
|
415
|
+
total: result.length,
|
|
416
|
+
filterGroups: [...this.getStatusFilterGroup(result.flatMap((item) => this.getStatusFromErrors(item.errors)))],
|
|
417
|
+
headerGroups: [
|
|
418
|
+
{
|
|
419
|
+
header: [
|
|
420
|
+
{
|
|
421
|
+
name: 'Name',
|
|
422
|
+
colspan: 1,
|
|
423
|
+
rowspan: 1,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'Status',
|
|
427
|
+
colspan: 1,
|
|
428
|
+
rowspan: 1,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: 'File Reference',
|
|
432
|
+
colspan: 1,
|
|
433
|
+
rowspan: 1,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: 'File Diff',
|
|
437
|
+
colspan: 1,
|
|
438
|
+
rowspan: 1,
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'Migration Status',
|
|
442
|
+
colspan: 1,
|
|
443
|
+
rowspan: 1,
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: 'Errors',
|
|
447
|
+
colspan: 1,
|
|
448
|
+
rowspan: 1,
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
},
|
|
452
|
+
],
|
|
453
|
+
rows: this.getLwcRowsForReport(result),
|
|
454
|
+
};
|
|
455
|
+
const reportTemplate = fs_1.default.readFileSync(reportTemplateFilePath, 'utf8');
|
|
456
|
+
const html = generate_1.TemplateParser.generate(reportTemplate, data, messages);
|
|
457
|
+
fs_1.default.writeFileSync(path_1.default.join(resultsDir, lwcFileName), html);
|
|
458
|
+
}
|
|
459
|
+
static getLwcRowsForReport(lwcAssessmentInfos) {
|
|
460
|
+
const rows = [];
|
|
461
|
+
for (const lwcAssessmentInfo of lwcAssessmentInfos) {
|
|
462
|
+
let showCommon = true;
|
|
463
|
+
const rid = `${this.rowClass}${this.rowId++}`;
|
|
464
|
+
const commonRowSpan = Math.max(1, lwcAssessmentInfo.changeInfos.length);
|
|
465
|
+
for (const fileChangeInfo of lwcAssessmentInfo.changeInfos) {
|
|
466
|
+
rows.push({
|
|
467
|
+
rowId: rid,
|
|
468
|
+
data: [
|
|
469
|
+
...(showCommon
|
|
470
|
+
? [
|
|
471
|
+
(0, reportUtil_1.createRowDataParam)('name', lwcAssessmentInfo.name, true, commonRowSpan, 1, false),
|
|
472
|
+
(0, reportUtil_1.createRowDataParam)('status', this.getStatusFromErrors(lwcAssessmentInfo.errors), false, commonRowSpan, 1, false, undefined, undefined, this.getStatusCssClass(lwcAssessmentInfo.errors)),
|
|
473
|
+
]
|
|
474
|
+
: []),
|
|
475
|
+
(0, reportUtil_1.createRowDataParam)('fileReference', fileChangeInfo.name, false, 1, 1, true, fileChangeInfo.path, fileChangeInfo.name, 'normal-td-padding'),
|
|
476
|
+
(0, reportUtil_1.createRowDataParam)('diff', fileChangeInfo.name + 'diff', false, 1, 1, false, undefined, FileDiffUtil_1.FileDiffUtil.getDiffHTML(fileChangeInfo.diff, fileChangeInfo.name)),
|
|
477
|
+
...(showCommon
|
|
478
|
+
? [
|
|
479
|
+
(0, reportUtil_1.createRowDataParam)('comments', lwcAssessmentInfo.warnings && lwcAssessmentInfo.warnings.length > 0
|
|
480
|
+
? 'Failed'
|
|
481
|
+
: 'Successfully Completed', false, commonRowSpan, 1, false, undefined, lwcAssessmentInfo.warnings || [], this.getStatusCssClass(lwcAssessmentInfo.errors, true)),
|
|
482
|
+
(0, reportUtil_1.createRowDataParam)('errors', lwcAssessmentInfo.errors ? lwcAssessmentInfo.errors.join(', ') : '', false, commonRowSpan, 1, false, undefined, lwcAssessmentInfo.errors || [], this.getStatusCssClass(lwcAssessmentInfo.errors, true)),
|
|
483
|
+
]
|
|
484
|
+
: []),
|
|
485
|
+
],
|
|
486
|
+
});
|
|
487
|
+
showCommon = false;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return rows;
|
|
491
|
+
}
|
|
492
|
+
static generateMigrationReportDashboard(orgDetails, results, relatedObjectMigrationResult, messages, actionItems, objectsToProcess) {
|
|
493
|
+
var _a, _b, _c, _d;
|
|
494
|
+
const relatedObjectSummaryItems = [];
|
|
495
|
+
if (objectsToProcess.includes(stringContants_1.Constants.Apex)) {
|
|
496
|
+
relatedObjectSummaryItems.push({
|
|
497
|
+
name: 'Apex Classes',
|
|
498
|
+
total: ((_a = relatedObjectMigrationResult.apexAssessmentInfos) === null || _a === void 0 ? void 0 : _a.length) || 0,
|
|
499
|
+
data: this.getDifferentStatusDataForApex(relatedObjectMigrationResult.apexAssessmentInfos),
|
|
500
|
+
file: apexFileName,
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
if (objectsToProcess.includes(stringContants_1.Constants.ExpSites)) {
|
|
504
|
+
relatedObjectSummaryItems.push({
|
|
505
|
+
name: 'Experience Sites',
|
|
506
|
+
total: ((_b = relatedObjectMigrationResult.experienceSiteAssessmentInfos) === null || _b === void 0 ? void 0 : _b.length) || 0,
|
|
507
|
+
data: this.getDifferentStatusDataForExperienceSites(relatedObjectMigrationResult.experienceSiteAssessmentInfos),
|
|
508
|
+
file: experienceSiteFileName,
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (objectsToProcess.includes(stringContants_1.Constants.FlexiPage)) {
|
|
512
|
+
relatedObjectSummaryItems.push({
|
|
513
|
+
name: 'FlexiPages',
|
|
514
|
+
total: ((_c = relatedObjectMigrationResult.flexipageAssessmentInfos) === null || _c === void 0 ? void 0 : _c.length) || 0,
|
|
515
|
+
data: this.getDifferentStatusDataForFlexipage(relatedObjectMigrationResult.flexipageAssessmentInfos),
|
|
516
|
+
file: flexipageFileName,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
if (objectsToProcess.includes(stringContants_1.Constants.LWC)) {
|
|
520
|
+
relatedObjectSummaryItems.push({
|
|
521
|
+
name: 'Lightning Web Components',
|
|
522
|
+
total: ((_d = relatedObjectMigrationResult.lwcAssessmentInfos) === null || _d === void 0 ? void 0 : _d.length) || 0,
|
|
523
|
+
data: this.getDifferentStatusDataForLwc(relatedObjectMigrationResult.lwcAssessmentInfos),
|
|
524
|
+
file: lwcFileName,
|
|
525
|
+
});
|
|
526
|
+
}
|
|
341
527
|
const data = {
|
|
342
528
|
title: 'Omnistudio Migration Report Dashboard',
|
|
343
529
|
heading: 'Omnistudio Migration Report Dashboard',
|
|
@@ -347,35 +533,30 @@ class ResultsBuilder {
|
|
|
347
533
|
namespace: orgDetails.packageDetails.namespace,
|
|
348
534
|
dataModel: orgDetails.dataModel,
|
|
349
535
|
},
|
|
350
|
-
assessmentDate: new Date().
|
|
536
|
+
assessmentDate: new Date().toLocaleString(),
|
|
351
537
|
summaryItems: [
|
|
352
538
|
...results.map((result) => {
|
|
353
|
-
var _a;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
539
|
+
var _a, _b;
|
|
540
|
+
// Handle custom labels specially for pagination and status calculation
|
|
541
|
+
if (result.name.toLowerCase().includes('custom labels')) {
|
|
542
|
+
const totalLabels = ((_a = result.data) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
543
|
+
const totalPages = Math.ceil(totalLabels / 1000);
|
|
544
|
+
const fileName = totalPages > 1 ? `Custom_Labels_Page_1_of_${totalPages}.html` : 'Custom_Labels.html';
|
|
545
|
+
return {
|
|
546
|
+
name: result.name,
|
|
547
|
+
total: totalLabels,
|
|
548
|
+
data: this.getCustomLabelStatusData(result.data),
|
|
549
|
+
file: fileName,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
return {
|
|
553
|
+
name: `${(0, stringUtils_1.getMigrationHeading)(result.name)}`,
|
|
554
|
+
total: ((_b = result.data) === null || _b === void 0 ? void 0 : _b.length) || 0,
|
|
357
555
|
data: this.getDifferentStatusDataForResult(result.data),
|
|
358
556
|
file: result.name.replace(/ /g, '_').replace(/\//g, '_') + '.html',
|
|
359
|
-
}
|
|
557
|
+
};
|
|
360
558
|
}),
|
|
361
|
-
|
|
362
|
-
name: 'Apex File Migration',
|
|
363
|
-
total: ((_a = relatedObjectMigrationResult.apexAssessmentInfos) === null || _a === void 0 ? void 0 : _a.length) || 0,
|
|
364
|
-
data: this.getDifferentStatusDataForApex(relatedObjectMigrationResult.apexAssessmentInfos),
|
|
365
|
-
file: apexFileName,
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
name: 'ExperienceSites',
|
|
369
|
-
total: ((_b = relatedObjectMigrationResult.experienceSiteAssessmentInfos) === null || _b === void 0 ? void 0 : _b.length) || 0,
|
|
370
|
-
data: this.getDifferentStatusDataForApex(relatedObjectMigrationResult.experienceSiteAssessmentInfos),
|
|
371
|
-
file: experienceSiteFileName,
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
name: 'Flexipage',
|
|
375
|
-
total: ((_c = relatedObjectMigrationResult.flexipageAssessmentInfos) === null || _c === void 0 ? void 0 : _c.length) || 0,
|
|
376
|
-
data: this.getDifferentStatusDataForFlexipage(relatedObjectMigrationResult.flexipageAssessmentInfos),
|
|
377
|
-
file: flexipageFileName,
|
|
378
|
-
},
|
|
559
|
+
...relatedObjectSummaryItems,
|
|
379
560
|
],
|
|
380
561
|
actionItems,
|
|
381
562
|
mode: 'migrate',
|
|
@@ -389,49 +570,127 @@ class ResultsBuilder {
|
|
|
389
570
|
let error = 0;
|
|
390
571
|
let skip = 0;
|
|
391
572
|
data.forEach((item) => {
|
|
392
|
-
if (item.status === '
|
|
573
|
+
if (item.status === 'Successfully migrated')
|
|
393
574
|
complete++;
|
|
394
|
-
if (item.status === '
|
|
575
|
+
if (item.status === 'Failed')
|
|
395
576
|
error++;
|
|
396
577
|
if (item.status === 'Skipped')
|
|
397
578
|
skip++;
|
|
398
579
|
});
|
|
399
580
|
return [
|
|
400
|
-
{ name: 'Successfully
|
|
401
|
-
{ name: '
|
|
402
|
-
{ name: '
|
|
581
|
+
{ name: 'Successfully migrated', count: complete, cssClass: 'text-success' },
|
|
582
|
+
{ name: 'Skipped', count: skip, cssClass: 'text-error' },
|
|
583
|
+
{ name: 'Failed', count: error, cssClass: 'text-error' },
|
|
584
|
+
];
|
|
585
|
+
}
|
|
586
|
+
static getCustomLabelStatusData(data) {
|
|
587
|
+
let created = 0;
|
|
588
|
+
let error = 0;
|
|
589
|
+
let duplicate = 0;
|
|
590
|
+
data.forEach((item) => {
|
|
591
|
+
// Handle both old and new status formats
|
|
592
|
+
const status = item.status || item.cloneStatus;
|
|
593
|
+
if (status === 'created' || status === 'Complete')
|
|
594
|
+
created++;
|
|
595
|
+
else if (status === 'error' || status === 'Error')
|
|
596
|
+
error++;
|
|
597
|
+
else if (status === 'duplicate' || status === 'Skipped')
|
|
598
|
+
duplicate++;
|
|
599
|
+
});
|
|
600
|
+
return [
|
|
601
|
+
{ name: 'Created', count: created, cssClass: 'text-success' },
|
|
602
|
+
{ name: 'Failed', count: error, cssClass: 'text-error' },
|
|
603
|
+
{ name: 'Duplicate', count: duplicate, cssClass: 'text-warning' },
|
|
403
604
|
];
|
|
404
605
|
}
|
|
405
606
|
static getDifferentStatusDataForApex(data) {
|
|
406
607
|
let complete = 0;
|
|
407
608
|
let error = 0;
|
|
408
609
|
data.forEach((item) => {
|
|
409
|
-
if (
|
|
610
|
+
if (this.getStatusFromErrors(item.errors) === 'Successfully migrated')
|
|
410
611
|
complete++;
|
|
411
612
|
else
|
|
412
613
|
error++;
|
|
413
614
|
});
|
|
414
615
|
return [
|
|
415
|
-
{ name: 'Successfully
|
|
416
|
-
{ name: '
|
|
616
|
+
{ name: 'Successfully migrated', count: complete, cssClass: 'text-success' },
|
|
617
|
+
{ name: 'Skipped', count: 0, cssClass: 'text-error' },
|
|
618
|
+
{ name: 'Failed', count: error, cssClass: 'text-error' },
|
|
417
619
|
];
|
|
418
620
|
}
|
|
419
621
|
static getDifferentStatusDataForFlexipage(data) {
|
|
622
|
+
let completed = 0;
|
|
623
|
+
let skipped = 0;
|
|
624
|
+
let failed = 0;
|
|
625
|
+
data.forEach((item) => {
|
|
626
|
+
if (item.status === 'Successfully migrated')
|
|
627
|
+
completed++;
|
|
628
|
+
else if (item.status === 'Skipped')
|
|
629
|
+
skipped++;
|
|
630
|
+
else
|
|
631
|
+
failed++;
|
|
632
|
+
});
|
|
633
|
+
return [
|
|
634
|
+
{ name: 'Successfully migrated', count: completed, cssClass: 'text-success' },
|
|
635
|
+
{ name: 'Skipped', count: skipped, cssClass: 'text-error' },
|
|
636
|
+
{ name: 'Failed', count: failed, cssClass: 'text-error' },
|
|
637
|
+
];
|
|
638
|
+
}
|
|
639
|
+
static getDifferentStatusDataForLwc(data) {
|
|
420
640
|
let completed = 0;
|
|
421
641
|
let failed = 0;
|
|
422
642
|
data.forEach((item) => {
|
|
423
|
-
if (item.
|
|
643
|
+
if (this.getStatusFromErrors(item.errors) === 'Successfully migrated')
|
|
424
644
|
completed++;
|
|
425
645
|
else
|
|
426
646
|
failed++;
|
|
427
647
|
});
|
|
428
648
|
return [
|
|
429
|
-
{ name: '
|
|
649
|
+
{ name: 'Successfully migrated', count: completed, cssClass: 'text-success' },
|
|
650
|
+
{ name: 'Skipped', count: 0, cssClass: 'text-error' },
|
|
430
651
|
{ name: 'Failed', count: failed, cssClass: 'text-error' },
|
|
431
652
|
];
|
|
432
653
|
}
|
|
654
|
+
static getDifferentStatusDataForExperienceSites(data) {
|
|
655
|
+
let completed = 0;
|
|
656
|
+
let skipped = 0;
|
|
657
|
+
let failed = 0;
|
|
658
|
+
data.forEach((item) => {
|
|
659
|
+
if (item.status === 'Successfully migrated')
|
|
660
|
+
completed++;
|
|
661
|
+
else if (item.status === 'Skipped')
|
|
662
|
+
skipped++;
|
|
663
|
+
else
|
|
664
|
+
failed++;
|
|
665
|
+
});
|
|
666
|
+
return [
|
|
667
|
+
{ name: 'Successfully migrated', count: completed, cssClass: 'text-success' },
|
|
668
|
+
{ name: 'Skipped', count: skipped, cssClass: 'text-error' },
|
|
669
|
+
{ name: 'Failed', count: failed, cssClass: 'text-error' },
|
|
670
|
+
];
|
|
671
|
+
}
|
|
672
|
+
static getStatusFilterGroup(statuses) {
|
|
673
|
+
const statusSet = new Set(statuses);
|
|
674
|
+
if (statusSet.size === 0)
|
|
675
|
+
return [];
|
|
676
|
+
return [(0, reportUtil_1.createFilterGroupParam)('Filter by Status', 'status', Array.from(statusSet))];
|
|
677
|
+
}
|
|
678
|
+
static getStatusFromErrors(errors) {
|
|
679
|
+
if (errors && errors.length > 0)
|
|
680
|
+
return 'Failed';
|
|
681
|
+
return 'Successfully migrated';
|
|
682
|
+
}
|
|
683
|
+
static getStatusCssClass(errors, neutralSuccess = false) {
|
|
684
|
+
if (errors && errors.length > 0)
|
|
685
|
+
return 'text-error';
|
|
686
|
+
if (neutralSuccess)
|
|
687
|
+
return '';
|
|
688
|
+
return 'text-success';
|
|
689
|
+
}
|
|
433
690
|
}
|
|
434
691
|
exports.ResultsBuilder = ResultsBuilder;
|
|
435
692
|
ResultsBuilder.rowClass = 'data-row-';
|
|
436
693
|
ResultsBuilder.rowId = 0;
|
|
694
|
+
ResultsBuilder.experienceSiteFileSuffix = '.json';
|
|
695
|
+
ResultsBuilder.flexiPageFileSuffix = '.flexipage-meta.xml';
|
|
437
696
|
//# sourceMappingURL=index.js.map
|