fix: view collection should set title value when sync form database (#3287)
This commit is contained in:
parent
467f3b6b79
commit
2836df2f10
@ -82,7 +82,8 @@ const PreviewCom = (props) => {
|
|||||||
setDataSource([]);
|
setDataSource([]);
|
||||||
const fieldsData = Object.values(data?.data?.fields)?.map((v: any) => {
|
const fieldsData = Object.values(data?.data?.fields)?.map((v: any) => {
|
||||||
if (v.source) {
|
if (v.source) {
|
||||||
return v;
|
const option = fields?.data.find((h) => h.name === v.name) || v;
|
||||||
|
return { ...v, uiSchema: option.uiSchema };
|
||||||
} else {
|
} else {
|
||||||
return fields?.data.find((h) => h.name === v.name) || v;
|
return fields?.data.find((h) => h.name === v.name) || v;
|
||||||
}
|
}
|
||||||
@ -205,7 +206,10 @@ const PreviewCom = (props) => {
|
|||||||
<Input
|
<Input
|
||||||
value={item?.uiSchema?.title || text}
|
value={item?.uiSchema?.title || text}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
handleFieldChange({ ...item, uiSchema: { ...item?.uiSchema, title: e.target.value } }, index)
|
handleFieldChange(
|
||||||
|
{ ...item, uiSchema: { ...item?.uiSchema, title: e.target.value, rawTitle: e.target.value } },
|
||||||
|
index,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -21,7 +21,7 @@ export const PreviewTable = (props) => {
|
|||||||
if (databaseView) {
|
if (databaseView) {
|
||||||
getPreviewData();
|
getPreviewData();
|
||||||
}
|
}
|
||||||
}, [form.values.fields]);
|
}, [viewName, schema]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const pColumns = formatPreviewColumns(fields);
|
const pColumns = formatPreviewColumns(fields);
|
||||||
|
Loading…
Reference in New Issue
Block a user