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