Skip to content

Commit

Permalink
Add Analytics Coverage for Node AutoComplete (DynamoDS#11209)
Browse files Browse the repository at this point in the history
* add analytics coverage for node autocomplete

Open auto complete window
Select suggestion

* Update NodeAutoCompleteSearchControl.xaml.cs

* add tracking to in-canvas search node selection

* add track points for in canvas search open/select

Co-authored-by: Ashish Aggarwal <[email protected]>
  • Loading branch information
zeusongit and Zeus1717 committed Oct 29, 2020
1 parent d2263d8 commit 08c726c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/DynamoCoreWpf/Controls/IncanvasSearchControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Threading;
using Dynamo.Logging;
using Dynamo.Utilities;
using Dynamo.ViewModels;
using Dynamo.Wpf.ViewModels;
Expand Down Expand Up @@ -34,10 +35,18 @@ public InCanvasSearchControl()
{
Application.Current.Deactivated += currentApplicationDeactivated;
}
Loaded += InCanvasSearchControl_Loaded;
Unloaded += InCanvasSearchControl_Unloaded;

}

private void InCanvasSearchControl_Loaded(object sender, RoutedEventArgs e)
{
Analytics.TrackEvent(
Dynamo.Logging.Actions.Open,
Dynamo.Logging.Categories.InCanvasSearchOperations);
}

private void InCanvasSearchControl_Unloaded(object sender, RoutedEventArgs e)
{
if (Application.Current != null)
Expand Down Expand Up @@ -86,6 +95,10 @@ private void ExecuteSearchElement(ListBoxItem listBoxItem)
{
searchElement.Position = ViewModel.InCanvasSearchPosition;
searchElement.ClickedCommand.Execute(null);
Analytics.TrackEvent(
Dynamo.Logging.Actions.Select,
Dynamo.Logging.Categories.InCanvasSearchOperations,
searchElement.FullName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Threading;
using Dynamo.Logging;
using Dynamo.Utilities;
using Dynamo.ViewModels;
using Dynamo.Wpf.ViewModels;
Expand Down Expand Up @@ -45,6 +46,9 @@ private void NodeAutoCompleteSearchControl_Loaded(object sender, RoutedEventArgs
if (ViewModel != null && ViewModel.PortViewModel != null)
{
ViewModel.PortViewModel.PlaceNodeAutocompleteWindow(this, e);
Analytics.TrackEvent(
Dynamo.Logging.Actions.Open,
Dynamo.Logging.Categories.NodeAutoCompleteOperations);
}
}

Expand Down Expand Up @@ -99,6 +103,10 @@ private void ExecuteSearchElement(ListBoxItem listBoxItem)
if (searchElement.CreateAndConnectCommand.CanExecute(port.PortModel))
{
searchElement.CreateAndConnectCommand.Execute(port.PortModel);
Analytics.TrackEvent(
Dynamo.Logging.Actions.Select,
Dynamo.Logging.Categories.NodeAutoCompleteOperations,
searchElement.FullName);
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/NodeServices/IAnalyticsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ public enum Categories
/// Events Category related to DesignScript VM
/// </summary>
Engine,

/// <summary>
/// Events Category related to Node Auto-Complete
/// </summary>
NodeAutoCompleteOperations,

/// <summary>
/// Events Category related to In-Canvas search
/// </summary>
InCanvasSearchOperations
}

/// <summary>
Expand Down Expand Up @@ -152,6 +162,11 @@ public enum Actions
/// Update Installed event
/// </summary>
Installed,

/// <summary>
/// Select event, such as node auto-complete suggestion selection or in-canvas search selection
/// </summary>
Select,
}

/// <summary>
Expand Down

0 comments on commit 08c726c

Please sign in to comment.