-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pie-toast-provider): DSW-2222 toast provider basic functionality #2098
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 7b0a454 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
62a41f9
to
5633655
Compare
/snapit |
Starting a new snapshot build. You can view the logs here. |
@raoufswe Your snapshots have been published to npm! Test the snapshots by updating your Note If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts. yarn up @justeattakeaway/[email protected] --mode=update-lockfile yarn up @justeattakeaway/[email protected] --mode=update-lockfile yarn up @justeattakeaway/[email protected] --mode=update-lockfile Then finally: yarn install |
/snapit |
Starting a new snapshot build. You can view the logs here. |
@raoufswe Your snapshots have been published to npm! Test the snapshots by updating your Note If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts. yarn up @justeattakeaway/[email protected] --mode=update-lockfile yarn up @justeattakeaway/[email protected] --mode=update-lockfile yarn up @justeattakeaway/[email protected] --mode=update-lockfile Then finally: yarn install |
|
<pie-button | ||
@click=${() => { | ||
toaster.create({ | ||
message: 'Low Priority Info', | ||
variant: 'info', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be ok to move the indentation of these buttons click handlers content?
<pie-button | |
@click=${() => { | |
toaster.create({ | |
message: 'Low Priority Info', | |
variant: 'info', | |
}); | |
<pie-button | |
@click=${() => { | |
toaster.create({ | |
message: 'Low Priority Info', | |
variant: 'info', | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's auto-formatted on save for me 🙄 are you getting the same thing locally?
Screen.Recording.2024-12-02.at.13.06.43.mov
|
||
const componentSelector = 'pie-toast-provider'; | ||
|
||
/** | ||
* @tagname pie-toast-provider | ||
* @event {CustomEvent} pie-toast-provider-queue-update - when a toast is added or removed from the queue. | ||
*/ | ||
export class PieToastProvider extends RtlMixin(LitElement) implements ToastProviderProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when a consumer mistakenly adds a second Toast Provider to an app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently assume only one toast provider, rendered at the root level of the consumer app, and toasts are displayed in the body as specified in design specs here
However, this might change as designers plan to support rendering toasts within modals (sub-containers) and this will be addressed once we receive the complete design requirements and will probably require the usage of multiple providers either identified by ids or querying the closest provider in the DOM tree when toaster.create
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that is expected to have a single provider at the moment, that's why I ask what happens if the user does a mistake. Everything still works perfectly when more than one provider is in the DOM? Should we help the user to avoid this mistake?
Describe your changes (can list changeset entries if preferable)
Author Checklist (complete before requesting a review, do not delete any)
PIE Storybook
/PIE Docs
PR preview./test-aperture
command.Not-applicable Checklist items
Please move any Author checklist items that do not apply to this pull request here.
Testing
How do I test my changes?
Reviewer checklists (complete before approving)
Mark items as
[-] N/A
if not applicable.Reviewer 1
PIE Storybook
/PIE Docs
PR preview.Reviewer 2
PIE Storybook
/PIE Docs
PR preview.