Adding foreign key to auto forms
This commit is contained in:
15
gui/app/src/common/crud/widgets/crud-text-widget.tsx
Normal file
15
gui/app/src/common/crud/widgets/crud-text-widget.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import TextWidget from "@rjsf/core/lib/components/widgets/TextWidget";
|
||||
import {FormContextType, getTemplate, RJSFSchema, StrictRJSFSchema, WidgetProps} from "@rjsf/utils";
|
||||
|
||||
import {ForeignKeyWidget} from "./foreign-key";
|
||||
|
||||
|
||||
export default function CrudTextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
|
||||
props: WidgetProps<T, S, F>
|
||||
) {
|
||||
if (props.schema.hasOwnProperty("foreign_key")) {
|
||||
return (<ForeignKeyWidget {...props} />);
|
||||
}else {
|
||||
return (<CrudTextWidget {...props} />);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user