feat(phoenix-ng): add NotificationService with 4 severity levels and configurable auto-dismiss#895
Conversation
|
Nice service, now I would not merge it before it's effectively used. By the way, I see you want to use MatSnackBar to display the messages, that would be a new dependency to my knowledge. Don't we already have a way to display messages ? @EdwardMoyse ? |
|
Thanks @sponce Understood on merging before use — I'll integrate it with On MatSnackBar:- @angular/material is already a dependency @EdwardMoyse - happy to hear your thoughts too. |
Summary
Adds
NotificationServiceas part of Work Area 1 (WA1).WA1 arc:
What this adds
notification.service.ts— Injectable Angular service:Follows the same
ActiveVariablepattern asErrorMessageService.Components subscribe via
subscribeToNotifications().Default auto-dismiss durations:
success— 5000msinfo— 5000mswarning— 8000mserror— 0ms (manual dismiss required)Custom duration supported via optional second parameter.
notification.service.component.test.ts— 6 tests:Why
PR #879 added try/catch to route IO errors through InfoLogger.
This PR adds the service layer that allows any Phoenix component
to emit user-visible notifications programmatically.
The next step (separate PR) will add the UI component that
subscribes to this service and renders toasts via MatSnackBar.
Scope
phoenix-ui-components/lib/services/index.tsfor export