fix(plugin-workflow): fix workflow title in binding workflow configuration not showing (#3026)

This commit is contained in:
Junyi 2023-11-13 12:13:54 +08:00 committed by GitHub
parent 9dae34a613
commit 83245a406b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -715,6 +715,7 @@ function RemoveButton(
} }
function WorkflowSelect({ types, ...props }) { function WorkflowSelect({ types, ...props }) {
const { t } = useTranslation();
const index = ArrayTable.useIndex(); const index = ArrayTable.useIndex();
const { setValuesIn } = useForm(); const { setValuesIn } = useForm();
const baseCollection = useCollection(); const baseCollection = useCollection();
@ -740,7 +741,12 @@ function WorkflowSelect({ types, ...props }) {
return ( return (
<RemoteSelect <RemoteSelect
{...props} manual={false}
placeholder={t('Select workflow', { ns: 'workflow' })}
fieldNames={{
label: 'title',
value: 'key',
}}
service={{ service={{
resource: 'workflows', resource: 'workflows',
action: 'list', action: 'list',
@ -752,6 +758,7 @@ function WorkflowSelect({ types, ...props }) {
}, },
}, },
}} }}
{...props}
/> />
); );
} }
@ -847,11 +854,6 @@ function WorkflowConfig() {
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'WorkflowSelect', 'x-component': 'WorkflowSelect',
'x-component-props': { 'x-component-props': {
placeholder: t('Select workflow', { ns: 'workflow' }),
fieldNames: {
label: 'title',
value: 'key',
},
types: workflowTypes.map((item) => item.value), types: workflowTypes.map((item) => item.value),
}, },
required: true, required: true,