Skip to content

Commit

Permalink
Node informational states (#4) (DynamoDS#11910)
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 (DynamoDS#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 (DynamoDS#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

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

Co-authored-by: aparajit-pratap <[email protected]>
  • Loading branch information
OliverEGreen and aparajit-pratap authored Aug 18, 2021
1 parent 28412bb commit 7dedb76
Show file tree
Hide file tree
Showing 17 changed files with 2,434 additions and 181 deletions.
1 change: 1 addition & 0 deletions src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ limitations under the License.
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblySharedInfoGenerator\AssemblySharedInfo.cs">
Expand Down
15 changes: 15 additions & 0 deletions src/DynamoCore/Graph/Nodes/NodeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using ProtoCore.Mirror;
using String = System.String;
using StringNode = ProtoCore.AST.AssociativeAST.StringNode;
using Type = System.Type;

namespace Dynamo.Graph.Nodes
{
Expand Down Expand Up @@ -144,6 +145,19 @@ private void OnDispatchedToUI(object sender, UIDispatcherEventArgs e)
/// </summary>
public event Action<NodeModel> NodeExecutionBegin;

/// <summary>
/// Event triggered whenever the node re-executes to clear its warnings and errors.
/// </summary>
public event Action<NodeModel> NodeMessagesClearing;

/// <summary>
/// Fires on each node that is modified when the graph executes.
/// </summary>
internal void OnNodeMessagesClearing()
{
NodeMessagesClearing?.Invoke(this);
}

internal void OnNodeExecutionBegin()
{
NodeExecutionBegin?.Invoke(this);
Expand Down Expand Up @@ -1578,6 +1592,7 @@ public virtual void ClearErrorsAndWarnings()

SetNodeStateBasedOnConnectionAndDefaults();
ClearTooltipText();
OnNodeMessagesClearing();
}

public void SelectNeighbors()
Expand Down
8 changes: 8 additions & 0 deletions src/DynamoCore/Graph/Workspaces/HomeWorkspaceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,14 @@ public void Run()
// The workspace has been built for the first time
silenceNodeModifications = false;

// An event handler we can listen to on the NodeViewModel, to update the
// node's informational state. This is required because Errors and Warnings
// currently fire differently from one another.
foreach (NodeModel nodeModel in task.ModifiedNodes)
{
nodeModel.OnNodeMessagesClearing();
}

OnEvaluationStarted(EventArgs.Empty);
scheduler.ScheduleForExecution(task);

Expand Down
9 changes: 9 additions & 0 deletions src/DynamoCore/Properties/Resources.Designer.cs

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

31 changes: 31 additions & 0 deletions src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -761,4 +761,35 @@ Parameter name: {0}</value>
<data name="NoneLinterDescriptorName" xml:space="preserve">
<value>None</value>
</data>
<data name="PackageStatePendingUnload" xml:space="preserve">
<value>Scheduled to be unloaded</value>
</data>
<data name="PackageStateError" xml:space="preserve">
<value>Error</value>
</data>
<data name="PackageStateLoaded" xml:space="preserve">
<value>Loaded</value>
</data>
<data name="PackageStateUnloaded" xml:space="preserve">
<value>Unloaded</value>
</data>
<data name="PackageStatePendingUnloadTooltip" xml:space="preserve">
<value>Scheduled to be unloaded.
This package will be unloaded after the next Dynamo restart.</value>
</data>
<data name="PackageStateErrorTooltip" xml:space="preserve">
<value>Unloaded.
This package has not been loaded due to an unexpected error.</value>
</data>
<data name="PackageStateLoadedTooltip" xml:space="preserve">
<value>Loaded.
This package is loaded and ready to be used.</value>
</data>
<data name="PackageStateUnloadedTooltip" xml:space="preserve">
<value>Unloaded.
This package has not been loaded because another conflicting package was loaded before it.</value>
</data>
<data name="NodeInformationalStateShowAllErrors" xml:space="preserve">
<value>Show all errors</value>
</data>
</root>
34 changes: 33 additions & 1 deletion src/DynamoCoreWpf/Commands/InfoBubbleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public partial class InfoBubbleViewModel : ViewModelBase
private DelegateCommand showCondensedContentCommand;
private DelegateCommand changeInfoBubbleStateCommand;
private DelegateCommand openDocumentationLinkCommand;
private DelegateCommand dismissMessageCommand;
private DelegateCommand undismissMessageCommand;

public DelegateCommand UpdateContentCommand
{
Expand All @@ -31,7 +33,6 @@ public DelegateCommand UpdatePositionCommand
return updatePositionCommand;
}
}

public DelegateCommand ResizeCommand
{
get
Expand Down Expand Up @@ -94,5 +95,36 @@ public DelegateCommand OpenDocumentationLinkCommand
}
}

/// <summary>
/// Fires when the user manually dismisses a message by clicking the little 'X' button next to it.
/// Users can only dismiss Info Messages and Warnings - not Errors.
/// </summary>
public DelegateCommand DismissMessageCommand
{
get
{
if (dismissMessageCommand == null)
{
dismissMessageCommand = new DelegateCommand(DismissMessage);
}
return dismissMessageCommand;
}
}

/// <summary>
/// Fires when the user manually selects a previously-dismissed message from the node's ContextMenu.
/// This un-dismisses the message and causes it to reappear above the node again.
/// </summary>
public DelegateCommand UndismissMessageCommand
{
get
{
if (undismissMessageCommand == null)
{
undismissMessageCommand = new DelegateCommand(UndismissMessage);
}
return undismissMessageCommand;
}
}
}
}
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ViewModels\Watch3D\shaderSource\CompileShaders.bat" />
<Resource Include="UI\Images\caret_up.png" />
<Resource Include="UI\Images\cursors.psd" />
<Resource Include="UI\Images\cursors1.psd" />
</ItemGroup>
Expand Down Expand Up @@ -1398,7 +1399,6 @@
<Resource Include="UI\Images\Pin_NoBackground_16_16.png" />
<Resource Include="UI\Images\menu_16_16.png" />
<Resource Include="UI\Images\caret_down.png" />
<Resource Include="UI\Images\caret_up.png" />
<Resource Include="UI\Images\PackageManager\close_16_16.png" />
<Resource Include="UI\Images\PackageManager\down_16_16.png" />
<Resource Include="UI\Images\PackageManager\folder_16_16.png" />
Expand Down
81 changes: 81 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.

