Skip to content
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

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

raoufswe
Copy link
Member

@raoufswe raoufswe commented Nov 27, 2024

Describe your changes (can list changeset entries if preferable)

  • Adds the ability to create a toast via the provider
  • Adds the ability to clear toasts via the provider
  • The provider should handle the order priority when tests are added
  • Docs (Draft)

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /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?

Task Link
Aperture PR 🔗
NextJS 14 deployment 🔗
Nuxt 3 deployment 🔗
Vanilla deployment 🔗

Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Copy link

changeset-bot bot commented Nov 27, 2024

🦋 Changeset detected

Latest commit: dcf3b4e

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

Base automatically changed from dsw-2222-toast-provider to main November 28, 2024 10:45
@raoufswe raoufswe changed the title feat(pie-toast-provider)Dsw 2222 toast provider basic functionality feat(pie-toast-provider): DSW-2222 toast provider basic functionality Nov 29, 2024
@raoufswe raoufswe force-pushed the dsw-2222-toast-provider-basic-functionality branch from 62a41f9 to 5633655 Compare November 29, 2024 15:02
@raoufswe raoufswe marked this pull request as ready for review November 29, 2024 15:14
@raoufswe raoufswe requested review from a team as code owners November 29, 2024 15:14
@raoufswe
Copy link
Member Author

/snapit

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@raoufswe Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

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

@raoufswe
Copy link
Member Author

/snapit

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@raoufswe Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

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

@raoufswe raoufswe force-pushed the dsw-2222-toast-provider-basic-functionality branch from 7b0a454 to 3807208 Compare January 3, 2025 09:01
fernandofranca
fernandofranca previously approved these changes Jan 6, 2025
Copy link
Contributor

@fernandofranca fernandofranca left a comment

Choose a reason for hiding this comment

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

Good stuff!!!

Copy link
Contributor

@siggerzz siggerzz left a comment

Choose a reason for hiding this comment

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

Small comment regarding testing, but looks good otherwise!

@raoufswe raoufswe force-pushed the dsw-2222-toast-provider-basic-functionality branch from a2e26a2 to ad8c015 Compare January 7, 2025 11:08
feat(pie-toast-provider): DSW-2222 add tests

feat(pie-toast-provider): DSW-2222 update yarn

fix(pie-toast-provider): DSW-2222 update formating

fix(pie-toast-provider): DSW-2222 ensure duration is parsed correctly

fix(pie-toast-provider): DSW-2222 update markup

fix(pie-toast-provider): DSW-2222 update yarn

fix(pie-toast-provider): DSW-2222 add validation

fix(pie-toast-provider): DSW-2222 update logs

fix(pie-toast-provider): DSW-2222 refactor tests

fix(pie-toast-provider): DSW-2222 refactor tests

fix(pie-toast-provider): DSW-2222 refactor tests
@raoufswe raoufswe force-pushed the dsw-2222-toast-provider-basic-functionality branch from c4b45b6 to 8ddb3da Compare January 7, 2025 14:59
siggerzz
siggerzz previously approved these changes Jan 7, 2025
fernandofranca
fernandofranca previously approved these changes Jan 7, 2025
@raoufswe raoufswe dismissed stale reviews from fernandofranca and siggerzz via dcf3b4e January 7, 2025 16:27
@raoufswe raoufswe closed this Jan 8, 2025
@raoufswe raoufswe reopened this Jan 8, 2025
@raoufswe raoufswe merged commit 109dd8e into main Jan 8, 2025
51 of 55 checks passed
@raoufswe raoufswe deleted the dsw-2222-toast-provider-basic-functionality branch January 8, 2025 08:48
Comment on lines +70 to +75
const queueVariants = toastsQueue.map((toast: ExtendedToastProps) => `${toast.variant}${toast.leadingAction ? '-actionable' : ''}`);
for (let i = 1; i < queueVariants.length; i++) {
const prevPriority = PRIORITY_ORDER[queueVariants[i - 1]];
const currPriority = PRIORITY_ORDER[queueVariants[i]];
expect(currPriority).toBeGreaterThanOrEqual(prevPriority); // Ensure the current has a higher priority
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if a cleaner way might be to sort by priority and check that the ordering is the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants