Skip to content

Commit 1f046e3

Browse files
Merge pull request #449 from sf-aastha-paruthi/u/aparuthi/globalautonumberreportchanges
Global Auto Number report update and version name update
2 parents 423b0e2 + 3438148 commit 1f046e3

File tree

14 files changed

+1385
-154
lines changed

14 files changed

+1385
-154
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-omnistudio-migration-tool",
33
"description": "This SFDX plugin migrates FlexCard, OmniScript, DataRaptor, and Integration Procedure custom objects to standard objects.",
4-
"version": "2.0.0-dev.9",
4+
"version": "2.0.0-dev.9-preview",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {

src/commands/omnistudio/migration/assess.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { ProjectPathUtil } from '../../../utils/projectPathUtil';
2020
import { PreMigrate } from '../../../migration/premigrate';
2121
import { PostMigrate } from '../../../migration/postMigrate';
2222
import { CustomLabelsUtil } from '../../../utils/customLabels';
23-
import { initializeDataModelService, isFoundationPackage } from '../../../utils/dataModelService';
23+
import { initializeDataModelService, isFoundationPackage, isStandardDataModel } from '../../../utils/dataModelService';
2424

2525
import { ValidatorService } from '../../../utils/validatorService';
2626

@@ -97,8 +97,7 @@ export default class Assess extends OmniStudioBaseCommand {
9797
const preMigrate: PreMigrate = new PreMigrate(namespace, conn, this.logger, messages, this.ux);
9898

9999
// Handle all versions prerequisite for standard data model
100-
if (
101-
DataModel()) {
100+
if (isStandardDataModel()) {
102101
allVersions = await preMigrate.handleAllVersionsPrerequisites(allVersions);
103102
}
104103
if (relatedObjects) {

src/templates/assessmentReport.template

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,13 @@
7373
<div class="label-value">{{org.dataModel}}</div>
7474
</div>
7575

76-
<div class="org-details-section">
77-
<div class="label-key">Assessment Date and Time</div>
78-
<div class="label-value">{{assessmentDate}}</div>
79-
</div>
76+
<div class="org-details-section">
77+
<div class="label-key">Assessment Date and Time</div>
78+
<div class="label-value">{{assessmentDate}}</div>
8079
</div>
80+
</div>
8181

82-
<c:if exp={$notSupportedMessage}>
83-
<div class="slds-box slds-m-top_medium" style="text-align: center; padding: 40px 20px; background-color: #f3f2f2; border: 2px solid #c9c7c5;">
84-
<div class="slds-text-heading_medium" style="color: #3e3e3c; font-weight: bold; margin-bottom: 8px;">
85-
Feature Not Supported
86-
</div>
87-
<div style="color: #3e3e3c; font-size: 16px;">
88-
{{notSupportedMessage}}
89-
</div>
90-
</div>
91-
</c:if>
92-
93-
<c:if exp={!$notSupportedMessage}>
94-
<div class="filter-dropdown-container">
82+
<div class="filter-dropdown-container">
9583
<div class="filter-header-bar">
9684
<!-- Row count display -->
9785
<div class="row-count-display" id="row-count">Loading Records...</div>
@@ -246,7 +234,6 @@
246234
</div>
247235
</c:if>
248236
</div>
249-
</c:if>
250237
</div>
251238
<div id="cta-summary-panel" class="cta-summary-panel hidden">
252239
<div class="cta-header">

src/templates/dashboard.template

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,28 @@
6969
<div class="slds-box slds-box_small slds-box_body-spacing">
7070
<div class="detail-row">
7171
<div class="detail-item slds-text-heading_medium">{{summary.name}}</div>
72-
<div class="detail-item slds-text-heading_medium">{{summary.total}}</div>
72+
<c:if exp={$summary.showDetails !== false}>
73+
<div class="detail-item slds-text-heading_medium">{{summary.total}}</div>
74+
</c:if>
7375
</div>
7476
<hr />
7577
<c:for items=(summary.data) var="item">
7678
<div class="detail-row">
7779
<div class="detail-item">{{item.name}}</div>
78-
<div class="(item.cssClass)">{{item.count}}</div>
80+
<c:if exp={$summary.showDetails !== false}>
81+
<div class="(item.cssClass)">{{item.count}}</div>
82+
</c:if>
7983
</div>
8084
</c:for>
8185

82-
<div class="detail-row card-footer">
83-
<button class="slds-button_stretch slds-button slds-button_neutral" data-summary="(summary.file)"
84-
onclick="openReport(this)">
85-
View Report
86-
</button>
87-
</div>
86+
<c:if exp={$summary.showDetails !== false}>
87+
<div class="detail-row card-footer">
88+
<button class="slds-button_stretch slds-button slds-button_neutral" data-summary="(summary.file)"
89+
onclick="openReport(this)">
90+
View Report
91+
</button>
92+
</div>
93+
</c:if>
8894
</div>
8995
</c:for>
9096
</div>

src/templates/migrationReport.template

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,6 @@
4343
</div>
4444
</div>
4545

46-
<c:if exp={$notSupportedMessage}>
47-
<div class="slds-box slds-m-top_medium" style="text-align: center; padding: 40px 20px; background-color: #f3f2f2; border: 2px solid #c9c7c5;">
48-
<div class="slds-text-heading_medium" style="color: #3e3e3c; font-weight: bold; margin-bottom: 8px;">
49-
Feature Not Supported
50-
</div>
51-
<div style="color: #3e3e3c; font-size: 16px;">
52-
{{notSupportedMessage}}
53-
</div>
54-
</div>
55-
</c:if>
56-
57-
<c:if exp={!$notSupportedMessage}>
5846
<c:if exp={$filterGroups.length>0}>
5947
<div class="filter-dropdown-container">
6048
<div class="filter-header-bar">
@@ -359,7 +347,6 @@
359347
</div>
360348
</div>
361349
</c:if>
362-
</c:if>
363350
</div>
364351
</div>
365352
</body>

src/utils/reportGenerator/reportInterfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface SummaryItemParam {
1616
total: number;
1717
data: SummaryItemDetailParam[];
1818
file: string;
19+
showDetails?: boolean; // Set to false to hide counts and view report button
1920
}
2021

2122
export interface SummaryItemDetailParam {
@@ -93,5 +94,4 @@ export interface ReportParam {
9394
};
9495
props?: string;
9596
reportType?: string; // Used to identify specific report types like 'customlabels' for custom styling
96-
notSupportedMessage?: string; // Message to display when a feature is not supported
9797
}

src/utils/resultsbuilder/GlobalAutoNumberAssessmentReporter.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,16 @@ export class GlobalAutoNumberAssessmentReporter {
1818
public static getGlobalAutoNumberAssessmentData(
1919
globalAutoNumberAssessmentInfos: GlobalAutoNumberAssessmentInfo[],
2020
instanceUrl: string,
21-
omnistudioOrgDetails: OmnistudioOrgDetails,
22-
isFoundationPackage = false
21+
omnistudioOrgDetails: OmnistudioOrgDetails
2322
): ReportParam {
2423
Logger.captureVerboseData('GAN data', globalAutoNumberAssessmentInfos);
2524

26-
// Common fields for both supported and unsupported cases
27-
const baseReport: ReportParam = {
25+
return {
2826
title: 'Omni Global Auto Numbers Assessment Report',
2927
heading: 'Omni Global Auto Numbers Assessment Report',
3028
org: getOrgDetailsForReport(omnistudioOrgDetails),
3129
assessmentDate: new Date().toLocaleString(),
3230
reportType: 'globalautonumber',
33-
total: 0,
34-
filterGroups: [],
35-
headerGroups: [],
36-
rows: [],
37-
};
38-
39-
// If foundation package (OmniStudio package), show not supported message
40-
if (isFoundationPackage) {
41-
return {
42-
...baseReport,
43-
notSupportedMessage: 'Omni Global Auto Number is not supported in Omnistudio Foundation package orgs.',
44-
};
45-
}
46-
47-
// Add specific fields for supported orgs
48-
return {
49-
...baseReport,
5031
total: globalAutoNumberAssessmentInfos?.length || 0,
5132
filterGroups: this.getFilterGroupsForReport(globalAutoNumberAssessmentInfos),
5233
headerGroups: this.getHeaderGroupsForReport(),

src/utils/resultsbuilder/assessmentReporter.ts

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ export class AssessmentReporter {
134134
GlobalAutoNumberAssessmentReporter.getGlobalAutoNumberAssessmentData(
135135
result.globalAutoNumberAssessmentInfos,
136136
instanceUrl,
137-
omnistudioOrgDetails,
138-
false
137+
omnistudioOrgDetails
139138
),
140139
messages
141140
)
@@ -219,19 +218,21 @@ export class AssessmentReporter {
219218

220219
case Constants.GlobalAutoNumber:
221220
reports.push(Constants.GlobalAutoNumber);
222-
this.createDocument(
223-
path.join(this.basePath, this.globalAutoNumberAssessmentFileName),
224-
TemplateParser.generate(
225-
assessmentReportTemplate,
226-
GlobalAutoNumberAssessmentReporter.getGlobalAutoNumberAssessmentData(
227-
result.globalAutoNumberAssessmentInfos,
228-
instanceUrl,
229-
omnistudioOrgDetails,
230-
isFoundationPackage()
231-
),
232-
messages
233-
)
234-
);
221+
// Skip document creation for foundation package as feature is not supported
222+
if (!isFoundationPackage()) {
223+
this.createDocument(
224+
path.join(this.basePath, this.globalAutoNumberAssessmentFileName),
225+
TemplateParser.generate(
226+
assessmentReportTemplate,
227+
GlobalAutoNumberAssessmentReporter.getGlobalAutoNumberAssessmentData(
228+
result.globalAutoNumberAssessmentInfos,
229+
instanceUrl,
230+
omnistudioOrgDetails
231+
),
232+
messages
233+
)
234+
);
235+
}
235236
break;
236237

237238
case Constants.CustomLabel:
@@ -408,11 +409,16 @@ export class AssessmentReporter {
408409
});
409410
}
410411
if (reports.includes(Constants.GlobalAutoNumber)) {
412+
// Show "Feature not supported" for foundation package orgs
413+
const isFoundationPkg = omnistudioOrgDetails.isFoundationPackage;
411414
summaryItems.push({
412415
name: 'Omni Global Auto Numbers',
413-
total: result.globalAutoNumberAssessmentInfos.length,
414-
data: GlobalAutoNumberAssessmentReporter.getSummaryData(result.globalAutoNumberAssessmentInfos),
416+
total: isFoundationPkg ? 0 : result.globalAutoNumberAssessmentInfos.length,
417+
data: isFoundationPkg
418+
? [{ name: 'Feature not supported', count: 0, cssClass: 'text-warning' }]
419+
: GlobalAutoNumberAssessmentReporter.getSummaryData(result.globalAutoNumberAssessmentInfos),
415420
file: this.globalAutoNumberAssessmentFileName,
421+
...(isFoundationPkg && { showDetails: false }),
416422
});
417423
}
418424
if (reports.includes(Constants.Apex)) {

0 commit comments

Comments
 (0)