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
 | 
					          <Dropdown
 | 
				
			||||||
            overlay={
 | 
					            overlay={
 | 
				
			||||||
              <Menu onClick={onMenuCommand}>
 | 
					              <Menu
 | 
				
			||||||
                <Menu.Item key="history" disabled={!workflow.allExecuted}>{lang('Execution history')}</Menu.Item>
 | 
					                items={[
 | 
				
			||||||
                <Menu.Item key="revision" disabled={!revisionable}>{lang('Copy to new version')}</Menu.Item>
 | 
					                  { key: 'history', label: lang('Execution history'), disabled: !workflow.allExecuted },
 | 
				
			||||||
              </Menu>
 | 
					                  { key: 'revision', label: lang('Copy to new version'), disabled: !revisionable },
 | 
				
			||||||
 | 
					                ]}
 | 
				
			||||||
 | 
					                onClick={onMenuCommand}
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <Button type="text" icon={<EllipsisOutlined />} />
 | 
					            <Button type="text" icon={<EllipsisOutlined />} />
 | 
				
			||||||
 | 
				
			|||||||
@ -117,14 +117,17 @@ export default observer(({ value, disabled, onChange }: any) => {
 | 
				
			|||||||
            {unassignedFields.length
 | 
					            {unassignedFields.length
 | 
				
			||||||
              ? (
 | 
					              ? (
 | 
				
			||||||
                <Dropdown overlay={
 | 
					                <Dropdown overlay={
 | 
				
			||||||
                  <Menu onClick={({ key }) => onChange({ ...value, [key]: null })} className={css`
 | 
					                  <Menu
 | 
				
			||||||
                    max-height: 300px;
 | 
					                    items={unassignedFields.map(field => ({
 | 
				
			||||||
                    overflow-y: auto;
 | 
					                      key: field.name,
 | 
				
			||||||
                  `}>
 | 
					                      label: compile(field.uiSchema?.title ?? field.name),
 | 
				
			||||||
                    {unassignedFields.map(field => (
 | 
					                    }))}
 | 
				
			||||||
                      <Menu.Item key={field.name}>{compile(field.uiSchema?.title ?? field.name)}</Menu.Item>
 | 
					                    onClick={({ key }) => onChange({ ...value, [key]: null })}
 | 
				
			||||||
                    ))}
 | 
					                    className={css`
 | 
				
			||||||
                  </Menu>
 | 
					                      max-height: 300px;
 | 
				
			||||||
 | 
					                      overflow-y: auto;
 | 
				
			||||||
 | 
					                    `}
 | 
				
			||||||
 | 
					                  />
 | 
				
			||||||
                }>
 | 
					                }>
 | 
				
			||||||
                  <Button icon={<PlusOutlined />}>{t('Add field')}</Button>
 | 
					                  <Button icon={<PlusOutlined />}>{t('Add field')}</Button>
 | 
				
			||||||
                </Dropdown>
 | 
					                </Dropdown>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user