@nocobase/client 0.7.0-alpha.25 → 0.7.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/locale/index.d.ts +48 -0
- package/esm/locale/zh_CN.d.ts +48 -0
- package/esm/locale/zh_CN.js +51 -2
- package/esm/locale/zh_CN.js.map +1 -1
- package/esm/workflow/WorkflowCanvas.js +11 -8
- package/esm/workflow/WorkflowCanvas.js.map +1 -1
- package/esm/workflow/WorkflowLink.js +3 -1
- package/esm/workflow/WorkflowLink.js.map +1 -1
- package/esm/workflow/WorkflowPage.js +3 -3
- package/esm/workflow/WorkflowPage.js.map +1 -1
- package/esm/workflow/WorkflowShortcut.js +4 -2
- package/esm/workflow/WorkflowShortcut.js.map +1 -1
- package/esm/workflow/calculators.js +26 -22
- package/esm/workflow/calculators.js.map +1 -1
- package/esm/workflow/nodes/calculation.js +5 -3
- package/esm/workflow/nodes/calculation.js.map +1 -1
- package/esm/workflow/nodes/create.js +5 -3
- package/esm/workflow/nodes/create.js.map +1 -1
- package/esm/workflow/nodes/destroy.js +2 -2
- package/esm/workflow/nodes/destroy.js.map +1 -1
- package/esm/workflow/nodes/index.js +11 -8
- package/esm/workflow/nodes/index.js.map +1 -1
- package/esm/workflow/nodes/query.js +5 -3
- package/esm/workflow/nodes/query.js.map +1 -1
- package/esm/workflow/nodes/update.js +2 -2
- package/esm/workflow/nodes/update.js.map +1 -1
- package/esm/workflow/schemas/collection.js +3 -3
- package/esm/workflow/schemas/collection.js.map +1 -1
- package/esm/workflow/schemas/executions.d.ts +4 -25
- package/esm/workflow/schemas/executions.js +38 -34
- package/esm/workflow/schemas/executions.js.map +1 -1
- package/esm/workflow/schemas/workflows.js +51 -30
- package/esm/workflow/schemas/workflows.js.map +1 -1
- package/esm/workflow/triggers/index.js +6 -5
- package/esm/workflow/triggers/index.js.map +1 -1
- package/esm/workflow/triggers/model.js +12 -10
- package/esm/workflow/triggers/model.js.map +1 -1
- package/lib/locale/index.d.ts +48 -0
- package/lib/locale/zh_CN.d.ts +48 -0
- package/lib/locale/zh_CN.js +51 -2
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/workflow/WorkflowCanvas.js +10 -7
- package/lib/workflow/WorkflowCanvas.js.map +1 -1
- package/lib/workflow/WorkflowLink.js +3 -1
- package/lib/workflow/WorkflowLink.js.map +1 -1
- package/lib/workflow/WorkflowPage.js +3 -3
- package/lib/workflow/WorkflowPage.js.map +1 -1
- package/lib/workflow/WorkflowShortcut.js +4 -2
- package/lib/workflow/WorkflowShortcut.js.map +1 -1
- package/lib/workflow/calculators.js +26 -22
- package/lib/workflow/calculators.js.map +1 -1
- package/lib/workflow/nodes/calculation.js +5 -3
- package/lib/workflow/nodes/calculation.js.map +1 -1
- package/lib/workflow/nodes/create.js +5 -3
- package/lib/workflow/nodes/create.js.map +1 -1
- package/lib/workflow/nodes/destroy.js +2 -2
- package/lib/workflow/nodes/destroy.js.map +1 -1
- package/lib/workflow/nodes/index.js +10 -7
- package/lib/workflow/nodes/index.js.map +1 -1
- package/lib/workflow/nodes/query.js +5 -3
- package/lib/workflow/nodes/query.js.map +1 -1
- package/lib/workflow/nodes/update.js +2 -2
- package/lib/workflow/nodes/update.js.map +1 -1
- package/lib/workflow/schemas/collection.js +3 -3
- package/lib/workflow/schemas/collection.js.map +1 -1
- package/lib/workflow/schemas/executions.d.ts +4 -25
- package/lib/workflow/schemas/executions.js +38 -34
- package/lib/workflow/schemas/executions.js.map +1 -1
- package/lib/workflow/schemas/workflows.js +51 -30
- package/lib/workflow/schemas/workflows.js.map +1 -1
- package/lib/workflow/triggers/index.js +5 -4
- package/lib/workflow/triggers/index.js.map +1 -1
- package/lib/workflow/triggers/model.js +12 -10
- package/lib/workflow/triggers/model.js.map +1 -1
- package/package.json +3 -3
- package/src/locale/zh_CN.ts +63 -2
- package/src/workflow/WorkflowCanvas.tsx +13 -8
- package/src/workflow/WorkflowLink.tsx +3 -1
- package/src/workflow/WorkflowPage.tsx +3 -3
- package/src/workflow/WorkflowShortcut.tsx +4 -2
- package/src/workflow/calculators.tsx +27 -23
- package/src/workflow/nodes/calculation.tsx +5 -3
- package/src/workflow/nodes/create.tsx +5 -3
- package/src/workflow/nodes/destroy.tsx +2 -2
- package/src/workflow/nodes/index.tsx +11 -8
- package/src/workflow/nodes/query.tsx +5 -3
- package/src/workflow/nodes/update.tsx +2 -2
- package/src/workflow/schemas/collection.ts +3 -3
- package/src/workflow/schemas/executions.ts +38 -34
- package/src/workflow/schemas/workflows.ts +31 -30
- package/src/workflow/triggers/index.tsx +6 -5
- package/src/workflow/triggers/model.tsx +12 -10
|
@@ -9,6 +9,7 @@ import { instructions, useNodeContext } from "./nodes";
|
|
|
9
9
|
import { useFlowContext } from "./WorkflowCanvas";
|
|
10
10
|
import { triggers } from "./triggers";
|
|
11
11
|
import { SchemaComponent, useCollectionManager, useCompile } from "..";
|
|
12
|
+
import { useTranslation } from "react-i18next";
|
|
12
13
|
|
|
13
14
|
function NullRender() {
|
|
14
15
|
return null;
|
|
@@ -17,7 +18,7 @@ function NullRender() {
|
|
|
17
18
|
export const calculators = [
|
|
18
19
|
{
|
|
19
20
|
value: 'boolean',
|
|
20
|
-
title: '
|
|
21
|
+
title: '{{t("Comparison")}}',
|
|
21
22
|
children: [
|
|
22
23
|
{ value: 'equal', name: '=' },
|
|
23
24
|
{ value: 'notEqual', name: '≠' },
|
|
@@ -29,7 +30,7 @@ export const calculators = [
|
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
value: 'number',
|
|
32
|
-
title: '
|
|
33
|
+
title: '{{t("Arithmetic calculation")}}',
|
|
33
34
|
children: [
|
|
34
35
|
{ value: 'add', name: '+' },
|
|
35
36
|
{ value: 'minus', name: '-' },
|
|
@@ -40,19 +41,19 @@ export const calculators = [
|
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
43
|
value: 'string',
|
|
43
|
-
title: '
|
|
44
|
+
title: '{{t("String operation")}}',
|
|
44
45
|
children: [
|
|
45
|
-
{ value: 'includes', name: '
|
|
46
|
-
{ value: 'notIncludes', name: '
|
|
47
|
-
{ value: 'startsWith', name: '
|
|
48
|
-
{ value: 'notStartsWith', name: '
|
|
49
|
-
{ value: 'endsWith', name: '
|
|
50
|
-
{ value: 'notEndsWith', name: '
|
|
46
|
+
{ value: 'includes', name: '{{t("contains")}}' },
|
|
47
|
+
{ value: 'notIncludes', name: '{{t("does not contain")}}' },
|
|
48
|
+
{ value: 'startsWith', name: '{{t("starts with")}}' },
|
|
49
|
+
{ value: 'notStartsWith', name: '{{t("not starts with")}}' },
|
|
50
|
+
{ value: 'endsWith', name: '{{t("ends with")}}' },
|
|
51
|
+
{ value: 'notEndsWith', name: '{{t("not ends with")}}' }
|
|
51
52
|
]
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
value: 'date',
|
|
55
|
-
title: '
|
|
56
|
+
title: '{{t("Date")}}',
|
|
56
57
|
children: []
|
|
57
58
|
}
|
|
58
59
|
];
|
|
@@ -77,7 +78,7 @@ export const BaseTypeSet = new Set(['boolean', 'number', 'string', 'date']);
|
|
|
77
78
|
|
|
78
79
|
const ConstantTypes = {
|
|
79
80
|
string: {
|
|
80
|
-
title: '
|
|
81
|
+
title: '{{t("String")}}',
|
|
81
82
|
value: 'string',
|
|
82
83
|
component({ onChange, type, options, value }) {
|
|
83
84
|
return (
|
|
@@ -90,7 +91,7 @@ const ConstantTypes = {
|
|
|
90
91
|
default: ''
|
|
91
92
|
},
|
|
92
93
|
number: {
|
|
93
|
-
title: '
|
|
94
|
+
title: '{{t("Number")}}',
|
|
94
95
|
value: 'number',
|
|
95
96
|
component({ onChange, type, options, value }) {
|
|
96
97
|
return (
|
|
@@ -103,7 +104,7 @@ const ConstantTypes = {
|
|
|
103
104
|
default: 0
|
|
104
105
|
},
|
|
105
106
|
boolean: {
|
|
106
|
-
title: '
|
|
107
|
+
title: '{{t("Boolean")}}',
|
|
107
108
|
value: 'boolean',
|
|
108
109
|
component({ onChange, type, options, value }) {
|
|
109
110
|
return (
|
|
@@ -127,7 +128,7 @@ const ConstantTypes = {
|
|
|
127
128
|
|
|
128
129
|
export const VariableTypes = {
|
|
129
130
|
constant: {
|
|
130
|
-
title: '
|
|
131
|
+
title: '{{t("Constant")}}',
|
|
131
132
|
value: 'constant',
|
|
132
133
|
options: Object.values(ConstantTypes).map(item => ({
|
|
133
134
|
value: item.value,
|
|
@@ -155,7 +156,7 @@ export const VariableTypes = {
|
|
|
155
156
|
}
|
|
156
157
|
},
|
|
157
158
|
$jobsMapByNodeId: {
|
|
158
|
-
title: '
|
|
159
|
+
title: '{{t("Node result")}}',
|
|
159
160
|
value: '$jobsMapByNodeId',
|
|
160
161
|
options() {
|
|
161
162
|
const node = useNodeContext();
|
|
@@ -210,7 +211,7 @@ export const VariableTypes = {
|
|
|
210
211
|
}
|
|
211
212
|
},
|
|
212
213
|
$context: {
|
|
213
|
-
title: '
|
|
214
|
+
title: '{{t("Trigger context")}}',
|
|
214
215
|
value: '$context',
|
|
215
216
|
component() {
|
|
216
217
|
const { workflow } = useFlowContext();
|
|
@@ -252,6 +253,7 @@ export function Operand({
|
|
|
252
253
|
onChange,
|
|
253
254
|
children
|
|
254
255
|
}: OperandProps) {
|
|
256
|
+
const compile = useCompile();
|
|
255
257
|
const Types = useVariableTypes();
|
|
256
258
|
|
|
257
259
|
const { type } = operand;
|
|
@@ -279,7 +281,7 @@ export function Operand({
|
|
|
279
281
|
options={Object.values(Types).map((item: any) => {
|
|
280
282
|
const options = typeof item.options === 'function' ? item.options() : item.options;
|
|
281
283
|
return {
|
|
282
|
-
label: item.title,
|
|
284
|
+
label: compile(item.title),
|
|
283
285
|
value: item.value,
|
|
284
286
|
children: options,
|
|
285
287
|
disabled: options && !options.length,
|
|
@@ -303,6 +305,7 @@ export function Operand({
|
|
|
303
305
|
}
|
|
304
306
|
|
|
305
307
|
export function Calculation({ calculator, operands = [], onChange }) {
|
|
308
|
+
const { t } = useTranslation();
|
|
306
309
|
return (
|
|
307
310
|
<VariableTypesContext.Provider value={VariableTypes}>
|
|
308
311
|
<div className={css`
|
|
@@ -321,9 +324,9 @@ export function Calculation({ calculator, operands = [], onChange }) {
|
|
|
321
324
|
<>
|
|
322
325
|
<Select value={calculator} onChange={v => onChange({ operands, calculator: v })}>
|
|
323
326
|
{calculators.map(group => (
|
|
324
|
-
<Select.OptGroup key={group.value} label={group.title}>
|
|
327
|
+
<Select.OptGroup key={group.value} label={t(group.title)}>
|
|
325
328
|
{group.children.map(item => (
|
|
326
|
-
<Select.Option key={item.value} value={item.value}>{item.name}</Select.Option>
|
|
329
|
+
<Select.Option key={item.value} value={t(item.value)}>{item.name}</Select.Option>
|
|
327
330
|
))}
|
|
328
331
|
</Select.OptGroup>
|
|
329
332
|
))}
|
|
@@ -341,7 +344,7 @@ export function Calculation({ calculator, operands = [], onChange }) {
|
|
|
341
344
|
export function VariableComponent({ value, onChange, renderSchemaComponent }) {
|
|
342
345
|
const VTypes = { ...VariableTypes,
|
|
343
346
|
constant: {
|
|
344
|
-
title: '
|
|
347
|
+
title: '{{t("Constant")}}',
|
|
345
348
|
value: 'constant',
|
|
346
349
|
options: undefined
|
|
347
350
|
}
|
|
@@ -372,6 +375,7 @@ export function VariableComponent({ value, onChange, renderSchemaComponent }) {
|
|
|
372
375
|
|
|
373
376
|
// NOTE: observer for watching useProps
|
|
374
377
|
export const CollectionFieldset = observer(({ value, onChange }: any) => {
|
|
378
|
+
const { t } = useTranslation();
|
|
375
379
|
const compile = useCompile();
|
|
376
380
|
const { getCollectionFields } = useCollectionManager();
|
|
377
381
|
const { values: data } = useForm();
|
|
@@ -384,7 +388,7 @@ export const CollectionFieldset = observer(({ value, onChange }: any) => {
|
|
|
384
388
|
const VTypes = {
|
|
385
389
|
...VariableTypes,
|
|
386
390
|
constant: {
|
|
387
|
-
title: '
|
|
391
|
+
title: '{{t("Constant")}}',
|
|
388
392
|
value: 'constant',
|
|
389
393
|
options: undefined
|
|
390
394
|
}
|
|
@@ -458,14 +462,14 @@ export const CollectionFieldset = observer(({ value, onChange }: any) => {
|
|
|
458
462
|
))}
|
|
459
463
|
</Menu>
|
|
460
464
|
}>
|
|
461
|
-
<Button icon={<PlusOutlined />}
|
|
465
|
+
<Button icon={<PlusOutlined />}>{t('Add field')}</Button>
|
|
462
466
|
</Dropdown>
|
|
463
467
|
)
|
|
464
468
|
: null
|
|
465
469
|
}
|
|
466
470
|
</>
|
|
467
471
|
)
|
|
468
|
-
: <p
|
|
472
|
+
: <p>{t('Select collection')}</p>
|
|
469
473
|
}
|
|
470
474
|
</fieldset>
|
|
471
475
|
);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { css } from '@emotion/css';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { Calculation } from '../calculators';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
|
-
title: '
|
|
7
|
+
title: '{{t("Calculation")}}',
|
|
7
8
|
type: 'calculation',
|
|
8
9
|
group: 'control',
|
|
9
10
|
fieldset: {
|
|
10
11
|
'config.calculation': {
|
|
11
12
|
type: 'object',
|
|
12
|
-
title: '
|
|
13
|
+
title: '{{t("Configure calculation")}}',
|
|
13
14
|
name: 'config.calculation',
|
|
14
15
|
required: true,
|
|
15
16
|
'x-decorator': 'FormItem',
|
|
@@ -27,6 +28,7 @@ export default {
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
getter() {
|
|
30
|
-
|
|
31
|
+
const { t } = useTranslation();
|
|
32
|
+
return <div className={css`flex-shrink: 0`}>{t('Calculation result')}</div>;
|
|
31
33
|
}
|
|
32
34
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Select } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { useCollectionDataSource, useCollectionManager, useCompile } from '../..';
|
|
4
5
|
import { BaseTypeSet, CollectionFieldset } from '../calculators';
|
|
5
6
|
import { collection, values } from '../schemas/collection';
|
|
@@ -7,9 +8,9 @@ import { useFlowContext } from '../WorkflowCanvas';
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
|
-
title: '
|
|
11
|
+
title: '{{t("Create record")}}',
|
|
11
12
|
type: 'create',
|
|
12
|
-
group: '
|
|
13
|
+
group: 'collection',
|
|
13
14
|
fieldset: {
|
|
14
15
|
'config.collection': {
|
|
15
16
|
...collection,
|
|
@@ -45,6 +46,7 @@ export default {
|
|
|
45
46
|
CollectionFieldset
|
|
46
47
|
},
|
|
47
48
|
getter({ type, options, onChange }) {
|
|
49
|
+
const { t } = useTranslation();
|
|
48
50
|
const compile = useCompile();
|
|
49
51
|
const { collections = [] } = useCollectionManager();
|
|
50
52
|
const { nodes } = useFlowContext();
|
|
@@ -52,7 +54,7 @@ export default {
|
|
|
52
54
|
const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };
|
|
53
55
|
|
|
54
56
|
return (
|
|
55
|
-
<Select value={options.path} placeholder=
|
|
57
|
+
<Select value={options.path} placeholder={t('Fields')} onChange={path => {
|
|
56
58
|
onChange({ type, options: { ...options, path } });
|
|
57
59
|
}}>
|
|
58
60
|
{collection.fields
|
|
@@ -4,9 +4,9 @@ import { VariableComponent } from '../calculators';
|
|
|
4
4
|
import { collection, filter } from '../schemas/collection';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: '
|
|
7
|
+
title: '{{t("Delete record")}}',
|
|
8
8
|
type: 'destroy',
|
|
9
|
-
group: '
|
|
9
|
+
group: 'collection',
|
|
10
10
|
fieldset: {
|
|
11
11
|
'config.collection': collection,
|
|
12
12
|
'config.params': {
|
|
@@ -4,7 +4,8 @@ import { ISchema, useForm } from '@formily/react';
|
|
|
4
4
|
import { Registry } from '@nocobase/utils';
|
|
5
5
|
import { Button, Modal, Tag } from 'antd';
|
|
6
6
|
import React, { useContext } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { SchemaComponent, useActionContext, useAPIClient, useCollection, useCompile, useRequest, useResourceActionContext } from '../..';
|
|
8
9
|
import { nodeBlockClass, nodeCardClass, nodeClass, nodeHeaderClass, nodeTitleClass } from '../style';
|
|
9
10
|
import { AddButton, useFlowContext } from '../WorkflowCanvas';
|
|
10
11
|
|
|
@@ -109,6 +110,7 @@ export function Node({ data }) {
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
export function RemoveButton() {
|
|
113
|
+
const { t } = useTranslation();
|
|
112
114
|
const { resource } = useCollection();
|
|
113
115
|
const current = useNodeContext();
|
|
114
116
|
const { nodes, onNodeRemoved } = useFlowContext();
|
|
@@ -123,11 +125,11 @@ export function RemoveButton() {
|
|
|
123
125
|
|
|
124
126
|
const hasBranches = !nodes.find(item => item.upstream === current && item.branchIndex != null);
|
|
125
127
|
const message = hasBranches
|
|
126
|
-
? '
|
|
127
|
-
: '
|
|
128
|
+
? t('Are you sure you want to delete it?')
|
|
129
|
+
: t('This node contains branches, deleting will also be preformed to them, are you sure?');
|
|
128
130
|
|
|
129
131
|
Modal.confirm({
|
|
130
|
-
title: '
|
|
132
|
+
title: t('Delete'),
|
|
131
133
|
content: message,
|
|
132
134
|
onOk
|
|
133
135
|
});
|
|
@@ -146,6 +148,7 @@ export function RemoveButton() {
|
|
|
146
148
|
|
|
147
149
|
export function NodeDefaultView(props) {
|
|
148
150
|
const { data, children } = props;
|
|
151
|
+
const compile = useCompile();
|
|
149
152
|
const instruction = instructions.get(data.type);
|
|
150
153
|
|
|
151
154
|
return (
|
|
@@ -154,7 +157,7 @@ export function NodeDefaultView(props) {
|
|
|
154
157
|
<div className={cx(nodeCardClass)}>
|
|
155
158
|
<div className={cx(nodeHeaderClass)}>
|
|
156
159
|
<h4 className={cx(nodeTitleClass)}>
|
|
157
|
-
<Tag>{instruction.title}</Tag>
|
|
160
|
+
<Tag>{compile(instruction.title)}</Tag>
|
|
158
161
|
<strong>{data.title}</strong>
|
|
159
162
|
<span className="workflow-node-id">#{data.id}</span>
|
|
160
163
|
</h4>
|
|
@@ -169,7 +172,7 @@ export function NodeDefaultView(props) {
|
|
|
169
172
|
view: instruction.view,
|
|
170
173
|
config: {
|
|
171
174
|
type: 'void',
|
|
172
|
-
title: '
|
|
175
|
+
title: '{{t("Node configuration")}}',
|
|
173
176
|
'x-component': 'Action.Link',
|
|
174
177
|
'x-component-props': {
|
|
175
178
|
type: 'primary',
|
|
@@ -177,7 +180,7 @@ export function NodeDefaultView(props) {
|
|
|
177
180
|
properties: {
|
|
178
181
|
drawer: {
|
|
179
182
|
type: 'void',
|
|
180
|
-
title: '
|
|
183
|
+
title: '{{t("Node configuration")}}',
|
|
181
184
|
'x-component': 'Action.Drawer',
|
|
182
185
|
'x-decorator': 'Form',
|
|
183
186
|
'x-decorator-props': {
|
|
@@ -192,7 +195,7 @@ export function NodeDefaultView(props) {
|
|
|
192
195
|
title: {
|
|
193
196
|
type: 'string',
|
|
194
197
|
name: 'title',
|
|
195
|
-
title: '
|
|
198
|
+
title: '{{t("Name")}}',
|
|
196
199
|
'x-decorator': 'FormItem',
|
|
197
200
|
'x-component': 'Input',
|
|
198
201
|
},
|
|
@@ -6,11 +6,12 @@ import { useCollectionDataSource, useCollectionManager, useCompile } from '../..
|
|
|
6
6
|
import { useFlowContext } from '../WorkflowCanvas';
|
|
7
7
|
import { BaseTypeSet, VariableComponent } from '../calculators';
|
|
8
8
|
import { collection, filter } from '../schemas/collection';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
|
-
title: '
|
|
12
|
+
title: '{{t("Query record")}}',
|
|
12
13
|
type: 'query',
|
|
13
|
-
group: '
|
|
14
|
+
group: 'collection',
|
|
14
15
|
fieldset: {
|
|
15
16
|
'config.collection': collection,
|
|
16
17
|
'config.multiple': {
|
|
@@ -43,6 +44,7 @@ export default {
|
|
|
43
44
|
VariableComponent
|
|
44
45
|
},
|
|
45
46
|
getter({ type, options, onChange }) {
|
|
47
|
+
const { t } = useTranslation();
|
|
46
48
|
const compile = useCompile();
|
|
47
49
|
const { collections = [] } = useCollectionManager();
|
|
48
50
|
const { nodes } = useFlowContext();
|
|
@@ -50,7 +52,7 @@ export default {
|
|
|
50
52
|
const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };
|
|
51
53
|
|
|
52
54
|
return (
|
|
53
|
-
<Select value={options.path} placeholder=
|
|
55
|
+
<Select value={options.path} placeholder={t('Fields')} onChange={path => {
|
|
54
56
|
onChange({ type, options: { ...options, path } });
|
|
55
57
|
}}>
|
|
56
58
|
{collection.fields
|
|
@@ -3,9 +3,9 @@ import { CollectionFieldset, VariableComponent } from '../calculators';
|
|
|
3
3
|
import { collection, filter, values } from '../schemas/collection';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title: '
|
|
6
|
+
title: '{{t("Update record")}}',
|
|
7
7
|
type: 'update',
|
|
8
|
-
group: '
|
|
8
|
+
group: 'collection',
|
|
9
9
|
fieldset: {
|
|
10
10
|
'config.collection': collection,
|
|
11
11
|
'config.params': {
|
|
@@ -5,7 +5,7 @@ import { useCollectionFilterOptions } from "../../collection-manager/action-hook
|
|
|
5
5
|
|
|
6
6
|
export const collection = {
|
|
7
7
|
type: 'string',
|
|
8
|
-
title: '
|
|
8
|
+
title: '{{t("Collection")}}',
|
|
9
9
|
name: 'config.collection',
|
|
10
10
|
required: true,
|
|
11
11
|
'x-reactions': ['{{useCollectionDataSource()}}'],
|
|
@@ -15,7 +15,7 @@ export const collection = {
|
|
|
15
15
|
|
|
16
16
|
export const values = {
|
|
17
17
|
type: 'object',
|
|
18
|
-
title: '
|
|
18
|
+
title: '{{t("Form values")}}',
|
|
19
19
|
name: 'config.params.values',
|
|
20
20
|
'x-decorator': 'FormItem',
|
|
21
21
|
'x-decorator-props': {
|
|
@@ -29,7 +29,7 @@ export const values = {
|
|
|
29
29
|
|
|
30
30
|
export const filter = {
|
|
31
31
|
type: 'object',
|
|
32
|
-
title: '
|
|
32
|
+
title: '{{t("Filter")}}',
|
|
33
33
|
name: 'config.params.filter',
|
|
34
34
|
'x-decorator': 'FormItem',
|
|
35
35
|
'x-decorator-props': {
|
|
@@ -4,12 +4,16 @@ const collection = {
|
|
|
4
4
|
name: 'executions',
|
|
5
5
|
fields: [
|
|
6
6
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
interface: 'createdAt',
|
|
8
|
+
type: 'datetime',
|
|
9
|
+
// field: 'createdAt',
|
|
10
|
+
name: 'createdAt',
|
|
10
11
|
uiSchema: {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
type: 'datetime',
|
|
13
|
+
title: '{{t("Created at")}}',
|
|
14
|
+
'x-component': 'DatePicker',
|
|
15
|
+
'x-component-props': {},
|
|
16
|
+
'x-read-pretty': true,
|
|
13
17
|
} as ISchema,
|
|
14
18
|
},
|
|
15
19
|
{
|
|
@@ -17,15 +21,15 @@ const collection = {
|
|
|
17
21
|
name: 'status',
|
|
18
22
|
interface: 'select',
|
|
19
23
|
uiSchema: {
|
|
20
|
-
title: '
|
|
24
|
+
title: '{{t("Status")}}',
|
|
21
25
|
type: 'string',
|
|
22
26
|
'x-component': 'Select',
|
|
23
27
|
'x-decorator': 'FormItem',
|
|
24
28
|
enum: [
|
|
25
|
-
{ value: 0, label: '
|
|
26
|
-
{ value: 1, label: '
|
|
27
|
-
{ value: -1, label: '
|
|
28
|
-
{ value: -2, label: '
|
|
29
|
+
{ value: 0, label: '{{t("On going")}}' },
|
|
30
|
+
{ value: 1, label: '{{t("Success")}}' },
|
|
31
|
+
{ value: -1, label: '{{t("Failed")}}' },
|
|
32
|
+
{ value: -2, label: '{{t("Canceled")}}' },
|
|
29
33
|
],
|
|
30
34
|
} as ISchema,
|
|
31
35
|
}
|
|
@@ -76,13 +80,13 @@ export const executionSchema = {
|
|
|
76
80
|
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
|
77
81
|
},
|
|
78
82
|
properties: {
|
|
79
|
-
|
|
83
|
+
createdAt: {
|
|
80
84
|
type: 'void',
|
|
81
85
|
'x-decorator': 'Table.Column.Decorator',
|
|
82
86
|
'x-component': 'Table.Column',
|
|
83
87
|
properties: {
|
|
84
|
-
|
|
85
|
-
type: '
|
|
88
|
+
createdAt: {
|
|
89
|
+
type: 'datetime',
|
|
86
90
|
'x-component': 'CollectionField',
|
|
87
91
|
'x-read-pretty': true,
|
|
88
92
|
},
|
|
@@ -100,27 +104,27 @@ export const executionSchema = {
|
|
|
100
104
|
},
|
|
101
105
|
}
|
|
102
106
|
},
|
|
103
|
-
actions: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
107
|
+
// actions: {
|
|
108
|
+
// type: 'void',
|
|
109
|
+
// title: '{{ t("Actions") }}',
|
|
110
|
+
// 'x-component': 'Table.Column',
|
|
111
|
+
// properties: {
|
|
112
|
+
// actions: {
|
|
113
|
+
// type: 'void',
|
|
114
|
+
// 'x-component': 'Space',
|
|
115
|
+
// 'x-component-props': {
|
|
116
|
+
// split: '|',
|
|
117
|
+
// },
|
|
118
|
+
// properties: {
|
|
119
|
+
// config: {
|
|
120
|
+
// type: 'void',
|
|
121
|
+
// title: '查看',
|
|
122
|
+
// 'x-component': 'ExecutionLink'
|
|
123
|
+
// },
|
|
124
|
+
// }
|
|
125
|
+
// }
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISchema } from '@formily/react';
|
|
2
|
+
import { triggers } from '../triggers';
|
|
2
3
|
import { executionSchema } from './executions';
|
|
3
4
|
|
|
4
5
|
const collection = {
|
|
@@ -9,7 +10,7 @@ const collection = {
|
|
|
9
10
|
name: 'title',
|
|
10
11
|
interface: 'input',
|
|
11
12
|
uiSchema: {
|
|
12
|
-
title: '
|
|
13
|
+
title: '{{t("Name")}}',
|
|
13
14
|
type: 'string',
|
|
14
15
|
'x-component': 'Input',
|
|
15
16
|
required: true,
|
|
@@ -20,13 +21,14 @@ const collection = {
|
|
|
20
21
|
name: 'type',
|
|
21
22
|
interface: 'select',
|
|
22
23
|
uiSchema: {
|
|
23
|
-
title: '
|
|
24
|
+
title: '{{t("Trigger type")}}',
|
|
24
25
|
type: 'string',
|
|
25
26
|
'x-component': 'Select',
|
|
26
27
|
'x-decorator': 'FormItem',
|
|
27
|
-
enum: [
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
enum: Array.from(triggers.getEntities()).map(([value, { title }]) => ({
|
|
29
|
+
value,
|
|
30
|
+
label: title,
|
|
31
|
+
})),
|
|
30
32
|
required: true,
|
|
31
33
|
} as ISchema,
|
|
32
34
|
},
|
|
@@ -35,7 +37,7 @@ const collection = {
|
|
|
35
37
|
name: 'description',
|
|
36
38
|
interface: 'textarea',
|
|
37
39
|
uiSchema: {
|
|
38
|
-
title: '
|
|
40
|
+
title: '{{t("Description")}}',
|
|
39
41
|
type: 'string',
|
|
40
42
|
'x-component': 'Input.TextArea',
|
|
41
43
|
} as ISchema,
|
|
@@ -45,11 +47,11 @@ const collection = {
|
|
|
45
47
|
name: 'enabled',
|
|
46
48
|
interface: 'radio',
|
|
47
49
|
uiSchema: {
|
|
48
|
-
title: '
|
|
50
|
+
title: '{{t("Status")}}',
|
|
49
51
|
type: 'string',
|
|
50
52
|
enum: [
|
|
51
|
-
{ label: '
|
|
52
|
-
{ label: '
|
|
53
|
+
{ label: '{{t("Enabled")}}', value: true },
|
|
54
|
+
{ label: '{{t("Disabled")}}', value: false },
|
|
53
55
|
],
|
|
54
56
|
'x-component': 'Radio.Group',
|
|
55
57
|
'x-decorator': 'FormItem',
|
|
@@ -94,7 +96,7 @@ export const workflowSchema: ISchema = {
|
|
|
94
96
|
properties: {
|
|
95
97
|
delete: {
|
|
96
98
|
type: 'void',
|
|
97
|
-
title: '
|
|
99
|
+
title: '{{t("Delete")}}',
|
|
98
100
|
'x-component': 'Action',
|
|
99
101
|
'x-component-props': {
|
|
100
102
|
useAction: '{{ cm.useBulkDestroyAction }}',
|
|
@@ -106,7 +108,7 @@ export const workflowSchema: ISchema = {
|
|
|
106
108
|
},
|
|
107
109
|
create: {
|
|
108
110
|
type: 'void',
|
|
109
|
-
title: '
|
|
111
|
+
title: '{{t("Add new")}}',
|
|
110
112
|
'x-component': 'Action',
|
|
111
113
|
'x-component-props': {
|
|
112
114
|
type: 'primary',
|
|
@@ -116,7 +118,7 @@ export const workflowSchema: ISchema = {
|
|
|
116
118
|
type: 'void',
|
|
117
119
|
'x-component': 'Action.Drawer',
|
|
118
120
|
'x-decorator': 'Form',
|
|
119
|
-
title: '
|
|
121
|
+
title: '{{t("Add new")}}',
|
|
120
122
|
properties: {
|
|
121
123
|
title: {
|
|
122
124
|
'x-component': 'CollectionField',
|
|
@@ -219,25 +221,24 @@ export const workflowSchema: ISchema = {
|
|
|
219
221
|
properties: {
|
|
220
222
|
config: {
|
|
221
223
|
type: 'void',
|
|
222
|
-
title: '配置流程',
|
|
223
224
|
'x-component': 'WorkflowLink'
|
|
224
225
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
226
|
+
executions: {
|
|
227
|
+
type: 'void',
|
|
228
|
+
title: '{{t("Executions")}}',
|
|
229
|
+
'x-component': 'Action.Link',
|
|
230
|
+
'x-component-props': {
|
|
231
|
+
type: 'primary',
|
|
232
|
+
},
|
|
233
|
+
properties: {
|
|
234
|
+
drawer: {
|
|
235
|
+
type: 'void',
|
|
236
|
+
title: '{{t("Executions")}}',
|
|
237
|
+
'x-component': 'Action.Drawer',
|
|
238
|
+
properties: executionSchema
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
241
242
|
update: {
|
|
242
243
|
type: 'void',
|
|
243
244
|
title: '{{ t("Edit") }}',
|
|
@@ -253,7 +254,7 @@ export const workflowSchema: ISchema = {
|
|
|
253
254
|
'x-decorator-props': {
|
|
254
255
|
useValues: '{{ cm.useValuesFromRecord }}',
|
|
255
256
|
},
|
|
256
|
-
title: '
|
|
257
|
+
title: '{{ t("Edit") }}',
|
|
257
258
|
properties: {
|
|
258
259
|
title: {
|
|
259
260
|
'x-component': 'CollectionField',
|