-
Notifications
You must be signed in to change notification settings - Fork 3.9k
🐛 [amp story shopping] Do not render shopping CTA if no shopping tags are on the page #37503
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
Hey @gmajoulet! These files were changed:
Hey @newmuis! These files were changed:
|
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.
Nit:
If there are no shopping tags, the attachment extension will still be fetched right? How often would this happen?
We could prevent that by removing the tag from the querySelector on amp-story-page
and on shopping-attachment
install the extension.
530d7c1
to
9ec5aa3
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.
Could be useful to add tests to check whether the attachment is built or not, code is 👍
… are on the page (ampproject#37503) * Rename. Do not render CTA. * Update comment * Update test. * Remove unused * revert * revert * install in shopping attachment * check in layoutCallback * Move selectors to buildCallback. * Refert install
Building the attachment was refactored as part of #37278 to be a separate component and introduced a regression which was not caught since Percy diffs were broken at the time of submitting the PR.
This PR removes dead code that previously prevented the CTA from being built if no shopping-tags are on the page (originally done in #37004) and puts the functionality in amp-story-shopping-attachment.
It also renames
renderOpenAttachmentUI_
toinstallPageAttachmentExtension_
to better describe functionality.