From 2686b5d35d151493ef83392fadc019103d5af0f8 Mon Sep 17 00:00:00 2001 From: Roberto T <61755417+RobertGlobant20@users.noreply.github.com> Date: Tue, 16 Aug 2022 00:45:02 -0500 Subject: [PATCH] Dyn 5106 webview2 documentation browser (#13212) * DYN-5106-WebView2-DocumentationBrowser I replaced the WebBrowser component by WebView2 in the file DocumentationBrowserView.xaml, also I added some functions for initializing WebView2, The method ShouldAllowNavigation was modified due that WebView2 doesn't have the Navigating event and also the event handler receive different parameters then modified the function to implement the same behavior than the previous one. Also I noticed that WebView2 CORS was blocking to load the jpg images that are shown for several nodes, then I had to create a mapped virtual directory in this way the html will be able to load the images and show them in the web page. Finally I removed a tag in all the html that was making the web page compatible for IE based browsers (due that now we are using WebView2 a Chromium based browser). * DYN-5106-WebView2-DocumentationBrowser Code Review Due that the fallback_doc directory path can change depending if Dynamo is executed as Sandbox or if is over Revit then the path can be different so I added a code that will create the virtual directory depending of the correct fallback_doc directory path. Also I modified the Md2Html class so now it will be inserting in the image source ( tab, then I updated the image to use the virtual folder and http. Co-authored-by: Aaron (Qilong) <173288704@qq.com> --- .../Docs/ArgumentNullException.html | 4 +- .../Docs/CustomNodeNotLoaded.html | 4 +- .../Docs/Deprecated.html | 4 +- .../Docs/DereferencingNonPointer.html | 4 +- .../Docs/ErrorPageTemplate.html | 4 +- .../Docs/ExcelNotInstalled.html | 4 +- .../Docs/FailedToCastFromNull.html | 4 +- .../Docs/FileNotFound.html | 4 +- .../Docs/IntegerOverflow.html | 4 +- .../Docs/InternalError.html | 4 +- .../Docs/InvalidArrayIndexType.html | 4 +- .../Docs/InvalidKeysLenghtErrorMessage.html | 4 +- .../Docs/MarkdownStyling.html | 4 +- .../Docs/MessageErrorOpeningFileGeneral.html | 4 +- .../MessageFailedToOpenCorruptedFile.html | 4 +- .../Docs/NoContent.html | 4 +- .../NonOverloadMethodResolutionError.html | 4 +- .../Docs/NothingIsSelectedWarning.html | 4 +- .../Docs/OperationFailType1.html | 4 +- .../Docs/RunCompletedWithWarningsMessage.html | 4 +- .../Docs/UnhandledException.html | 4 +- .../UnhandledExceptionInDynamoEngine.html | 4 +- ...GCoreCannotMakePolycurveFromEmptyList.html | 4 +- .../Docs/errorLibGCorePolycurveBranching.html | 4 +- ...errorLibGCorePolycurveMoreThanOneWIRE.html | 4 +- .../Docs/errorLibGCoreUnableToLoft.html | 4 +- ...errorLibGCoreUnableUpdateSolidBySweep.html | 4 +- .../Docs/kArrayOverIndexed.html | 4 +- .../Docs/kConvertArrayToNonArray.html | 4 +- .../Docs/kCyclicDependency.html | 4 +- .../Docs/kIndexOutOfRange.html | 4 +- .../Docs/kMethodHasInvalidArguments.html | 4 +- .../Docs/kMethodNotFound.html | 4 +- .../Docs/kMultipleSymbolFound.html | 4 +- .../Docs/kPropertyOfClassNotFound.html | 4 +- .../DocumentationBrowserView.xaml | 11 ++-- .../DocumentationBrowserView.xaml.cs | 50 +++++++++++++------ .../DocumentationBrowserViewExtension.cs | 22 ++++++++ .../DocumentationBrowserViewExtension.csproj | 3 ++ src/Tools/Md2Html/Md2Html.cs | 9 ++-- .../DocumentationBrowserViewExtensionTests.cs | 6 +-- 41 files changed, 143 insertions(+), 98 deletions(-) diff --git a/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html b/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html index 40532f958e8..8f18bf5bf66 100644 --- a/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html +++ b/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - +
- + diff --git a/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html b/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html index 5c869ea0bb8..ea7183c3004 100644 --- a/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html +++ b/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/Deprecated.html b/src/DocumentationBrowserViewExtension/Docs/Deprecated.html index 554a6aa32e8..1093a3cfa73 100644 --- a/src/DocumentationBrowserViewExtension/Docs/Deprecated.html +++ b/src/DocumentationBrowserViewExtension/Docs/Deprecated.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html b/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html index 5cfd91746d0..18490ed0202 100644 --- a/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html +++ b/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/ErrorPageTemplate.html b/src/DocumentationBrowserViewExtension/Docs/ErrorPageTemplate.html index b73f235be6a..e8da7ccac94 100644 --- a/src/DocumentationBrowserViewExtension/Docs/ErrorPageTemplate.html +++ b/src/DocumentationBrowserViewExtension/Docs/ErrorPageTemplate.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html b/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html index b4c1c7421d3..f79311b8ae4 100644 --- a/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html +++ b/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/FailedToCastFromNull.html b/src/DocumentationBrowserViewExtension/Docs/FailedToCastFromNull.html index 045a4ffd147..051f47089ab 100644 --- a/src/DocumentationBrowserViewExtension/Docs/FailedToCastFromNull.html +++ b/src/DocumentationBrowserViewExtension/Docs/FailedToCastFromNull.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/FileNotFound.html b/src/DocumentationBrowserViewExtension/Docs/FileNotFound.html index 8f26b2db110..b93122f025c 100644 --- a/src/DocumentationBrowserViewExtension/Docs/FileNotFound.html +++ b/src/DocumentationBrowserViewExtension/Docs/FileNotFound.html @@ -1,8 +1,8 @@ - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html b/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html index bcab5024323..56fbe2167cd 100644 --- a/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html +++ b/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html @@ -1,6 +1,6 @@ - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/InternalError.html b/src/DocumentationBrowserViewExtension/Docs/InternalError.html index b022914b2ac..2c77e28a709 100644 --- a/src/DocumentationBrowserViewExtension/Docs/InternalError.html +++ b/src/DocumentationBrowserViewExtension/Docs/InternalError.html @@ -1,8 +1,8 @@ - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/InvalidArrayIndexType.html b/src/DocumentationBrowserViewExtension/Docs/InvalidArrayIndexType.html index 9910efe3950..63ca69720c5 100644 --- a/src/DocumentationBrowserViewExtension/Docs/InvalidArrayIndexType.html +++ b/src/DocumentationBrowserViewExtension/Docs/InvalidArrayIndexType.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html b/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html index 6877be45a48..847cf705b5e 100644 --- a/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html +++ b/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html @@ -10,9 +10,9 @@ Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React --> - + - + diff --git a/src/DocumentationBrowserViewExtension/Docs/MarkdownStyling.html b/src/DocumentationBrowserViewExtension/Docs/MarkdownStyling.html index 84ede560890..431d5cacea0 100644 --- a/src/DocumentationBrowserViewExtension/Docs/MarkdownStyling.html +++ b/src/DocumentationBrowserViewExtension/Docs/MarkdownStyling.html @@ -1,6 +1,6 @@ - + - +