Minor Changes
-
#3027
177d0a764fe
Thanks @aliemir! - Initial release of the Inferencer package.This package provides series of components per each UI integration to generate list, show and edit pages for your resources. The fields and their representation are inferred from your resource's API response. Code is generated and presented with a preview and option to copy and edit in your project.
Note: It's highly advised to only use this package in development environments. While generating the sample code, multiple requests are made to the API and the result might not be the best application for your data.
Usage
Components for UI integrations are exported in sub directories. For example, to use the components for Ant Design integration, you can import them like this:
import { AntdListInferencer, AntdShowInferencer, AntdEditInferencer, } from "@pankod/refine-inferencer/antd";
After importing the component, you can directly use it in
<Refine/>
component'sresources
prop.<Refine resources={[ { name: "posts", list: AntdListInferencer, show: AntdShowInferencer, edit: AntdEditInferencer, }, ]} />
Tip: Relation data is only handled if the resource is present in the
resources
array. For example, if you have aposts
resource with ausers
relation, you need to addusers
resource to theresources
array as well. Otherwise, inferencer will try to show the relation data as a simple field like string or a number.
Patch Changes
- #3064
27df262dd0a
Thanks @aliemir! - Addedundefined
check for date field values in@pankod/refine-inferencer/antd
'sEditInferencer
component to prevent setting it to current date when it's not provided.