Skip to content

Commit ee89dea

Browse files
authored
[MDiff] Add remote site information in HTML and JSON reports (#1405)
* [MDiff] Enhance metadata diff reports - ✨ Added new fields for website details in metadata diff - 📝 Updated HTML report to include website information - 🔧 Modified handlers to support new data model attributes - 🔍 Improved site visibility and creator tracking in comparisons * Add site metadata fields to diff handlers and tests - ✨ Introduced new metadata fields: dataModelVersion, websiteUrl, siteVisibility, creator, and createdOn in ExportMetadataDiffHandler, GenerateHtmlReportHandler, and ResyncMetadataDiffHandler. - 🧪 Updated tests in MetadataDiffSiteTreeItem to validate new fields and their handling of optional values. -Priyanshu
1 parent eaf8683 commit ee89dea

File tree

18 files changed

+646
-34
lines changed

18 files changed

+646
-34
lines changed

l10n/bundle.l10n.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,19 @@
387387
"Comparison Details": "Comparison Details",
388388
"Site Name:": "Site Name:",
389389
"Environment:": "Environment:",
390+
"Website ID:": "Website ID:",
391+
"Data Model:": "Data Model:",
392+
"Website URL:": "Website URL:",
393+
"Site Visibility:": "Site Visibility:",
394+
"Creator:": "Creator:",
395+
"Created On:": "Created On:",
390396
"Generated:": "Generated:",
391397
"Changed Files": "Changed Files",
392398
"(click to expand diff)": "(click to expand diff)",
393399
"Expand All": "Expand All",
394400
"Collapse All": "Collapse All",
401+
"All": "All",
402+
"No files in this category": "No files in this category",
395403
"Generated by": "Generated by",
396404
"Power Platform Tools VS Code Extension": "Power Platform Tools VS Code Extension",
397405
"Added Locally": "Added Locally",

loc/translations-export/vscode-powerplatform.xlf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
<source xml:lang="en">Adding {0} web file(s). Existing files will be skipped</source>
6969
<note>{0} represents the number of web files</note>
7070
</trans-unit>
71+
<trans-unit id="++CODE++a52ace420f2175d08b1577a1bea5445e36801229c074ef9ed6c55a73401fd9c2">
72+
<source xml:lang="en">All</source>
73+
</trans-unit>
7174
<trans-unit id="++CODE++8890e663481705393ed3b1b4642095a11329e21320824ed567e383a12ea888f4">
7275
<source xml:lang="en">All changed files are binary files (e.g., images) and cannot be displayed in the diff viewer. You can view them individually in the file tree.</source>
7376
</trans-unit>
@@ -307,6 +310,9 @@ Check the CodeQL extension panel for available queries.</source>
307310
<trans-unit id="++CODE++92a450b51c228fc0a45836a3cb66a77276511e8b1a48e237c97f27576695288d">
308311
<source xml:lang="en">Could not locate CodeQL CLI in global storage.</source>
309312
</trans-unit>
313+
<trans-unit id="++CODE++217ec8ef23f31be4473af7c3e69f7965308bd2284d53eba7daf17b791db5fc74">
314+
<source xml:lang="en">Created On:</source>
315+
</trans-unit>
310316
<trans-unit id="++CODE++47234b3978427950c2a4ef0161f6dc8484b7faf44b21d30616d5d019eebaafd8">
311317
<source xml:lang="en">Created PowerPages config file at {0} with default query suite: {1}</source>
312318
</trans-unit>
@@ -321,6 +327,9 @@ Check the CodeQL extension panel for available queries.</source>
321327
<source xml:lang="en">Creating {0}...</source>
322328
<note>{0} will be replaced by the entity type.</note>
323329
</trans-unit>
330+
<trans-unit id="++CODE++dc15ecabf1e2c1c145b8ccbc7ef53c0e9b2a90f18414ba9887c2ae9aaa6575cd">
331+
<source xml:lang="en">Creator:</source>
332+
</trans-unit>
324333
<trans-unit id="++CODE++ec8fd606d46114985d2f628dc67992093b8abb32489b3cbbfbb86bba96925943">
325334
<source xml:lang="en">Creator: {0}</source>
326335
<note>{0} is the creator</note>
@@ -334,6 +343,9 @@ Check the CodeQL extension panel for available queries.</source>
334343
<trans-unit id="++CODE++52587c2a224d685113316dc5961aec7749a46dded161bfe07c40b715ca61db29">
335344
<source xml:lang="en">Current site path not found. Please ensure you have a site folder open.</source>
336345
</trans-unit>
346+
<trans-unit id="++CODE++ec1f0e40eb1d8b21b1c3e73679727c461ad9922cea5648859e5446ded7f9c97f">
347+
<source xml:lang="en">Data Model:</source>
348+
</trans-unit>
337349
<trans-unit id="++CODE++e159063579c9e875ce444b930e8feb5d4fc1a93af6acb47d7a5cf9d5c5241153">
338350
<source xml:lang="en">Data model version: {0}</source>
339351
<note>{0} is the data model version</note>
@@ -806,6 +818,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
806818
<trans-unit id="++CODE++80266a1ea7e6671d65c98a0624c254f5b9acfacddd05d69524b7f034eeba3268">
807819
<source xml:lang="en">No environments found</source>
808820
</trans-unit>
821+
<trans-unit id="++CODE++5f22b9670e54200b4ccdea959012a4670d9346315793eefd80e4290571492262">
822+
<source xml:lang="en">No files in this category</source>
823+
</trans-unit>
809824
<trans-unit id="++CODE++e75c23acb3f88e840f326048df92fcfd3350ec3b775a5c51e6ff6754f0f9f7a1">
810825
<source xml:lang="en">No issues found!</source>
811826
</trans-unit>
@@ -1093,6 +1108,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
10931108
<trans-unit id="++CODE++b7cc9930c5fbe6d45071fbce87e513399eda01d1be3cdcaa8c5c1426e98e8066">
10941109
<source xml:lang="en">Site Name:</source>
10951110
</trans-unit>
1111+
<trans-unit id="++CODE++4b7de12dbef5cc145cf5b8b08743a60d279d6ee27b8b13470e5f06bc21153867">
1112+
<source xml:lang="en">Site Visibility:</source>
1113+
</trans-unit>
10961114
<trans-unit id="++CODE++4fa72d80ab1b04e31f450bacc89bff526a5e52e3d104d153b3b493b108330b3c">
10971115
<source xml:lang="en">Site download cancelled. Authentication is required to proceed.</source>
10981116
</trans-unit>
@@ -1320,10 +1338,16 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
13201338
<trans-unit id="++CODE++a70c63db9e2d7ceb9f17f00065db00262718561d9330fbef203aba4acbf57d7b">
13211339
<source xml:lang="en">Website ID not found. Please ensure you have a valid Power Pages site open.</source>
13221340
</trans-unit>
1341+
<trans-unit id="++CODE++f61a5b01e081338759cfc22a2b8afcc35ab7a22a36585efe93fc1ac2a5afe124">
1342+
<source xml:lang="en">Website ID:</source>
1343+
</trans-unit>
13231344
<trans-unit id="++CODE++d3eaa7bf5377b15781ad4c0f43e4da94b9a2bd485ddbbbe62a2c3d53c5c7fe4a">
13241345
<source xml:lang="en">Website Id: {0}</source>
13251346
<note>{0} is the website ID</note>
13261347
</trans-unit>
1348+
<trans-unit id="++CODE++337c1eee64c216207c0df5634e89e0f1216a96d5430e57344a797452d8627757">
1349+
<source xml:lang="en">Website URL:</source>
1350+
</trans-unit>
13271351
<trans-unit id="++CODE++4f5909ac007d8a897ec18ede71cdf8f6b4af3bbe78bae2f13871d50a3cebb3f6">
13281352
<source xml:lang="en">Website Url: {0}</source>
13291353
<note>{0} is the website Url</note>

src/client/power-pages/actions-hub/Constants.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,20 @@ export const Constants = {
210210
HTML_REPORT_COMPARISON_DETAILS: vscode.l10n.t("Comparison Details"),
211211
HTML_REPORT_SITE_NAME_LABEL: vscode.l10n.t("Site Name:"),
212212
HTML_REPORT_ENVIRONMENT_LABEL: vscode.l10n.t("Environment:"),
213+
HTML_REPORT_WEBSITE_ID_LABEL: vscode.l10n.t("Website ID:"),
214+
HTML_REPORT_DATA_MODEL_LABEL: vscode.l10n.t("Data Model:"),
215+
HTML_REPORT_WEBSITE_URL_LABEL: vscode.l10n.t("Website URL:"),
216+
HTML_REPORT_SITE_VISIBILITY_LABEL: vscode.l10n.t("Site Visibility:"),
217+
HTML_REPORT_CREATOR_LABEL: vscode.l10n.t("Creator:"),
218+
HTML_REPORT_CREATED_ON_LABEL: vscode.l10n.t("Created On:"),
213219
HTML_REPORT_GENERATED_LABEL: vscode.l10n.t("Generated:"),
214220
HTML_REPORT_CHANGED_FILES: vscode.l10n.t("Changed Files"),
215221
HTML_REPORT_CLICK_TO_EXPAND: vscode.l10n.t("(click to expand diff)"),
216222
HTML_REPORT_EXPAND_ALL: vscode.l10n.t("Expand All"),
217223
HTML_REPORT_COLLAPSE_ALL: vscode.l10n.t("Collapse All"),
224+
// HTML Report tab labels
225+
HTML_REPORT_TAB_ALL: vscode.l10n.t("All"),
226+
HTML_REPORT_NO_FILES_IN_CATEGORY: vscode.l10n.t("No files in this category"),
218227
HTML_REPORT_GENERATED_BY: vscode.l10n.t("Generated by"),
219228
HTML_REPORT_EXTENSION_NAME: vscode.l10n.t("Power Platform Tools VS Code Extension"),
220229
// HTML Report status texts

src/client/power-pages/actions-hub/MetadataDiffContext.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import * as vscode from "vscode";
77
import { IFileComparisonResult, ISiteComparisonResults } from "./models/IFileComparisonResult";
8+
import { SiteVisibility } from "./models/SiteVisibility";
89

910
/**
1011
* Enum for metadata diff view modes
@@ -162,6 +163,10 @@ class MetadataDiffContextClass {
162163
* @param isImported Whether this is an imported comparison
163164
* @param exportedAt ISO 8601 timestamp when the comparison was exported (only for imported comparisons)
164165
* @param dataModelVersion The data model version of the site (1 = Standard, 2 = Enhanced)
166+
* @param websiteUrl The website URL
167+
* @param siteVisibility The site visibility (public, private, etc.)
168+
* @param creator The creator of the site
169+
* @param createdOn ISO 8601 timestamp when the site was created
165170
*/
166171
public setResults(
167172
results: IFileComparisonResult[],
@@ -172,7 +177,11 @@ class MetadataDiffContextClass {
172177
environmentId: string,
173178
isImported: boolean = false,
174179
exportedAt?: string,
175-
dataModelVersion?: 1 | 2
180+
dataModelVersion?: 1 | 2,
181+
websiteUrl?: string,
182+
siteVisibility?: SiteVisibility,
183+
creator?: string,
184+
createdOn?: string
176185
): void {
177186
const key = this.getUniqueKey(websiteId, environmentId, isImported);
178187
if (results.length > 0) {
@@ -185,7 +194,11 @@ class MetadataDiffContextClass {
185194
comparisonResults: results,
186195
isImported,
187196
exportedAt,
188-
dataModelVersion
197+
dataModelVersion,
198+
websiteUrl,
199+
siteVisibility,
200+
creator,
201+
createdOn
189202
});
190203
} else {
191204
// If no results, remove the site from the map

src/client/power-pages/actions-hub/handlers/metadata-diff/CompareWithEnvironmentHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ export const compareWithEnvironment = (pacTerminal: PacTerminal, context: vscode
331331
Constants.EventNames.ACTIONS_HUB_COMPARE_WITH_ENVIRONMENT_NO_DIFFERENCES,
332332
siteResolution.comparisonSubPath,
333333
selectedOrgInfo.EnvironmentId,
334-
dataModelVersion
334+
dataModelVersion,
335+
websiteDetails.websiteUrl,
336+
websiteDetails.siteVisibility,
337+
websiteDetails.creator,
338+
websiteDetails.createdOn
335339
);
336340

337341
if (hasDifferences) {

src/client/power-pages/actions-hub/handlers/metadata-diff/CompareWithLocalHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ export const compareWithLocal = (pacTerminal: PacTerminal, context: vscode.Exten
9898
Constants.EventNames.ACTIONS_HUB_COMPARE_WITH_LOCAL_NO_DIFFERENCES,
9999
undefined, // comparisonSubPath
100100
undefined, // environmentId - will use current context
101-
siteTreeItem.siteInfo.dataModelVersion
101+
siteTreeItem.siteInfo.dataModelVersion,
102+
siteTreeItem.siteInfo.websiteUrl,
103+
siteTreeItem.siteInfo.siteVisibility,
104+
siteTreeItem.siteInfo.creator,
105+
siteTreeItem.siteInfo.createdOn
102106
);
103107

104108
if (hasDifferences) {

src/client/power-pages/actions-hub/handlers/metadata-diff/ExportMetadataDiffHandler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export async function exportMetadataDiff(siteTreeItem: MetadataDiffSiteTreeItem)
106106
environmentId: siteTreeItem.environmentId,
107107
environmentName: siteTreeItem.environmentName,
108108
localSiteName: siteTreeItem.localSiteName,
109+
dataModelVersion: siteTreeItem.dataModelVersion,
110+
websiteUrl: siteTreeItem.websiteUrl,
111+
siteVisibility: siteTreeItem.siteVisibility,
112+
creator: siteTreeItem.creator,
113+
createdOn: siteTreeItem.createdOn,
109114
files
110115
};
111116

0 commit comments

Comments
 (0)