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
Subscriptions: fixing examples #15129
Conversation
prateekbh
commented
May 7, 2018
- Fix amp example
- Whitelist subscription attributes
- Execute action from amp-subscriptions-google
subscriptions-action="login" | ||
subscriptions-service="subscribe.google.com" | ||
subscriptions-decorate>Login</div> | ||
<div subscriptions-action="login" subscriptions-display="NOT loggedIn">Login</div> |
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.
NOT loggedIn
is now wrong too, right? Shouldn't it be NOT data.loggedIn
?
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.
yep
@@ -339,6 +334,10 @@ <h1 itemprop="headline">Lorem Ipsum</h1> | |||
</template> | |||
<template type="amp-mustache" subscriptions-dialog subscriptions-display="NOT loggedIn"> | |||
<div>Dialog for non logged in users<div> | |||
<div subscriptions-display="NOT loggedIn" |
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.
ditto
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.
fixed
@@ -131,6 +131,8 @@ const WHITELISTED_ATTRS = [ | |||
'subscriptions-actions', | |||
'subscriptions-section', | |||
'subscriptions-display', | |||
'subscriptions-service', | |||
'subscriptions-decorate', |
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.
Did you already put subscrpitions-decorate
into validator?
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.
done now
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 with one request
examples/amp-subscriptions.amp.html
Outdated
subscriptions-action="subscribe" | ||
subscriptions-service="subscribe.google.com" | ||
subscriptions-decorate>Login</div> | ||
<div subscriptions-display="NOT grantReason">btw u are not subscribed</div> |
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.
Let's do grantReason != "SUBSCRIBED"
(SUBSCRIBER, whichever is the latest 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.
reverted this and loggedIn change as that stuff is in PR #15059
* fixing examples * fixing types * fixing types * adding in validatior * reverting data changes in example