-
Notifications
You must be signed in to change notification settings - Fork 212
feat: Add analytics for Create Index Button Clicked CLOUDP-314818 #6878
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
Conversation
@@ -83,6 +83,10 @@ function CreateIndexModal({ | |||
const enableInIndexesGuidanceExp = usePreference('enableIndexesGuidanceExp'); | |||
const showIndexesGuidanceVariant = | |||
usePreference('showIndexesGuidanceVariant') && enableInIndexesGuidanceExp; | |||
if (showIndexesGuidanceVariant && !currentTab) { | |||
// If user is in the variant and there has not been a currentTab set, default it to IndexFlow | |||
props.onTabClick('IndexFlow'); |
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.
We should avoid setting something like this in the react flow. We're only doing this for telemetry purposes right? Can we instead set that telemetry event metadata based on the preferences? And then we can go back to always having the currentTab set.
if (showIndexesGuidanceVariant && !currentTab) { | ||
// If user is in the variant and there has not been a currentTab set, default it to IndexFlow | ||
props.onTabClick('IndexFlow'); | ||
} |
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.
Dispatching actions from a render method is an antipattern, so is dispatching actions to set initial state. If you need your state to have three distinct values, you should be using redux ability to set initial state to define it (this is already done for the indexes plugin, you can see some initial state being passed to the createStore
method in activateIndexesPlugin
). Looking at the logic though, I think you only need to check the same preference flag when tracking the event instead of introducing a third state to the currentTab
value and needing to account for this change everywhere
Description
Added tracking for when user clicks on the 'Create Index' button and the flow will be different based on whether they are not in the experiment / control, in the index flow, or in the query flow. To get this to work, i set the initial value of currentTab to null.



Checklist
Motivation and Context
Open Questions
Dependents
Types of changes