-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 support for AMP Story Quiz Reaction API calls #26242
✨Add support for AMP Story Quiz Reaction API calls #26242
Conversation
Hey @gmajoulet, these files were changed:
Hey @newmuis, these files were changed:
|
Would be great to pull the API out into a separate doc or GH issue for review |
I've got a doc I'm working on for review (hence why this is a draft PR still) which I should have ready to send out tomorrow |
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.
Is the plan to submit this with the work-in-progress API and subsequently iterate, or are you hoping to solidify the API design first before merging this PR?
examples/amp-story/quiz.html
Outdated
@@ -64,7 +64,8 @@ <h1 id="cat-facts-title">Cat Facts!</h1> | |||
</amp-story-grid-layer> | |||
<amp-story-grid-layer> | |||
<amp-story-quiz | |||
id='cat-question-appear'> | |||
id='cat-question-appear' | |||
endpoint="http://localhost:8000"> |
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 can revisit later but I'd really like us to consider both approaches to providing configuration to a quiz before we launch, parameters vs JSON
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 can sync about this option a bit more tomorrow offline
'method': 'GET', | ||
}); | ||
|
||
if (reactionValue !== undefined) { |
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.
Are you deciding whether we're fetching the data or answering the quiz with this test?
If yes, I think we need a clearer way to do so. Maybe two different methods that re-use some factorized code? Should not be a big change but I think we'd gain in clarity.
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.
The way I have it now is that I have two methods, retrieveReactionData_
and updateReactionData_
, which both call executeReactionRequest_
.
retrieveReactionData_
does so without passing parameters, where updateReactionData_
passes a reactionValue
parameter. I then use the presence of reactionValue
to check which reaction data method was called. Do I need to split the two further / bring more calculation into the caller functions?
PTAL |
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.
LGTM, just a few nits but it's looking good :))
Hey @zhouyx, requesting your review for the usage of |
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.
Change to build-system/tasks/presubmit-checks.js
LGTM.
I'll let someone from the STAMP team comment on whether it's actually okay to use cidForDoc
.
1a73e28
to
7301496
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.
Approving to override bundle-size bot bug
* master: [yahoonativeads-amp] code cleanup and bug fix (ampproject#26325) rephrased reasoning for text node (ampproject#26393) Render video alt and title attributes in vertical rendering mdoe. (ampproject#26370) Revert "Update I2I & I2S to reflect new Open Source process (ampproject#25530)" (ampproject#26392) Skip amp story affiliate link test (ampproject#26386) Update I2I & I2S to reflect new Open Source process (ampproject#25530) ✨ Add support for `"intrisic"` layout for `<amp-script>` (ampproject#26369) 📖 Rename Dev Channel to Experimental Channel in docs and comments (ampproject#26255) ✨Add support for AMP Story Quiz Reaction API calls (ampproject#26242) clarified text node behavior (ampproject#26376) # Conflicts: # extensions/amp-script/amp-script.md # extensions/amp-timeago/amp-timeago.md
Adds support for API calls in AMP Story Quizzes, to both retrieve and update the Reactions data. Currently the API calls must be supplied an endpoint, support for a default endpoint will come in a future PR.
Adds work related to tracking issue #25615