diff --git a/src/DocumentationBrowserViewExtension/DocumentationBrowserView.xaml.cs b/src/DocumentationBrowserViewExtension/DocumentationBrowserView.xaml.cs
index b02e30c05dd..75dcee02c63 100644
--- a/src/DocumentationBrowserViewExtension/DocumentationBrowserView.xaml.cs
+++ b/src/DocumentationBrowserViewExtension/DocumentationBrowserView.xaml.cs
@@ -27,7 +27,7 @@ public partial class DocumentationBrowserView : UserControl, IDisposable
internal string WebBrowserUserDataFolder { get; set; }
internal string FallbackDirectoryName { get; set; }
//This folder will be used to store images and dyn files previosuly located in /rootDirectory/en-US/fallback_docs so we don't need to copy all those files per each language
- internal const string SharedDocsDirectoryName = "NodeHelpSharedDocs";
+ internal static readonly string SharedDocsDirectoryName = "NodeHelpSharedDocs";
//Path in which the virtual folder for loading images will be created
internal string VirtualFolderPath { get; set; }
diff --git a/src/DocumentationBrowserViewExtension/DocumentationBrowserViewModel.cs b/src/DocumentationBrowserViewExtension/DocumentationBrowserViewModel.cs
index afb55ae768f..07dd12fad5d 100644
--- a/src/DocumentationBrowserViewExtension/DocumentationBrowserViewModel.cs
+++ b/src/DocumentationBrowserViewExtension/DocumentationBrowserViewModel.cs
@@ -446,7 +446,9 @@ internal void InsertGraph()
private string DynamoGraphFromMDFilePath(string path)
{
path = HttpUtility.UrlDecode(path);
- return Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(path)) + ".dyn";
+ var rootLevelDir = Path.GetDirectoryName(path);
+ var imagesLocation = Path.Combine(new DirectoryInfo(rootLevelDir).Parent.Parent.FullName, DocumentationBrowserView.SharedDocsDirectoryName);
+ return Path.Combine(imagesLocation, Path.GetFileNameWithoutExtension(path)) + ".dyn";
}
diff --git a/src/DynamoCore/DynamoCore.csproj b/src/DynamoCore/DynamoCore.csproj
index fb7e67be4e3..73bb1d1763a 100644
--- a/src/DynamoCore/DynamoCore.csproj
+++ b/src/DynamoCore/DynamoCore.csproj
@@ -138,7 +138,7 @@
-
+
diff --git a/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs
index 8079cfe37a1..2aeb2ef082c 100644
--- a/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs
+++ b/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs
@@ -763,6 +763,44 @@ public void AddGraphInSpecificLocationToWorkspace()
Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Nodes.Count(), 5);
}
+ [Test]
+ public void Validate_GetGraphLinkFromMDLocation()
+ {
+ var nodeName = "Number";
+ this.ViewModel.ExecuteCommand(
+ new DynamoModel.CreateNodeCommand(
+ Guid.NewGuid().ToString(), nodeName, 0, 0, false, false)
+ );
+
+ //Validates that we have just one node in the CurrentWorkspace
+ Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Nodes.Count(), 1);
+
+ var node = ViewModel.Model.CurrentWorkspace.Nodes.FirstOrDefault();
+
+ //In this call the GetGraphLinkFromMDLocation() method is executed internally
+ RequestNodeDocs(node);
+
+ // Show the DocumentationBrowser so we can get the DocumentationBrowserViewModel
+ ShowDocsBrowser();
+ var docsView = GetDocsTabItem().Content as DocumentationBrowserView;
+ var docsViewModel = docsView.DataContext as DocumentationBrowserViewModel;
+
+ //Due that graphPath is a private we use reflection to get the value.
+ FieldInfo type = typeof(DocumentationBrowserViewModel).GetField("graphPath", BindingFlags.NonPublic | BindingFlags.Instance);
+ var graphPathValue = type.GetValue(docsViewModel);
+
+ var dynFileName = Path.GetFileNameWithoutExtension(docsViewModel.Link.AbsolutePath) + ".dyn";
+
+ //This will return a path with the NodeHelpSharedDocs + dyn file name
+ var sharedFilesPath = Path.Combine(DocumentationBrowserView.SharedDocsDirectoryName, dynFileName);
+
+ Assert.IsNotNull(graphPathValue);
+ Assert.IsTrue(!string.IsNullOrEmpty(graphPathValue.ToString()));
+
+ //Chech that the pathPath contains "NodeHelpSharedDocs//dynfilename"
+ Assert.That(graphPathValue.ToString().Contains(sharedFilesPath));
+ }
+
#region Helpers
private DocumentationBrowserViewExtension SetupNewViewExtension(bool runLoadedMethod = false)