Issue 6922 - Provide a fallback for unknown notifications type
Partly to solve https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/179, partly to fix current broken behavior, this MR is meant to provide a generic fallback for any kind of unknown notification, despite what any
type of notification will bring in.
What changed
- the
hidden
attribute is now enforced to be respected, if available - any unknown notification will be shown with a decent UI, not a half-broken looking one
- the Stop showing notification button is shown only for
information
and not of other one-off, or critical, kind
How to test
Dispatch an event through the Bubble UI console.
dispatchEvent(new CustomEvent("extension:notification", {
detail: {
type: "information", // or "critical" or "anything"
texts: {
title: "Title for a notification", // or empty string
message: "There is something to read here"
}
}
}));
See the different layout and then eventually update the page and re-dispatch with a different notification type.
Result
It should be one of the following:
The fallback uses the regular border color for the top border and it has no icon, unless we want to provide a default icon for unknown notifications.
Edited by Andrea Giammarchi