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

GraphNodeManager Update #13069

Merged
merged 37 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5ccedd2
Nested Empty List Not Showing
dnenov Jun 28, 2022
f272c2c
Filter Label Consistent Capitalisation
dnenov Jun 28, 2022
b0b940a
Export Tooltip
dnenov Jun 28, 2022
9978f7b
Tooltip Export and Copy Flip
dnenov Jun 28, 2022
fa1e4d2
DismissedAlerts Not Updated in Automatic Mode
dnenov Jun 28, 2022
19b0211
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into dnen…
dnenov Jul 26, 2022
cc65e29
Icons to Filters
dnenov Jul 26, 2022
3090d39
Aligned Filters to Figma
dnenov Jul 26, 2022
759c6ed
Export Default Name
dnenov Jul 26, 2022
ab01d8f
Export Unfiltered Nodes Only
dnenov Jul 26, 2022
30b59aa
Renamed Node Blue Dot
dnenov Jul 26, 2022
2658095
Comments: nameof
dnenov Jul 27, 2022
9b0a73b
Comments: GetOriginalName Internal, used InternalsVisibleTo instead
dnenov Jul 27, 2022
cd5d3c1
Summary Comments Added to FilterViewModel
dnenov Jul 27, 2022
7365210
Fixed Summary Comments After Change
dnenov Jul 27, 2022
b73cf21
Comments: IEnumerable to Array Simplified
dnenov Jul 27, 2022
bbb88f3
Comments: Braces
dnenov Jul 27, 2022
bfb9187
SearchTextBox Update
dnenov Jul 27, 2022
88db85f
DataGrid Visual Changes
dnenov Jul 27, 2022
ec981e1
Export Dual Tooltip
dnenov Jul 27, 2022
2cf1df8
Select Node Behavior Change
dnenov Jul 27, 2022
954a3ea
Multiple Visual Updates
dnenov Jul 29, 2022
9b2ed4b
Warning/Error Text Contrast
dnenov Jul 29, 2022
a1ebe97
Hover State Colors, Consistent Selection Color
dnenov Jul 30, 2022
ff962a9
Dismissed Warning Italic Font
dnenov Aug 2, 2022
d2a4356
Any Empty Lists and Null
dnenov Aug 2, 2022
9622fc1
GNM EmptyList and Null Test
dnenov Aug 2, 2022
6ca914b
Remove Dismissed Icon
dnenov Aug 3, 2022
0837fe3
Naming Convention
dnenov Aug 5, 2022
4580258
Images as Resource
dnenov Aug 5, 2022
5615669
Removed/Replaced Converters
dnenov Aug 5, 2022
dcdf553
Color Resources Replaced
dnenov Aug 5, 2022
d7a8e1f
Converter Namespace Rename
dnenov Aug 9, 2022
a97c133
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into dnen…
dnenov Aug 11, 2022
07125c9
Merge Fix
dnenov Aug 11, 2022
5a07586
Reverted Changes, Fix Tests Fail
dnenov Aug 15, 2022
abee353
Merge branch 'master' into dnenov-update-graphnodemanager
reddyashish Aug 15, 2022
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
25 changes: 24 additions & 1 deletion src/DynamoCore/Graph/Nodes/NodeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,11 +1081,34 @@ public virtual NodeOutputData OutputData
};
}
}

/// A collection of error/warning/info messages, dismissed via a sub-menu in the node Context Menu.
[JsonIgnore]
public ObservableCollection<string> DismissedAlerts { get; set; } = new ObservableCollection<string>();


private int _dismissedAlertsCount;
/// <summary>
/// Returns the number of dismissed error/warning/info messages.
/// </summary>
[JsonIgnore]
public int DismissedAlertsCount
{
get
{
return _dismissedAlertsCount;
dnenov marked this conversation as resolved.
Show resolved Hide resolved
}

internal set // Private setter, see "ArgumentLacing" for details.
{
if (_dismissedAlertsCount != value)
{
_dismissedAlertsCount = value;
RaisePropertyChanged(nameof(DismissedAlertsCount));
}
}
}

#endregion

