Skip to content

Commit

Permalink
DYN-6874 Logging Packages Tour
Browse files Browse the repository at this point in the history
Due that the Packages guide doesn't have a Welcome popup (like the other guides)  the Guide.Sequence starts at 1 (instead of 0) so I had to do a fix for calculating the number of steps correctly and modify the validation which is logging information when packages tour is completed.
  • Loading branch information
RobertGlobant20 committed May 9, 2024
1 parent b120519 commit c397ff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/DynamoCoreWpf/UI/GuidedTour/Guide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ internal void Play()
/// </summary>
internal void Initialize()
{
TotalSteps = GuideSteps.Count;
//There are guided tours containing repeated Sequences due that we can have different Steps flow (conditional flows)
var differentSteps = GuideSteps.Select(step => step.Sequence).Distinct().ToList();
TotalSteps = differentSteps.Count;

SetLibraryViewVisible(false);

Expand Down
6 changes: 5 additions & 1 deletion src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ internal void ExitTour()
}

string guidName = Resources.ResourceManager.GetString(currentGuide.GuideNameResource, System.Globalization.CultureInfo.InvariantCulture).Replace("_", "");
if (currentGuide.TotalSteps - 1 == currentGuide.CurrentStep.Sequence)
int offSet = 1;
//Due that the Packages guide doesn't have a Welcome popup (like the other guides) then the Guide.Sequence starts at 1 (instead of 0) when we need to use a offSet = 0
if (currentGuide.Name == PackagesGuideName)
offSet = 0;
if (currentGuide.TotalSteps - offSet == currentGuide.CurrentStep.Sequence)
{
Logging.Analytics.TrackEvent(Logging.Actions.Completed, Logging.Categories.GuidedTourOperations, guidName, currentGuide.CurrentStep.Sequence);
}
Expand Down

0 comments on commit c397ff2

Please sign in to comment.