-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-2149 DummyNode unresolved node messages are confusing #10051
Conversation
InputCount = inputCount; | ||
OutputCount = outputCount; | ||
|
||
string legacyName = "Unresolved"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner @aparajit-pratap I cant remember, do we localize node names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found out that we do not localize node names, so we should be fine here
@@ -96,11 +96,22 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist | |||
{ | |||
NodeModel node = null; | |||
|
|||
String typeName = null; | |||
String functionName = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would usually recommend to use String.Empty
because it is less likely to cause crashes. But I saw you have wrapped string null check lots of places which is also good.
@reddyashish - I think something we neglected to consider or discuss yesterday was
Have you considered that other case and ensured it is not broken now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- let's improve the zero touch dummy node messaging - as you have done here
- let's keep the NodeModel dummy node messaging as it is - using type and assembly - as those will be known for NodeModel nodes.
- tests for both cases.
if (typeName.Contains("ZeroTouch")) | ||
{ | ||
// This assemblyName does not usually contain version information... | ||
if (typeName.Contains("ZeroTouch")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we be specific about this- it's possible anyone could make a nodeModel and name it ZeroTouch
lets use our entire namespace and type name - including the assembly name would be fine as well for precision.
// This assemblyName does not usually contain version information... | ||
if (typeName.Contains("ZeroTouch")) | ||
{ | ||
// If it is a zero touch node, then get the whole function name including the namespace. | ||
functionName = obj["FunctionSignature"].Value<string>().Split('@').FirstOrDefault().Trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do FunctionSignatures always have the @
token? What if it's not there, what happens?
Added the typename info for the node model node. Now the message for node model node looks like this: @mjkkirschner If the function signature has not parameters(no '@'), it just takes the complete name. Have tested this case. |
Also have checked for the complete namespace for xero-touch nodes. The assembly name is stored as DynamoCore in the type string. So was just checking for the namespace. |
/// <summary> | ||
/// Type name of the node. | ||
/// </summary> | ||
public string TypeName { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to overload the LegacyNodeName - maybe note that this is property is only valid for NodeModel dummy nodes?
/// <summary> | ||
/// Returns the node's function name | ||
/// </summary> | ||
public string FunctionName { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to overload the LegacyNodeName - maybe note that this is property is only valid for ZeroTouch dummy nodes?
} | ||
else | ||
{ | ||
const string format = "Node of type '{0}' ({1}) cannot be resolved"; | ||
return string.Format(format, LegacyNodeName, LegacyAssembly); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is LegacyNodeName
used anywhere anymore? If not maybe you want to obsolete it?
@reddyashish it looks good, thanks for the hard work, just a few last comments. |
Added more comments. The LegacyNodeName and LegacyFullName are being used in some other places so I din't remove or obsolete it. |
Purpose
This PR is to improve the warning message shown on the unresolved dummy nodes.
Task: https://jira.autodesk.com/browse/DYN-2149
The description of the node is shown when the user hovers on the node. When the node is of type 'unresolved', a warning message is shown that specifies the function name.
Before this change, the message was:
After this change,
The assembly name is not stored in the object so instead we show the whole function name(along with the namespace).
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@DynamoDS/dynamo