#region freeze execution
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Graph/Nodes/NodeModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ internal static List<IGraphicItem> GeneratedGraphicItems(this NodeModel node, En
/// </summary>
/// <param name="node">target NodeModel</param>
/// <returns>Original node name as string</returns>
internal static string GetOriginalName(this NodeModel node)
public static string GetOriginalName(this NodeModel node)
reddyashish marked this conversation as resolved.
Show resolved Hide resolved
{
if (node == null) return string.Empty;
// For dummy node, return the current name so that does not appear to be renamed
Expand Down
13 changes: 12 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,19 @@ private void DismissedNodeMessages_CollectionChanged(object sender, NotifyCollec

RaisePropertyChanged(nameof(DismissedAlerts));
RaisePropertyChanged(nameof(NumberOfDismissedAlerts));

UpdateModelDismissedAlertsCount();
}


/// <summary>
/// Calls an update for the DismissedAlertCount inside the NodeModel to push PropertyChanged fire
/// </summary>
private void UpdateModelDismissedAlertsCount()
{
if(DismissedAlerts != null)
dnenov marked this conversation as resolved.
Show resolved Hide resolved
nodeLogic.DismissedAlertsCount = DismissedAlerts.Count;
}

/// <summary>
/// Dispose function
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@
Converter={StaticResource BooleanToColorConverter},
ConverterParameter=Default,
UpdateSourceTrigger=PropertyChanged}">
<ContentPresenter />
<StackPanel Orientation="Horizontal">
<Image Source="{Binding FilterImage}"
Width="12"
Height="12"
SnapsToDevicePixels="True"
VerticalAlignment="Stretch"
Margin="2 0 0 0"/>
<ContentPresenter />
</StackPanel>
</Border>

<ControlTemplate.Triggers>
Expand Down
55 changes: 48 additions & 7 deletions src/GraphNodeManagerViewExtension/GraphNodeManagerView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:controls="clr-namespace:Dynamo.GraphNodeManager.Controls"
xmlns:ui="clr-namespace:Dynamo.UI;assembly=DynamoCoreWpf"
xmlns:p="clr-namespace:Dynamo.GraphNodeManager.Properties"
xmlns:controls1="clr-namespace:Dynamo.UI.Controls;assembly=DynamoCoreWpf"
x:Name="UserControl"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
Expand Down Expand Up @@ -62,7 +63,6 @@
VerticalAlignment="Center"
Source="/GraphNodeManagerViewExtension;component/Images/Export.png"
Stretch="UniformToFill"
ToolTip="{x:Static p:Resources.ToolTip_ExportToExcel}"
MouseUp="ExportImage_OnMouseUp"
Cursor="Hand">
<Image.ContextMenu>
Expand All @@ -77,6 +77,17 @@
Command="{Binding ExportCommand}" CommandParameter="JSON"/>
</ContextMenu>
</Image.ContextMenu>
<Image.ToolTip>
<controls1:DynamoToolTip AttachmentSide="Bottom" Style="{DynamicResource ResourceKey=SLightToolTip}">
<Grid>
<TextBlock MaxWidth="320"
Padding="5"
Foreground="Black" FontSize="12"
Text="{x:Static p:Resources.ToolTip_ExportToExcel}"
TextWrapping="Wrap" />
</Grid>
</controls1:DynamoToolTip>
</Image.ToolTip>
</Image>
<Button x:Name="ClearFiltersButton"
DockPanel.Dock="Right"
Expand Down Expand Up @@ -141,13 +152,33 @@
<DataGrid.Columns>

<!-- Name -->
<DataGridTextColumn
<DataGridTemplateColumn
Header="Name"
Binding="{Binding Name}"
FontWeight="Light"
Foreground="#F5F5F5"
IsReadOnly="True"
Width="6*"></DataGridTextColumn>
Width="6*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<DockPanel HorizontalAlignment="Stretch">
<TextBlock
Text="{Binding Name}"
FontWeight="Light"
Foreground="#F5F5F5"
DockPanel.Dock="Left"></TextBlock>
<Grid
DockPanel.Dock="Right">
<Ellipse Name="nodeRenamedBlueDot"
Width="6"
Height="6"
Margin="0 0 6 0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Fill="{StaticResource Blue300Brush}"
Visibility="{Binding IsRenamed, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid>
</DockPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

<!-- Type -->
<DataGridTemplateColumn
Expand Down Expand Up @@ -308,10 +339,20 @@
Tag="{Binding ElementName=DetailedRowItemControl, Path=DataContext}"
Width="24"
VerticalAlignment="Top"
ToolTip="{x:Static p:Resources.ToolTip_CopyToClipboard}"
Cursor="Hand">
<Image Source="/GraphNodeManagerViewExtension;component/Images/Copy.png"
Style="{StaticResource ImageStyle}"/>
<Button.ToolTip>
<controls1:DynamoToolTip AttachmentSide="Bottom" Style="{DynamicResource ResourceKey=SLightToolTip}">
<Grid>
<TextBlock MaxWidth="320"
Padding="5"
Foreground="Black" FontSize="12"
Text="{x:Static p:Resources.ToolTip_CopyToClipboard}"
TextWrapping="Wrap" />
</Grid>
</controls1:DynamoToolTip>
</Button.ToolTip>
</Button>
</Grid>
</Border>
Expand Down
47 changes: 33 additions & 14 deletions src/GraphNodeManagerViewExtension/GraphNodeManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ public GraphNodeManagerViewModel(ViewLoadedParams p, string id, Action<Logging.I


private void InitializeFilters()
{ //TODO this should really not use localized text... it should use an enum etc.
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_EmptyList });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Error });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Frozen });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_MissingContent });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Function });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Information });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_IsInput });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_IsOutput });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Null });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Warning });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_PreviewOff });
{
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_EmptyList, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/EmptyList.png" });
dnenov marked this conversation as resolved.
Show resolved Hide resolved
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Error, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Error.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Frozen, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Frozen.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Function, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Function.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Information, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Info.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_IsInput, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/IsInput.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_IsOutput, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/IsOutput.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_MissingContent, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/MissingNode.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Null, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Null.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_Warning, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Alert.png" });
FilterItems.Add(new FilterViewModel(this){Name = Resources.Title_PreviewOff, FilterImage = "pack://application:,,,/GraphNodeManagerViewExtension;component/Images/Hidden.png" });

filterDictionary = new Dictionary<string, FilterViewModel>(FilterItems.ToDictionary(fi => fi.Name));
}
Expand Down Expand Up @@ -325,18 +325,37 @@ internal void ExportGraph(object parameter)
{
if (parameter == null) return;
string type = parameter.ToString();
string promptName = System.IO.Path.GetFileNameWithoutExtension(currentWorkspace.FileName);
dnenov marked this conversation as resolved.
Show resolved Hide resolved

var filteredNodes = FilteredNodesArray();

switch (type)
{
case "CSV":
Utilities.Utilities.ExportToCSV(Nodes.ToArray());
Utilities.Utilities.ExportToCSV(filteredNodes, promptName);
break;
case "JSON":
Utilities.Utilities.ExportToJson(Nodes.ToArray());
Utilities.Utilities.ExportToJson(filteredNodes, promptName);
break;
}
}

