File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ const dataSource = new ObjectQLDataSource({
2929function UsersTable() {
3030 return (
3131 <ObjectTable
32- objectName = " users"
32+ schema = { {
33+ type: ' object-table' ,
34+ objectName: ' users'
35+ }}
3336 dataSource = { dataSource }
3437 />
3538 );
@@ -50,10 +53,13 @@ const dataSource = new ObjectQLDataSource({
5053function UserForm() {
5154 return (
5255 <ObjectForm
53- objectName = " users"
56+ schema = { {
57+ type: ' object-form' ,
58+ objectName: ' users' ,
59+ mode: ' create' ,
60+ onSuccess : (data ) => console .log (' Created:' , data )
61+ }}
5462 dataSource = { dataSource }
55- mode = " create"
56- onSuccess = { (data ) => console .log (' Created:' , data )}
5763 />
5864 );
5965}
Original file line number Diff line number Diff line change @@ -209,10 +209,14 @@ export const ObjectForm: React.FC<ObjectFormProps> = ({
209209 }
210210
211211 // Convert to FormSchema
212+ // Note: FormSchema currently only supports 'vertical' and 'horizontal' layouts
213+ // Map 'grid' and 'inline' to 'vertical' as fallback
212214 const formSchema : FormSchema = {
213215 type : 'form' ,
214216 fields : formFields ,
215- layout : schema . layout === 'grid' || schema . layout === 'inline' ? 'vertical' : schema . layout || 'vertical' ,
217+ layout : ( schema . layout === 'vertical' || schema . layout === 'horizontal' )
218+ ? schema . layout
219+ : 'vertical' ,
216220 columns : schema . columns ,
217221 submitLabel : schema . submitText || ( schema . mode === 'create' ? 'Create' : 'Update' ) ,
218222 cancelLabel : schema . cancelText ,
You can’t perform that action at this time.
0 commit comments