From cc95adfd0f3a8723cc1b264a860e48e12ecce375 Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Wed, 18 Jan 2023 14:30:29 +0000 Subject: [PATCH] Revert "Merge remote-tracking branch 'upstream/master' into LiveChartImplementation" This reverts commit 321a32686c178a91de260aee25bbb8d2d611fdde, reversing changes made to 1023291bba678c49256e957192d77515254a3cca. --- .../Docs/ArgumentNullException.html | 3 +-- .../Docs/CustomNodeNotLoaded.html | 8 +++---- .../Docs/DereferencingNonPointer.html | 5 ++-- .../Docs/ExcelNotInstalled.html | 2 +- .../Docs/IntegerOverflow.html | 2 +- .../Docs/InvalidKeysLenghtErrorMessage.html | 5 ++-- .../MessageFailedToOpenCorruptedFile.html | 1 - src/DynamoCore/Models/DynamoModel.cs | 16 ++----------- .../NodeAutoCompleteSearchControl.xaml.cs | 23 ++++--------------- .../Services/UsageReportingManager.cs | 3 +-- .../ViewModels/Menu/PreferencesViewModel.cs | 14 ++--------- .../Search/NodeAutoCompleteSearchViewModel.cs | 8 +------ .../Views/Menu/PreferencesView.xaml.cs | 5 ++++ .../Views/Preview/WatchTree.xaml | 14 +++++------ .../Views/SplashScreen/SplashScreen.xaml.cs | 22 ++---------------- 15 files changed, 34 insertions(+), 97 deletions(-) diff --git a/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html b/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html index 5ec179730e9..8f18bf5bf66 100644 --- a/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html +++ b/src/DocumentationBrowserViewExtension/Docs/ArgumentNullException.html @@ -34,7 +34,6 @@ min-width:300px; max-width:450px; width:100%; - background-color: white; } @@ -54,7 +53,7 @@

How to fix

Another approach is to use a combination of Object.IsNull and List.FilterByBoolMask to filter null values from your data, as shown below:

-Example of using object is null with list filter by bool mask to filter null values from input data +Example of using object is null with list filter by bool mask to filter null values from input data

More information

To find out more, please check posts on the Dynamobim forum discussing "value cannot be null".

diff --git a/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html b/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html index c0cc1f7a391..ea7183c3004 100644 --- a/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html +++ b/src/DocumentationBrowserViewExtension/Docs/CustomNodeNotLoaded.html @@ -31,9 +31,9 @@ background-color: transparent; } img { - - width:auto; - background-color: white; + min-width:300px; + max-width:450px; + width:100%; } @@ -50,7 +50,7 @@

How to fix

The node might also come from a local package or dll and will therefore not be available in the Package Manager. If this is the case you need to manually load the dll by pressing the “+” sign under the “Add-ons” tab in the library pane, as shown below:

- Image showing plus button at the bottom of the package manager window + Image showing plus button at the bottom of the package manager window

More information

To find out more, please check posts on the Dynamobim forum discussing "custom node not loaded".

diff --git a/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html b/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html index 6292c0d50f2..18490ed0202 100644 --- a/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html +++ b/src/DocumentationBrowserViewExtension/Docs/DereferencingNonPointer.html @@ -1,4 +1,4 @@ - -Example of using object is null with list filter by bool mask to filter null values from input data +Example of using object is null with list filter by bool mask to filter null values from input data

More information

To find out more, please check posts on the Dynamobim forum discussing "dereferencing a non-pointer".

diff --git a/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html b/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html index ade2b9bb615..f79311b8ae4 100644 --- a/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html +++ b/src/DocumentationBrowserViewExtension/Docs/ExcelNotInstalled.html @@ -47,7 +47,7 @@

Excel not installed

How to fix

To resolve this error, make sure that Excel is installed on your machine. If you do not have access to Excel from your machine, there are other methods you can use to export data from Dynamo (e.g., you can use the Data.ExportCSV node which will save your data to a comma-separated values (csv) file). A .csv file can easily be opened in Excel if needed.

- Example of using data export csv node + Example of using data export csv node

More information

diff --git a/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html b/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html index fdbecf3aa0a..56fbe2167cd 100644 --- a/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html +++ b/src/DocumentationBrowserViewExtension/Docs/IntegerOverflow.html @@ -72,7 +72,7 @@

How to fix

-Example of converting numbers from int to double to avoid overflow +Example of converting numbers from int to double to avoid overflow

More information

To find out more, please check posts on the Dynamobim forum discussing "integer overflow".

