Skip to content

Issue 6922 - Provide a fallback for unknown notifications type

Andrea Giammarchi requested to merge bubble-ui-all-notifications into release-2018-4

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:

Screen_Shot_2018-09-03_at_16.33.30

Screen_Shot_2018-09-03_at_16.33.49

Screen_Shot_2018-09-03_at_16.34.04

Screen_Shot_2018-09-04_at_12.29.31

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

Merge request reports