fix(plugin-workflow): fix collection fieldset component (#942)

This commit is contained in:
Junyi 2022-10-20 22:39:52 +08:00 committed by chenos
parent c7300d1100
commit 9111693804

View File

@ -40,6 +40,8 @@ export default observer(({ value, onChange }: any) => {
// && (!['linkTo', 'hasMany', 'hasOne', 'belongsToMany'].includes(field.type)) // && (!['linkTo', 'hasMany', 'hasOne', 'belongsToMany'].includes(field.type))
)); ));
const fieldsSet = new Set(fields.map(field => field.name));
return ( return (
<fieldset className={css` <fieldset className={css`
margin-top: .5em; margin-top: .5em;
@ -129,7 +131,7 @@ export default observer(({ value, onChange }: any) => {
); );
}) })
} }
{Object.keys(value).length < fields.length {Object.keys(value).filter(key => fieldsSet.has(key)).length < fields.length
? ( ? (
<Dropdown overlay={ <Dropdown overlay={
<Menu onClick={({ key }) => onChange({ ...value, [key]: null })} className={css` <Menu onClick={({ key }) => onChange({ ...value, [key]: null })} className={css`