@nocobase/plugin-workflow 0.10.0-alpha.5 → 0.11.0-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/client.d.ts +2 -3
- package/client.js +1 -30
- package/lib/client/AddButton.js +1 -8
- package/lib/client/Branch.js +8 -8
- package/lib/client/CanvasContent.js +8 -8
- package/lib/client/ExecutionCanvas.js +20 -27
- package/lib/client/ExecutionPage.js +1 -8
- package/lib/client/WorkflowCanvas.js +3 -10
- package/lib/client/WorkflowPage.js +1 -8
- package/lib/client/WorkflowProvider.js +3 -42
- package/lib/client/components/CollectionFieldset.d.ts +1 -1
- package/lib/client/components/CollectionFieldset.js +8 -15
- package/lib/client/components/Duration.js +5 -5
- package/lib/client/components/DynamicExpression.d.ts +3 -3
- package/lib/client/components/DynamicExpression.js +14 -4
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +6 -6
- package/lib/client/components/NodeDescription.js +11 -11
- package/lib/client/components/RadioWithTooltip.js +13 -20
- package/lib/client/components/ValueBlock.js +14 -21
- package/lib/client/components/renderEngineReference.js +1 -8
- package/lib/client/index.d.ts +12 -4
- package/lib/client/index.js +78 -15
- package/lib/client/nodes/aggregate.d.ts +10 -4
- package/lib/client/nodes/aggregate.js +12 -9
- package/lib/client/nodes/calculation.d.ts +11 -16
- package/lib/client/nodes/calculation.js +72 -52
- package/lib/client/nodes/condition.d.ts +2 -6
- package/lib/client/nodes/condition.js +20 -24
- package/lib/client/nodes/create.d.ts +8 -5
- package/lib/client/nodes/create.js +34 -7
- package/lib/client/nodes/destroy.d.ts +1 -1
- package/lib/client/nodes/index.d.ts +4 -4
- package/lib/client/nodes/index.js +79 -86
- package/lib/client/nodes/loop.d.ts +3 -1
- package/lib/client/nodes/loop.js +48 -35
- package/lib/client/nodes/manual/ModeConfig.js +23 -30
- package/lib/client/nodes/manual/SchemaConfig.d.ts +3 -3
- package/lib/client/nodes/manual/SchemaConfig.js +18 -17
- package/lib/client/nodes/manual/WorkflowTodo.js +66 -72
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -5
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +6 -5
- package/lib/client/nodes/manual/forms/custom.js +11 -18
- package/lib/client/nodes/manual/index.d.ts +11 -5
- package/lib/client/nodes/manual/index.js +21 -10
- package/lib/client/nodes/parallel.js +20 -20
- package/lib/client/nodes/query.d.ts +7 -4
- package/lib/client/nodes/query.js +34 -7
- package/lib/client/nodes/request.d.ts +10 -6
- package/lib/client/nodes/request.js +37 -9
- package/lib/client/nodes/update.d.ts +2 -2
- package/lib/client/nodes/update.js +1 -1
- package/lib/client/schemas/collection.d.ts +1 -1
- package/lib/client/schemas/collection.js +3 -10
- package/lib/client/style.js +18 -18
- package/lib/client/triggers/collection.d.ts +4 -3
- package/lib/client/triggers/collection.js +21 -7
- package/lib/client/triggers/index.d.ts +2 -2
- package/lib/client/triggers/index.js +46 -52
- package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -1
- package/lib/client/triggers/schedule/EndsByField.js +11 -11
- package/lib/client/triggers/schedule/OnField.js +11 -11
- package/lib/client/triggers/schedule/RepeatField.js +4 -4
- package/lib/client/triggers/schedule/ScheduleConfig.js +17 -24
- package/lib/client/triggers/schedule/index.d.ts +3 -4
- package/lib/client/triggers/schedule/index.js +21 -11
- package/lib/client/variable.d.ts +3 -4
- package/lib/client/variable.js +110 -45
- package/lib/server/Plugin.d.ts +2 -3
- package/lib/server/Plugin.js +8 -9
- package/lib/server/Processor.d.ts +2 -4
- package/lib/server/actions/nodes.js +7 -7
- package/lib/server/fields/expression-field.d.ts +1 -2
- package/lib/server/fields/expression-field.js +1 -8
- package/lib/server/functions/index.d.ts +2 -3
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +12 -0
- package/lib/server/instructions/aggregate.d.ts +1 -1
- package/lib/server/instructions/aggregate.js +5 -5
- package/lib/server/instructions/condition.d.ts +2 -1
- package/lib/server/instructions/create.d.ts +1 -1
- package/lib/server/instructions/delay.d.ts +3 -3
- package/lib/server/instructions/delay.js +66 -64
- package/lib/server/instructions/destroy.d.ts +1 -1
- package/lib/server/instructions/index.d.ts +5 -5
- package/lib/server/instructions/loop.d.ts +1 -2
- package/lib/server/instructions/manual/actions.js +1 -1
- package/lib/server/instructions/manual/forms/index.d.ts +1 -1
- package/lib/server/instructions/manual/index.d.ts +1 -1
- package/lib/server/instructions/parallel.d.ts +1 -2
- package/lib/server/instructions/query.d.ts +1 -1
- package/lib/server/instructions/request.d.ts +2 -2
- package/lib/server/instructions/request.js +1 -0
- package/lib/server/instructions/update.d.ts +1 -1
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -1
- package/lib/server/migrations/20230221121203-condition-calculation.js +1 -1
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +7 -7
- package/lib/server/migrations/20230411034722-manual-multi-form.js +1 -8
- package/lib/server/triggers/collection.d.ts +1 -1
- package/lib/server/triggers/collection.js +2 -2
- package/lib/server/triggers/index.d.ts +1 -1
- package/lib/server/triggers/schedule.d.ts +1 -1
- package/lib/server/triggers/schedule.js +18 -18
- package/lib/server/{models → types}/Execution.d.ts +2 -3
- package/lib/server/{models → types}/FlowNode.d.ts +1 -2
- package/lib/server/{models → types}/Job.d.ts +1 -2
- package/lib/server/{models → types}/Workflow.d.ts +1 -2
- package/lib/server/types/index.d.ts +4 -0
- package/lib/server/types/index.js +5 -0
- package/package.json +40 -20
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/AddButton.tsx +99 -0
- package/src/client/Branch.tsx +35 -0
- package/src/client/CanvasContent.tsx +23 -0
- package/src/client/ExecutionCanvas.tsx +168 -0
- package/src/client/ExecutionLink.tsx +16 -0
- package/src/client/ExecutionPage.tsx +44 -0
- package/src/client/ExecutionResourceProvider.tsx +21 -0
- package/src/client/FlowContext.ts +7 -0
- package/src/client/WorkflowCanvas.tsx +220 -0
- package/src/client/WorkflowLink.tsx +16 -0
- package/src/client/WorkflowPage.tsx +51 -0
- package/src/client/WorkflowProvider.tsx +84 -0
- package/src/client/components/CollectionBlockInitializer.tsx +71 -0
- package/src/client/components/CollectionFieldset.tsx +158 -0
- package/src/client/components/Duration.tsx +45 -0
- package/src/client/components/DynamicExpression.tsx +53 -0
- package/src/client/components/FieldsSelect.tsx +28 -0
- package/src/client/components/FilterDynamicComponent.tsx +15 -0
- package/src/client/components/NodeDescription.tsx +44 -0
- package/src/client/components/NullRender.tsx +3 -0
- package/src/client/components/OpenDrawer.tsx +24 -0
- package/src/client/components/RadioWithTooltip.tsx +38 -0
- package/src/client/components/ValueBlock.tsx +67 -0
- package/src/client/components/renderEngineReference.tsx +30 -0
- package/src/client/constants.tsx +91 -0
- package/src/client/index.tsx +51 -0
- package/src/client/interfaces/expression.tsx +25 -0
- package/src/client/locale/en-US.ts +136 -0
- package/src/client/locale/es-ES.ts +129 -0
- package/src/client/locale/index.ts +18 -0
- package/src/client/locale/ja-JP.ts +90 -0
- package/src/client/locale/pt-BR.ts +136 -0
- package/src/client/locale/ru-RU.ts +90 -0
- package/src/client/locale/tr-TR.ts +90 -0
- package/src/client/locale/zh-CN.ts +242 -0
- package/src/client/nodes/aggregate.tsx +327 -0
- package/src/client/nodes/calculation.tsx +217 -0
- package/src/client/nodes/condition.tsx +490 -0
- package/src/client/nodes/create.tsx +86 -0
- package/src/client/nodes/delay.tsx +37 -0
- package/src/client/nodes/destroy.tsx +34 -0
- package/src/client/nodes/index.tsx +489 -0
- package/src/client/nodes/loop.tsx +159 -0
- package/src/client/nodes/manual/AssigneesSelect.tsx +33 -0
- package/src/client/nodes/manual/DetailsBlockProvider.tsx +80 -0
- package/src/client/nodes/manual/FormBlockInitializer.tsx +68 -0
- package/src/client/nodes/manual/FormBlockProvider.tsx +75 -0
- package/src/client/nodes/manual/ModeConfig.tsx +84 -0
- package/src/client/nodes/manual/SchemaConfig.tsx +365 -0
- package/src/client/nodes/manual/WorkflowTodo.tsx +611 -0
- package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
- package/src/client/nodes/manual/forms/create.tsx +88 -0
- package/src/client/nodes/manual/forms/custom.tsx +388 -0
- package/src/client/nodes/manual/forms/update.tsx +130 -0
- package/src/client/nodes/manual/index.tsx +162 -0
- package/src/client/nodes/manual/utils.ts +28 -0
- package/src/client/nodes/parallel.tsx +137 -0
- package/src/client/nodes/query.tsx +89 -0
- package/src/client/nodes/request.tsx +185 -0
- package/src/client/nodes/update.tsx +99 -0
- package/src/client/schemas/collection.ts +75 -0
- package/src/client/schemas/executions.tsx +169 -0
- package/src/client/schemas/workflows.ts +364 -0
- package/src/client/style.tsx +312 -0
- package/src/client/triggers/collection.tsx +186 -0
- package/src/client/triggers/index.tsx +307 -0
- package/src/client/triggers/schedule/DateFieldsSelect.tsx +28 -0
- package/src/client/triggers/schedule/EndsByField.tsx +40 -0
- package/src/client/triggers/schedule/OnField.tsx +50 -0
- package/src/client/triggers/schedule/RepeatField.tsx +116 -0
- package/src/client/triggers/schedule/ScheduleConfig.tsx +225 -0
- package/src/client/triggers/schedule/constants.ts +4 -0
- package/src/client/triggers/schedule/index.tsx +72 -0
- package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +79 -0
- package/src/client/utils.ts +36 -0
- package/src/client/variable.tsx +296 -0
- package/src/index.ts +1 -0
- package/src/server/Plugin.ts +351 -0
- package/src/server/Processor.ts +354 -0
- package/src/server/__tests__/Plugin.test.ts +398 -0
- package/src/server/__tests__/Processor.test.ts +474 -0
- package/src/server/__tests__/actions/workflows.test.ts +419 -0
- package/src/server/__tests__/collections/categories.ts +23 -0
- package/src/server/__tests__/collections/comments.ts +24 -0
- package/src/server/__tests__/collections/posts.ts +42 -0
- package/src/server/__tests__/collections/replies.ts +9 -0
- package/src/server/__tests__/collections/tags.ts +15 -0
- package/src/server/__tests__/index.ts +89 -0
- package/src/server/__tests__/instructions/aggregate.test.ts +294 -0
- package/src/server/__tests__/instructions/calculation.test.ts +265 -0
- package/src/server/__tests__/instructions/condition.test.ts +335 -0
- package/src/server/__tests__/instructions/create.test.ts +129 -0
- package/src/server/__tests__/instructions/delay.test.ts +182 -0
- package/src/server/__tests__/instructions/destroy.test.ts +58 -0
- package/src/server/__tests__/instructions/loop.test.ts +331 -0
- package/src/server/__tests__/instructions/manual.test.ts +854 -0
- package/src/server/__tests__/instructions/parallel.test.ts +445 -0
- package/src/server/__tests__/instructions/query.test.ts +359 -0
- package/src/server/__tests__/instructions/request.test.ts +217 -0
- package/src/server/__tests__/instructions/update.test.ts +189 -0
- package/src/server/__tests__/triggers/collection.test.ts +298 -0
- package/src/server/__tests__/triggers/schedule.test.ts +369 -0
- package/src/server/actions/index.ts +25 -0
- package/src/server/actions/nodes.ts +214 -0
- package/src/server/actions/workflows.ts +178 -0
- package/src/server/collections/executions.ts +35 -0
- package/src/server/collections/flow_nodes.ts +54 -0
- package/src/server/collections/jobs.ts +31 -0
- package/src/server/collections/workflows.ts +88 -0
- package/src/server/constants.ts +26 -0
- package/src/server/fields/expression-field.ts +11 -0
- package/src/server/fields/index.ts +7 -0
- package/src/server/functions/index.ts +16 -0
- package/src/server/index.ts +6 -0
- package/src/server/instructions/aggregate.ts +42 -0
- package/src/server/instructions/calculation.ts +41 -0
- package/src/server/instructions/condition.ts +172 -0
- package/src/server/instructions/create.ts +37 -0
- package/src/server/instructions/delay.ts +105 -0
- package/src/server/instructions/destroy.ts +23 -0
- package/src/server/instructions/index.ts +63 -0
- package/src/server/instructions/loop.ts +99 -0
- package/src/server/instructions/manual/actions.ts +79 -0
- package/src/server/instructions/manual/collecions/jobs.ts +17 -0
- package/src/server/instructions/manual/collecions/users.ts +15 -0
- package/src/server/instructions/manual/collecions/users_jobs.ts +50 -0
- package/src/server/instructions/manual/forms/create.ts +22 -0
- package/src/server/instructions/manual/forms/index.ts +12 -0
- package/src/server/instructions/manual/forms/update.ts +22 -0
- package/src/server/instructions/manual/index.ts +184 -0
- package/src/server/instructions/parallel.ts +121 -0
- package/src/server/instructions/query.ts +31 -0
- package/src/server/instructions/request.ts +87 -0
- package/src/server/instructions/update.ts +24 -0
- package/src/server/migrations/20221129153547-calculation-variables.ts +64 -0
- package/src/server/migrations/20230221032941-change-request-body-type.ts +76 -0
- package/src/server/migrations/20230221071831-calculation-expression.ts +102 -0
- package/src/server/migrations/20230221121203-condition-calculation.ts +82 -0
- package/src/server/migrations/20230221162902-jsonb-to-json.ts +51 -0
- package/src/server/migrations/20230411034722-manual-multi-form.ts +282 -0
- package/src/server/migrations/20230612021134-manual-collection-block.ts +138 -0
- package/src/server/triggers/collection.ts +142 -0
- package/src/server/triggers/index.ts +22 -0
- package/src/server/triggers/schedule.ts +567 -0
- package/src/server/types/Execution.ts +26 -0
- package/src/server/types/FlowNode.ts +21 -0
- package/src/server/types/Job.ts +18 -0
- package/src/server/types/Workflow.ts +36 -0
- package/src/server/types/index.ts +4 -0
- /package/lib/server/{models → types}/Execution.js +0 -0
- /package/lib/server/{models → types}/FlowNode.js +0 -0
- /package/lib/server/{models → types}/Job.js +0 -0
- /package/lib/server/{models → types}/Workflow.js +0 -0
|
@@ -4,37 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RadioWithTooltip = RadioWithTooltip;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _antd() {
|
|
15
|
-
const data = require("antd");
|
|
16
|
-
_antd = function _antd() {
|
|
7
|
+
function _icons() {
|
|
8
|
+
const data = require("@ant-design/icons");
|
|
9
|
+
_icons = function _icons() {
|
|
17
10
|
return data;
|
|
18
11
|
};
|
|
19
12
|
return data;
|
|
20
13
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("@
|
|
23
|
-
|
|
14
|
+
function _client() {
|
|
15
|
+
const data = require("@nocobase/client");
|
|
16
|
+
_client = function _client() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("
|
|
30
|
-
|
|
21
|
+
function _antd() {
|
|
22
|
+
const data = require("antd");
|
|
23
|
+
_antd = function _antd() {
|
|
31
24
|
return data;
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
35
|
-
function
|
|
36
|
-
const data = require("
|
|
37
|
-
|
|
28
|
+
function _react() {
|
|
29
|
+
const data = _interopRequireDefault(require("react"));
|
|
30
|
+
_react = function _react() {
|
|
38
31
|
return data;
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
@@ -57,7 +50,7 @@ function RadioWithTooltip(props) {
|
|
|
57
50
|
key: option.value,
|
|
58
51
|
value: option.value
|
|
59
52
|
}, _react().default.createElement("span", {
|
|
60
|
-
className: (0,
|
|
53
|
+
className: (0, _client().css)`
|
|
61
54
|
& + .anticon {
|
|
62
55
|
margin-left: 0.25em;
|
|
63
56
|
}
|
|
@@ -5,36 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ValueBlock = void 0;
|
|
7
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
8
|
const data = require("@formily/react");
|
|
16
|
-
|
|
9
|
+
_react = function _react() {
|
|
17
10
|
return data;
|
|
18
11
|
};
|
|
19
12
|
return data;
|
|
20
13
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("@
|
|
23
|
-
|
|
14
|
+
function _client() {
|
|
15
|
+
const data = require("@nocobase/client");
|
|
16
|
+
_client = function _client() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
|
-
function
|
|
21
|
+
function _client2() {
|
|
29
22
|
const data = require("@nocobase/utils/client");
|
|
30
|
-
|
|
23
|
+
_client2 = function _client2() {
|
|
31
24
|
return data;
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
35
|
-
function
|
|
36
|
-
const data = require("
|
|
37
|
-
|
|
28
|
+
function _react2() {
|
|
29
|
+
const data = _interopRequireDefault(require("react"));
|
|
30
|
+
_react2 = function _react2() {
|
|
38
31
|
return data;
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
@@ -58,7 +51,7 @@ function Initializer(_ref) {
|
|
|
58
51
|
resultTitle = _ref.resultTitle,
|
|
59
52
|
insert = _ref.insert,
|
|
60
53
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
|
-
return
|
|
54
|
+
return _react2().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
62
55
|
onClick: () => {
|
|
63
56
|
var _node$title;
|
|
64
57
|
insert({
|
|
@@ -89,19 +82,19 @@ function Result({
|
|
|
89
82
|
dataSource
|
|
90
83
|
}) {
|
|
91
84
|
var _execution$jobs;
|
|
92
|
-
const field = (0,
|
|
85
|
+
const field = (0, _react().useFieldSchema)();
|
|
93
86
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
94
87
|
execution = _useFlowContext.execution;
|
|
95
88
|
if (!execution) {
|
|
96
89
|
return field.title;
|
|
97
90
|
}
|
|
98
|
-
const result = (0,
|
|
91
|
+
const result = (0, _client2().parse)(dataSource)({
|
|
99
92
|
$jobsMapByNodeId: ((_execution$jobs = execution.jobs) !== null && _execution$jobs !== void 0 ? _execution$jobs : []).reduce((map, job) => Object.assign(map, {
|
|
100
93
|
[job.nodeId]: job.result
|
|
101
94
|
}), {})
|
|
102
95
|
});
|
|
103
|
-
return
|
|
104
|
-
className: (0,
|
|
96
|
+
return _react2().default.createElement("pre", {
|
|
97
|
+
className: (0, _client().css)`
|
|
105
98
|
margin: 0;
|
|
106
99
|
`
|
|
107
100
|
}, JSON.stringify(result, null, 2));
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.renderEngineReference = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _client() {
|
|
15
8
|
const data = require("@nocobase/client");
|
|
16
9
|
_client = function _client() {
|
|
@@ -39,7 +32,7 @@ const renderEngineReference = key => {
|
|
|
39
32
|
return null;
|
|
40
33
|
}
|
|
41
34
|
return engine.link ? _react().default.createElement(_react().default.Fragment, null, _react().default.createElement("span", {
|
|
42
|
-
className: (0,
|
|
35
|
+
className: (0, _client().css)`
|
|
43
36
|
&:after {
|
|
44
37
|
content: ':';
|
|
45
38
|
}
|
package/lib/client/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
export { triggers } from './triggers';
|
|
2
|
-
export * from './nodes';
|
|
3
|
-
export * from './FlowContext';
|
|
4
1
|
export * from './Branch';
|
|
5
|
-
export
|
|
2
|
+
export * from './FlowContext';
|
|
3
|
+
export * from './nodes';
|
|
4
|
+
export { triggers } from './triggers';
|
|
5
|
+
export { useWorkflowVariableOptions } from './variable';
|
|
6
|
+
import { Plugin } from '@nocobase/client';
|
|
7
|
+
export declare class WorkflowPlugin extends Plugin {
|
|
8
|
+
load(): Promise<void>;
|
|
9
|
+
addScopes(): void;
|
|
10
|
+
addComponents(): void;
|
|
11
|
+
addRoutes(): void;
|
|
12
|
+
}
|
|
13
|
+
export default WorkflowPlugin;
|
package/lib/client/index.js
CHANGED
|
@@ -4,30 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
|
|
7
|
+
WorkflowPlugin: true,
|
|
8
|
+
triggers: true,
|
|
9
|
+
useWorkflowVariableOptions: true
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
exports.default = exports.WorkflowPlugin = void 0;
|
|
12
|
+
Object.defineProperty(exports, "triggers", {
|
|
10
13
|
enumerable: true,
|
|
11
14
|
get: function get() {
|
|
12
|
-
return
|
|
15
|
+
return _triggers.triggers;
|
|
13
16
|
}
|
|
14
17
|
});
|
|
15
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "useWorkflowVariableOptions", {
|
|
16
19
|
enumerable: true,
|
|
17
20
|
get: function get() {
|
|
18
|
-
return
|
|
21
|
+
return _variable.useWorkflowVariableOptions;
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
Object.keys(_nodes).forEach(function (key) {
|
|
24
|
+
var _Branch = require("./Branch");
|
|
25
|
+
Object.keys(_Branch).forEach(function (key) {
|
|
24
26
|
if (key === "default" || key === "__esModule") return;
|
|
25
27
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
-
if (key in exports && exports[key] ===
|
|
28
|
+
if (key in exports && exports[key] === _Branch[key]) return;
|
|
27
29
|
Object.defineProperty(exports, key, {
|
|
28
30
|
enumerable: true,
|
|
29
31
|
get: function get() {
|
|
30
|
-
return
|
|
32
|
+
return _Branch[key];
|
|
31
33
|
}
|
|
32
34
|
});
|
|
33
35
|
});
|
|
@@ -43,16 +45,77 @@ Object.keys(_FlowContext).forEach(function (key) {
|
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
});
|
|
46
|
-
var
|
|
47
|
-
Object.keys(
|
|
48
|
+
var _nodes = require("./nodes");
|
|
49
|
+
Object.keys(_nodes).forEach(function (key) {
|
|
48
50
|
if (key === "default" || key === "__esModule") return;
|
|
49
51
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
50
|
-
if (key in exports && exports[key] ===
|
|
52
|
+
if (key in exports && exports[key] === _nodes[key]) return;
|
|
51
53
|
Object.defineProperty(exports, key, {
|
|
52
54
|
enumerable: true,
|
|
53
55
|
get: function get() {
|
|
54
|
-
return
|
|
56
|
+
return _nodes[key];
|
|
55
57
|
}
|
|
56
58
|
});
|
|
57
59
|
});
|
|
58
|
-
var
|
|
60
|
+
var _triggers = require("./triggers");
|
|
61
|
+
var _variable = require("./variable");
|
|
62
|
+
function _client() {
|
|
63
|
+
const data = require("@nocobase/client");
|
|
64
|
+
_client = function _client() {
|
|
65
|
+
return data;
|
|
66
|
+
};
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
69
|
+
function _react() {
|
|
70
|
+
const data = _interopRequireDefault(require("react"));
|
|
71
|
+
_react = function _react() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
76
|
+
var _DynamicExpression = require("./components/DynamicExpression");
|
|
77
|
+
var _ExecutionPage = require("./ExecutionPage");
|
|
78
|
+
var _WorkflowTodo = require("./nodes/manual/WorkflowTodo");
|
|
79
|
+
var _WorkflowTodoBlockInitializer = require("./nodes/manual/WorkflowTodoBlockInitializer");
|
|
80
|
+
var _WorkflowPage = require("./WorkflowPage");
|
|
81
|
+
var _WorkflowProvider = require("./WorkflowProvider");
|
|
82
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
84
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
85
|
+
class WorkflowPlugin extends _client().Plugin {
|
|
86
|
+
load() {
|
|
87
|
+
var _this = this;
|
|
88
|
+
return _asyncToGenerator(function* () {
|
|
89
|
+
_this.addRoutes();
|
|
90
|
+
_this.addComponents();
|
|
91
|
+
_this.app.use(_WorkflowProvider.WorkflowProvider);
|
|
92
|
+
})();
|
|
93
|
+
}
|
|
94
|
+
addScopes() {
|
|
95
|
+
this.app.addScopes({
|
|
96
|
+
useCollectionDataSource: _client().useCollectionDataSource
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
addComponents() {
|
|
100
|
+
this.app.addComponents({
|
|
101
|
+
WorkflowPage: _WorkflowPage.WorkflowPage,
|
|
102
|
+
ExecutionPage: _ExecutionPage.ExecutionPage,
|
|
103
|
+
WorkflowTodo: _WorkflowTodo.WorkflowTodo,
|
|
104
|
+
WorkflowTodoBlockInitializer: _WorkflowTodoBlockInitializer.WorkflowTodoBlockInitializer,
|
|
105
|
+
DynamicExpression: _DynamicExpression.DynamicExpression
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
addRoutes() {
|
|
109
|
+
this.app.router.add('admin.settings.workflow.workflows.id', {
|
|
110
|
+
path: '/admin/settings/workflow/workflows/:id',
|
|
111
|
+
element: _react().default.createElement(_WorkflowPage.WorkflowPage, null)
|
|
112
|
+
});
|
|
113
|
+
this.app.router.add('admin.settings.workflow.executions.id', {
|
|
114
|
+
path: '/admin/settings/workflow/executions/:id',
|
|
115
|
+
element: _react().default.createElement(_ExecutionPage.ExecutionPage, null)
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.WorkflowPlugin = WorkflowPlugin;
|
|
120
|
+
var _default = WorkflowPlugin;
|
|
121
|
+
exports.default = _default;
|
|
@@ -67,7 +67,7 @@ declare const _default: {
|
|
|
67
67
|
title: string;
|
|
68
68
|
'x-component-props': {
|
|
69
69
|
className: string;
|
|
70
|
-
|
|
70
|
+
popupMatchSelectWidth: boolean;
|
|
71
71
|
};
|
|
72
72
|
'x-reactions': any[];
|
|
73
73
|
type: string;
|
|
@@ -171,16 +171,22 @@ declare const _default: {
|
|
|
171
171
|
components: {
|
|
172
172
|
SchemaComponentContext: React.Context<import("@nocobase/client").ISchemaComponentContext>;
|
|
173
173
|
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
174
|
-
FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<
|
|
174
|
+
FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|
|
175
175
|
ValueBlock: (() => JSX.Element) & {
|
|
176
176
|
Initializer: (props: any) => JSX.Element;
|
|
177
177
|
Result: (props: any) => JSX.Element;
|
|
178
178
|
};
|
|
179
179
|
AssociatedConfig: typeof AssociatedConfig;
|
|
180
180
|
};
|
|
181
|
-
useVariables(
|
|
181
|
+
useVariables({ id, title }: {
|
|
182
|
+
id: any;
|
|
183
|
+
title: any;
|
|
184
|
+
}, { types }: {
|
|
182
185
|
types: any;
|
|
183
|
-
}):
|
|
186
|
+
}): {
|
|
187
|
+
value: string;
|
|
188
|
+
label: any;
|
|
189
|
+
};
|
|
184
190
|
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
185
191
|
};
|
|
186
192
|
export default _default;
|
|
@@ -38,7 +38,6 @@ var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
|
38
38
|
var _variable = require("../variable");
|
|
39
39
|
var _FieldsSelect = require("../components/FieldsSelect");
|
|
40
40
|
var _ValueBlock = require("../components/ValueBlock");
|
|
41
|
-
var _ = require(".");
|
|
42
41
|
const _excluded = ["value", "onChange"];
|
|
43
42
|
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); }
|
|
44
43
|
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; }
|
|
@@ -49,8 +48,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
49
48
|
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); }
|
|
50
49
|
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; }
|
|
51
50
|
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; }
|
|
52
|
-
function matchToManyField(field,
|
|
53
|
-
|
|
51
|
+
function matchToManyField(field, appends) {
|
|
52
|
+
const fieldPrefix = `${field.name}.`;
|
|
53
|
+
return ['hasMany', 'belongsToMany'].includes(field.type) && (appends.includes(field.name) || appends.some(item => item.startsWith(fieldPrefix)));
|
|
54
54
|
}
|
|
55
55
|
function AssociatedConfig(_ref) {
|
|
56
56
|
let value = _ref.value,
|
|
@@ -61,7 +61,6 @@ function AssociatedConfig(_ref) {
|
|
|
61
61
|
const compile = (0, _client().useCompile)();
|
|
62
62
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
63
63
|
getCollection = _useCollectionManager.getCollection;
|
|
64
|
-
const current = (0, _.useNodeContext)();
|
|
65
64
|
const options = [_variable.nodesOptions, _variable.triggerOptions].map(item => {
|
|
66
65
|
var _item$useOptions;
|
|
67
66
|
const children = (_item$useOptions = item.useOptions({
|
|
@@ -85,7 +84,7 @@ function AssociatedConfig(_ref) {
|
|
|
85
84
|
p = [...matched[1].trim().split('.').slice(0, -1), fieldName];
|
|
86
85
|
}
|
|
87
86
|
const onSelectChange = (0, _react().useCallback)((path, option) => {
|
|
88
|
-
if (!(path
|
|
87
|
+
if (!(path !== null && path !== void 0 && path.length)) {
|
|
89
88
|
setValuesIn('collection', null);
|
|
90
89
|
onChange({});
|
|
91
90
|
return;
|
|
@@ -322,15 +321,19 @@ var _default = {
|
|
|
322
321
|
ValueBlock: _ValueBlock.ValueBlock,
|
|
323
322
|
AssociatedConfig
|
|
324
323
|
},
|
|
325
|
-
useVariables(
|
|
324
|
+
useVariables({
|
|
325
|
+
id,
|
|
326
|
+
title
|
|
327
|
+
}, {
|
|
326
328
|
types
|
|
327
329
|
}) {
|
|
328
330
|
if (types && !types.some(type => type in _variable.BaseTypeSets || Object.values(_variable.BaseTypeSets).some(set => set.has(type)))) {
|
|
329
331
|
return null;
|
|
330
332
|
}
|
|
331
|
-
return
|
|
332
|
-
|
|
333
|
-
|
|
333
|
+
return {
|
|
334
|
+
value: `${id}`,
|
|
335
|
+
label: title
|
|
336
|
+
};
|
|
334
337
|
},
|
|
335
338
|
useInitializers(node) {
|
|
336
339
|
var _node$title;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
4
|
-
import { useWorkflowVariableOptions } from '../variable';
|
|
5
|
-
declare function useWorkflowVariableEntityOptions(): {
|
|
6
|
-
label: any;
|
|
7
|
-
value: any;
|
|
8
|
-
key: any;
|
|
9
|
-
children: any;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
}[];
|
|
12
4
|
declare const _default: {
|
|
13
5
|
title: string;
|
|
14
6
|
type: string;
|
|
@@ -26,7 +18,7 @@ declare const _default: {
|
|
|
26
18
|
'x-decorator': string;
|
|
27
19
|
'x-component': string;
|
|
28
20
|
'x-component-props': {
|
|
29
|
-
options: any
|
|
21
|
+
options: any;
|
|
30
22
|
};
|
|
31
23
|
required: boolean;
|
|
32
24
|
default: string;
|
|
@@ -44,9 +36,6 @@ declare const _default: {
|
|
|
44
36
|
title: string;
|
|
45
37
|
'x-decorator': string;
|
|
46
38
|
'x-component': string;
|
|
47
|
-
'x-component-props': {
|
|
48
|
-
scope: string;
|
|
49
|
-
};
|
|
50
39
|
"x-validator"(value: any, rules: any, { form }: {
|
|
51
40
|
form: any;
|
|
52
41
|
}): string;
|
|
@@ -75,7 +64,7 @@ declare const _default: {
|
|
|
75
64
|
'x-decorator': string;
|
|
76
65
|
'x-component': string;
|
|
77
66
|
'x-component-props': {
|
|
78
|
-
|
|
67
|
+
changeOnSelect: boolean;
|
|
79
68
|
};
|
|
80
69
|
'x-reactions': {
|
|
81
70
|
dependencies: string[];
|
|
@@ -89,11 +78,11 @@ declare const _default: {
|
|
|
89
78
|
};
|
|
90
79
|
view: {};
|
|
91
80
|
scope: {
|
|
92
|
-
useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
|
|
93
|
-
useWorkflowVariableEntityOptions: typeof useWorkflowVariableEntityOptions;
|
|
94
81
|
renderEngineReference: (key: string) => React.JSX.Element;
|
|
95
82
|
};
|
|
96
83
|
components: {
|
|
84
|
+
CalculationExpression(props: any): React.JSX.Element;
|
|
85
|
+
ScopeSelect(props: any): React.JSX.Element;
|
|
97
86
|
CalculationResult({ dataSource }: {
|
|
98
87
|
dataSource: any;
|
|
99
88
|
}): string | React.JSX.Element;
|
|
@@ -103,7 +92,13 @@ declare const _default: {
|
|
|
103
92
|
onChange: any;
|
|
104
93
|
}) => React.JSX.Element;
|
|
105
94
|
};
|
|
106
|
-
useVariables(
|
|
95
|
+
useVariables({ id, title }: {
|
|
96
|
+
id: any;
|
|
97
|
+
title: any;
|
|
98
|
+
}, options: any): {
|
|
99
|
+
value: any;
|
|
100
|
+
label: any;
|
|
101
|
+
};
|
|
107
102
|
useInitializers(node: any): SchemaInitializerItemOptions;
|
|
108
103
|
};
|
|
109
104
|
export default _default;
|