-
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
Intent to implement: Non-modal dismissable user notifications #902
Comments
See #871 for one possible use of this. |
@erwinmombay Assigned you. OK? |
@erwinmombay Trying to get a handle on when various features will land. Any estimate on this one? |
@rudygalfi almost done (thursday or friday at worst), talking to @dvoytenko about some technical details on implementation (since he's also working on some alert stuff). I think he had some concerns on this specific component. |
👍 thanks |
@erwinmombay — can this be closed? |
@ericlindley-g i think we should be good here since we have issues for the follow ups. anyone feel free to reopen otherwise. |
Implement a tag that can be shown conditionally for applicable users and that can be dismissed by users.
Usage
Showing the dialog
The new tag
amp-user-notification
always starts out in layout modenodisplay
(isn’t shown). Upon page load it makes a POST CORS XHR request to the URL given asdata-show-if-href
. It posts anExternalCID
that is specific for the string given asdata-dialog-id
as the POST argument “user_id”.The POST request is expected to return a simple JSON document of the form
{"show_dialog": true}
or
{"show_dialog": false}
In case of the
true
response AMP switches the<amp-user-notification>
tag to havecontainer
layout and displays it in a fixed positioned container at position (0, 0) and as wide as the screen.Closing the dialog
A button or similar tag inside of the notification can be designated with
on="tap:amp-user-notification.dismiss()"
to dismiss the notification.If the user taps that button the
<amp-user-notification>
is again switched tonodisplay
mode and AMP makes a POST CORS XHR request to the URL given asdata-dismiss-href
. It posts anExternalCID
that is specific for the string given asdata-dialog-id
as the POST argument “user_id”.The above POST request presents an opportunity for the publisher to store for the given “user_id” as to whether it should return true next time a request to
data-show-if-href
is made.The text was updated successfully, but these errors were encountered: