@nocobase/plugin-workflow 0.9.4-alpha.2 → 0.10.0-alpha.3
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/AddButton.d.ts +2 -2
- package/lib/client/AddButton.js +76 -65
- package/lib/client/Branch.d.ts +2 -2
- package/lib/client/CanvasContent.d.ts +2 -2
- package/lib/client/ExecutionCanvas.d.ts +2 -2
- package/lib/client/ExecutionCanvas.js +1 -1
- package/lib/client/ExecutionLink.d.ts +2 -1
- package/lib/client/ExecutionPage.d.ts +2 -1
- package/lib/client/ExecutionPage.js +14 -15
- package/lib/client/ExecutionResourceProvider.d.ts +2 -1
- package/lib/client/WorkflowCanvas.d.ts +2 -2
- package/lib/client/WorkflowCanvas.js +31 -31
- package/lib/client/WorkflowLink.d.ts +2 -1
- package/lib/client/WorkflowPage.d.ts +2 -1
- package/lib/client/WorkflowPage.js +11 -10
- package/lib/client/WorkflowProvider.d.ts +1 -1
- package/lib/client/WorkflowProvider.js +15 -15
- package/lib/client/components/CollectionBlockInitializer.d.ts +2 -7
- package/lib/client/components/CollectionBlockInitializer.js +49 -17
- package/lib/client/components/CollectionFieldset.d.ts +3 -2
- package/lib/client/components/CollectionFieldset.js +87 -74
- package/lib/client/components/Duration.d.ts +2 -2
- package/lib/client/components/DynamicExpression.d.ts +3 -1
- package/lib/client/components/DynamicExpression.js +2 -0
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +2 -0
- package/lib/client/components/FilterDynamicComponent.d.ts +2 -2
- package/lib/client/components/NodeDescription.d.ts +2 -2
- package/lib/client/components/OpenDrawer.d.ts +2 -2
- package/lib/client/components/OpenDrawer.js +1 -1
- package/lib/client/components/RadioWithTooltip.d.ts +2 -2
- package/lib/client/components/renderEngineReference.d.ts +2 -1
- package/lib/client/constants.d.ts +2 -1
- package/lib/client/locale/zh-CN.d.ts +8 -0
- package/lib/client/locale/zh-CN.js +8 -0
- package/lib/client/nodes/aggregate.d.ts +1 -1
- package/lib/client/nodes/calculation.d.ts +4 -3
- package/lib/client/nodes/condition.d.ts +6 -4
- package/lib/client/nodes/condition.js +3 -1
- package/lib/client/nodes/create.d.ts +3 -6
- package/lib/client/nodes/create.js +1 -4
- package/lib/client/nodes/index.d.ts +5 -5
- package/lib/client/nodes/index.js +9 -6
- package/lib/client/nodes/loop.d.ts +4 -1
- package/lib/client/nodes/loop.js +3 -1
- package/lib/client/nodes/manual/AssigneesSelect.d.ts +2 -2
- package/lib/client/nodes/manual/DetailsBlockProvider.d.ts +2 -0
- package/lib/client/nodes/manual/DetailsBlockProvider.js +106 -0
- package/lib/client/nodes/manual/FormBlockInitializer.d.ts +2 -0
- package/lib/client/nodes/manual/FormBlockInitializer.js +106 -0
- package/lib/client/nodes/manual/FormBlockProvider.d.ts +2 -0
- package/lib/client/nodes/manual/FormBlockProvider.js +113 -0
- package/lib/client/nodes/manual/ModeConfig.d.ts +2 -2
- package/lib/client/nodes/manual/SchemaConfig.d.ts +43 -3
- package/lib/client/nodes/manual/SchemaConfig.js +42 -79
- package/lib/client/nodes/manual/WorkflowTodo.d.ts +5 -8
- package/lib/client/nodes/manual/WorkflowTodo.js +111 -76
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -2
- package/lib/client/nodes/manual/forms/create.d.ts +3 -0
- package/lib/client/nodes/manual/forms/create.js +104 -0
- package/lib/client/nodes/manual/forms/custom.d.ts +3 -0
- package/lib/client/nodes/manual/forms/{customForm.js → custom.js} +63 -45
- package/lib/client/nodes/manual/forms/update.d.ts +3 -0
- package/lib/client/nodes/manual/forms/update.js +161 -0
- package/lib/client/nodes/manual/index.d.ts +2 -5
- package/lib/client/nodes/manual/index.js +17 -16
- package/lib/client/nodes/manual/utils.d.ts +2 -0
- package/lib/client/nodes/manual/utils.js +31 -0
- package/lib/client/nodes/parallel.d.ts +4 -1
- package/lib/client/nodes/parallel.js +3 -1
- package/lib/client/nodes/query.d.ts +2 -5
- package/lib/client/nodes/query.js +2 -5
- package/lib/client/nodes/request.d.ts +1 -1
- package/lib/client/nodes/request.js +1 -11
- package/lib/client/nodes/update.d.ts +24 -1
- package/lib/client/nodes/update.js +76 -3
- package/lib/client/schemas/collection.js +1 -1
- package/lib/client/schemas/executions.d.ts +2 -0
- package/lib/client/style.js +4 -0
- package/lib/client/triggers/collection.d.ts +2 -5
- package/lib/client/triggers/collection.js +5 -8
- package/lib/client/triggers/index.d.ts +1 -2
- package/lib/client/triggers/index.js +10 -8
- package/lib/client/triggers/schedule/DateFieldsSelect.js +14 -12
- package/lib/client/triggers/schedule/EndsByField.d.ts +2 -2
- package/lib/client/triggers/schedule/OnField.d.ts +2 -2
- package/lib/client/triggers/schedule/RepeatField.d.ts +2 -2
- package/lib/client/triggers/schedule/ScheduleConfig.d.ts +2 -1
- package/lib/client/triggers/schedule/index.d.ts +3 -6
- package/lib/client/triggers/schedule/index.js +1 -4
- package/lib/server/Plugin.js +6 -3
- package/lib/server/Processor.d.ts +2 -2
- package/lib/server/Processor.js +22 -26
- package/lib/server/instructions/delay.js +1 -1
- package/lib/server/instructions/loop.d.ts +1 -1
- package/lib/server/instructions/loop.js +1 -1
- package/lib/server/instructions/manual/actions.js +42 -47
- package/lib/server/instructions/manual/forms/create.d.ts +5 -0
- package/lib/server/instructions/manual/forms/create.js +46 -0
- package/lib/server/instructions/manual/forms/index.d.ts +6 -0
- package/lib/server/instructions/manual/forms/index.js +15 -0
- package/lib/server/instructions/manual/forms/update.d.ts +6 -0
- package/lib/server/instructions/manual/forms/update.js +47 -0
- package/lib/server/instructions/manual/index.d.ts +3 -0
- package/lib/server/instructions/manual/index.js +16 -3
- package/lib/server/instructions/parallel.js +2 -2
- package/lib/server/instructions/request.js +3 -3
- package/lib/server/instructions/update.js +2 -3
- package/lib/server/migrations/20230612021134-manual-collection-block.d.ts +4 -0
- package/lib/server/migrations/20230612021134-manual-collection-block.js +155 -0
- package/package.json +16 -13
- package/lib/client/WorkflowShortcut.d.ts +0 -1
- package/lib/client/WorkflowShortcut.js +0 -48
- package/lib/client/components/CollectionFieldInitializers.d.ts +0 -2
- package/lib/client/components/CollectionFieldInitializers.js +0 -70
- package/lib/client/nodes/manual/forms/customForm.d.ts +0 -40
|
@@ -165,7 +165,7 @@ declare const _default: {
|
|
|
165
165
|
view: {};
|
|
166
166
|
scope: {};
|
|
167
167
|
components: {
|
|
168
|
-
ArrayItems: import("react").FC<import("react").HTMLAttributes<HTMLDivElement>> & import("@formily/antd").ArrayBaseMixins & {
|
|
168
|
+
ArrayItems: import("react").FC<import("react").PropsWithChildren<import("react").HTMLAttributes<HTMLDivElement> & import("@formily/antd").IArrayBaseProps>> & import("@formily/antd").ArrayBaseMixins & {
|
|
169
169
|
Item?: import("react").FC<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
170
170
|
type?: "divide" | "card";
|
|
171
171
|
}>;
|
|
@@ -11,13 +11,6 @@ function _antd() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _css() {
|
|
15
|
-
const data = require("@emotion/css");
|
|
16
|
-
_css = function _css() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
14
|
var _locale = require("../locale");
|
|
22
15
|
var _variable = require("../variable");
|
|
23
16
|
var _default = {
|
|
@@ -171,10 +164,7 @@ var _default = {
|
|
|
171
164
|
minRows: 10
|
|
172
165
|
},
|
|
173
166
|
placeholder: `{{t("Input request data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
174
|
-
className:
|
|
175
|
-
font-size: 90%;
|
|
176
|
-
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
177
|
-
`)
|
|
167
|
+
className: 'full-width'
|
|
178
168
|
},
|
|
179
169
|
description: `{{t("Only support standard JSON data", { ns: "${_locale.NAMESPACE}" })}}`
|
|
180
170
|
},
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { useCollectionDataSource } from '@nocobase/client';
|
|
2
3
|
import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
|
|
4
|
+
declare function IndividualHooksRadioWithTooltip({ onChange, ...props }: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
onChange: any;
|
|
7
|
+
}): React.JSX.Element;
|
|
3
8
|
declare const _default: {
|
|
4
9
|
title: string;
|
|
5
10
|
type: string;
|
|
@@ -20,6 +25,20 @@ declare const _default: {
|
|
|
20
25
|
params: {
|
|
21
26
|
type: string;
|
|
22
27
|
properties: {
|
|
28
|
+
individualHooks: {
|
|
29
|
+
type: string;
|
|
30
|
+
title: string;
|
|
31
|
+
'x-decorator': string;
|
|
32
|
+
'x-component': string;
|
|
33
|
+
'x-component-props': {
|
|
34
|
+
options: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: boolean;
|
|
37
|
+
tooltip: string;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
23
42
|
filter: {
|
|
24
43
|
title: string;
|
|
25
44
|
"x-validator"(value: any): string;
|
|
@@ -35,6 +54,9 @@ declare const _default: {
|
|
|
35
54
|
};
|
|
36
55
|
};
|
|
37
56
|
values: {
|
|
57
|
+
'x-component-props': {
|
|
58
|
+
filter(this: any, field: any): any;
|
|
59
|
+
};
|
|
38
60
|
type: string;
|
|
39
61
|
title: string;
|
|
40
62
|
'x-decorator': string;
|
|
@@ -54,7 +76,8 @@ declare const _default: {
|
|
|
54
76
|
};
|
|
55
77
|
components: {
|
|
56
78
|
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
57
|
-
CollectionFieldset:
|
|
79
|
+
CollectionFieldset: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
80
|
+
IndividualHooksRadioWithTooltip: typeof IndividualHooksRadioWithTooltip;
|
|
58
81
|
};
|
|
59
82
|
};
|
|
60
83
|
export default _default;
|
|
@@ -4,6 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
function _react() {
|
|
8
|
+
const data = _interopRequireDefault(require("react"));
|
|
9
|
+
_react = function _react() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _react2() {
|
|
15
|
+
const data = require("@formily/react");
|
|
16
|
+
_react2 = function _react2() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
7
21
|
function _client() {
|
|
8
22
|
const data = require("@nocobase/client");
|
|
9
23
|
_client = function _client() {
|
|
@@ -12,16 +26,49 @@ function _client() {
|
|
|
12
26
|
return data;
|
|
13
27
|
}
|
|
14
28
|
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
15
|
-
var _CollectionFieldset =
|
|
29
|
+
var _CollectionFieldset = _interopRequireWildcard(require("../components/CollectionFieldset"));
|
|
16
30
|
var _utils = require("../utils");
|
|
17
31
|
var _locale = require("../locale");
|
|
18
32
|
var _collection = require("../schemas/collection");
|
|
33
|
+
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
34
|
+
const _excluded = ["onChange"];
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
38
|
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; }
|
|
21
39
|
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; }
|
|
22
40
|
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; }
|
|
23
41
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
24
42
|
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); }
|
|
43
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
44
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
+
function IndividualHooksRadioWithTooltip(_ref) {
|
|
46
|
+
let onChange = _ref.onChange,
|
|
47
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
+
const form = (0, _react2().useForm)();
|
|
49
|
+
const collection = form.values.collection;
|
|
50
|
+
const fields = (0, _CollectionFieldset.useCollectionUIFields)(collection);
|
|
51
|
+
const field = (0, _react2().useField)();
|
|
52
|
+
function onValueChange({
|
|
53
|
+
target
|
|
54
|
+
}) {
|
|
55
|
+
const valuesField = field.query('.values').take();
|
|
56
|
+
if (!valuesField) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const filteredValues = fields.reduce((result, item) => {
|
|
60
|
+
if (item.name in valuesField.value && (target.value || !['hasOne', 'hasMany', 'belongsToMany'].includes(item.type))) {
|
|
61
|
+
result[item.name] = valuesField.value[item.name];
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}, {});
|
|
65
|
+
form.setValuesIn('params.values', filteredValues);
|
|
66
|
+
onChange(target.value);
|
|
67
|
+
}
|
|
68
|
+
return _react().default.createElement(_RadioWithTooltip.RadioWithTooltip, _objectSpread(_objectSpread({}, props), {}, {
|
|
69
|
+
onChange: onValueChange
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
25
72
|
var _default = {
|
|
26
73
|
title: `{{t("Update record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
27
74
|
type: 'update',
|
|
@@ -32,13 +79,38 @@ var _default = {
|
|
|
32
79
|
params: {
|
|
33
80
|
type: 'object',
|
|
34
81
|
properties: {
|
|
82
|
+
individualHooks: {
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
title: `{{t("Update mode", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
85
|
+
'x-decorator': 'FormItem',
|
|
86
|
+
'x-component': 'IndividualHooksRadioWithTooltip',
|
|
87
|
+
'x-component-props': {
|
|
88
|
+
options: [{
|
|
89
|
+
label: `{{t("Update in a batch", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
90
|
+
value: false,
|
|
91
|
+
tooltip: `{{t("Update all eligible data at one time, which has better performance when the amount of data is large. But the updated data will not trigger other workflows, and will not record audit logs.", { ns: "${_locale.NAMESPACE}" })}}`
|
|
92
|
+
}, {
|
|
93
|
+
label: `{{t("Update one by one", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
94
|
+
value: true,
|
|
95
|
+
tooltip: `{{t("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.", { ns: "${_locale.NAMESPACE}" })}}`
|
|
96
|
+
}]
|
|
97
|
+
},
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
35
100
|
filter: _objectSpread(_objectSpread({}, _collection.filter), {}, {
|
|
36
101
|
title: `{{t("Only update records matching conditions", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
37
102
|
['x-validator'](value) {
|
|
38
103
|
return (0, _utils.isValidFilter)(value) ? '' : `{{t("Please add at least one condition", { ns: "${_locale.NAMESPACE}" })}}`;
|
|
39
104
|
}
|
|
40
105
|
}),
|
|
41
|
-
values: _collection.values
|
|
106
|
+
values: _objectSpread(_objectSpread({}, _collection.values), {}, {
|
|
107
|
+
'x-component-props': {
|
|
108
|
+
filter(field) {
|
|
109
|
+
var _this$params;
|
|
110
|
+
return ((_this$params = this.params) === null || _this$params === void 0 ? void 0 : _this$params.individualHooks) || !['hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
})
|
|
42
114
|
}
|
|
43
115
|
}
|
|
44
116
|
},
|
|
@@ -48,7 +120,8 @@ var _default = {
|
|
|
48
120
|
},
|
|
49
121
|
components: {
|
|
50
122
|
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent,
|
|
51
|
-
CollectionFieldset: _CollectionFieldset.default
|
|
123
|
+
CollectionFieldset: _CollectionFieldset.default,
|
|
124
|
+
IndividualHooksRadioWithTooltip
|
|
52
125
|
}
|
|
53
126
|
};
|
|
54
127
|
exports.default = _default;
|
|
@@ -82,7 +82,7 @@ const appends = {
|
|
|
82
82
|
'x-component': 'FieldsSelect',
|
|
83
83
|
'x-component-props': {
|
|
84
84
|
mode: 'multiple',
|
|
85
|
-
placeholder: '{{t("Select
|
|
85
|
+
placeholder: '{{t("Select field")}}',
|
|
86
86
|
filter(field) {
|
|
87
87
|
return ['linkTo', 'belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
|
|
88
88
|
}
|
|
@@ -59,6 +59,7 @@ export declare const executionCollection: {
|
|
|
59
59
|
"x-editable"?: boolean;
|
|
60
60
|
"x-read-only"?: boolean;
|
|
61
61
|
"x-read-pretty"?: boolean;
|
|
62
|
+
"x-compile-omitted"?: string[];
|
|
62
63
|
}>;
|
|
63
64
|
}[];
|
|
64
65
|
};
|
|
@@ -133,6 +134,7 @@ export declare const executionSchema: {
|
|
|
133
134
|
"x-editable"?: boolean;
|
|
134
135
|
"x-read-only"?: boolean;
|
|
135
136
|
"x-read-pretty"?: boolean;
|
|
137
|
+
"x-compile-omitted"?: string[];
|
|
136
138
|
}>;
|
|
137
139
|
}[];
|
|
138
140
|
};
|
package/lib/client/style.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
|
|
2
|
-
import { CollectionFieldInitializers } from '../components/CollectionFieldInitializers';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
type: string;
|
|
@@ -104,12 +103,10 @@ declare const _default: {
|
|
|
104
103
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
105
104
|
};
|
|
106
105
|
components: {
|
|
107
|
-
FieldsSelect: import("react").MemoExoticComponent<import("react").
|
|
106
|
+
FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
108
107
|
};
|
|
109
108
|
useVariables(config: any, options: any): import("../variable").VariableOption[];
|
|
110
109
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
111
|
-
initializers: {
|
|
112
|
-
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
113
|
-
};
|
|
110
|
+
initializers: {};
|
|
114
111
|
};
|
|
115
112
|
export default _default;
|
|
@@ -11,12 +11,11 @@ function _client() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
var _collection = require("../schemas/collection");
|
|
15
|
-
var _variable = require("../variable");
|
|
16
14
|
var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
|
|
17
|
-
var _CollectionFieldInitializers = require("../components/CollectionFieldInitializers");
|
|
18
|
-
var _locale = require("../locale");
|
|
19
15
|
var _FieldsSelect = require("../components/FieldsSelect");
|
|
16
|
+
var _locale = require("../locale");
|
|
17
|
+
var _collection = require("../schemas/collection");
|
|
18
|
+
var _variable = require("../variable");
|
|
20
19
|
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; }
|
|
21
20
|
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; }
|
|
22
21
|
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; }
|
|
@@ -92,7 +91,7 @@ var _default = {
|
|
|
92
91
|
'x-component': 'FieldsSelect',
|
|
93
92
|
'x-component-props': {
|
|
94
93
|
mode: 'multiple',
|
|
95
|
-
placeholder: '{{t("Select
|
|
94
|
+
placeholder: '{{t("Select field")}}',
|
|
96
95
|
filter(field) {
|
|
97
96
|
return !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true) && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
|
|
98
97
|
}
|
|
@@ -166,8 +165,6 @@ var _default = {
|
|
|
166
165
|
dataSource: '{{$context.data}}'
|
|
167
166
|
};
|
|
168
167
|
},
|
|
169
|
-
initializers: {
|
|
170
|
-
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
171
|
-
}
|
|
168
|
+
initializers: {}
|
|
172
169
|
};
|
|
173
170
|
exports.default = _default;
|
|
@@ -17,10 +17,9 @@ export interface Trigger {
|
|
|
17
17
|
components?: {
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
};
|
|
20
|
-
render?(props: any): React.ReactNode;
|
|
21
20
|
useInitializers?(config: any): SchemaInitializerItemOptions | null;
|
|
22
21
|
initializers?: any;
|
|
23
22
|
}
|
|
24
23
|
export declare const triggers: Registry<Trigger>;
|
|
25
|
-
export declare const TriggerConfig: () => JSX.Element;
|
|
24
|
+
export declare const TriggerConfig: () => React.JSX.Element;
|
|
26
25
|
export declare function useTrigger(): Trigger;
|
|
@@ -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:
|
|
129
|
+
className: _style.nodeJobButtonClass,
|
|
130
130
|
type: 'primary'
|
|
131
131
|
},
|
|
132
132
|
properties: {
|
|
@@ -186,6 +186,7 @@ const TriggerConfig = () => {
|
|
|
186
186
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
187
187
|
editingConfig = _useState4[0],
|
|
188
188
|
setEditingConfig = _useState4[1];
|
|
189
|
+
let typeTitle = '';
|
|
189
190
|
(0, _react().useEffect)(() => {
|
|
190
191
|
if (workflow) {
|
|
191
192
|
var _workflow$title;
|
|
@@ -199,11 +200,11 @@ const TriggerConfig = () => {
|
|
|
199
200
|
type = workflow.type,
|
|
200
201
|
config = workflow.config,
|
|
201
202
|
executed = workflow.executed;
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
const trigger = triggers.get(type);
|
|
204
|
+
const fieldset = trigger.fieldset,
|
|
205
|
+
scope = trigger.scope,
|
|
206
|
+
components = trigger.components;
|
|
207
|
+
typeTitle = trigger.title;
|
|
207
208
|
const detailText = executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
|
208
209
|
const titleText = `${(0, _locale.lang)('Trigger')}: ${compile(typeTitle)}`;
|
|
209
210
|
function onChangeTitle(_x2) {
|
|
@@ -234,7 +235,8 @@ const TriggerConfig = () => {
|
|
|
234
235
|
}
|
|
235
236
|
const whiteSet = new Set(['workflow-node-meta', 'workflow-node-config-button', 'ant-input-disabled']);
|
|
236
237
|
for (let el = ev.target; el && el !== ev.currentTarget; el = el.parentNode) {
|
|
237
|
-
|
|
238
|
+
var _el$classList;
|
|
239
|
+
if (Array.from((_el$classList = el.classList) !== null && _el$classList !== void 0 ? _el$classList : []).some(name => whiteSet.has(name))) {
|
|
238
240
|
setEditingConfig(true);
|
|
239
241
|
ev.stopPropagation();
|
|
240
242
|
return;
|
|
@@ -253,7 +255,7 @@ const TriggerConfig = () => {
|
|
|
253
255
|
onChange: ev => setEditingTitle(ev.target.value),
|
|
254
256
|
onBlur: ev => onChangeTitle(ev.target.value),
|
|
255
257
|
autoSize: true
|
|
256
|
-
})), _react().default.createElement(TriggerExecution, null), _react().default.createElement(_client2().
|
|
258
|
+
})), _react().default.createElement(TriggerExecution, null), _react().default.createElement(_client2().ActionContextProvider, {
|
|
257
259
|
value: {
|
|
258
260
|
visible: editingConfig,
|
|
259
261
|
setVisible: setEditingConfig
|
|
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DateFieldsSelect = void 0;
|
|
7
7
|
function _react() {
|
|
8
|
-
const data =
|
|
8
|
+
const data = require("@formily/react");
|
|
9
9
|
_react = function _react() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _antd() {
|
|
15
|
+
const data = require("antd");
|
|
16
|
+
_antd = function _antd() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("
|
|
23
|
-
|
|
21
|
+
function _react2() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react2 = function _react2() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
@@ -45,23 +45,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
45
45
|
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; }
|
|
46
46
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
47
47
|
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); }
|
|
48
|
-
const DateFieldsSelect = (0,
|
|
48
|
+
const DateFieldsSelect = (0, _react().observer)(props => {
|
|
49
49
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
50
50
|
t = _useTranslation.t;
|
|
51
51
|
const compile = (0, _client().useCompile)();
|
|
52
52
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
53
53
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
54
|
-
const _useForm = (0,
|
|
54
|
+
const _useForm = (0, _react().useForm)(),
|
|
55
55
|
values = _useForm.values;
|
|
56
56
|
const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
|
|
57
|
-
return
|
|
58
|
-
placeholder: t('Select
|
|
57
|
+
return _react2().default.createElement(_antd().Select, _objectSpread({
|
|
58
|
+
placeholder: t('Select field')
|
|
59
59
|
}, props), fields.filter(field => !field.hidden && (field.uiSchema ? field.type === 'date' : false)).map(field => {
|
|
60
60
|
var _field$uiSchema;
|
|
61
|
-
return
|
|
61
|
+
return _react2().default.createElement(_antd().Select.Option, {
|
|
62
62
|
key: field.name,
|
|
63
63
|
value: field.name
|
|
64
64
|
}, compile((_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title));
|
|
65
65
|
}));
|
|
66
|
+
}, {
|
|
67
|
+
displayName: 'DateFieldsSelect'
|
|
66
68
|
});
|
|
67
69
|
exports.DateFieldsSelect = DateFieldsSelect;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ScheduleConfig: () => React.JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCollectionDataSource, SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
|
-
import { CollectionFieldInitializers } from '../../components/CollectionFieldInitializers';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
type: string;
|
|
@@ -34,15 +33,13 @@ declare const _default: {
|
|
|
34
33
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
35
34
|
};
|
|
36
35
|
components: {
|
|
37
|
-
ScheduleConfig: () => JSX.Element;
|
|
38
|
-
FieldsSelect: import("react").MemoExoticComponent<import("react").
|
|
36
|
+
ScheduleConfig: () => import("react").JSX.Element;
|
|
37
|
+
FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
39
38
|
};
|
|
40
39
|
useVariables(config: any, { types }: {
|
|
41
40
|
types: any;
|
|
42
41
|
}): any[];
|
|
43
42
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
44
|
-
initializers: {
|
|
45
|
-
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
46
|
-
};
|
|
43
|
+
initializers: {};
|
|
47
44
|
};
|
|
48
45
|
export default _default;
|
|
@@ -14,7 +14,6 @@ function _client() {
|
|
|
14
14
|
var _ScheduleConfig = require("./ScheduleConfig");
|
|
15
15
|
var _constants = require("./constants");
|
|
16
16
|
var _locale = require("../../locale");
|
|
17
|
-
var _CollectionFieldInitializers = require("../../components/CollectionFieldInitializers");
|
|
18
17
|
var _CollectionBlockInitializer = require("../../components/CollectionBlockInitializer");
|
|
19
18
|
var _variable = require("../../variable");
|
|
20
19
|
var _collection = require("../../schemas/collection");
|
|
@@ -91,8 +90,6 @@ var _default = {
|
|
|
91
90
|
dataSource: '{{$context.data}}'
|
|
92
91
|
};
|
|
93
92
|
},
|
|
94
|
-
initializers: {
|
|
95
|
-
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
96
|
-
}
|
|
93
|
+
initializers: {}
|
|
97
94
|
};
|
|
98
95
|
exports.default = _default;
|
package/lib/server/Plugin.js
CHANGED
|
@@ -265,9 +265,11 @@ class WorkflowPlugin extends _server().Plugin {
|
|
|
265
265
|
workflows.forEach(workflow => {
|
|
266
266
|
_this2.toggle(workflow);
|
|
267
267
|
});
|
|
268
|
+
}));
|
|
269
|
+
_this2.app.on('afterStart', () => {
|
|
268
270
|
// check for not started executions
|
|
269
271
|
_this2.dispatch();
|
|
270
|
-
})
|
|
272
|
+
});
|
|
271
273
|
_this2.app.on('beforeStop', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
272
274
|
const collection = db.getCollection('workflows');
|
|
273
275
|
const workflows = yield collection.repository.find({
|
|
@@ -301,8 +303,9 @@ class WorkflowPlugin extends _server().Plugin {
|
|
|
301
303
|
return;
|
|
302
304
|
}
|
|
303
305
|
this.events.push([workflow, context, options]);
|
|
304
|
-
this.getLogger(workflow.id).
|
|
305
|
-
|
|
306
|
+
this.getLogger(workflow.id).info(`new event triggered, now events: ${this.events.length}`);
|
|
307
|
+
this.getLogger(workflow.id).debug(`event data:`, {
|
|
308
|
+
data: context
|
|
306
309
|
});
|
|
307
310
|
if (this.events.length > 1) {
|
|
308
311
|
return;
|
|
@@ -31,9 +31,9 @@ export default class Processor {
|
|
|
31
31
|
private commit;
|
|
32
32
|
private exec;
|
|
33
33
|
run(node: any, input?: any): any;
|
|
34
|
-
end(node: any, job:
|
|
34
|
+
end(node: any, job: JobModel): Promise<any>;
|
|
35
35
|
recall(node: any, job: any): Promise<any>;
|
|
36
|
-
exit(
|
|
36
|
+
exit(s?: number): Promise<any>;
|
|
37
37
|
saveJob(payload: any): Promise<any>;
|
|
38
38
|
getBranches(node: FlowNodeModel): FlowNodeModel[];
|
|
39
39
|
findBranchStartNode(node: FlowNodeModel, parent?: FlowNodeModel): FlowNodeModel | null;
|