-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upcoming: [M3-8328] - Add Analytics Events to Linode Create v2 #10649
upcoming: [M3-8328] - Add Analytics Events to Linode Create v2 #10649
Conversation
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I confirmed sendLinodePowerOffEvent
, sendApiAwarenessClickEvent
, sendLinodeCreateFlowDocsClickEvent
, and sendLinodeCreateEvent
were still firing and the other events are no longer being tracked.
Aside from sendLinodeCreate on Clone, everything fired as expected.
packages/manager/src/features/Linodes/LinodeCreatev2/utilities.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming seeing proper events being fired ✅
if (type === 'Clone Linode' && values.linode) { | ||
// @todo use Linode Query key factory when implemented | ||
const linode = await queryClient.ensureQueryData({ | ||
queryFn: () => getLinode(values.linode!.id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we avoid this assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish. Not sure why Typescript can't see the values.linode
check in the if
statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the type checker does not refine the type of values.linode
inside the lambda function passed to queryFn.
just make it a new const
if (type === 'Clone Linode' && values.linode) {
// @todo use Linode Query key factory when implemented
const linodeId = values.linode.id;
const linode = await queryClient.ensureQueryData({
queryFn: () => getLinode(linodeId),
queryKey: ['linodes', 'linode', linodeId, 'details'],
});
sendCreateLinodeEvent('clone', values.type, {
isLinodePoweredOff: linode.status === 'offline',
});
}
@@ -113,7 +113,7 @@ export const sendCreateNodeBalancerEvent = (eventLabel: string): void => { | |||
// LinodeCreateContainer.tsx | |||
export const sendCreateLinodeEvent = ( | |||
eventAction: string, | |||
eventLabel: string, | |||
eventLabel: string | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still send an event if we don't have a label?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1 does, so I opted to send even for undefined
. I had to update the type because v1 just lied about types
Description 📝
How to test 🧪
Prerequisites
Linode Create v2
feature flag 🇺🇸_satellite.setDebug(true)
in your browser's console ⌨️Verification steps
As an Author I have considered 🤔