From a5bdb6e73bc838cd5151c952e6f1ef24dfbedc9e Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Fri, 12 Aug 2022 01:29:26 -0400 Subject: [PATCH 1/4] install notifications-center under Notifications (#13208) I found that because of my directory structure this npm install command was finding my global node_modules location. Then the embeddedResource targets were failing because the package was not installed there. The prefix option prefixes the node_modules folder were npm will install, here we just use current directory. --- src/Notifications/Notifications.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Notifications/Notifications.csproj b/src/Notifications/Notifications.csproj index 58597e7c69d..dcf928614ac 100644 --- a/src/Notifications/Notifications.csproj +++ b/src/Notifications/Notifications.csproj @@ -11,7 +11,7 @@ - + @@ -95,4 +95,4 @@ - \ No newline at end of file + From 07788fb873eb10b87931867498a6824b6d54fa98 Mon Sep 17 00:00:00 2001 From: jesusalvino <96534278+jesusalvino@users.noreply.github.com> Date: Fri, 12 Aug 2022 00:29:46 -0500 Subject: [PATCH 2/4] Fixing CustomNode WorkSpace first scenario and trusted bubble behavior (#13197) --- src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs | 4 ++-- src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs | 4 ++-- .../Views/FileTrust/FileTrustWarning.xaml.cs | 11 +++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs index 43043506aea..1404e4332c1 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs @@ -218,8 +218,8 @@ public int CurrentWorkspaceIndex // Keep DynamoModel.CurrentWorkspace update-to-date int modelIndex = model.Workspaces.IndexOf(currentWorkspaceViewModel.Model); - ExecuteCommand(new DynamoModel.SwitchTabCommand(modelIndex)); - (HomeSpaceViewModel as HomeWorkspaceViewModel).UpdateRunStatusMsgBasedOnStates(); + ExecuteCommand(new DynamoModel.SwitchTabCommand(modelIndex)); + (HomeSpaceViewModel as HomeWorkspaceViewModel)?.UpdateRunStatusMsgBasedOnStates(); } } } diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index b4b01b1c42e..e3d3efa6022 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -2507,8 +2507,8 @@ private void FileTrustWarning_Click(object sender, RoutedEventArgs e) } private void DynamoView_Activated(object sender, EventArgs e) - { - if (fileTrustWarningPopup != null) + { + if (fileTrustWarningPopup != null && dynamoViewModel.ViewingHomespace) { fileTrustWarningPopup.ManagePopupActivation(true); } diff --git a/src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs b/src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs index 3cf0d789462..ee639665648 100644 --- a/src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs +++ b/src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs @@ -52,9 +52,16 @@ public FileTrustWarning(DynamoView dynamoViewWindow) private void DynViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { - if (e.PropertyName == "CurrentSpace" && !dynViewModel.ViewingHomespace) + if (e.PropertyName == nameof(DynamoViewModel.CurrentSpace)) { - IsOpen = false; + if (dynViewModel.ViewingHomespace) + { + ManagePopupActivation(true); + } + else + { + IsOpen = false; + } } } From df64d01349af8820fe4807abe2f51142d77740fb Mon Sep 17 00:00:00 2001 From: jesusalvino <96534278+jesusalvino@users.noreply.github.com> Date: Fri, 12 Aug 2022 02:54:40 -0500 Subject: [PATCH 3/4] Add ValueMarkerWidth property (#13188) * Add ValueMarkerWidth property * Handling ValueMarkerColumn width in the UI * missing line * Adding UI Test * Adding UI test file * Adding UI Test * Set the property width to valueMarkerWidthWithFunction --- .../UI/Themes/Modern/OutPorts.xaml | 16 +- .../ViewModels/Core/OutPortViewModel.cs | 27 +++ test/DynamoCoreWpfTests/NodeViewTests.cs | 21 +- ...uemarker_portDefaultValueMarkerVisible.dyn | 213 ++++++++++++++++++ 4 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 test/UI/outport_valuemarker_portDefaultValueMarkerVisible.dyn diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/OutPorts.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/OutPorts.xaml index 3b42c660c72..3ca7fe010fb 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/OutPorts.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/OutPorts.xaml @@ -21,7 +21,21 @@ IsHitTestVisible="True"> - + + + + + + diff --git a/src/DynamoCoreWpf/ViewModels/Core/OutPortViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/OutPortViewModel.cs index ce8a595eec1..14a1475447b 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/OutPortViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/OutPortViewModel.cs @@ -21,12 +21,15 @@ public partial class OutPortViewModel : PortViewModel private SolidColorBrush portValueMarkerColor = new SolidColorBrush(Color.FromArgb(255, 204, 204, 204)); internal static SolidColorBrush PortValueMarkerGrey = new SolidColorBrush(Color.FromRgb(153, 153, 153)); + internal static int valueMarkerWidthWithFunction = 5; + internal static int valueMarkerWidthWithoutFunction = 0; private bool showContextMenu; private bool areConnectorsHidden; private string showHideWiresButtonContent = ""; private bool hideWiresButtonEnabled; private bool portDefaultValueMarkerVisible; + private int valueMarkerWidth; /// /// Sets the condensed styling on Code Block output ports. @@ -130,6 +133,29 @@ public bool PortDefaultValueMarkerVisible } } + /// + /// Returns the width from the ValueMarkerColumn + /// + public int ValueMarkerWidth + { + get => valueMarkerWidth; + } + + /// + /// Returns the width to assign to the ValueMarkerColumn when is function state + /// + public int ValueMarkerWidthWithFunction + { + get => valueMarkerWidthWithFunction; + } + + /// + /// Returns the width to assign to the ValueMarkerColumn when is not function state + /// + public int ValueMarkerWidthWithoutFunction + { + get => valueMarkerWidthWithoutFunction; + } /// /// Takes care of the multiple UI concerns when dealing with the Unhide/Hide Wires button @@ -310,6 +336,7 @@ private void OnMouseLeftButtonDownOnContext(object parameter) protected override void RefreshPortColors() { PortDefaultValueMarkerVisible = node.NodeModel.CachedValue != null && node.NodeModel.CachedValue.IsFunction && !node.IsWatchNode; + valueMarkerWidth = PortDefaultValueMarkerVisible ? valueMarkerWidthWithFunction : valueMarkerWidthWithoutFunction; } } } diff --git a/test/DynamoCoreWpfTests/NodeViewTests.cs b/test/DynamoCoreWpfTests/NodeViewTests.cs index ab37f72685c..cafc2d8c964 100644 --- a/test/DynamoCoreWpfTests/NodeViewTests.cs +++ b/test/DynamoCoreWpfTests/NodeViewTests.cs @@ -23,7 +23,8 @@ public class NodeViewTests : DynamoTestUIBase protected override void GetLibrariesToPreload(List libraries) { - libraries.Add("FunctionObject.ds"); + libraries.Add("FunctionObject.ds"); + libraries.Add("DesignScriptBuiltin.dll"); libraries.Add("BuiltIn.ds"); libraries.Add("DSCPython.dll"); libraries.Add("FFITarget.dll"); @@ -587,5 +588,23 @@ public void TestPortColors_NodeModel() Assert.AreEqual(InPortViewModel.PortValueMarkerRed.Color, (dportVMs[0] as InPortViewModel).PortValueMarkerColor.Color); Assert.True((doutPorts[0] as OutPortViewModel).PortDefaultValueMarkerVisible); } + + [Test] + public void TestPortDefaultValueMarket_Visibility() + { + Open(@"UI\outport_valuemarker_portDefaultValueMarkerVisible.dyn"); + + var nodeWithFunction = NodeViewWithGuid("e3269c4b-2bab-43d0-b362-f0a589cbe02d"); + var nodeWithOutFunction = NodeViewWithGuid("43985007-e995-494f-b3e7-7c5d6ba317c3"); + + var outPorts_Function = nodeWithFunction.ViewModel.OutPorts; + var outPorts_WithoutFunction = nodeWithOutFunction.ViewModel.OutPorts; + + OutPortViewModel outPort_With_Function = outPorts_Function[0] as OutPortViewModel; + OutPortViewModel outPort_Without_Function = outPorts_WithoutFunction[0] as OutPortViewModel; + + Assert.AreEqual(outPort_With_Function.ValueMarkerWidth, outPort_With_Function.ValueMarkerWidthWithFunction); + Assert.AreEqual(outPort_Without_Function.ValueMarkerWidth, outPort_Without_Function.ValueMarkerWidthWithoutFunction); + } } } \ No newline at end of file diff --git a/test/UI/outport_valuemarker_portDefaultValueMarkerVisible.dyn b/test/UI/outport_valuemarker_portDefaultValueMarkerVisible.dyn new file mode 100644 index 00000000000..5f7af4911a7 --- /dev/null +++ b/test/UI/outport_valuemarker_portDefaultValueMarkerVisible.dyn @@ -0,0 +1,213 @@ +{ + "Uuid": "0cfad1ba-bb08-4038-a111-59cef7711d26", + "IsCustomNode": false, + "Description": null, + "Name": "outport_valuemarker_portDefaultValueMarkerVisible", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "NodeType": "FunctionNode", + "FunctionSignature": "DesignScript.Builtin.Dictionary.ByKeysValues@string[],var[]..[]", + "Id": "e3269c4b2bab43d0b362f0a589cbe02d", + "Inputs": [ + { + "Id": "0f2fcee0e4554417826922807ce7f754", + "Name": "keys", + "Description": "Keys of dictionary\n\nstring[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "a19e4c1923bb451e90ef6ce6ba346096", + "Name": "values", + "Description": "Values of dictionary\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "976b2d5b9b81422a911837c9faf3f6e1", + "Name": "dictionary", + "Description": "Dictionary from keys and values", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "Produces a Dictionary with the supplied keys and values. The number of entries is the shorter of keys or values.\n\nDictionary.ByKeysValues (keys: string[], values: var[]..[]): Dictionary" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "NodeType": "FunctionNode", + "FunctionSignature": "DesignScript.Builtin.Dictionary.ByKeysValues@string[],var[]..[]", + "Id": "43985007e995494fb3e77c5d6ba317c3", + "Inputs": [ + { + "Id": "7bf8b99f500b4afa9a42126307a0e565", + "Name": "keys", + "Description": "Keys of dictionary\n\nstring[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "5dc512074dfa45429d898bc53396883b", + "Name": "values", + "Description": "Values of dictionary\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "63f8f0ab3eee42bd916339ab67dc8556", + "Name": "dictionary", + "Description": "Dictionary from keys and values", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "Produces a Dictionary with the supplied keys and values. The number of entries is the shorter of keys or values.\n\nDictionary.ByKeysValues (keys: string[], values: var[]..[]): Dictionary" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", + "NodeType": "CodeBlockNode", + "Code": "[\"Hello\",\"World\"];\n[1,2];", + "Id": "b0f0685937b9444dbc5e3fe6dc2f5112", + "Inputs": [], + "Outputs": [ + { + "Id": "bc2e164158734eb3999a400134507eea", + "Name": "", + "Description": "Value of expression at line 1", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "1c3455226cf049d29c462e26e1377201", + "Name": "", + "Description": "Value of expression at line 2", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Allows for DesignScript code to be authored directly" + } + ], + "Connectors": [ + { + "Start": "bc2e164158734eb3999a400134507eea", + "End": "7bf8b99f500b4afa9a42126307a0e565", + "Id": "e0b301c3cc774a12b6ce4b000df20821", + "IsHidden": "False" + }, + { + "Start": "1c3455226cf049d29c462e26e1377201", + "End": "5dc512074dfa45429d898bc53396883b", + "Id": "42cdeef42a104b2eb98317dc3253233d", + "IsHidden": "False" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [], + "Thumbnail": "", + "GraphDocumentationURL": null, + "ExtensionWorkspaceData": [ + { + "ExtensionGuid": "28992e1d-abb9-417f-8b1b-05e053bee670", + "Name": "Properties", + "Version": "2.16", + "Data": {} + } + ], + "Author": "None provided", + "Linting": { + "activeLinter": "None", + "activeLinterId": "7b75fb44-43fd-4631-a878-29f4d5d8399a", + "warningCount": 0, + "errorCount": 0 + }, + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": true, + "IsVisibleInDynamoLibrary": true, + "Version": "2.16.0.2215", + "RunType": "Automatic", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "ConnectorPins": [], + "NodeViews": [ + { + "Name": "With Function State", + "ShowGeometry": true, + "Id": "e3269c4b2bab43d0b362f0a589cbe02d", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 98.391454139287021, + "Y": 304.30657294978636 + }, + { + "Name": "No Function State", + "ShowGeometry": true, + "Id": "43985007e995494fb3e77c5d6ba317c3", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 100.87220284075806, + "Y": 513.49899824029239 + }, + { + "Name": "Code Block", + "ShowGeometry": true, + "Id": "b0f0685937b9444dbc5e3fe6dc2f5112", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": -215.66336600516274, + "Y": 494.92370187174367 + } + ], + "Annotations": [], + "X": 278.70863229971621, + "Y": -293.17906607266212, + "Zoom": 1.0862025341059167 + } +} \ No newline at end of file From 933f16c61c3798961a965063cf2eaf067fc81824 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" <173288704@qq.com> Date: Mon, 15 Aug 2022 10:00:03 -0700 Subject: [PATCH 4/4] Localize Color Picker imp (#13203) * Initialize with current culture * Revert "Initialize with current culture" This reverts commit cb89a20f706f659df45937ba1d8470803ae71252. * Add resource strings for buttons --- .../Controls/ColorPalette.xaml | 4 +++- .../CoreNodeModelsWpf.csproj | 20 +++++++++---------- .../CoreNodeModelWpfResources.Designer.cs | 18 +++++++++++++++++ .../CoreNodeModelWpfResources.en-US.resx | 6 ++++++ .../Properties/CoreNodeModelWpfResources.resx | 6 ++++++ 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/Libraries/CoreNodeModelsWpf/Controls/ColorPalette.xaml b/src/Libraries/CoreNodeModelsWpf/Controls/ColorPalette.xaml index 3b6441eec9a..75d7d7d3081 100644 --- a/src/Libraries/CoreNodeModelsWpf/Controls/ColorPalette.xaml +++ b/src/Libraries/CoreNodeModelsWpf/Controls/ColorPalette.xaml @@ -17,7 +17,9 @@ Width="80" AvailableColorsHeader="{x:Static p:CoreNodeModelWpfResources.ColorPaletteUIStandardColors}" ShowStandardColors="False" - ShowRecentColors="True" + ShowRecentColors="True" + StandardButtonHeader="{x:Static p:CoreNodeModelWpfResources.ColorPaletteUIStandardButtonHeader}" + AdvancedButtonHeader="{x:Static p:CoreNodeModelWpfResources.ColorPaletteUIAdvancedButtonHeader}" RecentColorsHeader="{x:Static p:CoreNodeModelWpfResources.ColorPaletteUIRecentColors}" /> diff --git a/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj b/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj index 058a15adde0..ed58160674e 100644 --- a/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj +++ b/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj @@ -92,15 +92,15 @@ - - True + True - Resources.resx - - True + CoreNodeModelWpfResources.resx + + True - Resources.en-US.resx + True + CoreNodeModelWpfResources.en-US.resx @@ -110,13 +110,13 @@ - + PublicResXFileCodeGenerator - Resources.Designer.cs + CoreNodeModelWpfResources.en-US.Designer.cs - + PublicResXFileCodeGenerator - Resources.en-US.Designer.cs + CoreNodeModelWpfResources.Designer.cs diff --git a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.Designer.cs b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.Designer.cs index f4214446264..442bc0348ad 100644 --- a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.Designer.cs +++ b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.Designer.cs @@ -60,6 +60,15 @@ internal CoreNodeModelWpfResources() { } } + /// + /// Looks up a localized string similar to Advanced. + /// + public static string ColorPaletteUIAdvancedButtonHeader { + get { + return ResourceManager.GetString("ColorPaletteUIAdvancedButtonHeader", resourceCulture); + } + } + /// /// Looks up a localized string similar to Recent Colors. /// @@ -69,6 +78,15 @@ public static string ColorPaletteUIRecentColors { } } + /// + /// Looks up a localized string similar to Standard. + /// + public static string ColorPaletteUIStandardButtonHeader { + get { + return ResourceManager.GetString("ColorPaletteUIStandardButtonHeader", resourceCulture); + } + } + /// /// Looks up a localized string similar to Standard Colors. /// diff --git a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.en-US.resx b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.en-US.resx index 16e141a5920..e5718d85d89 100644 --- a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.en-US.resx +++ b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.en-US.resx @@ -117,9 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Advanced + Recent Colors + + Standard + Standard Colors diff --git a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.resx b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.resx index 16e141a5920..e5718d85d89 100644 --- a/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.resx +++ b/src/Libraries/CoreNodeModelsWpf/Properties/CoreNodeModelWpfResources.resx @@ -117,9 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Advanced + Recent Colors + + Standard + Standard Colors