Unverified Commit e51feafe authored by 金昶's avatar 金昶 Committed by GitHub
Browse files

fix(client): select component cannot be opened in sub-table block (#431)

parent 9a64384b
No related merge requests found
Showing with 37 additions and 0 deletions
+37 -0
......@@ -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();
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment