11import type { WalkthroughSteps } from '../constants' ;
22import { urls } from '../constants' ;
3+ import type { GlCommands } from '../constants.commands' ;
34import { GlCommand } from '../constants.commands' ;
45import type { Source , Sources } from '../constants.telemetry' ;
56import type { Container } from '../container' ;
@@ -16,18 +17,20 @@ export class GetStartedCommand extends GlCommandBase {
1617 execute ( extensionIdOrsource ?: Sources ) : void {
1718 // If the extensionIdOrsource is the same as the current extension, then it came from the extension content menu in the extension view, so don't pass the source
1819 const source = extensionIdOrsource !== this . container . context . extension . id ? undefined : extensionIdOrsource ;
19- openWalkthrough ( this . container , source ? { source : source } : undefined ) ;
20+ openWalkthrough ( this . container , source ? { source : { source : source } } : undefined ) ;
2021 }
2122}
2223
23- export interface OpenWalkthroughCommandArgs extends Source {
24+ export interface OpenWalkthroughCommandArgs {
2425 step ?: WalkthroughSteps | undefined ;
26+ source ?: Source ;
27+ detail ?: string | undefined ;
2528}
2629
2730@command ( )
2831export class OpenWalkthroughCommand extends GlCommandBase {
2932 constructor ( private readonly container : Container ) {
30- super ( GlCommand . OpenWalkthrough ) ;
33+ super ( 'gitlens.openWalkthrough' ) ;
3134 }
3235
3336 execute ( args ?: OpenWalkthroughCommandArgs ) : void {
@@ -37,11 +40,7 @@ export class OpenWalkthroughCommand extends GlCommandBase {
3740
3841function openWalkthrough ( container : Container , args ?: OpenWalkthroughCommandArgs ) {
3942 if ( container . telemetry . enabled ) {
40- container . telemetry . sendEvent (
41- 'walkthrough' ,
42- { step : args ?. step } ,
43- args ?. source ? { source : args . source , detail : args ?. detail } : undefined ,
44- ) ;
43+ container . telemetry . sendEvent ( 'walkthrough' , { step : args ?. step } , args ?. source ) ;
4544 }
4645
4746 void openWalkthroughCore ( container . context . extension . id , 'welcome' , args ?. step , false ) ;
@@ -55,13 +54,13 @@ export class WalkthroughOpenWalkthroughCommand extends GlCommandBase {
5554 }
5655
5756 execute ( ) : void {
58- const command = GlCommand . OpenWalkthrough ;
57+ const command : GlCommands = 'gitlens.openWalkthrough' ;
5958 this . container . telemetry . sendEvent ( 'walkthrough/action' , {
6059 type : 'command' ,
6160 name : 'open/walkthrough' ,
6261 command : command ,
6362 } ) ;
64- executeCommand ( command ) ;
63+ executeCommand < OpenWalkthroughCommandArgs > ( command , { source : { source : 'walkthrough' } } ) ;
6564 }
6665}
6766
@@ -79,7 +78,7 @@ export class WalkthroughPlusUpgradeCommand extends GlCommandBase {
7978 name : 'plus/upgrade' ,
8079 command : command ,
8180 } ) ;
82- executeCommand ( command , { source : 'walkthrough' } ) ;
81+ executeCommand < Source > ( command , { source : 'walkthrough' } ) ;
8382 }
8483}
8584
@@ -115,7 +114,7 @@ export class WalkthroughPlusSignUpCommand extends GlCommandBase {
115114 name : 'plus/sign-up' ,
116115 command : command ,
117116 } ) ;
118- executeCommand ( command ) ;
117+ executeCommand < Source > ( command , { source : 'walkthrough' } ) ;
119118 }
120119}
121120
@@ -132,7 +131,7 @@ export class WalkthroughPlusReactivateCommand extends GlCommandBase {
132131 name : 'plus/reactivate' ,
133132 command : command ,
134133 } ) ;
135- executeCommand ( command ) ;
134+ executeCommand < Source > ( command , { source : 'walkthrough' } ) ;
136135 }
137136}
138137
0 commit comments