-
Notifications
You must be signed in to change notification settings - Fork 0
2143 refactor components and context setup #181
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
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
63f6201
Updates package version in package-lock
0ac13b8
2143: Refactor RenderFormErrors into RenderValidatioErrors
1e17d84
2143: Improve typing of apiResonse
7a107cf
2143: Add changeset
0a77871
2143: Adds configurable error component
fbb68f9
2143: Updates react-hook-form to latest version
b4308d0
2143: Small refactor
4b091f0
2143: Refactor: Split components WIP
d3776ef
2143: Create usePydanticForm hook. Moves logic there WIP
cc6c271
2143: Moves api and parsing logic to usePydanticForm hook
360b06b
2143: Create react-hook-form in its own component
85be78a
2143: Fixes frontend validation lag
55e54cb
1243: Introduces config context and useGetConfig hook
7d6b38d
2143: Fixes passing title to header
38b07cf
2143: Fixes hasNext and hasPrevious in footer component
ca7daee
2143: Stores previous steps and uses them
55b5a88
2143: Handle backend validation errors
ba58772
2143: Handle 200 success response
ce81be0
2143: Handle 500 responses
4720959
2143: Re-implement back fucntionality
b0904d5
2143: reimplements going back
9a41da8
2143: Reimplement restoring history when going forward
9379bf8
2143: Readss fieldDataStorage as a hook
c2473a0
2143: Fixes arrayField
77a0503
2143: Restores object field
8f5a051
2143: Fixes linting errors
f3a1b75
2143: Restore validation error render component
5eee4af
2143: Create and expose a proxy hook for useFormContext
3d2a3ce
2143: Fixes using 201 as a status code
96bad36
2143: Fixes fieldDataStorage
34bfe49
2143: Adds changeset
0c67d61
2143: Remove disabled line
38924ac
2143: Fixes resetting form on formKey change
6b17a59
2143: TyPo
270efe3
Update frontend/packages/pydantic-forms/src/core/hooks/useFieldDataSt…
DutchBen 9a4ebd2
2143: PR comments
fee729d
Update frontend/apps/example/src/app/page.tsx
DutchBen ee95c49
2143: Reject if not valid return code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'pydantic-forms': patch | ||
--- | ||
|
||
Improves handling 500 api errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'pydantic-forms': minor | ||
--- | ||
|
||
Refactors component and contextprovider setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
frontend/packages/pydantic-forms/src/components/fields/HiddenField.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import React from 'react'; | ||
|
||
import { usePydanticFormContext } from '@/core'; | ||
import { useGetForm } from '@/core'; | ||
import { PydanticFormElementProps } from '@/types'; | ||
|
||
export const HiddenField = ({ | ||
pydanticFormField, | ||
}: PydanticFormElementProps) => { | ||
const { reactHookForm } = usePydanticFormContext(); | ||
const { register } = useGetForm(); | ||
return ( | ||
<input | ||
type="hidden" | ||
data-testid={pydanticFormField.id} | ||
{...reactHookForm.register(pydanticFormField.id)} | ||
{...register(pydanticFormField.id)} | ||
/> | ||
); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.