Skip to content

Commit 29b09ca

Browse files
authored
fix: make eventing for firstMile buttons identify stage it was clicked at (#4628)
1 parent a885035 commit 29b09ca

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

src/homepageExperience/containers/GoWizard.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@ export class GoWizard extends PureComponent<null, State> {
7070
),
7171
},
7272
() => {
73-
event('firstMile.goWizard.next.clicked')
73+
event(
74+
'firstMile.goWizard.next.clicked',
75+
{},
76+
{
77+
clickedButtonAtStep: this.state.currentStep - 1,
78+
currentStep: this.state.currentStep,
79+
}
80+
)
7481
}
7582
)
7683
}
@@ -79,7 +86,14 @@ export class GoWizard extends PureComponent<null, State> {
7986
this.setState(
8087
{currentStep: Math.max(this.state.currentStep - 1, 1)},
8188
() => {
82-
event('firstMile.goWizard.previous.clicked')
89+
event(
90+
'firstMile.goWizard.previous.clicked',
91+
{},
92+
{
93+
clickedButtonAtStep: this.state.currentStep + 1,
94+
currentStep: this.state.currentStep,
95+
}
96+
)
8397
}
8498
)
8599
}

src/homepageExperience/containers/NodejsWizard.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@ export class NodejsWizard extends PureComponent<null, State> {
7070
),
7171
},
7272
() => {
73-
event('firstMile.nodejsWizard.next.clicked')
73+
event(
74+
'firstMile.nodejsWizard.next.clicked',
75+
{},
76+
{
77+
clickedButtonAtStep: this.state.currentStep - 1,
78+
currentStep: this.state.currentStep,
79+
}
80+
)
7481
}
7582
)
7683
}
@@ -79,7 +86,14 @@ export class NodejsWizard extends PureComponent<null, State> {
7986
this.setState(
8087
{currentStep: Math.max(this.state.currentStep - 1, 1)},
8188
() => {
82-
event('firstMile.nodejsWizard.previous.clicked')
89+
event(
90+
'firstMile.nodejsWizard.previous.clicked',
91+
{},
92+
{
93+
clickedButtonAtStep: this.state.currentStep + 1,
94+
currentStep: this.state.currentStep,
95+
}
96+
)
8397
}
8498
)
8599
}

src/homepageExperience/containers/PythonWizard.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ export class PythonWizard extends PureComponent<null, State> {
7171
),
7272
},
7373
() => {
74-
event('firstMile.pythonWizard.next.clicked')
74+
event(
75+
'firstMile.pythonWizard.next.clicked',
76+
{},
77+
{
78+
clickedButtonAtStep: this.state.currentStep - 1,
79+
currentStep: this.state.currentStep,
80+
}
81+
)
7582
}
7683
)
7784
}
@@ -80,7 +87,14 @@ export class PythonWizard extends PureComponent<null, State> {
8087
this.setState(
8188
{currentStep: Math.max(this.state.currentStep - 1, 1)},
8289
() => {
83-
event('firstMile.pythonWizard.previous.clicked')
90+
event(
91+
'firstMile.pythonWizard.previous.clicked',
92+
{},
93+
{
94+
clickedButtonAtStep: this.state.currentStep + 1,
95+
currentStep: this.state.currentStep,
96+
}
97+
)
8498
}
8599
)
86100
}

0 commit comments

Comments
 (0)