mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 21:28:34 +08:00
refactor(plugin-workflow): migrate menu items to options (#1724)
This commit is contained in:
parent
a3a91965c7
commit
422429e772
@ -173,10 +173,13 @@ export function WorkflowCanvas() {
|
||||
/>
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu onClick={onMenuCommand}>
|
||||
<Menu.Item key="history" disabled={!workflow.allExecuted}>{lang('Execution history')}</Menu.Item>
|
||||
<Menu.Item key="revision" disabled={!revisionable}>{lang('Copy to new version')}</Menu.Item>
|
||||
</Menu>
|
||||
<Menu
|
||||
items={[
|
||||
{ key: 'history', label: lang('Execution history'), disabled: !workflow.allExecuted },
|
||||
{ key: 'revision', label: lang('Copy to new version'), disabled: !revisionable },
|
||||
]}
|
||||
onClick={onMenuCommand}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Button type="text" icon={<EllipsisOutlined />} />
|
||||
|
@ -117,14 +117,17 @@ export default observer(({ value, disabled, onChange }: any) => {
|
||||
{unassignedFields.length
|
||||
? (
|
||||
<Dropdown overlay={
|
||||
<Menu onClick={({ key }) => onChange({ ...value, [key]: null })} className={css`
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
`}>
|
||||
{unassignedFields.map(field => (
|
||||
<Menu.Item key={field.name}>{compile(field.uiSchema?.title ?? field.name)}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
<Menu
|
||||
items={unassignedFields.map(field => ({
|
||||
key: field.name,
|
||||
label: compile(field.uiSchema?.title ?? field.name),
|
||||
}))}
|
||||
onClick={({ key }) => onChange({ ...value, [key]: null })}
|
||||
className={css`
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
`}
|
||||
/>
|
||||
}>
|
||||
<Button icon={<PlusOutlined />}>{t('Add field')}</Button>
|
||||
</Dropdown>
|
||||
|
Loading…
Reference in New Issue
Block a user