Skip to content

Commit 87d2857

Browse files
authored
[MDiff] Update metadata diff handlers and tests (#1376)
* [Mdiff] Update metadata diff handlers and tests - Show full path of the local file in tooltip and in discard changes dialog - When "Comparing with Environment", show the list of websites for the selected environment. Show a confirmation when user selects a site different from current site. - Remove the current environment name from environment list which is connected in Actions Hub - Add a subtext for the website in website quickpick if it exists in the environment. - Add time taken to download the site in telemetry - "Compare with Environment" is for contextual comparison. Only the folder which is right clicked by user is shown in comparison view - When viewing as tree, show all the folders first by alphabetical order and then all the files in alphabetical order. - Priyanshu * [MDiff] Add HTML report generation for metadata diff (#1377) * [MDiff] Add HTML report generation for metadata diff This update introduces functionality to generate and download an HTML report for metadata differences in Power Pages. - ✨ Added command to generate HTML report in the actions hub. - 📝 Implemented HTML report generation logic in a new handler. - 🎨 Created a detailed HTML template for the report with styling. - 🔧 Updated package and localization files to support new features. - ✅ Added integration and unit tests for the new functionality. -Priyanshu * [MDiff] Add new metadata diff commands - ✨ Added commands for opening files and all metadata diffs - ✨ Included commands for clearing and removing sites - ✨ Implemented sorting options for metadata diffs - ✨ Added command to generate HTML report for metadata diffs -Priyanshu * [MDiff] Add export and import support for metadata diff (#1379) * [MDiff] Add export and import support for metadata diff - 🆕 Added `ExportMetadataDiffHandler` tests to validate file export functionality. - 🔄 Updated `ClearMetadataDiffHandler` and `GenerateHtmlReportHandler` tests to include website and environment IDs. - 🆕 Introduced `ImportMetadataDiffHandler` tests for file import functionality. - 🔄 Refactored `OpenAllMetadataDiffsHandler` tests to utilize a helper function for creating site results. - 🔄 Enhanced `OpenMetadataDiffFileHandler` tests to include telemetry for imported comparisons. - 🔄 Updated `MetadataDiffFileTreeItem` and `MetadataDiffSiteTreeItem` tests to validate new properties and behaviors. - 🔄 Adjusted `MetadataDiffGroupTreeItem` tests to include website and environment IDs in context. -Priyanshu * [MDiff] Add resync functionality for metadata comparisons (#1380) * [MDiff] Add resync functionality for metadata comparisons ✨ Implemented resync command to refresh site comparisons. 📝 Updated localization files for new messages. 🔧 Registered resync command in ActionsHub. ✅ Added tests for resync functionality and edge cases. -Priyanshu * Add clipboard functionality to environment and site details - ✨ Implemented clipboard mock for testing in ShowEnvironmentDetailsHandler and ShowSiteDetailsHandler. - 🔄 Updated tests to check clipboard interactions when showing environment and site details. - 📝 Adjusted mockShowInformationMessage responses to handle undefined cases. -Priyanshu * Add data model version support for metadata diff - ✨ Introduced `dataModelVersion` parameter in relevant functions and interfaces. - 🔧 Updated `setResults`, `processComparisonResults`, and comparison handlers to utilize the new parameter. - 📦 Enhanced `MetadataDiffSiteTreeItem` to store and retrieve the data model version. -Priyanshu * Add site clearing logic for resync completion - ✨ Implemented logic to clear site from MetadataDiffContext when no differences are found after resync. - 🔧 Updated tests to verify the new behavior for both scenarios: with and without differences. -Priyanshu * Improve UI responsiveness for no differences notification - 🚀 Show notification without blocking UI updates - 🔧 Adjusted await behavior in processComparisonResults -Priyanshu * Refactor telemetry event names for metadata diff 🎨 Updated telemetry event names to include "Called" suffix for clarity. 🔧 Adjusted corresponding traceInfo calls in handlers and tests. 🧪 Modified tests to reflect changes in telemetry event names. -Priyanshu * Add metadata diff export/import error handling ✨ Add constants for metadata diff export title and error messages. 🔧 Update exportMetadataDiff to use new error handling constants. 🔧 Update importMetadataDiff to use new error handling constants. -Priyanshu
1 parent e98177c commit 87d2857

File tree

44 files changed

+5045
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5045
-266
lines changed

l10n/bundle.l10n.json

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@
242242
"Session Details": "Session Details",
243243
"Changing environment...": "Changing environment...",
244244
"Current": "Current",
245+
"Local": "Local",
246+
"Local Site": "Local Site",
245247
"Site management URL not found for the selected site. Please try again after refreshing the environment.": "Site management URL not found for the selected site. Please try again after refreshing the environment.",
246248
"Be careful when you're updating public sites. The changes you make are visible to anyone immediately. Do you want to continue?": "Be careful when you're updating public sites. The changes you make are visible to anyone immediately. Do you want to continue?",
247249
"Current site path not found.": "Current site path not found.",
@@ -345,17 +347,79 @@
345347
"Deleted locally": "Deleted locally",
346348
"Download is complete. You can now view the report.": "Download is complete. You can now view the report.",
347349
"Select an environment to compare with": "Select an environment to compare with",
350+
"Select a website to compare with": "Select a website to compare with",
351+
"No sites found in the selected environment.": "No sites found in the selected environment.",
352+
"Matching Site": "Matching Site",
353+
"Enhanced Data Model": "Enhanced Data Model",
354+
"Standard Data Model": "Standard Data Model",
355+
"The website you selected is different from the local site. Are you sure you want to compare with this website?": "The website you selected is different from the local site. Are you sure you want to compare with this website?",
356+
"Yes, Don't Ask Again": "Yes, Don't Ask Again",
348357
"The website was not found in the selected environment. Please select a different environment.": "The website was not found in the selected environment. Please select a different environment.",
349-
"Fetching websites from the selected environment...": "Fetching websites from the selected environment...",
350358
"Discard Changes": "Discard Changes",
351359
"Show Diff": "Show Diff",
352360
"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.": "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.",
361+
"1 file changed": "1 file changed",
362+
"Save Report": "Save Report",
363+
"Save HTML Report": "Save HTML Report",
364+
"Open Report": "Open Report",
365+
"Metadata Diff Report": "Metadata Diff Report",
366+
"Power Pages Site Comparison Results": "Power Pages Site Comparison Results",
367+
"Total Changes": "Total Changes",
368+
"Added": "Added",
369+
"Deleted": "Deleted",
370+
"Comparison Details": "Comparison Details",
371+
"Site Name:": "Site Name:",
372+
"Environment:": "Environment:",
373+
"Generated:": "Generated:",
374+
"Changed Files": "Changed Files",
375+
"(click to expand diff)": "(click to expand diff)",
376+
"Expand All": "Expand All",
377+
"Collapse All": "Collapse All",
378+
"Generated by": "Generated by",
379+
"Power Platform Tools VS Code Extension": "Power Platform Tools VS Code Extension",
380+
"Added Locally": "Added Locally",
381+
"Deleted Locally": "Deleted Locally",
382+
"Unknown": "Unknown",
383+
"Binary file - content comparison not available": "Binary file - content comparison not available",
384+
"Unable to read file contents": "Unable to read file contents",
385+
"Unable to read local file": "Unable to read local file",
386+
"Unable to read remote file": "Unable to read remote file",
387+
"Unable to read one or both files": "Unable to read one or both files",
388+
"Exporting comparison...": "Exporting comparison...",
389+
"Importing comparison...": "Importing comparison...",
390+
"Invalid file format. The file does not contain valid metadata diff data.": "Invalid file format. The file does not contain valid metadata diff data.",
391+
"Unsupported version. This file was created with a newer version of the extension.": "Unsupported version. This file was created with a newer version of the extension.",
392+
"This file was exported with a newer version of the extension. Please update your extension to import this file.": "This file was exported with a newer version of the extension. Please update your extension to import this file.",
393+
"Metadata Diff JSON": "Metadata Diff JSON",
394+
"Binary file content is not available in imported comparisons. The original file was not included in the export.": "Binary file content is not available in imported comparisons. The original file was not included in the export.",
395+
"An imported comparison already exists for this site. Do you want to replace it?": "An imported comparison already exists for this site. Do you want to replace it?",
396+
"Replace": "Replace",
397+
"Comparison has been refreshed with the latest data from the environment.": "Comparison has been refreshed with the latest data from the environment.",
398+
"Cannot refresh an imported comparison. Import a new file or run a new comparison.": "Cannot refresh an imported comparison. Import a new file or run a new comparison.",
399+
"Fetching websites from '{0}'.../Message shown while fetching websites from an environment. {0} is the environment name.": {
400+
"message": "Fetching websites from '{0}'...",
401+
"comment": [
402+
"Message shown while fetching websites from an environment. {0} is the environment name."
403+
]
404+
},
353405
"Downloading {0} site metadata ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show download output\")).../This is a markdown formatting which must persist across translations.": {
354406
"message": "Downloading {0} site metadata ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show download output\"))...",
355407
"comment": [
356408
"This is a markdown formatting which must persist across translations."
357409
]
358410
},
411+
"{0} ({1}) ↔ {2} (Local)/Comparison label showing remote and local sites. Format: 'Remote (Env) ↔ Local (Local)'.": {
412+
"message": "{0} ({1}) ↔ {2} (Local)",
413+
"comment": [
414+
"Comparison label showing remote and local sites. Format: 'Remote (Env) ↔ Local (Local)'."
415+
]
416+
},
417+
"{0} files changed/Description showing the number of changed files. 'files' is plural.": {
418+
"message": "{0} files changed",
419+
"comment": [
420+
"Description showing the number of changed files. 'files' is plural."
421+
]
422+
},
359423
"{0} ({1} file)/This is the site label showing the number of changed files. 'file' is singular.": {
360424
"message": "{0} ({1} file)",
361425
"comment": [
@@ -416,6 +480,48 @@
416480
"Message shown when binary files are skipped in the multi-diff view."
417481
]
418482
},
483+
"HTML report saved successfully to '{0}'./Success message when HTML report is saved. {0} is the file path.": {
484+
"message": "HTML report saved successfully to '{0}'.",
485+
"comment": [
486+
"Success message when HTML report is saved. {0} is the file path."
487+
]
488+
},
489+
"Failed to generate HTML report: {0}/Error message when HTML report generation fails. {0} is the error message.": {
490+
"message": "Failed to generate HTML report: {0}",
491+
"comment": [
492+
"Error message when HTML report generation fails. {0} is the error message."
493+
]
494+
},
495+
"{0} files changed (Imported {1})/Description for imported comparison. {0} is file count, {1} is formatted date.": {
496+
"message": "{0} files changed (Imported {1})",
497+
"comment": [
498+
"Description for imported comparison. {0} is file count, {1} is formatted date."
499+
]
500+
},
501+
"Missing required field: {0}/Error when importing a file that is missing a required field.": {
502+
"message": "Missing required field: {0}",
503+
"comment": [
504+
"Error when importing a file that is missing a required field."
505+
]
506+
},
507+
"Comparison exported successfully to '{0}'./Success message when export is saved. {0} is the file path.": {
508+
"message": "Comparison exported successfully to '{0}'.",
509+
"comment": [
510+
"Success message when export is saved. {0} is the file path."
511+
]
512+
},
513+
"Comparison for '{0}' imported successfully./Success message when import is complete. {0} is the site name.": {
514+
"message": "Comparison for '{0}' imported successfully.",
515+
"comment": [
516+
"Success message when import is complete. {0} is the site name."
517+
]
518+
},
519+
"Refreshing comparison for {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show download output\")).../This is a markdown formatting which must persist across translations.": {
520+
"message": "Refreshing comparison for {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel \"Show download output\"))...",
521+
"comment": [
522+
"This is a markdown formatting which must persist across translations."
523+
]
524+
},
419525
"Friendly name: {0}/{0} is the website name": {
420526
"message": "Friendly name: {0}",
421527
"comment": [
@@ -524,6 +630,10 @@
524630
"{0} is the cluster geo name"
525631
]
526632
},
633+
"Import Metadata Diff": "Import Metadata Diff",
634+
"Failed to import comparison: {0}": "Failed to import comparison: {0}",
635+
"Export Metadata Diff": "Export Metadata Diff",
636+
"Failed to export comparison: {0}": "Failed to export comparison: {0}",
527637
"Power Platform Tools: PAC CLI": "Power Platform Tools: PAC CLI",
528638
"Command completed successfully.": "Command completed successfully.",
529639
"PAC Telemetry enabled": "PAC Telemetry enabled",

0 commit comments

Comments
 (0)