diff --git a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs index b4b76ab659d..03d328738ac 100644 --- a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs +++ b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs @@ -45,7 +45,7 @@ // to distinguish one build from another. AssemblyFileVersion is specified // in AssemblyVersionInfo.cs so that it can be easily incremented by the // automated build process. -[assembly: AssemblyVersion("2.10.0.2945")] +[assembly: AssemblyVersion("2.11.0.3246")] // By default, the "Product version" shown in the file properties window is @@ -64,4 +64,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("2.10.0.2945")] +[assembly: AssemblyFileVersion("2.11.0.3246")] diff --git a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt index 08cc07a2af4..91ee7add27d 100644 --- a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt +++ b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt @@ -68,7 +68,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyFileVersion("<#= this.MajorVersion #>.<#= this.MinorVersion #>.<#= this.BuildNumber #>.<#= this.RevisionNumber #>")] <#+ int MajorVersion = 2; -int MinorVersion = 10; +int MinorVersion = 11; int BuildNumber = 0; // The datetime baseline we choose using this algorithm will affect build number and all nuget packages uploaded // Please only change when major or minor version got incremented diff --git a/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs index 9a520a5a019..28e86617e39 100644 --- a/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs @@ -62,7 +62,7 @@ public ObservableCollection Children } /// - /// The string lable visibile in the watch. + /// The string label visible in the watch. /// public string NodeLabel { diff --git a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs index 6dae92cbdff..4f70d04e8e5 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs @@ -60,8 +60,25 @@ internal void PopulateAutoCompleteCandidates() // If node match searchElements found, use default suggestions if (!searchElementsCache.Any()) { - searchElementsCache = DefaultResults.Select(e => e.Model).ToList(); - FilteredResults = DefaultResults; + searchElementsCache = DefaultResults.Select(e => e.Model).ToList(); + switch (PortViewModel.PortModel.GetInputPortType()) + { + case "int": + FilteredResults = DefaultResults.Where(e => e.Name == "Number Slider" || e.Name == "Integer Slider").ToList(); + break; + case "double": + FilteredResults = DefaultResults.Where(e => e.Name == "Number Slider" || e.Name == "Integer Slider").ToList(); + break; + case "string": + FilteredResults = DefaultResults.Where(e => e.Name == "String").ToList(); + break; + case "bool": + FilteredResults = DefaultResults.Where(e => e.Name == "Boolean").ToList(); + break; + default: + FilteredResults = DefaultResults; + break; + } } else { diff --git a/src/DynamoCoreWpf/Views/Preview/PreviewControl.xaml.cs b/src/DynamoCoreWpf/Views/Preview/PreviewControl.xaml.cs index 80ccb7f4d3d..9bd462523d2 100644 --- a/src/DynamoCoreWpf/Views/Preview/PreviewControl.xaml.cs +++ b/src/DynamoCoreWpf/Views/Preview/PreviewControl.xaml.cs @@ -11,6 +11,7 @@ using System.Windows.Threading; using Dynamo.Configuration; using Dynamo.Controls; +using Dynamo.Graph.Nodes.ZeroTouch; using Dynamo.Interfaces; using Dynamo.Models; using Dynamo.Scheduler; @@ -368,8 +369,17 @@ private void RefreshExpandedDisplay(Action refreshDisplay) RunOnSchedulerSync( () => { - var preferredDictionaryOrdering = - nodeViewModel.NodeModel.OutPorts.Select(p => p.Name).Where(n => !String.IsNullOrEmpty(n)); + IEnumerable preferredDictionaryOrdering; + if (nodeViewModel.NodeModel is DSFunction dsFunction) + { + preferredDictionaryOrdering = dsFunction.Controller.ReturnKeys; + } + else + { + preferredDictionaryOrdering = + nodeViewModel.NodeModel.OutPorts.Select(p => p.Name).Where(n => !string.IsNullOrEmpty(n)); + } + newViewModel = nodeViewModel.DynamoViewModel.WatchHandler.GenerateWatchViewModelForData( nodeViewModel.NodeModel.CachedValue, preferredDictionaryOrdering, null, nodeViewModel.NodeModel.AstIdentifierForPreview.Name, false); diff --git a/src/Libraries/CoreNodes/List.cs b/src/Libraries/CoreNodes/List.cs index 27e0ed91bd5..b890c8fbf06 100644 --- a/src/Libraries/CoreNodes/List.cs +++ b/src/Libraries/CoreNodes/List.cs @@ -444,7 +444,7 @@ public static IDictionary Deconstruct(IList list) /// type: var[]..[] /// type: var[]..[] /// sort;key - [MultiReturn(new[] { "sorted list", "sorted keys" })] + [MultiReturn("sortedList", "sortedKeys")] [IsVisibleInDynamoLibrary(true)] public static IDictionary SortByKey(IList list, IList keys) { @@ -484,8 +484,8 @@ public static IDictionary SortByKey(IList list, IList keys) return new Dictionary { - { "sorted list", sortedList }, - { "sorted keys", sortedKeys } + { "sortedList", sortedList }, + { "sortedKeys", sortedKeys } }; } diff --git a/src/Notifications/NotificationsView.xaml b/src/Notifications/NotificationsView.xaml index a7759c2f88b..f3b2dbd41f2 100644 --- a/src/Notifications/NotificationsView.xaml +++ b/src/Notifications/NotificationsView.xaml @@ -1,20 +1,19 @@  + mc:Ignorable="d"> @@ -62,34 +61,40 @@ - + - - + - - - - - - + + + + + + - - - diff --git a/src/Notifications/Properties/Resources.Designer.cs b/src/Notifications/Properties/Resources.Designer.cs index 5a876844898..fb1aa1293b2 100644 --- a/src/Notifications/Properties/Resources.Designer.cs +++ b/src/Notifications/Properties/Resources.Designer.cs @@ -60,6 +60,24 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Show Details. + /// + public static string ButtonDetails { + get { + return ResourceManager.GetString("ButtonDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + public static string ButtonOK { + get { + return ResourceManager.GetString("ButtonOK", resourceCulture); + } + } + /// /// Looks up a localized string similar to Dismiss All Notifications. /// diff --git a/src/Notifications/Properties/Resources.en-US.resx b/src/Notifications/Properties/Resources.en-US.resx index c24a639c970..75f1e06783a 100644 --- a/src/Notifications/Properties/Resources.en-US.resx +++ b/src/Notifications/Properties/Resources.en-US.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Show Details + + + OK + Dismiss All Notifications diff --git a/src/Notifications/Properties/Resources.resx b/src/Notifications/Properties/Resources.resx index c24a639c970..75f1e06783a 100644 --- a/src/Notifications/Properties/Resources.resx +++ b/src/Notifications/Properties/Resources.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Show Details + + + OK + Dismiss All Notifications diff --git a/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs b/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs index 49d8c19817e..999dad47140 100644 --- a/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs +++ b/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs @@ -315,8 +315,8 @@ public void NodeSuggestions_SkippedSuggestions() // The initial list will fill the FilteredResults with a list of default options searchViewModel.PopulateAutoCompleteCandidates(); - Assert.AreEqual(5, searchViewModel.FilteredResults.Count()); - Assert.AreEqual("String", searchViewModel.FilteredResults.FirstOrDefault().Name); + Assert.AreEqual(2, searchViewModel.FilteredResults.Count()); + Assert.AreEqual("Number Slider", searchViewModel.FilteredResults.FirstOrDefault().Name); } } } diff --git a/test/DynamoCoreWpfTests/PreviewBubbleTests.cs b/test/DynamoCoreWpfTests/PreviewBubbleTests.cs index 841ddd65258..b1b19de59e6 100644 --- a/test/DynamoCoreWpfTests/PreviewBubbleTests.cs +++ b/test/DynamoCoreWpfTests/PreviewBubbleTests.cs @@ -32,6 +32,7 @@ protected override void GetLibrariesToPreload(List libraries) { libraries.Add("DesignScriptBuiltin.dll"); libraries.Add("DSCoreNodes.dll"); + libraries.Add("FFITarget.dll"); base.GetLibrariesToPreload(libraries); } @@ -354,6 +355,30 @@ public void PreviewBubble_ShowExpandedPreviewOnPinIconHover() Assert.IsTrue(previewBubble.IsExpanded, "Expanded preview bubble should be shown"); } + [Test] + public void PreviewBubble_ShowExpandedPreview_MultiReturnNode() + { + Open(@"core\multireturnnode_preview.dyn"); + var nodeView = NodeViewWithGuid("587d7494-e764-41fb-8b5d-a4229f7294ee"); + + var previewBubble = nodeView.PreviewControl; + previewBubble.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent)); + previewBubble.bubbleTools.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent)); + + // open preview bubble + RaiseMouseEnterOnNode(nodeView); + Assert.IsTrue(previewBubble.IsCondensed, "Compact preview bubble should be shown"); + Assert.AreEqual(Visibility.Collapsed, previewBubble.bubbleTools.Visibility, "Pin icon should not be shown"); + + // hover preview bubble to see pin icon + RaiseMouseEnterOnNode(previewBubble); + Assert.AreEqual(Visibility.Visible, previewBubble.bubbleTools.Visibility, "Pin icon should be shown"); + + // expand preview bubble + RaiseMouseEnterOnNode(previewBubble.bubbleTools); + Assert.IsTrue(previewBubble.IsExpanded, "Expanded preview bubble should be shown"); + } + [Test] public void PreviewBubble_ShownForColorRange() { diff --git a/test/Engine/FFITarget/FFITarget.csproj b/test/Engine/FFITarget/FFITarget.csproj index 6c65b0386db..33941deee04 100644 --- a/test/Engine/FFITarget/FFITarget.csproj +++ b/test/Engine/FFITarget/FFITarget.csproj @@ -25,6 +25,7 @@ prompt 4 false + ..\..\..\bin\AnyCPU\Debug\en-US\FFITarget.xml pdbonly diff --git a/test/Engine/FFITarget/ProtoFFITests.cs b/test/Engine/FFITarget/ProtoFFITests.cs index 436f33d076c..afe66310938 100644 --- a/test/Engine/FFITarget/ProtoFFITests.cs +++ b/test/Engine/FFITarget/ProtoFFITests.cs @@ -423,6 +423,14 @@ public int TestInternalClass(object y) return x.GetValue(); } + /// + /// Return nested dictionary. + /// + /// column + /// dictionary + /// number + /// weight + /// okay [MultiReturn("color", "dict", "nums", "weight", "ok")] public Dictionary ReturnNestedDictionary() { diff --git a/test/Libraries/CoreNodesTests/ListTests.cs b/test/Libraries/CoreNodesTests/ListTests.cs index ab0e8831ed5..1c6635b4c5c 100644 --- a/test/Libraries/CoreNodesTests/ListTests.cs +++ b/test/Libraries/CoreNodesTests/ListTests.cs @@ -1097,8 +1097,8 @@ public static void SortByKey1() var result = List.SortByKey(list, keys); var expected = new Dictionary { - { "sorted list", new object[] { "item2", "item1" } }, - { "sorted keys", new object[] { "key1", "key2" } } + { "sortedList", new object[] { "item2", "item1" } }, + { "sortedKeys", new object[] { "key1", "key2" } } }; Assert.AreEqual(expected, result); @@ -1142,8 +1142,8 @@ public static void SortByKey4() var result = List.SortByKey(list, keys); var expected = new Dictionary { - { "sorted list", new object[] { "Neal", "Matt", "Ian", "Zack", "Colin" } }, - { "sorted keys", new object[] { "Burnham", "Jezyk", "Keough", "Kron", "McCrone" } } + { "sortedList", new object[] { "Neal", "Matt", "Ian", "Zack", "Colin" } }, + { "sortedKeys", new object[] { "Burnham", "Jezyk", "Keough", "Kron", "McCrone" } } }; Assert.AreEqual(expected, result); @@ -1165,8 +1165,8 @@ public static void SortByKey5() var result = List.SortByKey(list, keys); var expected = new Dictionary { - { "sorted list", new object[] { "Zack", "Ian", "Anna", "Neal" } }, - { "sorted keys", new object[] { -3, 1.6, 5, "abc" } } + { "sortedList", new object[] { "Zack", "Ian", "Anna", "Neal" } }, + { "sortedKeys", new object[] { -3, 1.6, 5, "abc" } } }; Assert.AreEqual(expected, result); @@ -1182,8 +1182,8 @@ public static void SortByKey6() var result = List.SortByKey(list, keys); var expected = new Dictionary { - { "sorted list", new object[] { 2, 3, 1 }}, - { "sorted keys", new object[] { 1.20, 1.2001, 1.21 } } + { "sortedList", new object[] { 2, 3, 1 }}, + { "sortedKeys", new object[] { 1.20, 1.2001, 1.21 } } }; Assert.AreEqual(expected, result); diff --git a/test/core/multireturnnode_preview.dyn b/test/core/multireturnnode_preview.dyn new file mode 100644 index 00000000000..ba593701868 --- /dev/null +++ b/test/core/multireturnnode_preview.dyn @@ -0,0 +1,157 @@ +{ + "Uuid": "cdab5b52-304f-4b23-8a5e-4a93ebdcafb9", + "IsCustomNode": false, + "Description": null, + "Name": "multireturnnode_preview", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "NodeType": "FunctionNode", + "FunctionSignature": "FFITarget.TestData.ReturnNestedDictionary", + "Id": "587d7494e76441fb8b5da4229f7294ee", + "Inputs": [ + { + "Id": "0e6050e8916a454eab7cf2d87861cb07", + "Name": "testData", + "Description": "FFITarget.TestData", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "fddbb030b56041bf88ee3b0f0b44c493", + "Name": "col", + "Description": "column", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "0f381b0e745e4604856705582cf0231c", + "Name": "dict", + "Description": "dictionary", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "421f2476bb444d8ba1330c9fd8d6e4fd", + "Name": "num", + "Description": "number", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "fc3fbe47234a4e0f8d4fa4385e301419", + "Name": "wt", + "Description": "weight", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "8d8682c503d84a0f8da77833247df6a8", + "Name": "ok", + "Description": "okay", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "Return nested dictionary.\n\nTestData.ReturnNestedDictionary ( ): var[]..[]" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "NodeType": "FunctionNode", + "FunctionSignature": "FFITarget.TestData.TestData", + "Id": "e64dd6ca741c4a09b722c7fb231cf474", + "Inputs": [], + "Outputs": [ + { + "Id": "1404145039bf4ffbb2f648eecdce0928", + "Name": "TestData", + "Description": "TestData", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "TestData.TestData ( ): TestData" + } + ], + "Connectors": [ + { + "Start": "1404145039bf4ffbb2f648eecdce0928", + "End": "0e6050e8916a454eab7cf2d87861cb07", + "Id": "e9da6bf89a1f4ff98b09a22a57585115" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [], + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": true, + "IsVisibleInDynamoLibrary": true, + "Version": "2.10.0.3246", + "RunType": "Automatic", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "NodeViews": [ + { + "ShowGeometry": true, + "Name": "TestData.ReturnNestedDictionary", + "Id": "587d7494e76441fb8b5da4229f7294ee", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 587.591972524768, + "Y": 366.80443744047426 + }, + { + "ShowGeometry": true, + "Name": "TestData.TestData", + "Id": "e64dd6ca741c4a09b722c7fb231cf474", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 396.92609744922186, + "Y": 383.40302487798539 + } + ], + "Annotations": [], + "X": -201.66090832590237, + "Y": -282.42730312803474, + "Zoom": 1.2374114765500794 + } +} \ No newline at end of file