fix(client): select component cannot be opened in sub-table block (#431)
This commit is contained in:
parent
9a64384bc1
commit
e51feafe53
@ -94,6 +94,24 @@ const useCreateCollectionField = () => {
|
||||
}),
|
||||
);
|
||||
}
|
||||
function recursiveChildren(children = [], prefix = 'children') {
|
||||
children.forEach((item, index) => {
|
||||
const itemOptions = item.uiSchema?.enum?.slice() || [];
|
||||
form.setValuesIn(
|
||||
`${prefix}[${index}].uiSchema.enum`,
|
||||
itemOptions.map((option) => {
|
||||
return {
|
||||
value: uid(),
|
||||
...option,
|
||||
};
|
||||
}),
|
||||
);
|
||||
recursiveChildren(item.children, `${prefix}[${index}].children`);
|
||||
});
|
||||
}
|
||||
|
||||
recursiveChildren(form?.values?.children);
|
||||
|
||||
if (form?.values?.interface === 'linkTo' && title) {
|
||||
form.setValuesIn('reverseField.uiSchema.title', title);
|
||||
}
|
||||
|
@ -83,6 +83,25 @@ const useUpdateCollectionField = () => {
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
function recursiveChildren(children = [], prefix = 'children') {
|
||||
children.forEach((item, index) => {
|
||||
const itemOptions = item.uiSchema?.enum?.slice() || [];
|
||||
form.setValuesIn(
|
||||
`${prefix}[${index}].uiSchema.enum`,
|
||||
itemOptions.map((option) => {
|
||||
return {
|
||||
value: uid(),
|
||||
...option,
|
||||
};
|
||||
}),
|
||||
);
|
||||
recursiveChildren(item.children, `${prefix}[${index}].children`);
|
||||
});
|
||||
}
|
||||
|
||||
recursiveChildren(form?.values?.children);
|
||||
|
||||
await run();
|
||||
await refreshCM();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user