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

TECH: Non-Nullable UI Support, Re-Initialization Improvements, Valida… #52

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

jwdotjs
Copy link
Contributor

@jwdotjs jwdotjs commented May 23, 2021

…te URL Params

Features

  • If a Param has a description, it will render an info question mark to help provide more information to the end-user.
  • A previous version added support for nullable: true for the OpenAPI spec when downloading JSON. Now the badmagic UI respects that and won't show the Null button if a field can't be nullable
  • Before a network request is submitted by the end user, badmagic now validates that the URL Params all have values using Yup. If they don't the request fails with validation errors. Note: We are planning on adding support for validating body params in the future but for now, even though they can be marked as required and the red asterisk shows up, badmagic will allow the network request to continue.

Bugfixes

  • URL Params are always required but a previous iteration caused URL Params to lose the red asterisk indicating it was required. This has been added back.
  • New routes weren't showing up if local storage wasn't cleared for that workspace (presumed fixed in 0.0.24 but there were instances where this was still occurring). Workspace initialization (including all of a workspace's routes) has been moved to Workspace.tsx from Route.tsx. The problem was that we were writing to localstorage asynchronously so sometimes routes that were being initialized were clobbering other routes that has been just saved to local storage, causing them not to render. This also should improve performance because Route.tsx should generally have less re-renders.

Enhancements

  • Improved Typescript specifications in many areas
  • Misc. cleanup on components to break them apart more
  • Uses useMemo and useCallback in a few areas to improve performance

Screenshots

URL Param Validation

Screen Shot 2021-05-23 at 12 15 31 PM

URL Params marked as required, URL Params Cannot Be Null

Screen Shot 2021-05-23 at 12 15 48 PM

Workspace Initialization Improvements + Bugfixes

Screen Shot 2021-05-23 at 12 42 40 PM

Screen Shot 2021-05-23 at 12 43 10 PM

Issues

fixes #46
fixes #50

@jwdotjs jwdotjs merged commit 110ea86 into master Jun 1, 2021
@jwdotjs jwdotjs deleted the tech/misc-changes-may-23rd-2021 branch June 1, 2021 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant