feat(dialog, toast): add specific tokens - #552
Open
DavideMininni-Fincons wants to merge 2 commits into
Open
Conversation
DavideMininni-Fincons
requested review from
jeripeierSBB and
kyubisation
as code owners
August 7, 2026 09:49
There was a problem hiding this comment.
Pull request overview
This PR introduces service-specific “data” injection tokens for dialog and toast (while preserving backwards compatibility with SBB_OVERLAY_DATA) and updates documentation/examples/tests to use the new token names.
Changes:
- Add
SBB_DIALOG_DATAandSBB_TOAST_DATAas backwards-compatible aliases and configure services to provide data via those tokens. - Update docs app examples and package READMEs to inject dialog/toast data via the new tokens.
- Update dialog/toast unit tests to use the new tokens.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/docs/app/angular/icon-overview/cdn-icon-list/cdn-icon-dialog/cdn-icon-dialog.component.ts | Switch dialog injected data token usage to SBB_DIALOG_DATA. |
| src/docs/app/angular/examples/toast/toast-service/toast-service-example.ts | Switch toast injected data token usage to SBB_TOAST_DATA. |
| src/docs/app/angular/examples/dialog/dialog-shared-data/dialog-shared-data-example.ts | Switch dialog injected data token usage to SBB_DIALOG_DATA. |
| src/docs/app/angular/examples/dialog/dialog-service/dialog-service-example.ts | Switch dialog injected data token usage to SBB_DIALOG_DATA. |
| src/angular/toast/toast.spec.ts | Update toast tests to inject via SBB_TOAST_DATA. |
| src/angular/toast/toast-service.ts | Introduce/export SBB_TOAST_DATA alias and set overlayDataToken to it. |
| src/angular/toast/simple-toast.ts | Use SBB_TOAST_DATA for injected data in the default toast component. |
| src/angular/toast/readme.md | Update toast documentation snippet to use SBB_TOAST_DATA. |
| src/angular/dialog/readme.md | Update dialog documentation snippet to use SBB_DIALOG_DATA. |
| src/angular/dialog/dialog/dialog.spec.ts | Update dialog tests to inject via SBB_DIALOG_DATA. |
| src/angular/dialog/dialog/dialog-service.ts | Introduce/export SBB_DIALOG_DATA alias and set overlayDataToken to it. |
| src/angular/core/overlay/overlay-base.ts | Add TODO notes around SBB_OVERLAY_DATA and overlayDataToken (no functional change in shown hunk). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
+17
| @@ -13,5 +14,5 @@ import { SBB_OVERLAY_DATA } from '@sbb-esta/lyne-angular/core'; | |||
| }) | |||
| export class SbbSimpleToast { | |||
| /** Data that was injected into the notification toast. */ | |||
| data: { message: string } = inject(SBB_OVERLAY_DATA) as { message: string }; | |||
| data: { message: string } = inject(SBB_TOAST_DATA) as { message: string }; | |||
Comment on lines
+11
to
+13
| // TODO before next major, create specific InjectionToken | ||
| /** Injection token that can be used to access the data that was passed in to a toast. */ | ||
| export const SBB_TOAST_DATA = SBB_OVERLAY_DATA; |
Comment on lines
+10
to
+12
| // TODO before next major, create specific InjectionToken | ||
| /** Injection token that can be used to access the data that was passed in to a dialog. */ | ||
| export const SBB_DIALOG_DATA = SBB_OVERLAY_DATA; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #415