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

DYN-6893 input symbol nodes should have default names - pt 1 #15193

Merged
merged 4 commits into from
May 7, 2024
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
12 changes: 9 additions & 3 deletions src/DynamoCore/Graph/Nodes/CustomNodes/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Dynamo.Engine;
using Dynamo.Engine.CodeGeneration;
using Dynamo.Library;
using Dynamo.Properties;
using Newtonsoft.Json;
using ProtoCore;
using ProtoCore.AST.AssociativeAST;
Expand Down Expand Up @@ -388,8 +389,13 @@ public Symbol()
RegisterAllPorts();

ArgumentLacing = LacingStrategy.Disabled;

InputSymbol = String.Empty;
InputSymbol = new TypedParameter(
Resources.InputPortAlternativeName,
"var",
-1,
null,
Resources.InputNodeRenameHint)
.ToCommentNameString();

ElementResolver = new ElementResolver();
}
Expand Down Expand Up @@ -463,7 +469,7 @@ public string InputSymbol
}

OnNodeModified();
RaisePropertyChanged("InputSymbol");
RaisePropertyChanged(nameof(InputSymbol));
}
}

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.

3 changes: 3 additions & 0 deletions src/DynamoCore/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -911,4 +911,7 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="LegacyTraceDataWarning" xml:space="preserve">
<value>This workspace contains element binding data in a legacy format that is no longer supported in Dynamo 3.0 and higher versions. Element binding data will be saved in the new format the next time you run and save this workspace.</value>
</data>
<data name="InputNodeRenameHint" xml:space="preserve">
<value>default input name, rename me!</value>
</data>
</root>
5 changes: 4 additions & 1 deletion src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -914,4 +914,7 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="LegacyTraceDataWarning" xml:space="preserve">
<value>This workspace contains element binding data in a legacy format that is no longer supported in Dynamo 3.0 and higher versions. Element binding data will be saved in the new format the next time you run and save this workspace.</value>
</data>
</root>
<data name="InputNodeRenameHint" xml:space="preserve">
<value>default input name, rename me!</value>
</data>
</root>
1 change: 1 addition & 0 deletions src/DynamoCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,7 @@ static Dynamo.Properties.Resources.IncorrectlyFormattedNodeLibraryWarning.get ->
static Dynamo.Properties.Resources.IncorrectVersionToOpenFile.get -> string
static Dynamo.Properties.Resources.InputLabel.get -> string
static Dynamo.Properties.Resources.InputNodeDescription.get -> string
static Dynamo.Properties.Resources.InputNodeRenameHint.get -> string
static Dynamo.Properties.Resources.InputNodeSearchTags.get -> string
static Dynamo.Properties.Resources.InputPortAlternativeName.get -> string
static Dynamo.Properties.Resources.InsertDialogBoxText.get -> string
Expand Down
8 changes: 8 additions & 0 deletions test/DynamoCoreTests/CustomNodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,5 +1423,13 @@ public void LooseCustomNodeShouldNotHavePackageInfoOrPackageMember()
Assert.IsFalse(nodeInfo.Value.IsPackageMember);
Assert.IsNull(nodeInfo.Value.PackageInfo);
}
[Test]
public void InputNodeShouldHaveNameByDefault()
{
var input = new Symbol();
Assert.NotNull(input.Parameter.Name);
Assert.IsNotEmpty(input.Parameter.Name);
Assert.AreEqual("input",input.Parameter.Name);
}
}
}
Loading