Skip to content

Notifications improvements #5175

@m-orlova

Description

@m-orlova

Introduce jmix-notification component that supports:

  1. Dedicated areas for title,body and footer
  2. title,body and footer can be either component or text
  3. Markdown text (same as vaadin-tooltip) - body only
  4. prefix and suffix slots
  5. Close button
  6. Modality like a dialog
  7. Click on notification (and backdrop) closes it. Configurable.
  8. title and footer are optional
  9. Same API as vaadin-notification
  10. Notifications bean - Notifications.Type assumes default icon (prefix)

Original issue as motivation

Currently, there is no easy way to show a notification with icon and simple text or title+description. Need to use custom component each time or override Notifications bean to used such notifications by default.

Example of notifications:
Image

Image

It will be useful:

  1. Have API in notifications for adding icons.
    Example:
      notifications.create("Unable to execute operaion")
                            .withType(Notifications.Type.ERROR)
                            .withIcon(VaadinIcon.WARNING.create()) // also it can be a custom icon
                            .build();
    
  2. Configure usage of icons in notifications by default instead of adding each time

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions