Fix/plugin workflow (#349)

* fix(plugin-workflow): fix i18n

* fix(plugin-workflow): fix default enabled value of workflows
This commit is contained in:
Junyi 2022-04-30 17:29:15 +08:00 committed by GitHub
parent 8ee25e1109
commit 01c7c95369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 27 deletions

View File

@ -284,4 +284,5 @@ export default {
// workflows
'Execution History': 'History',
'Parallel branch': 'Branch',
}

View File

@ -460,13 +460,11 @@ export default {
'Condition': '条件判断',
'Mode': '模式',
'Reject on false': '通行模式',
'Branch results': '分支模式',
'Continue when result is "Yes"': '判断为“是”时继续',
'Make 2 branches for "Yes" and "No"': '判断结果分为“是”和“否”两个分支,分别继续',
'Continue when "Yes"': '“是”则继续',
'Branch into "Yes" and "No"': '“是”和“否”分别继续',
'Conditions': '条件配置',
'Parallel': '并行',
'Parallel branch': '分支',
'All succeeded': '全部成功',
'Any succeeded': '任意成功',
'Continue after all branches succeeded': '全部分支都成功后才能继续',

View File

@ -1,7 +1,7 @@
import React from "react";
import { css, cx } from "@emotion/css";
import { Button, Select, Tooltip } from "antd";
import { CloseCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { Button, Select } from "antd";
import { CloseCircleOutlined } from '@ant-design/icons';
import { Trans, useTranslation } from "react-i18next";
import { NodeDefaultView } from ".";
@ -150,25 +150,11 @@ export default {
enum: [
{
value: true,
label: (
<Tooltip
title={i18n.t('Continue when result is "Yes"')}
placement="bottom"
>
{i18n.t('Reject on false')} <QuestionCircleOutlined style={{ color: '#999' }} />
</Tooltip>
)
label: i18n.t('Continue when "Yes"')
},
{
value: false,
label: (
<Tooltip
title={i18n.t('Make 2 branches for "Yes" and "No"')}
placement="bottom"
>
{i18n.t('Branch results')} <QuestionCircleOutlined style={{ color: '#999' }} />
</Tooltip>
)
label: i18n.t('Branch results')
}
],
},

View File

@ -11,7 +11,7 @@ import { useTranslation } from "react-i18next";
// import { SchemaComponent } from "../../schema-component";
export default {
title: '{{t("Parallel")}}',
title: '{{t("Parallel branch")}}',
type: 'parallel',
group: 'control',
fieldset: {
@ -39,7 +39,7 @@ export default {
value: 'any',
label: (
<Tooltip
title="Continue after any branch succeeded"
title={i18n.t('Continue after any branch succeeded')}
placement="bottom"
>
{i18n.t('Any succeeded')} <QuestionCircleOutlined style={{ color: '#999' }} />

View File

@ -55,6 +55,7 @@ const collection = {
],
'x-component': 'Radio.Group',
'x-decorator': 'FormItem',
default: false
} as ISchema
}
],

View File

@ -16,7 +16,8 @@ export default {
interface: 'boolean',
type: 'boolean',
name: 'enabled',
title: '启用'
title: '启用',
defaultValue: false
},
{
interface: 'textarea',

View File

@ -45,7 +45,7 @@ export default {
if (!Collection) {
return;
}
// TODO: duplication when mode change should be considered
for (let [key, event] of MODE_BITMAP_EVENTS.entries()) {
if (mode & key) {
if (!Collection.model.options.hooks[event]?.find(item => item.name && item.name === this.getHookId())) {