-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add track events #108
Add track events #108
Conversation
a9a2d55
to
2192294
Compare
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.
Nice work, Karen! I had a few compile errors that I pointed out below. I fixed them locally, so I could continue testing your PR, but please take a look when you have a chance!
Once I got Bugomattic working, I checked all of the events and they fired as expected. I just had one comment about naming, but that's it.
src/app-navbar/app-navbar.tsx
Outdated
dispatch( setActivePage( page ) ); | ||
dispatch( updateHistoryWithState() ); | ||
|
||
monitoringClient.analytics.recordEvent( 'navbar_item_click', { page } ); |
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.
issue (blocking):
I'm not sure if you're seeing it on your end, but I actually had a couple of compile errors. One was on line 92
:
TS2304: Cannot find name 'monitoringClient'.
90 | dispatch( updateHistoryWithState() );
91 |
> 92 | monitoringClient.analytics.recordEvent( 'navbar_item_click', { page } );
| ^^^^^^^^^^^^^^^^
93 | };
94 |
95 | return (
I'm not sure if something happened the recent force push, but I just added const monitoringClient = useMonitoring();
under SimpleMenuItem
to get it working.
I also got this error on line 100
:
TS2304: Cannot find name 'handleClick'.
98 | role="menuitem" 99 | aria-current={ currentActivePage === page ? 'page' : undefined }
> 100 | onClick={ handleClick( page ) }
| ^^^^^^^^^^^ 101 | tabIndex={ tabIndex }
102 | className={ styles.menuItem }
103 | >
I just changed it to handleMenuItemClick
to get it working.
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 had a few compile errors that I pointed out below
AAAAAH. My bad! I had two VS Codes (one is the Insiders one since I'm playing with the Copilot chat) open and didn't see the error after "fixing" the merge conflicts! It should be fixed now.
Thank you for the heads up! 🙇🏻♀️
await user.click( screen.getByRole( 'option', { name: 'Date added' } ) ); | ||
|
||
expect( monitoringClient.analytics.recordEvent ).toHaveBeenCalledWith( 'sort_select', { | ||
sortOption: 'date-created', |
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.
nitpick (non-blocking):
I noticed that the event name is date-created
, whereas the filter in the UI is Date added
. This made me realize that we've been a bit inconsistent with our naming of this field because even the duplicate search result row uses Opened 4 days ago
lol.
I feel like we should probably pick one and keep it the same throughout duplicate search 😆 For example, the filter and event name could be date created
and the results row could display Created 4 days ago
.
Karen and @dpasque, what are your thoughts on this?
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 feel like we should probably pick one and keep it the same throughout duplicate search 😆 For example, the filter and event name could be date created and the results row could display Created 4 days ago.
That's a good point! Since date created
is used mostly everywhere, we can update the text in the dropdown from Date added
to Date created
.
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.
Created a separate PR for this change: #110
2192294
to
589ce4c
Compare
Record issue_search event
589ce4c
to
4e018a3
Compare
This looks great, Karen! The code compiled properly and all of the track events work as expected 😄 suggestion (non-blocking):
For the duplicate search result rows, would it be possible to change the word |
Ofc, I missed the previous text! 🤦🏻♀️ it should be fixed in #113. Thanks again for checking. |
What Does This PR Add/Change?
Add track events based on pciE2j-27d-p2
issue_search
status_filter_select
repo_filter_select
sort_select
issue_link_click
navbar_report_issue_start
banner_report_issue_start
navbar_item_click
Testing Instructions
Issues
Related to #
Closes #