-
Notifications
You must be signed in to change notification settings - Fork 4.1k
✨ [AMP Story Paywall] Handles grant status and show/hide paywall dialog in amp-story-subscriptions #37892
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
Merged
Merged
✨ [AMP Story Paywall] Handles grant status and show/hide paywall dialog in amp-story-subscriptions #37892
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit
Hold shift + click to select a range
d977fd2
Create a new extension that would control paywall experience in amp-s…
ychsieh 876ba53
Update extensions/amp-story-subscription/OWNERS
ychsieh 115f58c
Merge branch 'main' into amp-story-subscription
ychsieh bfd09f1
Add validator required changes to pass the presubmit.
ychsieh 76c5581
Update validation result
ychsieh 98565ab
Replace htmlFor with JSX. Add I2I issue to the comment.
ychsieh 5984f87
Add amp-story-subscription.html to allowlist. Will remove it once the…
ychsieh 9c9fa3a
Fix lint errors
ychsieh e98ae97
Add a todo to remove allowlist once the validator rules are in.
ychsieh 2ef0cb7
Rename amp-story-subscription to amp-story-subscriptions. Update owne…
ychsieh 05e9d9f
Fix validator .out file.
ychsieh d26b5a8
Remove 'latest' verson as it's been deprecated.
ychsieh a1454f5
Merge branch 'main' into amp-story-subscription
ychsieh 5e5147b
Add new states for displaying subscription dialog. Also add required …
ychsieh 43fefcb
Delete trailing spaces.
ychsieh b5f639f
Add store service dependency.
ychsieh a0dde57
Apply Z_INDEX.md change.
ychsieh a1e5001
Marking attributes in new extension instead of in amp-story. Add func…
ychsieh 5f13a0e
StoreService fixes. Also remove the AmpStoryPage attribute setting fu…
ychsieh 000e1bb
Remove enums so that AmpStoryPage won't have dependency on new extens…
ychsieh a55639d
Call query selector on the document instead of the custom element, ot…
ychsieh 02d3b0b
Add unit test case for paywall triggering upon receiving state update.
ychsieh 3b6ca77
Fix lint error
ychsieh 5b61b32
Merge branch 'main' of github.com:ampproject/amphtml into paywall-dialog
ychsieh 6ce8848
Protect paywall logic behind an experiment. Some other minor fixes
ychsieh e9d3330
Optimize code
ychsieh 055dc60
Unit test fix: wait for a tick to ensure the listeners registration …
ychsieh 1112400
Merge branch 'main' of github.com:ampproject/amphtml into amp-story-s…
ychsieh eebfd4c
Merge branch 'amp-story-subscription' into paywall-dialog
ychsieh 2ec8a35
Replace demo images with random images on splash to avoid the bundle …
ychsieh 9464168
Minor fixes
ychsieh 4d00152
Make 'subscriptions-section' a const for reuse.
ychsieh bfcf002
Update unit test with storeService stub instead of registering servic…
ychsieh 5685b29
Linter fix
ychsieh 509bcd0
Linter fix
ychsieh 5926c18
Merge branch 'main' of github.com:ampproject/amphtml into paywall-dialog
ychsieh ad19867
Trigger AMP story paywall dialog. Adding callbacks to SubscriptionSer…
ychsieh 1823fe6
Merge branch 'main' of github.com:ampproject/amphtml into paywall-dialog
ychsieh 47b630d
Fix linter errors
ychsieh 6d28823
Fix z-index
ychsieh df778c5
Merge branch 'main' into paywall-dialog
ychsieh 2fa6e17
CSS fixes
ychsieh 713e7c4
Unit test fix. Remove unnecessary switchTo call.
ychsieh 8204105
Merge branch 'main' of github.com:ampproject/amphtml into amp-story-s…
ychsieh f8f038b
Update z_index markup
ychsieh 241c5b2
Move dialog wrapper CSS style to amp-story-subscriptions
ychsieh b8b4b82
Fix CSS. Use JSX for UI. Use localized strings. Update comments.
ychsieh 05ed864
Merge branch 'main' into paywall-dialog
ychsieh cc66ad1
Fix localized string bug
ychsieh a1b3219
Move all paywall triggering logic from amp-story to amp-story-subscri…
ychsieh 3c3434e
Use publisher-logo-url from amp-story instead. Also added a test to v…
ychsieh dd7ecf0
Remove all subscriptions-section attribute logic. This is not needed …
ychsieh c19c5e4
Fix linter error
ychsieh a2600f1
Update comment
ychsieh ce5798f
Wait on entitlement response before showing paywall. Use an enum inst…
ychsieh 9a3f021
Merge branch 'main' into paywall-dialog
ychsieh 2765646
Fix dependency test
ychsieh 22fc0fc
Merge branch 'paywall-dialog' of https://github.com/ychsieh/amphtml i…
ychsieh 24620de
Separate the logic of switching subscription states and dialog ui state.
ychsieh 887fbb2
Remove all changes and keep only the the amp-subscriptions ones to m…
ychsieh cc74589
Add the test to verify the callback added by the new API would still …
ychsieh d77886c
Merge branch 'main' into paywall-dialog
ychsieh 33ebb4b
Add the usage of story-specific dialog wrapper class. Add unit test f…
ychsieh 7609d47
Update based on missed comments
ychsieh 210c014
update unit tests
ychsieh 24a48f3
Really remove expect import...
ychsieh e6e3f49
nit
ychsieh 829f700
Update unit test with exactly params
ychsieh 67010e1
Fix import
ychsieh bf01050
nit
ychsieh c988a1b
Merge branch 'main' of github.com:ampproject/amphtml into paywall-dialog
ychsieh 2ef17cd
Paywall-related story navigation
ychsieh 6181b0c
Merge branch 'main' of github.com:ampproject/amphtml into amp-story-s…
ychsieh ca202bb
Merge branch 'amp-story' into amp-story-subscription
ychsieh 459f7d8
Merge branch 'main' of github.com:ampproject/amphtml into amp-story-s…
ychsieh 989fc68
Merge branch 'main' into paywall-dialog
ychsieh df5b117
Remove isPaywallProteced function. Move common logic in unit test to …
ychsieh 1bb6e37
Remove unnecessary intitialize_ call
ychsieh fb197cd
Fix lint error
ychsieh 7580cb9
Paywall-related story navigation
ychsieh 911fd59
Remove isPaywallProteced function. Move common logic in unit test to …
ychsieh 6b985a3
Fix lint error
ychsieh c7a4558
Merge branch 'amp-story' of https://github.com/ychsieh/amphtml into a…
ychsieh c2f91ad
Handle grant status and subscription states
ychsieh 6d1d5b4
Remove unnecessary unit test imports
ychsieh 0a1c504
Rename amp-subscription function to maybeRenderDialogForSelectedPlatform
ychsieh a09d9e9
Merge branch 'amp-story-subscription' of https://github.com/ychsieh/a…
ychsieh 3a3f091
Update toggle action name to fix unit test
ychsieh a5837b5
Add end-to-end verification for platform activation to the unit test
ychsieh 749257e
Merge branch 'main' of github.com:ampproject/amphtml into amp-story
ychsieh 2a478c2
Merge branch 'paywall-dialog' into amp-story
ychsieh 801a4a4
Fix unit test
ychsieh 6347dd1
Remove pending state check since switchTo already has some guard agai…
ychsieh 8a7c1ad
If starting deep in story, initialize with paywall page and navigate …
ychsieh ab08885
Merge branch 'main' into amp-story
ychsieh 8550d12
Fix unit test by making RAF a sync op earlier than all click event di…
ychsieh 270d8b7
Flatten if else nested blocks. Also add a test case for any switch ev…
ychsieh de65be0
Resume to the correct page even after tap previous. Click-based paywa…
ychsieh b12de29
lint
ychsieh 2bec999
Update extensions/amp-story/1.0/amp-story.js
ychsieh 2397335
Add a new navigation direction so that we don't need to maintain stat…
ychsieh 4456a23
Simply handle pageAfterGranted_ differrently based on the target index.
ychsieh b666a69
Update comment.
ychsieh c263e00
Merge branch 'amp-story' into amp-story-subscriptions
ychsieh 79b2206
Remove subscription state handler since it's beem handled in amp-story
ychsieh 7cd90b1
lint
ychsieh 69ff1aa
Flatten paywall if else blocks. Also add a new sub state to facilitat…
ychsieh 9c6428c
Flatten the structure a bit by separating the logic of showing ui and…
ychsieh c3cb650
lint
ychsieh 4f74de7
Merge branch 'main' into amp-story
ychsieh c8d72b8
Merge branch 'main' into amp-story
ychsieh 8f2a438
Hide paywall dialog only for the paywall-enabled stories.
ychsieh a098930
Fix race condition issues in other unit tests by stubbing some async …
ychsieh d899c8a
Refactor to simplify logic and the readability. Big refactoring on th…
ychsieh 849f897
Apply suggestions from code review
ychsieh 6116262
last nits
ychsieh 41acf76
Nits
ychsieh 8994765
Merge branch 'amp-story' into amp-story-subscriptions
ychsieh 05011f5
Merge branch 'main' into amp-story-subscription
ychsieh a312769
nit
ychsieh 692be7a
Merge branch 'amp-story-subscription' of https://github.com/ychsieh/a…
ychsieh a72f88f
Nits
ychsieh c3064d6
nits and refactor
ychsieh bc329c2
refactor unit test
ychsieh ceb74a8
lint
ychsieh f762b21
Update unit test
ychsieh 6e05ea1
Fix unit test
ychsieh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lint
- Loading branch information
commit ceb74a8ab573652630b87e9232910d9433287726
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.