Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #27

Merged
merged 4 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")]
2 changes: 1 addition & 1 deletion src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public ObservableCollection<WatchViewModel> Children
}

/// <summary>
/// The string lable visibile in the watch.
/// The string label visible in the watch.
/// </summary>
public string NodeLabel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
14 changes: 12 additions & 2 deletions src/DynamoCoreWpf/Views/Preview/PreviewControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<string> 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);
Expand Down
6 changes: 3 additions & 3 deletions src/Libraries/CoreNodes/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public static IDictionary Deconstruct(IList list)
/// <returns name="sortedList">type: var[]..[]</returns>
/// <returns name="sortedKeys">type: var[]..[]</returns>
/// <search>sort;key</search>
[MultiReturn(new[] { "sorted list", "sorted keys" })]
[MultiReturn("sortedList", "sortedKeys")]
[IsVisibleInDynamoLibrary(true)]
public static IDictionary SortByKey(IList list, IList keys)
{
Expand Down Expand Up @@ -484,8 +484,8 @@ public static IDictionary SortByKey(IList list, IList keys)

return new Dictionary<object, object>
{
{ "sorted list", sortedList },
{ "sorted keys", sortedKeys }
{ "sortedList", sortedList },
{ "sortedKeys", sortedKeys }
};
}

Expand Down
45 changes: 25 additions & 20 deletions src/Notifications/NotificationsView.xaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Window x:Class="Dynamo.Notifications.NotificationsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Dynamo.Notifications"
xmlns:Logging="clr-namespace:Dynamo.Logging;assembly=DynamoCore"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:local="clr-namespace:Dynamo.Notifications"
xmlns:p="clr-namespace:Dynamo.Notifications.Properties"
xmlns:ui="clr-namespace:Dynamo.UI;assembly=DynamoCoreWpf"
Title="Notifications"
Height="450"
Width="400"
Background="#555"
MinWidth="400"
MaxWidth="400"
xmlns:ui="clr-namespace:Dynamo.UI;assembly=DynamoCoreWpf"
d:DataContext="{d:DesignInstance Type = local:NotificationsViewExtension}"
mc:Ignorable="d">
mc:Ignorable="d">

<Window.Resources>
<ResourceDictionary>
Expand Down Expand Up @@ -62,34 +61,40 @@
<StackPanel.Background>
<SolidColorBrush Color="{DynamicResource ResourceKey=BorderDarkColor}"></SolidColorBrush>
</StackPanel.Background>

<StackPanel Margin="10,10,20,10">
<TextBox Style="{DynamicResource ResourceKey =SDarkTextBox }" Name="Title" Text="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" IsReadOnly="True" TextWrapping="Wrap" Visibility="Visible" Grid.Row="0" Grid.Column="0" ></TextBox>
<TextBox Style="{DynamicResource ResourceKey =SDarkTextBox }" Name="ShortErrorMessage" Text="{Binding Path= ShortMessage,Mode=OneWay}" FontSize="11" IsReadOnly="True" TextWrapping="Wrap" Visibility="Visible" Grid.Row="0" Grid.Column="0" ></TextBox>
</StackPanel>

<Border BorderThickness="1" BorderBrush="Black">

<Border BorderThickness="1" BorderBrush="Black">
<StackPanel Orientation="Horizontal">
<StackPanel.Background>
<SolidColorBrush Color="{DynamicResource ResourceKey=BorderDarkColor}"></SolidColorBrush>
</StackPanel.Background>
<Button Margin="20,20,20,20" Style="{DynamicResource ResourceKey=STextButton}" Tag="{Binding ElementName=Details}" Click="ShowDetails_ButtonClick" >Show Details</Button>
<Button Margin="50,20,20,20" HorizontalAlignment="Right" Style="{DynamicResource ResourceKey=STextButton}" Click="OKButton_Click">OK</Button>
</StackPanel>
</Border>
<StackPanel Margin="0,0,20,0">

<Button Margin="20,20,20,20"
Style="{DynamicResource ResourceKey=STextButton}"
Tag="{Binding ElementName=Details}"
Click="ShowDetails_ButtonClick"
Content="{x:Static p:Resources.ButtonDetails}">
</Button>
<Button Margin="50,20,20,20"
HorizontalAlignment="Right"
Style="{DynamicResource ResourceKey=STextButton}"
Click="OKButton_Click"
Content="{x:Static p:Resources.ButtonOK}">
</Button>
</StackPanel>
</Border>
<StackPanel Margin="0,0,20,0">

<StackPanel.Background>
<SolidColorBrush Color="{DynamicResource ResourceKey=BorderMediumColor}"></SolidColorBrush>
</StackPanel.Background>
<TextBox Style="{DynamicResource ResourceKey =SDarkTextBox }" FontSize="10" IsReadOnly="True" Text="{Binding Path=DetailedMessage,Mode=OneWay}" Name="Details" TextWrapping="Wrap" Background="WhiteSmoke" Visibility="Collapsed"></TextBox>
</StackPanel>
</StackPanel>


</DataTemplate>

</ListBox.ItemTemplate>

</ListBox>
Expand Down
18 changes: 18 additions & 0 deletions src/Notifications/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Notifications/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonDetails" xml:space="preserve">
<value>Show Details</value>
</data>
<data name="ButtonOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Dismiss" xml:space="preserve">
<value>Dismiss All Notifications</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions src/Notifications/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonDetails" xml:space="preserve">
<value>Show Details</value>
</data>
<data name="ButtonOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Dismiss" xml:space="preserve">
<value>Dismiss All Notifications</value>
</data>
Expand Down
4 changes: 2 additions & 2 deletions test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
25 changes: 25 additions & 0 deletions test/DynamoCoreWpfTests/PreviewBubbleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ protected override void GetLibrariesToPreload(List<string> libraries)
{
libraries.Add("DesignScriptBuiltin.dll");
libraries.Add("DSCoreNodes.dll");
libraries.Add("FFITarget.dll");
base.GetLibrariesToPreload(libraries);
}

Expand Down Expand Up @@ -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()
{
Expand Down
1 change: 1 addition & 0 deletions test/Engine/FFITarget/FFITarget.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<DocumentationFile>..\..\..\bin\AnyCPU\Debug\en-US\FFITarget.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
8 changes: 8 additions & 0 deletions test/Engine/FFITarget/ProtoFFITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,14 @@ public int TestInternalClass(object y)
return x.GetValue();
}

/// <summary>
/// Return nested dictionary.
/// </summary>
/// <returns name="col">column</returns>
/// <returns name="dict">dictionary</returns>
/// <returns name="num">number</returns>
/// <returns name="wt">weight</returns>
/// <returns name="ok">okay</returns>
[MultiReturn("color", "dict", "nums", "weight", "ok")]
public Dictionary<string, object> ReturnNestedDictionary()
{
Expand Down
16 changes: 8 additions & 8 deletions test/Libraries/CoreNodesTests/ListTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,8 @@ public static void SortByKey1()
var result = List.SortByKey(list, keys);
var expected = new Dictionary<string, object>
{
{ "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);
Expand Down Expand Up @@ -1142,8 +1142,8 @@ public static void SortByKey4()
var result = List.SortByKey(list, keys);
var expected = new Dictionary<string, object>
{
{ "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);
Expand All @@ -1165,8 +1165,8 @@ public static void SortByKey5()
var result = List.SortByKey(list, keys);
var expected = new Dictionary<string, object>
{
{ "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);
Expand All @@ -1182,8 +1182,8 @@ public static void SortByKey6()
var result = List.SortByKey(list, keys);
var expected = new Dictionary<string, object>
{
{ "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);
Expand Down
Loading