27 changes: 27 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2508,6 +2508,33 @@ Uninstall the following packages: {0}?</value>
<data name="GetStartedGuideSurveyTitle" xml:space="preserve">
<value>Finished</value>
</data>
<data name="NodeInformationalStateDismiss" xml:space="preserve">
<value>Dismiss</value>
</data>
<data name="NodeInformationalStateShowAllInfo" xml:space="preserve">
<value>Show all info</value>
</data>
<data name="NodeInformationalStateShowAllWarnings" xml:space="preserve">
<value>Show all warnings</value>
</data>
<data name="NodeInformationalStateShowAllErrors" xml:space="preserve">
<value>Show all errors</value>
</data>
<data name="NodeInformationalStateShowLess" xml:space="preserve">
<value>Show less</value>
</data>
<data name="NodeInformationalStateLearnMore" xml:space="preserve">
<value>Learn more</value>
</data>
<data name="NodeInformationalStateDismissAll" xml:space="preserve">
<value>Dismiss all</value>
</data>
<data name="NodeInfoDismissButtonToolTip" xml:space="preserve">
<value>Dismisses the info messages on this node. Utilize when you want to design in graph failures, or the info message will not be relevant during graph execution.</value>
</data>
<data name="NodeWarningDismissButtonToolTip" xml:space="preserve">
<value>Dismisses the warning messages on this node. Utilize when you want to design in graph failures, or the warning message will not be relevant during graph execution.</value>
</data>
<data name="BreakConnectionPopupMenuItem" xml:space="preserve">
<value>Break Connection</value>
</data>
Expand Down
27 changes: 27 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,33 @@ Uninstall the following packages: {0}?</value>
<data name="NodeRenamedLabel" xml:space="preserve">
<value>Renamed</value>
</data>
<data name="NodeInformationalStateDismiss" xml:space="preserve">
<value>Dismiss</value>
</data>
<data name="NodeInfoDismissButtonToolTip" xml:space="preserve">
<value>Dismisses the info messages on this node. Utilize when you want to design in graph failures, or the info message will not be relevant during graph execution.</value>
</data>
<data name="NodeWarningDismissButtonToolTip" xml:space="preserve">
<value>Dismisses the warning messages on this node. Utilize when you want to design in graph failures, or the warning message will not be relevant during graph execution.</value>
</data>
<data name="NodeInformationalStateDismissAll" xml:space="preserve">
<value>Dismiss all</value>
</data>
<data name="NodeInformationalStateLearnMore" xml:space="preserve">
<value>Learn more</value>
</data>
<data name="NodeInformationalStateShowAllInfo" xml:space="preserve">
<value>Show all info</value>
</data>
<data name="NodeInformationalStateShowAllWarnings" xml:space="preserve">
<value>Show all warnings</value>
</data>
<data name="NodeInformationalStateShowAllErrors" xml:space="preserve">
<value>Show all errors</value>
</data>
<data name="NodeInformationalStateShowLess" xml:space="preserve">
<value>Show less</value>
</data>
<data name="PackagePathProtected" xml:space="preserve">
<value>This path is built-in and cannot be modified.</value>
</data>
Expand Down
Loading

0 comments on commit 7dedb76

Please sign in to comment.