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

Consistently track modal events #1007

Merged
merged 5 commits into from
Jun 28, 2021
Merged

Consistently track modal events #1007

merged 5 commits into from
Jun 28, 2021

Conversation

connor-baer
Copy link
Member

Purpose

While migrating the dashboard to the new Modal API (#949), I realized that modal events aren't tracked consistently depending on how a modal is opened or closed. The logic is duplicated in several places which allowed for inconsistencies.

Approach and changes

  • Moved all the logic related to opening and closing a modal from the useModal hook into the ModalProvider component. Added tests to verify that tracking events are dispatched no matter how the model is triggered.
  • Split the code into separate files to improve tree-shaking and code readability.
  • Bonus: Added headlines to the modal stories as a best practice.

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@connor-baer connor-baer added the 🐞 bug Something isn't working as it should label Jun 28, 2021
@connor-baer connor-baer requested a review from a team as a code owner June 28, 2021 09:10
@connor-baer connor-baer requested review from amelako and removed request for a team June 28, 2021 09:10
@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2021

🦋 Changeset detected

Latest commit: 6c10a02

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Patch

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

@vercel
Copy link

vercel bot commented Jun 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/GtdTTDR4FBKi184mpNfc5TxsH2mv
✅ Preview: https://oss-circuit-ui-git-feature-modal-hoc-sumup.vercel.app

@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #1007 (6c10a02) into next (43b1403) will decrease coverage by 0.03%.
The diff coverage is 91.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1007      +/-   ##
==========================================
- Coverage   90.99%   90.96%   -0.04%     
==========================================
  Files         160      161       +1     
  Lines        2665     2666       +1     
  Branches      765      763       -2     
==========================================
  Hits         2425     2425              
- Misses        215      217       +2     
+ Partials       25       24       -1     
Impacted Files Coverage Δ
...ircuit-ui/components/ModalContext/ModalContext.tsx 88.88% <86.95%> (-7.12%) ⬇️
packages/circuit-ui/components/Modal/Modal.tsx 95.00% <92.30%> (+7.00%) ⬆️
...rcuit-ui/components/ModalContext/createUseModal.ts 100.00% <100.00%> (ø)

Copy link
Contributor

@amelako amelako left a comment

Choose a reason for hiding this comment

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

🚀

@amelako amelako merged commit efe0210 into next Jun 28, 2021
@amelako amelako deleted the feature/modal-hoc branch June 28, 2021 14:17
@github-actions github-actions bot mentioned this pull request Jun 28, 2021
This was referenced Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working as it should 🗂 circuit-ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants