[MGNLUI-5622] Create a common way to show notifications Created: 21/Jan/20 Updated: 21/Jan/20 |
|
| Status: | Open |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Jorge Franco | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Description |
|
Actually, when we want to show a notification, we call directly to com.vaadin.ui.Notification. Would be nice offer a wrap around it for users and other magnolia modules, something like:
public class Notifications { private final SimpleTranslator i18n; @Inject public Notifications(SimpleTranslator i18n) { this.i18n = i18n; } public void showError(String key) { Notification.show(i18n.translate(key), Notification.Type.ERROR_MESSAGE); } .... }
|