/// <summary>
/// Helper method to return an Array of the currently active Nodes
/// </summary>
/// <returns></returns>
private GridNodeViewModel [] FilteredNodesArray()
{
var filteredNodes = new List<GridNodeViewModel>();
dnenov marked this conversation as resolved.
Show resolved Hide resolved

foreach (var item in GraphNodeManagerView.NodesInfoDataGrid.ItemsSource)
{
filteredNodes.Add((item as GridNodeViewModel));
}

return filteredNodes.ToArray();
}

/// <summary>
/// On changing a condition that affects the filter
/// </summary>
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<value>Show _Graph Node Manager</value>
</data>
<data name="Title_EmptyList" xml:space="preserve">
<value>Empty List</value>
<value>Empty list</value>
</data>
<data name="Title_Error" xml:space="preserve">
<value>Error</value>
Expand All @@ -136,13 +136,13 @@
<value>Function</value>
</data>
<data name="Title_Information" xml:space="preserve">
<value>Information</value>
<value>Info</value>
</data>
<data name="Title_IsInput" xml:space="preserve">
<value>Is Input</value>
<value>Is input</value>
</data>
<data name="Title_IsOutput" xml:space="preserve">
<value>Is Output</value>
<value>Is output</value>
</data>
<data name="Title_MissingContent" xml:space="preserve">
<value>Missing content</value>
Expand All @@ -151,7 +151,7 @@
<value>Null</value>
</data>
<data name="Title_PreviewOff" xml:space="preserve">
<value>Preview Off</value>
<value>Preview off</value>
</data>
<data name="Title_Warning" xml:space="preserve">
<value>Warning</value>
Expand All @@ -163,9 +163,9 @@
<value>Copy to clipboard</value>
</data>
<data name="ToolTip_DismissedWarnings" xml:space="preserve">
<value>Dismissed Warnings</value>
<value>Dismissed warnings</value>
</data>
<data name="ToolTip_ExportToExcel" xml:space="preserve">
<value>Export to Excel</value>
<value>Export</value>
</data>
</root>
Loading