-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
Forms initial data #6365
Forms initial data #6365
Conversation
- Allows user to specify an initial dataset to override default values
- Allows lower elements to access all form data without rebuild - Pass all form data through to adjustFilters routine
- Ensure that the saved data are cleared when filters change
- Use new "hook" form structure
- Only fetch when the drop-down is actually opened - Significantly reduces the number of API calls
- Display label / description / placeholder text
- Correct conversion of datatype
- Uses modal form hook - Supply initial data - Adjust filters according to selected company
- StockLocation - PartCategory
- PartParameter table - PartParameterTemplate table - Cleanup unused imports
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
- Also consolidate translated strings - Also improve consistency of inline rendering (with missing image)
- Use apiUrl wrapper around ApiEndpoint
@@ -32,6 +36,8 @@ export function RelatedModelField({ | |||
fieldState: { error } | |||
} = controller; | |||
|
|||
const form = useFormContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have any drawback on performance? Eg does this component now gets rerendered more often as without that hook?
As you asked on the other, now closed pr, if there is any reason to keep two ways, no absolutely fine to refactor to the more reactive one. Thank you that you did that now. The only thing which I sometimes experienced and not sure about yet how to fix it are some performance problems. Mostly in react dev mode with safari on macOS. If I open a large form with lots of fields and type in something it lags a bit behind to how fast I'm typing. Have you seen this too? |
- Only show localhost:8000 if in dev mode
Looks fine; regarding performance Lukas is probably a better discussion partner, I am not knowledgable in that area. |
- Check initial value works for nested field
@SchrodingersGat seems like, that this PR broke the RelatedModelField. If you try to scroll all the way to the bottom it always resets to the top and there are no more items loaded after one time. Before (working): Bildschirmaufnahme.2024-02-02.um.17.30.05.movAfter (not working): Bildschirmaufnahme.2024-02-02.um.17.29.27.mov |
Replaces #6332
This PR is working towards a complete refactoring of how we handle modal forms. The intent is to remove the duplicate pathways for creating forms, and settle on a single, consistent framework (as implemented by @wolflu05 )
So, in this PR we refactor / rework a number of existing forms, add some new features, add some new forms, and fix some bugs along the way.
Important Notes