diff --git a/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html b/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html index 071b206c076..847cf705b5e 100644 --- a/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html +++ b/src/DocumentationBrowserViewExtension/Docs/InvalidKeysLenghtErrorMessage.html @@ -34,7 +34,6 @@ min-width:300px; max-width:450px; width:100%; - background-color: white; } @@ -45,13 +44,13 @@

Number of items does not match the number of keys

This error message indicates that there is mismatch between the number of keys and the number of values passed into your node (i.e., the Keys input of your node received fewer or more items that the List input of your node). In the example below, the list input received ten items, whereas the keys input received only five (i.e., each key must have a corresponding value and vice-versa):

- Example of using mismatching number of keys inputs and list inputs in the list group by keys node + Example of using mismatching number of keys inputs and list inputs in the list group by keys node

How to fix

Make sure that both inputs (i.e., both Keys input and List input) on your node have the same number of elements, as shown below:

- Example of using matching number of keys inputs and list inputs in the list group by keys node + Example of using matching number of keys inputs and list inputs in the list group by keys node

More information

To find out more, please check posts on the Dynamobim forum discussing "number of items does not match the number of keys".

diff --git a/src/DocumentationBrowserViewExtension/Docs/MessageFailedToOpenCorruptedFile.html b/src/DocumentationBrowserViewExtension/Docs/MessageFailedToOpenCorruptedFile.html index 50e4fff97a2..e7498c519b3 100644 --- a/src/DocumentationBrowserViewExtension/Docs/MessageFailedToOpenCorruptedFile.html +++ b/src/DocumentationBrowserViewExtension/Docs/MessageFailedToOpenCorruptedFile.html @@ -34,7 +34,6 @@ min-width:300px; max-width:450px; width:100%; - background-color: white; } diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index 4916fa7082a..135980b9067 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -703,20 +703,8 @@ protected DynamoModel(IStartConfiguration config) // or the feature flags client. if (!areAnalyticsDisabledFromConfig && !Dynamo.Logging.Analytics.DisableAnalytics) { - // Start the Analytics service only when a session is not present. - // In an integrator host, as splash screen can be closed without shutting down the ViewModel, the analytics service is not stopped. - // So we don't want to start it when splash screen or dynamo window is launched again. - if (Analytics.client == null) - { - AnalyticsService.Start(this, IsHeadless, IsTestMode); - } - else if (Analytics.client is DynamoAnalyticsClient dac) - { - if (dac.Session == null) - { - AnalyticsService.Start(this, IsHeadless, IsTestMode); - } - } + AnalyticsService.Start(this, IsHeadless, IsTestMode); + //run process startup/reading on another thread so we don't block dynamo startup. //if we end up needing to control aspects of dynamo model or view startup that we can't make diff --git a/src/DynamoCoreWpf/Controls/NodeAutoCompleteSearchControl.xaml.cs b/src/DynamoCoreWpf/Controls/NodeAutoCompleteSearchControl.xaml.cs index 9ea52024980..7d5502392ba 100644 --- a/src/DynamoCoreWpf/Controls/NodeAutoCompleteSearchControl.xaml.cs +++ b/src/DynamoCoreWpf/Controls/NodeAutoCompleteSearchControl.xaml.cs @@ -7,7 +7,6 @@ using System.Windows.Data; using System.Windows.Input; using System.Windows.Threading; -using Dynamo.Graph.Nodes.ZeroTouch; using Dynamo.Graph.Workspaces; using Dynamo.Logging; using Dynamo.Models; @@ -98,23 +97,10 @@ private void ExecuteSearchElement(ListBoxItem listBoxItem) if (searchElement.CreateAndConnectCommand.CanExecute(port.PortModel)) { searchElement.CreateAndConnectCommand.Execute(port.PortModel); - var selectedNodeName = (searchElement.Model is Search.SearchElements.ZeroTouchSearchElement) ? - searchElement.Model.CreationName : - // Same as NameTypeId.ToStrng() format - string.Format("{0}, {1}", searchElement.Model.CreationName, searchElement.Assembly.Split('\\').Last().Split('.').First()); - var originalNodeName = (port.NodeViewModel.NodeModel is DSFunctionBase) ? - port.NodeViewModel.NodeModel.CreationName : - string.Format("{0}, {1}", port.NodeViewModel.NodeModel.GetType().FullName, port.NodeViewModel.NodeModel.GetType().Assembly.GetName().Name) ; - var searchElementInfo = ViewModel.IsDisplayingMLRecommendation ? - selectedNodeName + " " + port.PortModel.Index.ToString() + " " + port.PortName + " " + originalNodeName + " " + - searchElement.Model.AutoCompletionNodeElementInfo.PortToConnect.ToString() + " " + - searchElement.AutoCompletionNodeMachineLearningInfo.ConfidenceScore.ToString() + " " + ViewModel.ServiceVersion - : selectedNodeName; - Analytics.TrackEvent( Dynamo.Logging.Actions.Select, Dynamo.Logging.Categories.NodeAutoCompleteOperations, - searchElementInfo); + searchElement.FullName); } } } @@ -320,8 +306,7 @@ private void ShowLowConfidenceResults(object sender, RoutedEventArgs e) Analytics.TrackEvent( Actions.Expanded, Categories.NodeAutoCompleteOperations, - "LowConfidenceResults", - ViewModel.dynamoViewModel.Model.PreferenceSettings.MLRecommendationConfidenceLevel); + "LowConfidenceResults"); } private void OnSuggestion_Click(object sender, RoutedEventArgs e) @@ -330,12 +315,12 @@ private void OnSuggestion_Click(object sender, RoutedEventArgs e) if (selectedSuggestion.Name.Contains(nameof(Models.NodeAutocompleteSuggestion.MLRecommendation))) { ViewModel.dynamoViewModel.PreferenceSettings.DefaultNodeAutocompleteSuggestion = Models.NodeAutocompleteSuggestion.MLRecommendation; - Analytics.TrackEvent(Actions.Switch, Categories.Preferences, nameof(NodeAutocompleteSuggestion.MLRecommendation)); + Analytics.TrackEvent(Actions.Select, Categories.Preferences, nameof(NodeAutocompleteSuggestion.MLRecommendation)); } else { ViewModel.dynamoViewModel.PreferenceSettings.DefaultNodeAutocompleteSuggestion = Models.NodeAutocompleteSuggestion.ObjectType; - Analytics.TrackEvent(Actions.Switch, Categories.Preferences, nameof(NodeAutocompleteSuggestion.ObjectType)); + Analytics.TrackEvent(Actions.Select, Categories.Preferences, nameof(NodeAutocompleteSuggestion.ObjectType)); } ViewModel.PopulateAutoCompleteCandidates(); } diff --git a/src/DynamoCoreWpf/Services/UsageReportingManager.cs b/src/DynamoCoreWpf/Services/UsageReportingManager.cs index 1aa3867cd2e..7a3de7236d2 100644 --- a/src/DynamoCoreWpf/Services/UsageReportingManager.cs +++ b/src/DynamoCoreWpf/Services/UsageReportingManager.cs @@ -159,8 +159,7 @@ public void CheckIsFirstRun(Window ownerWindow, IBrandingResourceProvider resour { resourceProvider = resource; // First run of Dynamo - if (dynamoViewModel != null - && dynamoViewModel.Model.PreferenceSettings.IsFirstRun + if (dynamoViewModel.Model.PreferenceSettings.IsFirstRun && !dynamoViewModel.HideReportOptions && !Analytics.DisableAnalytics && !DynamoModel.IsTestMode) diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index d6ff1b2f390..df7649249ee 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -860,11 +860,13 @@ public bool NodeAutocompleteMachineLearningIsChecked { preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; + Analytics.TrackEvent(Actions.Select,Categories.Preferences,nameof(NodeAutocompleteSuggestion.MLRecommendation)); } else { preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; + Analytics.TrackEvent(Actions.Select, Categories.Preferences, nameof(NodeAutocompleteSuggestion.ObjectType)); } dynamoViewModel.HomeSpaceViewModel.NodeAutoCompleteSearchViewModel.ResetAutoCompleteSearchViewState(); @@ -1461,18 +1463,6 @@ private void Model_PropertyChanged(object sender, PropertyChangedEventArgs e) case nameof(DisableTrustWarnings): description = Resources.ResourceManager.GetString(nameof(Res.PreferencesViewTrustWarningHeader), System.Globalization.CultureInfo.InvariantCulture); goto default; - // We track these this in two places, one in preference panel, - // one where user make such switch in Node AutoComplete UI - case nameof(nodeAutocompleteSuggestion): - if (nodeAutocompleteSuggestion == NodeAutocompleteSuggestion.MLRecommendation) - description = nameof(NodeAutocompleteSuggestion.MLRecommendation); - else - description = nameof(NodeAutocompleteSuggestion.ObjectType); - goto default; - case nameof(MLRecommendationConfidenceLevel): - // Internal use only, no need to localize for now - description = "Confidence Level"; - goto default; default: if (!string.IsNullOrEmpty(description)) { diff --git a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs index f3140c67067..138403ad7b8 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs @@ -38,11 +38,6 @@ public class NodeAutoCompleteSearchViewModel : SearchViewModel private bool displayLowConfidence; private const string nodeAutocompleteMLEndpoint = "MLNodeAutocomplete"; - /// - /// The Node AutoComplete ML service version, this could be empty if user has not used ML way - /// - internal string ServiceVersion { get; set; } - /// /// Cache of default node suggestions, use it in case where /// a. our algorithm does not return sufficient results @@ -121,7 +116,6 @@ internal NodeAutoCompleteSearchViewModel(DynamoViewModel dynamoViewModel) : base { // Off load some time consuming operation here InitializeDefaultAutoCompleteCandidates(); - ServiceVersion = string.Empty; } /// @@ -286,7 +280,7 @@ internal void DisplayMachineLearningResults() Analytics.TrackEvent(Actions.View, Categories.NodeAutoCompleteOperations, "NoRecommendation"); return; } - ServiceVersion = MLresults.Version; + var results = new List(); var zeroTouchSearchElements = Model.SearchEntries.OfType().Where(x => x.IsVisibleInSearch); diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 8dd397935ef..d8b288d5abd 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -581,6 +581,11 @@ int getExtraLeftSpace(int confidenceLevel) private void sliderConfidenceLevel_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { displayConfidenceLevel(); + //Tracking Analytics when changing the ML Confidence Level in the Preferences panel + Analytics.TrackEvent( + Actions.Set, + Categories.Preferences, + "ConfidendeLevel"); } private void displayConfidenceLevel() diff --git a/src/DynamoCoreWpf/Views/Preview/WatchTree.xaml b/src/DynamoCoreWpf/Views/Preview/WatchTree.xaml index 6f9443e5ba1..9082eacbc28 100644 --- a/src/DynamoCoreWpf/Views/Preview/WatchTree.xaml +++ b/src/DynamoCoreWpf/Views/Preview/WatchTree.xaml @@ -1,4 +1,4 @@ - @@ -177,12 +176,11 @@ @@ -469,4 +467,4 @@ - + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs index 0852c72e4ac..cc2ecfb10d4 100644 --- a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs +++ b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs @@ -63,8 +63,6 @@ public DynamoView DynamoView { dynamoView = value; viewModel = value.DataContext as DynamoViewModel; - // When view model is closed, we need to close the splash screen if it is displayed. - viewModel.RequestClose += SplashScreenRequestClose; authManager = viewModel.Model.AuthenticationManager; } } @@ -142,15 +140,6 @@ private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCo OnRequestDynamicSplashScreen(); } - /// - /// Request to close SplashScreen. - /// - private void SplashScreenRequestClose(object sender, EventArgs e) - { - CloseWindow(); - viewModel.RequestClose -= SplashScreenRequestClose; - } - /// /// Import setting file from chosen path /// @@ -199,6 +188,7 @@ private bool SignOut() private void LaunchDynamo(bool isCheckboxChecked) { viewModel.PreferenceSettings.EnableStaticSplashScreen = !isCheckboxChecked; + DynamoModel.RequestUpdateLoadBarStatus -= DynamoModel_RequestUpdateLoadBarStatus; StaticSplashScreenReady -= OnStaticScreenReady; Close(); dynamoView.Show(); @@ -212,6 +202,7 @@ private void OnStaticScreenReady() { // Stop the timer in any case loadingTimer.Stop(); + loadingTimer = null; //When a xml preferences settings file is located at C:\ProgramData\Dynamo will be read and deserialized so the settings can be set correctly. LoadPreferencesFileAtStartup(); @@ -453,21 +444,12 @@ private void CloseWindow() Application.Current.Shutdown(); Analytics.TrackEvent(Actions.Close, Categories.SplashScreenOperations); } - // If Dynamo is launched from an integrator host, user should be able to close the splash screen window. - // Additionally, we will have to shutdown the ViewModel which will close all the services and dispose the events. - // RequestUpdateLoadBarStatus event needs to be unsubscribed when the splash screen window is closed, to avoid populating the info on splash screen. - else if (this is SplashScreen) - { - this.Close(); - viewModel.Model.ShutDown(false); - } } protected override void OnClosed(EventArgs e) { base.OnClosed(e); - DynamoModel.RequestUpdateLoadBarStatus -= DynamoModel_RequestUpdateLoadBarStatus; webView.Dispose(); webView = null;