Skip to content
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 files for Amplitude events in the navbar Create menu #56319

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

TurnerRiley
Copy link
Contributor

My first attempt at adding click events to the "Create" menu in the navbar seemed to work locally, but once it merged there were HoneyBadger errors on staging relating to webpack_asset_name. Since the navbar is used all across our site, I was afraid it would break something so I rushed to revert. However, after having a conversation with Elijah, it seems like it's possible that if I had let it play out after it finished building, it would've used the newly-built package and worked.

So, following Elijah's advice, I'm using this PR to create the files themselves without actually implementing them into the user navbar so that if anything goes wrong it won't cause errors on our pages. Currently, I'm just having it console log a message so that there's something in the js file (even though it won't be shown anywhere). Once I can confirm this is working, I'll set up the 2nd PR which will actually implement the event logger.

Links

Jira ticket: here
Previous attempt: here
Revert of attempt: here
Slack conversation with Elijah: here

Testing story

While the event logger is not being implemented anywhere yet, I was able to confirm that adding it into the user_header.haml file showed the console log I would expect locally (I then deleted that line before committing this):
userlogger

Deployment strategy

I'm going to merge this after a DTP so I can monitor #infra-staging and HoneyBadger for errors. Then, if anything breaks there's plenty of time to debug and/or revert.

Follow-up work

Actually implement the event logger into the user navbar.

@TurnerRiley
Copy link
Contributor Author

This PR is a continuation of #56195, which was mis-closed by the Git LFS migration (#55759).

Previous Comments:

Previous Reviews:

  • hannahbergam approved - I appreciate the conservative approach!

@TurnerRiley TurnerRiley requested a review from a team February 5, 2024 20:46
import $ from 'jquery';

$(document).ready(function () {
console.log('User header event logger');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, won't this log to the console on every page? (that's not a big deal tbh, but curious because the description says it doesn't?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it won't log on any page because the haml view user_header_event_logger isn't in the user header (that will be added in the next PR). Currently, this is just a pair of haml/js files that aren't being used anywhere yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol right 🤦‍♀️

Copy link
Contributor

@bethanyaconnor bethanyaconnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the conservative approach!

@TurnerRiley TurnerRiley merged commit 3309ab8 into staging Feb 13, 2024
2 checks passed
@TurnerRiley TurnerRiley deleted the add-amplitude-user-navbar-files branch February 13, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants