From 295369b14de513f85a95cc353a297965d02d82fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Suwi=C5=84ski?= Date: Wed, 6 Mar 2024 11:17:45 +0100 Subject: [PATCH] feat: FieldGuesser: props passing to SingleFieldList (linkType prop) (#495) --- src/FieldGuesser.tsx | 7 +++++-- src/types.ts | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/FieldGuesser.tsx b/src/FieldGuesser.tsx index 90e123de..d715d817 100644 --- a/src/FieldGuesser.tsx +++ b/src/FieldGuesser.tsx @@ -23,6 +23,7 @@ import type { NumberFieldProps, ReferenceArrayFieldProps, ReferenceFieldProps, + SingleFieldListProps, TextFieldProps, UrlFieldProps, } from 'react-admin'; @@ -65,11 +66,13 @@ const renderField = ( } const fieldName = schemaAnalyzer.getFieldNameFromSchema(field.reference); + const { linkType, ...rest } = props as ReferenceArrayFieldProps & + Pick; return ( - + diff --git a/src/types.ts b/src/types.ts index 30032f7d..25124da4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -47,6 +47,7 @@ import type { ResourceProps, ShowProps, SimpleFormProps, + SingleFieldListProps, TabbedFormProps, TextFieldProps, TextInputProps, @@ -452,7 +453,7 @@ export type FieldProps = | UrlFieldProps | EmailFieldProps | ArrayFieldProps - | ReferenceArrayFieldProps + | (ReferenceArrayFieldProps & Pick) | EnumFieldProps | ReferenceFieldProps;