Add component-id for HighlightsNewsletterCard#16272
Open
georgerichmond wants to merge 7 commits into
Open
Conversation
4 tasks
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
…XPAND' for modal interactions
…to 16261-add-data-component-id-to-highlightsnewslettercard
da29006 to
238961c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Adds a
data-modal-component-idattribute to the<a>tag inHighlightsNewsletterCard:data-modal-component-id— matches the signup modal's Ophancomponent.id(HighlightsNewsletterModal <identityName>)The value is derived from the existing
NEWSLETTER_SIGNUP_COMPONENT_ID.highlightsModalhelper, so it is guaranteed to stay in sync with the events already sent to Ophan. Tests are updated to assert the attribute is present and correctly valued.Why?
Heatphan needs a DOM hook on the Highlights card to display modal-open and subscribe counts as a badge on the front. It listens for Ophan
EXPANDandSUBSCRIBEevents, using thecomponent.idto identify which element to update — so the<a>tag needs a matching attribute for Heatphan to hook into.The card and its modal have separate component IDs (split in #16258, because
EXPANDfires twice — once when the modal opens, and again when the captcha loads — and a shared ID made them indistinguishable).data-modal-component-idpoints to the modal's ID, which is the one associated with theEXPAND(modal-open) andSUBSCRIBEevents Heatphan cares about.Screenshots
No visual change.