Skip to content

feat(dialog, toast): add specific tokens - #552

Open
DavideMininni-Fincons wants to merge 2 commits into
mainfrom
feat/dialog-and-toast-tokens
Open

feat(dialog, toast): add specific tokens#552
DavideMininni-Fincons wants to merge 2 commits into
mainfrom
feat/dialog-and-toast-tokens

Conversation

@DavideMininni-Fincons

Copy link
Copy Markdown
Contributor

Closes #415

@github-actions github-actions Bot added target: 22.x pr: peer review required A peer review is required for this pull request labels Aug 7, 2026
@DavideMininni-Fincons DavideMininni-Fincons changed the title feat: add new tokens for dialog and toast feat(dialog, toast): add specific tokens Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DATA and SBB_TOAST_DATA as 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: peer review required A peer review is required for this pull request preview-available target: 22.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

story(overlay services): SBB_OVERLAY_DATA should receive specific tokens

2 participants