fix(plugin-workflow): fix node type title in drawers (#389)

This commit is contained in:
Junyi 2022-05-14 12:07:10 +08:00 committed by GitHub
parent 48b2b4bc7b
commit 4476b86b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,14 +165,13 @@ export function NodeDefaultView(props) {
const { data, children } = props;
const instruction = instructions.get(data.type);
const detailText = workflow.executed ? '{{t("View")}}' : '{{t("Configure")}}';
const typeText = compile(instruction.title);
return (
<div className={cx(nodeClass, `workflow-node-type-${data.type}`)}>
<div className={cx(nodeCardClass)}>
<div className={cx(nodeHeaderClass)}>
<div className={cx(nodeMetaClass)}>
<Tag>{typeText}</Tag>
<Tag>{compile(instruction.title)}</Tag>
</div>
<h4 className={cx(nodeTitleClass)}>
<strong>{data.title}</strong>
@ -195,9 +194,9 @@ export function NodeDefaultView(props) {
type: 'primary',
},
properties: {
drawer: {
[instruction.type]: {
type: 'void',
title: typeText,
title: instruction.title,
'x-component': 'Action.Drawer',
'x-decorator': 'Form',
'x-decorator-props': {