Skip to content

Commit

Permalink
Node informational states (#11983)
Browse files Browse the repository at this point in the history
* Updates node styling

* Updates UI

Adds Artifakt font, changes colors, port/header height config, code block editor colours.

* Update UI

* Updates UI

* Updates UI

* Updates UI

* Ports visual states are working.

* Revert "Ports visual states are working."

* Revert "Revert "Ports visual states are working.""

This reverts commit 3557726.

* Updates UI

* Updates ContextMenu style

* Updates UI

* Updates UI

* Updates ComboBox and Output Ports style for Code Blocks

* Loads icon to node header

* Updates UI

* Updates UI

* Updates UI

* Bug fixes and responding to comments

* Updates UI

* WIP changes

* ViewModel logic working as per mockup

* Node redesign (#3)

* Updates node styling

* Updates UI

Adds Artifakt font, changes colors, port/header height config, code block editor colours.

* Update UI

* Updates UI

* Updates UI

* Updates UI

* Ports visual states are working.

* Revert "Ports visual states are working."

* Revert "Revert "Ports visual states are working.""

This reverts commit 3557726.

* Updates UI

* Updates ContextMenu style

* Updates UI

* Updates UI

* Updates ComboBox and Output Ports style for Code Blocks

* Loads icon to node header

* Updates UI

* Updates UI

* Updates UI

* Bug fixes and responding to comments

* DYN-3875: Restore LocalPackages property in PreferencesViewModel (#11881)

* restore property in PreferencesViewModel

* add regression test for installedpackagesview

* fix test

* remove setting datacontext for installed packages view control as it is inherited

* undo unnecessary changes

* more cleanup

* Updates UI

* fix node autocomplete crash (#11887)

* Minor UI changes to Autodesk feedback

* Temporarily disabled dismissed alerts features

* Minor UI fix to the nodes' GlyphStackPanel

Co-authored-by: aparajit-pratap <[email protected]>

* Updates

* Updates node informational states

* Minor fixes

* Removed INodeInformationalState interface, no longer needed.

* Restored previously-removed commands in InfoBubbleCommand.cs

* Typo fix and restoring old NodeInfoBubbleViewModel methods to original state.

* Added comments, minor (old) API restoration work

* Renaming, refactoring and added 2 tests.

* Removed new constructor for OutputMessage.

Class is no longer being used for Informational States.

* Minor fixes.

Removed outdated and unused collection on NodeModel.
Changed command name to be less confusing.

* Update

* Responds to comments

* Removed unneeded references

* Reponse to comments

* Removed 'else' from method body

* two more

* Fixes UI bug

* Switched out vector-based info/warning/error icons for .png equivalents.

* Removes reference to WindowsBase in DynamoCore and flags many properties in the InfoBubbleViewModel as obsolete.

* Updates

* Minor graphical updates

* Updates in response to feedback

Adds new resource strings.
Adds a ToolTip for the node context menu.
Makes node context menu visible for all nodes.
Fixes error bubble Z Index issue.
Adds chevron to error bubble design.
Unsubscribes from NodeMessages.CollectionChanged on InfoBubbleViewModel's Dispose method.

Co-authored-by: aparajit-pratap <[email protected]>
  • Loading branch information
OliverEGreen and aparajit-pratap authored Aug 27, 2021
1 parent 584c462 commit e4fc63d
Show file tree
Hide file tree
Showing 9 changed files with 604 additions and 598 deletions.
2 changes: 1 addition & 1 deletion src/DynamoCore/Graph/Nodes/PortModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public Point2D Center
// Special case because code block outputs are smaller than regular outputs.
// This ensures the output port of the first code block output aligns with
// the first input port of any node.
return new Point2D(Owner.X + Owner.Width, y + 12.7);
return new Point2D(Owner.X + Owner.Width, y + 12.8);
}
return new Point2D(Owner.X + Owner.Width, y);
}
Expand Down
7 changes: 3 additions & 4 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,6 @@
<None Include="UI\Fonts\CourierPrime-Regular.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="UI\Fonts\CourierPrime-Regular.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="UI\Fonts\OpenSans-Bold.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -1387,14 +1384,16 @@
<Resource Include="UI\Images\profile_normal.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="UI\Images\error.png" />
<Resource Include="UI\Images\info.png" />
<Resource Include="UI\Images\warning.png" />
<Resource Include="UI\Images\menu_grey_48px.png" />
<Resource Include="UI\Images\caret_down_grey_48px.png" />
<Resource Include="UI\Images\caret_up_grey_48px.png" />
<Resource Include="UI\Images\NodeIcon_placeholder.png" />
<Resource Include="UI\Images\hidden.png" />
<Resource Include="UI\Images\default-node-icon.png" />
<Resource Include="UI\Images\more-vertical.png" />
<Resource Include="UI\Images\warning.png" />
<Resource Include="UI\Images\pin_default_16_16.png" />
<Resource Include="UI\Images\watch_default_16_16.png" />
<Resource Include="UI\Images\wire_anchor_12_12.png" />
Expand Down
18 changes: 18 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

7 changes: 7 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2657,4 +2657,11 @@ Delete the following packages: {2}?
<data name="DynamoViewViewMenuConnectorShowTooltip" xml:space="preserve">
<value>_Show Tooltip</value>
</data>
<data name="NodeInformationalStateDismissedAlerts" xml:space="preserve">
<value>Dismissed Alerts</value>
</data>
<data name="ContextMenu" xml:space="preserve">
<value>Node Options</value>
<comment>Node context menu</comment>
</data>
</root>
7 changes: 7 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@
<value>Groups</value>
<comment>Context menu for group-based operations</comment>
</data>
<data name="ContextMenu" xml:space="preserve">
<value>Node Options</value>
<comment>Node context menu</comment>
</data>
<data name="ContextMenuLacing" xml:space="preserve">
<value>Lacing</value>
<comment>Context menu for selected node</comment>
Expand Down Expand Up @@ -2467,6 +2471,9 @@ Uninstall the following packages: {0}?</value>
<data name="NodeInformationalStateDismissAll" xml:space="preserve">
<value>Dismiss all</value>
</data>
<data name="NodeInformationalStateDismissedAlerts" xml:space="preserve">
<value>Dismissed Alerts</value>
</data>
<data name="NodeInformationalStateLearnMore" xml:space="preserve">
<value>Learn more</value>
</data>
Expand Down
19 changes: 8 additions & 11 deletions src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,8 @@ public override bool IsCollapsed
/// A collection of MenuItems used by the node's Context Menu, since errors/warnings are undismissed via a sub-menu.
/// </summary>
[JsonIgnore]
public ObservableCollection<MenuItem> DismissedAlerts
{
get => dismissedAlerts;
set
{
dismissedAlerts = value;
RaisePropertyChanged(nameof(DismissedAlerts));
}
}

public ObservableCollection<MenuItem> DismissedAlerts { get; set; } = new ObservableCollection<MenuItem>();

#endregion

#region events
Expand Down Expand Up @@ -704,7 +696,9 @@ public NodeViewModel(WorkspaceViewModel workspaceViewModel, NodeModel logic)

ErrorBubble = new InfoBubbleViewModel(DynamoViewModel);
UpdateBubbleContent();


ErrorBubble.ZIndex = 1000;

//Do a one time setup of the initial ports on the node
//we can not do this automatically because this constructor
//is called after the node's constructor where the ports
Expand Down Expand Up @@ -767,6 +761,8 @@ void RebuildDismissedWarningsCollection()
// Ellipses to truncate the message if too long
string ellipses = infoBubbleDataPacket.Message.Length > 30 ? "..." : "";



DismissedAlerts.Add(new MenuItem
{
Header = infoBubbleDataPacket.Message.Substring(0, Math.Min(infoBubbleDataPacket.Message.Length, 30)) + ellipses,
Expand Down Expand Up @@ -822,6 +818,7 @@ public override void Dispose()
{
p.Dispose();
}

ErrorBubble.Dispose();
DynamoSelection.Instance.Selection.CollectionChanged -= SelectionOnCollectionChanged;
base.Dispose();
Expand Down
Loading

0 comments on commit e4fc63d

Please sign in to comment.