@nocobase/plugin-workflow 0.9.2-alpha.4 → 0.9.4-alpha.1
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/lib/client/CanvasContent.d.ts +4 -0
- package/lib/client/CanvasContent.js +49 -0
- package/lib/client/ExecutionCanvas.js +110 -44
- package/lib/client/WorkflowCanvas.js +35 -18
- package/lib/client/components/CollectionFieldset.js +2 -2
- package/lib/client/components/FieldsSelect.js +2 -1
- package/lib/client/components/NodeDescription.d.ts +2 -0
- package/lib/client/components/NodeDescription.js +59 -0
- package/lib/client/components/ValueBlock.d.ts +5 -0
- package/lib/client/components/ValueBlock.js +110 -0
- package/lib/client/index.d.ts +1 -0
- package/lib/client/index.js +12 -0
- package/lib/client/locale/es-ES.d.ts +130 -0
- package/lib/client/locale/es-ES.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +35 -6
- package/lib/client/locale/zh-CN.js +35 -6
- package/lib/client/nodes/aggregate.d.ts +186 -0
- package/lib/client/nodes/aggregate.js +349 -0
- package/lib/client/nodes/calculation.d.ts +2 -1
- package/lib/client/nodes/calculation.js +35 -60
- package/lib/client/nodes/condition.d.ts +2 -6
- package/lib/client/nodes/condition.js +4 -3
- package/lib/client/nodes/create.d.ts +6 -3
- package/lib/client/nodes/create.js +16 -7
- package/lib/client/nodes/delay.d.ts +1 -0
- package/lib/client/nodes/delay.js +1 -0
- package/lib/client/nodes/destroy.d.ts +3 -2
- package/lib/client/nodes/destroy.js +1 -0
- package/lib/client/nodes/index.d.ts +5 -2
- package/lib/client/nodes/index.js +96 -105
- package/lib/client/nodes/loop.d.ts +29 -0
- package/lib/client/nodes/loop.js +165 -0
- package/lib/client/nodes/manual/AssigneesSelect.js +8 -6
- package/lib/client/nodes/manual/WorkflowTodo.js +1 -8
- package/lib/client/nodes/manual/index.d.ts +6 -1
- package/lib/client/nodes/manual/index.js +6 -1
- package/lib/client/nodes/parallel.d.ts +1 -0
- package/lib/client/nodes/parallel.js +2 -1
- package/lib/client/nodes/query.d.ts +13 -3
- package/lib/client/nodes/query.js +24 -17
- package/lib/client/nodes/request.d.ts +1 -0
- package/lib/client/nodes/request.js +1 -0
- package/lib/client/nodes/update.d.ts +3 -2
- package/lib/client/nodes/update.js +1 -0
- package/lib/client/schemas/collection.d.ts +2 -2
- package/lib/client/schemas/collection.js +5 -5
- package/lib/client/style.d.ts +1 -0
- package/lib/client/style.js +40 -26
- package/lib/client/triggers/collection.d.ts +4 -11
- package/lib/client/triggers/collection.js +7 -7
- package/lib/client/triggers/index.d.ts +1 -1
- package/lib/client/triggers/index.js +5 -3
- package/lib/client/triggers/schedule/index.d.ts +3 -1
- package/lib/client/triggers/schedule/index.js +6 -4
- package/lib/client/variable.d.ts +27 -1
- package/lib/client/variable.js +66 -35
- package/lib/server/Plugin.d.ts +5 -2
- package/lib/server/Plugin.js +2 -14
- package/lib/server/Processor.d.ts +3 -0
- package/lib/server/Processor.js +34 -8
- package/lib/server/actions/workflows.js +2 -2
- package/lib/server/collections/workflows.js +2 -1
- package/lib/server/functions/index.d.ts +7 -1
- package/lib/server/instructions/aggregate.d.ts +9 -0
- package/lib/server/instructions/aggregate.js +57 -0
- package/lib/server/instructions/calculation.js +6 -7
- package/lib/server/instructions/condition.js +1 -1
- package/lib/server/instructions/create.js +1 -1
- package/lib/server/instructions/destroy.js +1 -1
- package/lib/server/instructions/index.d.ts +1 -0
- package/lib/server/instructions/index.js +1 -1
- package/lib/server/instructions/loop.d.ts +16 -0
- package/lib/server/instructions/loop.js +107 -0
- package/lib/server/instructions/parallel.js +17 -10
- package/lib/server/instructions/query.js +1 -4
- package/lib/server/instructions/request.js +1 -1
- package/lib/server/instructions/update.js +1 -1
- package/package.json +13 -14
|
@@ -5,18 +5,26 @@ declare const _default: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
type: string;
|
|
7
7
|
group: string;
|
|
8
|
+
description: string;
|
|
8
9
|
fieldset: {
|
|
9
10
|
collection: {
|
|
10
11
|
type: string;
|
|
11
12
|
title: string;
|
|
12
13
|
required: boolean;
|
|
13
|
-
'x-reactions':
|
|
14
|
+
'x-reactions': any[];
|
|
14
15
|
'x-decorator': string;
|
|
15
16
|
'x-component': string;
|
|
16
17
|
'x-component-props': {
|
|
17
|
-
|
|
18
|
+
dropdownMatchSelectWidth: boolean;
|
|
18
19
|
};
|
|
19
20
|
};
|
|
21
|
+
multiple: {
|
|
22
|
+
type: string;
|
|
23
|
+
title: string;
|
|
24
|
+
'x-decorator': string;
|
|
25
|
+
'x-component': string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
20
28
|
params: {
|
|
21
29
|
type: string;
|
|
22
30
|
properties: {
|
|
@@ -70,7 +78,9 @@ declare const _default: {
|
|
|
70
78
|
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
71
79
|
FieldsSelect: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
72
80
|
};
|
|
73
|
-
|
|
81
|
+
useVariables({ config }: {
|
|
82
|
+
config: any;
|
|
83
|
+
}, options: any): import("../variable").VariableOption[];
|
|
74
84
|
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
75
85
|
initializers: {
|
|
76
86
|
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
@@ -18,21 +18,25 @@ var _CollectionFieldInitializers = require("../components/CollectionFieldInitial
|
|
|
18
18
|
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
19
19
|
var _variable = require("../variable");
|
|
20
20
|
var _FieldsSelect = require("../components/FieldsSelect");
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
25
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
26
|
var _default = {
|
|
22
27
|
title: `{{t("Query record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
23
28
|
type: 'query',
|
|
24
29
|
group: 'collection',
|
|
30
|
+
description: `{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
25
31
|
fieldset: {
|
|
26
32
|
collection: _collection.collection,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// }
|
|
35
|
-
// },
|
|
33
|
+
multiple: {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
title: `{{t("Allow multiple records as result", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
36
|
+
'x-decorator': 'FormItem',
|
|
37
|
+
'x-component': 'Checkbox',
|
|
38
|
+
description: `{{t("If checked, when there are multiple records in the query result, an array will be returned as the result, which can be operated on one by one using a loop node. Otherwise, only one record will be returned.", { ns: "${_locale.NAMESPACE}" })}}`
|
|
39
|
+
},
|
|
36
40
|
params: {
|
|
37
41
|
type: 'object',
|
|
38
42
|
properties: {
|
|
@@ -42,7 +46,7 @@ var _default = {
|
|
|
42
46
|
},
|
|
43
47
|
failOnEmpty: {
|
|
44
48
|
type: 'boolean',
|
|
45
|
-
title: `{{t("
|
|
49
|
+
title: `{{t("Exit when query result is null", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
46
50
|
'x-decorator': 'FormItem',
|
|
47
51
|
'x-component': 'Checkbox'
|
|
48
52
|
}
|
|
@@ -55,13 +59,16 @@ var _default = {
|
|
|
55
59
|
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent,
|
|
56
60
|
FieldsSelect: _FieldsSelect.FieldsSelect
|
|
57
61
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
62
|
+
useVariables({
|
|
63
|
+
config
|
|
64
|
+
}, options) {
|
|
65
|
+
var _options$depth, _config$params, _config$params$append;
|
|
66
|
+
const result = (0, _variable.useCollectionFieldOptions)(_objectSpread(_objectSpread({
|
|
67
|
+
collection: config === null || config === void 0 ? void 0 : config.collection
|
|
68
|
+
}, options), {}, {
|
|
69
|
+
depth: ((_options$depth = options === null || options === void 0 ? void 0 : options.depth) !== null && _options$depth !== void 0 ? _options$depth : config === null || config === void 0 ? void 0 : (_config$params = config.params) === null || _config$params === void 0 ? void 0 : (_config$params$append = _config$params.appends) === null || _config$params$append === void 0 ? void 0 : _config$params$append.length) ? 1 : 0
|
|
70
|
+
}));
|
|
71
|
+
return (result === null || result === void 0 ? void 0 : result.length) ? result : null;
|
|
65
72
|
},
|
|
66
73
|
useInitializers(node) {
|
|
67
74
|
var _node$title;
|
|
@@ -24,6 +24,7 @@ var _default = {
|
|
|
24
24
|
title: `{{t("HTTP request", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
25
25
|
type: 'request',
|
|
26
26
|
group: 'extended',
|
|
27
|
+
description: `{{t("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
27
28
|
fieldset: {
|
|
28
29
|
method: {
|
|
29
30
|
type: 'string',
|
|
@@ -4,16 +4,17 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
type: string;
|
|
6
6
|
group: string;
|
|
7
|
+
description: string;
|
|
7
8
|
fieldset: {
|
|
8
9
|
collection: {
|
|
9
10
|
type: string;
|
|
10
11
|
title: string;
|
|
11
12
|
required: boolean;
|
|
12
|
-
'x-reactions':
|
|
13
|
+
'x-reactions': any[];
|
|
13
14
|
'x-decorator': string;
|
|
14
15
|
'x-component': string;
|
|
15
16
|
'x-component-props': {
|
|
16
|
-
|
|
17
|
+
dropdownMatchSelectWidth: boolean;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
params: {
|
|
@@ -26,6 +26,7 @@ var _default = {
|
|
|
26
26
|
title: `{{t("Update record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
27
27
|
type: 'update',
|
|
28
28
|
group: 'collection',
|
|
29
|
+
description: `{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
29
30
|
fieldset: {
|
|
30
31
|
collection: _collection.collection,
|
|
31
32
|
params: {
|
|
@@ -2,11 +2,11 @@ export declare const collection: {
|
|
|
2
2
|
type: string;
|
|
3
3
|
title: string;
|
|
4
4
|
required: boolean;
|
|
5
|
-
'x-reactions':
|
|
5
|
+
'x-reactions': any[];
|
|
6
6
|
'x-decorator': string;
|
|
7
7
|
'x-component': string;
|
|
8
8
|
'x-component-props': {
|
|
9
|
-
|
|
9
|
+
dropdownMatchSelectWidth: boolean;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export declare const values: {
|
|
@@ -30,11 +30,11 @@ const collection = {
|
|
|
30
30
|
type: 'string',
|
|
31
31
|
title: '{{t("Collection")}}',
|
|
32
32
|
required: true,
|
|
33
|
-
'x-reactions': [
|
|
33
|
+
'x-reactions': [],
|
|
34
34
|
'x-decorator': 'FormItem',
|
|
35
|
-
'x-component': '
|
|
35
|
+
'x-component': 'CollectionSelect',
|
|
36
36
|
'x-component-props': {
|
|
37
|
-
|
|
37
|
+
dropdownMatchSelectWidth: false
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
exports.collection = collection;
|
|
@@ -49,7 +49,7 @@ const values = {
|
|
|
49
49
|
`
|
|
50
50
|
},
|
|
51
51
|
'x-component': 'CollectionFieldset',
|
|
52
|
-
description: `{{t("
|
|
52
|
+
description: `{{t("Unassigned fields will be set to default values, and those without default values will be set to null.", { ns: "${_locale.NAMESPACE}" })}}`
|
|
53
53
|
};
|
|
54
54
|
exports.values = values;
|
|
55
55
|
const filter = {
|
|
@@ -77,7 +77,7 @@ exports.filter = filter;
|
|
|
77
77
|
const appends = {
|
|
78
78
|
type: 'array',
|
|
79
79
|
title: `{{t("Preload associations", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
80
|
-
description: `{{t("
|
|
80
|
+
description: `{{t("Please select the associated fields that need to be accessed in subsequent nodes", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
81
81
|
'x-decorator': 'FormItem',
|
|
82
82
|
'x-component': 'FieldsSelect',
|
|
83
83
|
'x-component-props': {
|
package/lib/client/style.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const branchClass: string;
|
|
|
5
5
|
export declare const nodeBlockClass: string;
|
|
6
6
|
export declare const nodeClass: string;
|
|
7
7
|
export declare const nodeCardClass: string;
|
|
8
|
+
export declare const nodeJobButtonClass: string;
|
|
8
9
|
export declare const nodeHeaderClass: string;
|
|
9
10
|
export declare const nodeMetaClass: string;
|
|
10
11
|
export declare const nodeTitleClass: string;
|
package/lib/client/style.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.workflowVersionDropdownClass = exports.workflowPageClass = exports.nodeTitleClass = exports.nodeSubtreeClass = exports.nodeMetaClass = exports.nodeHeaderClass = exports.nodeClass = exports.nodeCardClass = exports.nodeBlockClass = exports.branchClass = exports.branchBlockClass = exports.addButtonClass = void 0;
|
|
6
|
+
exports.workflowVersionDropdownClass = exports.workflowPageClass = exports.nodeTitleClass = exports.nodeSubtreeClass = exports.nodeMetaClass = exports.nodeJobButtonClass = exports.nodeHeaderClass = exports.nodeClass = exports.nodeCardClass = exports.nodeBlockClass = exports.branchClass = exports.branchBlockClass = exports.addButtonClass = void 0;
|
|
7
7
|
function _css() {
|
|
8
8
|
const data = require("@emotion/css");
|
|
9
9
|
_css = function _css() {
|
|
@@ -12,12 +12,19 @@ function _css() {
|
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
14
|
const workflowPageClass = (0, _css().css)`
|
|
15
|
+
flex-grow: 1;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
|
|
15
20
|
.workflow-toolbar {
|
|
16
21
|
display: flex;
|
|
17
22
|
align-items: center;
|
|
18
23
|
justify-content: space-between;
|
|
24
|
+
position: relative;
|
|
19
25
|
padding: 0.5rem 1rem;
|
|
20
26
|
background: #fff;
|
|
27
|
+
border-bottom: 1px solid #e7e7e7;
|
|
21
28
|
|
|
22
29
|
header {
|
|
23
30
|
display: flex;
|
|
@@ -39,8 +46,9 @@ const workflowPageClass = (0, _css().css)`
|
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
.workflow-canvas {
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
flex-grow: 1;
|
|
50
|
+
overflow: auto;
|
|
51
|
+
width: 100%;
|
|
44
52
|
display: flex;
|
|
45
53
|
flex-direction: column;
|
|
46
54
|
align-items: center;
|
|
@@ -106,11 +114,11 @@ const branchClass = (0, _css().css)`
|
|
|
106
114
|
flex-direction: column;
|
|
107
115
|
align-items: center;
|
|
108
116
|
position: relative;
|
|
117
|
+
min-width: 20em;
|
|
109
118
|
padding: 0 2em;
|
|
110
119
|
|
|
111
120
|
.workflow-node-list {
|
|
112
121
|
flex-grow: 1;
|
|
113
|
-
min-width: 20em;
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
.workflow-branch-lines {
|
|
@@ -192,12 +200,8 @@ const nodeCardClass = (0, _css().css)`
|
|
|
192
200
|
box-shadow: 0 0.25em 1em rgba(0, 100, 200, 0.25);
|
|
193
201
|
}
|
|
194
202
|
|
|
195
|
-
.workflow-node-remove-button,
|
|
196
|
-
.workflow-node-job-button {
|
|
197
|
-
position: absolute;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
203
|
.workflow-node-remove-button {
|
|
204
|
+
position: absolute;
|
|
201
205
|
right: 0.5em;
|
|
202
206
|
top: 0.5em;
|
|
203
207
|
color: #999;
|
|
@@ -213,23 +217,6 @@ const nodeCardClass = (0, _css().css)`
|
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
|
|
216
|
-
.workflow-node-job-button {
|
|
217
|
-
display: flex;
|
|
218
|
-
top: 1em;
|
|
219
|
-
right: 1em;
|
|
220
|
-
width: 1.25rem;
|
|
221
|
-
height: 1.25rem;
|
|
222
|
-
min-width: 1.25rem;
|
|
223
|
-
justify-content: center;
|
|
224
|
-
align-items: center;
|
|
225
|
-
font-size: 0.8em;
|
|
226
|
-
color: #fff;
|
|
227
|
-
|
|
228
|
-
&[type='button'] {
|
|
229
|
-
border: none;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
220
|
.ant-input {
|
|
234
221
|
font-weight: bold;
|
|
235
222
|
|
|
@@ -262,6 +249,33 @@ const nodeCardClass = (0, _css().css)`
|
|
|
262
249
|
}
|
|
263
250
|
`;
|
|
264
251
|
exports.nodeCardClass = nodeCardClass;
|
|
252
|
+
const nodeJobButtonClass = (0, _css().css)`
|
|
253
|
+
display: flex;
|
|
254
|
+
position: absolute;
|
|
255
|
+
top: 1.25em;
|
|
256
|
+
right: 1.25em;
|
|
257
|
+
width: 1.25rem;
|
|
258
|
+
height: 1.25rem;
|
|
259
|
+
min-width: 1.25rem;
|
|
260
|
+
justify-content: center;
|
|
261
|
+
align-items: center;
|
|
262
|
+
font-size: 0.8em;
|
|
263
|
+
color: #fff;
|
|
264
|
+
|
|
265
|
+
&[type='button'] {
|
|
266
|
+
border: none;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ant-tag {
|
|
270
|
+
padding: 0;
|
|
271
|
+
width: 100%;
|
|
272
|
+
line-height: 18px;
|
|
273
|
+
margin-right: 0;
|
|
274
|
+
border-radius: 50%;
|
|
275
|
+
text-align: center;
|
|
276
|
+
}
|
|
277
|
+
`;
|
|
278
|
+
exports.nodeJobButtonClass = nodeJobButtonClass;
|
|
265
279
|
const nodeHeaderClass = (0, _css().css)`
|
|
266
280
|
position: relative;
|
|
267
281
|
`;
|
|
@@ -5,22 +5,14 @@ declare const _default: {
|
|
|
5
5
|
type: string;
|
|
6
6
|
fieldset: {
|
|
7
7
|
collection: {
|
|
8
|
-
"x-reactions":
|
|
9
|
-
target: string;
|
|
10
|
-
effects: string[];
|
|
11
|
-
fulfill: {
|
|
12
|
-
state: {
|
|
13
|
-
value: any[];
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
})[];
|
|
8
|
+
"x-reactions": any[];
|
|
17
9
|
type: string;
|
|
18
10
|
title: string;
|
|
19
11
|
required: boolean;
|
|
20
12
|
'x-decorator': string;
|
|
21
13
|
'x-component': string;
|
|
22
14
|
'x-component-props': {
|
|
23
|
-
|
|
15
|
+
dropdownMatchSelectWidth: boolean;
|
|
24
16
|
};
|
|
25
17
|
};
|
|
26
18
|
mode: {
|
|
@@ -29,6 +21,7 @@ declare const _default: {
|
|
|
29
21
|
'x-decorator': string;
|
|
30
22
|
'x-component': string;
|
|
31
23
|
'x-component-props': {
|
|
24
|
+
dropdownMatchSelectWidth: boolean;
|
|
32
25
|
options: {
|
|
33
26
|
label: string;
|
|
34
27
|
value: number;
|
|
@@ -113,7 +106,7 @@ declare const _default: {
|
|
|
113
106
|
components: {
|
|
114
107
|
FieldsSelect: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
115
108
|
};
|
|
116
|
-
|
|
109
|
+
useVariables(config: any, options: any): import("../variable").VariableOption[];
|
|
117
110
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
118
111
|
initializers: {
|
|
119
112
|
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
@@ -70,6 +70,7 @@ var _default = {
|
|
|
70
70
|
'x-decorator': 'FormItem',
|
|
71
71
|
'x-component': 'Select',
|
|
72
72
|
'x-component-props': {
|
|
73
|
+
dropdownMatchSelectWidth: false,
|
|
73
74
|
options: collectionModeOptions,
|
|
74
75
|
placeholder: `{{t("Trigger on", { ns: "${_locale.NAMESPACE}" })}}`
|
|
75
76
|
},
|
|
@@ -133,8 +134,8 @@ var _default = {
|
|
|
133
134
|
components: {
|
|
134
135
|
FieldsSelect: _FieldsSelect.FieldsSelect
|
|
135
136
|
},
|
|
136
|
-
|
|
137
|
-
var _config$appends;
|
|
137
|
+
useVariables(config, options) {
|
|
138
|
+
var _options$depth, _config$appends;
|
|
138
139
|
const _useWorkflowTranslati = (0, _locale.useWorkflowTranslation)(),
|
|
139
140
|
t = _useWorkflowTranslati.t;
|
|
140
141
|
const rootFields = [{
|
|
@@ -146,12 +147,11 @@ var _default = {
|
|
|
146
147
|
title: t('Trigger data')
|
|
147
148
|
}
|
|
148
149
|
}];
|
|
149
|
-
const
|
|
150
|
+
const result = (0, _variable.useCollectionFieldOptions)(_objectSpread(_objectSpread({}, options), {}, {
|
|
150
151
|
fields: rootFields,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return options;
|
|
152
|
+
depth: (_options$depth = options === null || options === void 0 ? void 0 : options.depth) !== null && _options$depth !== void 0 ? _options$depth : ((_config$appends = config.appends) === null || _config$appends === void 0 ? void 0 : _config$appends.length) ? 2 : 1
|
|
153
|
+
}));
|
|
154
|
+
return result;
|
|
155
155
|
},
|
|
156
156
|
useInitializers(config) {
|
|
157
157
|
if (!config.collection) {
|
|
@@ -6,7 +6,7 @@ import { VariableOptions } from '../variable';
|
|
|
6
6
|
export interface Trigger {
|
|
7
7
|
title: string;
|
|
8
8
|
type: string;
|
|
9
|
-
|
|
9
|
+
useVariables?(config: any, options?: any): VariableOptions;
|
|
10
10
|
fieldset: {
|
|
11
11
|
[key: string]: ISchema;
|
|
12
12
|
};
|
|
@@ -126,7 +126,7 @@ function TriggerExecution() {
|
|
|
126
126
|
'x-component-props': {
|
|
127
127
|
title: _react().default.createElement(_icons().InfoOutlined, null),
|
|
128
128
|
shape: 'circle',
|
|
129
|
-
className: 'workflow-node-job-button',
|
|
129
|
+
className: (0, _css().cx)(_style.nodeJobButtonClass, 'workflow-node-job-button'),
|
|
130
130
|
type: 'primary'
|
|
131
131
|
},
|
|
132
132
|
properties: {
|
|
@@ -187,8 +187,10 @@ const TriggerConfig = () => {
|
|
|
187
187
|
editingConfig = _useState4[0],
|
|
188
188
|
setEditingConfig = _useState4[1];
|
|
189
189
|
(0, _react().useEffect)(() => {
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
if (workflow) {
|
|
191
|
+
var _workflow$title;
|
|
192
|
+
setEditingTitle((_workflow$title = workflow.title) !== null && _workflow$title !== void 0 ? _workflow$title : typeTitle);
|
|
193
|
+
}
|
|
192
194
|
}, [workflow]);
|
|
193
195
|
if (!workflow || !workflow.type) {
|
|
194
196
|
return null;
|
|
@@ -37,7 +37,9 @@ declare const _default: {
|
|
|
37
37
|
ScheduleConfig: () => JSX.Element;
|
|
38
38
|
FieldsSelect: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
useVariables(config: any, { types }: {
|
|
41
|
+
types: any;
|
|
42
|
+
}): any[];
|
|
41
43
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
42
44
|
initializers: {
|
|
43
45
|
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
@@ -51,7 +51,9 @@ var _default = {
|
|
|
51
51
|
ScheduleConfig: _ScheduleConfig.ScheduleConfig,
|
|
52
52
|
FieldsSelect: _FieldsSelect.FieldsSelect
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
useVariables(config, {
|
|
55
|
+
types
|
|
56
|
+
}) {
|
|
55
57
|
const _useWorkflowTranslati = (0, _locale.useWorkflowTranslation)(),
|
|
56
58
|
t = _useWorkflowTranslati.t;
|
|
57
59
|
const options = [];
|
|
@@ -62,10 +64,10 @@ var _default = {
|
|
|
62
64
|
label: t('Trigger time')
|
|
63
65
|
});
|
|
64
66
|
}
|
|
67
|
+
const fieldOptions = (0, _variable.useCollectionFieldOptions)({
|
|
68
|
+
collection: config.collection
|
|
69
|
+
});
|
|
65
70
|
if (config.mode === _constants.SCHEDULE_MODE.COLLECTION_FIELD) {
|
|
66
|
-
const fieldOptions = (0, _variable.useCollectionFieldOptions)({
|
|
67
|
-
collection: config.collection
|
|
68
|
-
});
|
|
69
71
|
if (fieldOptions.length) {
|
|
70
72
|
options.push({
|
|
71
73
|
key: 'data',
|
package/lib/client/variable.d.ts
CHANGED
|
@@ -5,6 +5,32 @@ export declare type VariableOption = {
|
|
|
5
5
|
children?: VariableOptions;
|
|
6
6
|
};
|
|
7
7
|
export declare type VariableOptions = VariableOption[] | null;
|
|
8
|
+
export declare const nodesOptions: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
useOptions(options: any): VariableOption[];
|
|
12
|
+
};
|
|
13
|
+
export declare const triggerOptions: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
useOptions(options: any): VariableOption[];
|
|
17
|
+
};
|
|
18
|
+
export declare const scopeOptions: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
useOptions(options: any): VariableOption[];
|
|
22
|
+
};
|
|
23
|
+
export declare const systemOptions: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
useOptions({ types }: {
|
|
27
|
+
types: any;
|
|
28
|
+
}): {
|
|
29
|
+
key: string;
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
8
34
|
export declare const BaseTypeSets: {
|
|
9
35
|
boolean: Set<string>;
|
|
10
36
|
number: Set<string>;
|
|
@@ -12,7 +38,7 @@ export declare const BaseTypeSets: {
|
|
|
12
38
|
date: Set<string>;
|
|
13
39
|
};
|
|
14
40
|
export declare function filterTypedFields(fields: any, types: any, depth?: number): any;
|
|
15
|
-
export declare function useWorkflowVariableOptions(
|
|
41
|
+
export declare function useWorkflowVariableOptions(options?: {}): {
|
|
16
42
|
label: any;
|
|
17
43
|
value: any;
|
|
18
44
|
key: any;
|