Skip to content

fix: transition import & SubmitError handling #230

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

Merged
merged 14 commits into from
Oct 26, 2022
Merged

fix: transition import & SubmitError handling #230

merged 14 commits into from
Oct 26, 2022

Conversation

tenphi
Copy link
Member

@tenphi tenphi commented Oct 20, 2022

Fix Transition import
Submit error should follow the rules:

  • Don't be shown if validation is failed
  • Should trigger uncaught exception if the error is not handled properly (Error object, for example)
  • SubmitError component should show the error only if it's a valid react element or a string. For other cases, it should show "Internal error" so we don't expose unhandled errors to the user.

If Form submission is failed on the validation step, then the onFailed callback is not fired.

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2022

🦋 Changeset detected

Latest commit: d781d47

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

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit 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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2022

🏗 Docs are successfully deployed!

👀 Preview: https://63580e3a7886da1b938f6f16--cube-uikit-storybook.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2022

📦 NPM canary release

Deployed canary version 0.0.0-canary-d031b13.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2022

🏋️ Size limit report

Name Size Passed?
All 139.96 KB (+0.04% 🔺) Yes 🎉
Tree shaking (just a Button) 25.16 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2022

🧪 Storybook is successfully deployed!

@MrFlashAccount
Copy link
Contributor

MrFlashAccount commented Oct 24, 2022

Don't be shown if validation is failed
Should trigger uncaught exception if the error is not handled properly (Error object, for example)
SubmitError component should show the error only if it's a valid react element or a string. For other cases, it should show "Internal error" so we don't expose unhandled errors to the user.

all these cases could be easily covered with unit tests. Reach me in DM if you need some help

@tenphi
Copy link
Member Author

tenphi commented Oct 24, 2022

@MrFlashAccount I wasn't able to create a test that checks an uncaught rejection.

@MrFlashAccount
Copy link
Contributor

@tenphi feel free to reach me in DM anytime 😊

@tenphi tenphi merged commit 9578486 into main Oct 26, 2022
@tenphi tenphi deleted the minor-fixes-2 branch October 26, 2022 08:58
@github-actions github-actions bot mentioned this pull request Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants