2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-18 18:28:18 +00:00

[ui] Enable form auto-fill (#10061)

* Enable form auto-fill

- If a single value is available, pre-fill
- Must be enabled per-field

* Tweak playwright tests for increased reliability

* Fix deps
This commit is contained in:
Oliver
2025-07-23 18:32:04 +10:00
committed by GitHub
parent 89279ef091
commit 73231ce921
5 changed files with 72 additions and 9 deletions

View File

@@ -56,6 +56,7 @@ export type ApiFormFieldHeader = {
* @param description : The description to display for the field
* @param preFieldContent : Content to render before the field
* @param postFieldContent : Content to render after the field
* @param autoFill: Whether to automatically fill the field with data from the API
* @param onValueChange : Callback function to call when the field value changes
* @param adjustFilters : Callback function to adjust the filters for a related field before a query is made
* @param adjustValue : Callback function to adjust the value of the field before it is sent to the API
@@ -104,6 +105,7 @@ export type ApiFormFieldType = {
description?: string;
preFieldContent?: JSX.Element;
postFieldContent?: JSX.Element;
autoFill?: boolean;
adjustValue?: (value: any) => any;
onValueChange?: (value: any, record?: any) => void;
adjustFilters?: (value: ApiFormAdjustFilterType) => any;