@nocobase/plugin-workflow 0.9.0-alpha.2 → 0.9.1-alpha.2
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/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/lib/client/AddButton.d.ts +1 -1
- package/lib/client/AddButton.js +43 -27
- package/lib/client/Branch.d.ts +1 -1
- package/lib/client/ExecutionCanvas.js +5 -10
- package/lib/client/WorkflowCanvas.js +12 -42
- package/lib/client/WorkflowProvider.js +10 -1
- package/lib/client/components/CollectionBlockInitializer.d.ts +7 -0
- package/lib/client/components/CollectionBlockInitializer.js +81 -0
- package/lib/client/components/CollectionFieldInitializers.d.ts +2 -0
- package/lib/client/components/CollectionFieldInitializers.js +89 -0
- package/lib/client/components/CollectionFieldset.js +25 -33
- package/lib/client/components/FilterDynamicComponent.d.ts +6 -0
- package/lib/client/components/FilterDynamicComponent.js +43 -0
- package/lib/client/components/NullRender.d.ts +1 -0
- package/lib/client/components/NullRender.js +10 -0
- package/lib/client/components/RadioWithTooltip.d.ts +7 -0
- package/lib/client/components/RadioWithTooltip.js +94 -0
- package/lib/client/constants.d.ts +10 -8
- package/lib/client/constants.js +52 -14
- package/lib/client/index.d.ts +0 -1
- package/lib/client/index.js +1 -10
- package/lib/client/locale/en-US.d.ts +18 -18
- package/lib/client/locale/en-US.js +19 -19
- package/lib/client/locale/zh-CN.d.ts +47 -20
- package/lib/client/locale/zh-CN.js +48 -21
- package/lib/client/nodes/calculation.d.ts +39 -7
- package/lib/client/nodes/calculation.js +165 -19
- package/lib/client/nodes/condition.d.ts +67 -4
- package/lib/client/nodes/condition.js +283 -31
- package/lib/client/nodes/create.d.ts +10 -10
- package/lib/client/nodes/create.js +28 -42
- package/lib/client/nodes/delay.d.ts +4 -4
- package/lib/client/nodes/delay.js +10 -8
- package/lib/client/nodes/destroy.d.ts +4 -7
- package/lib/client/nodes/destroy.js +4 -5
- package/lib/client/nodes/index.d.ts +10 -2
- package/lib/client/nodes/index.js +217 -110
- package/lib/client/nodes/manual/AssigneesSelect.d.ts +6 -0
- package/lib/client/nodes/manual/AssigneesSelect.js +65 -0
- package/lib/client/nodes/manual/ModeConfig.d.ts +5 -0
- package/lib/client/nodes/manual/ModeConfig.js +160 -0
- package/lib/client/nodes/manual/SchemaConfig.d.ts +6 -0
- package/lib/client/nodes/manual/SchemaConfig.js +715 -0
- package/lib/client/nodes/manual/WorkflowTodo.d.ts +8 -0
- package/lib/client/nodes/manual/WorkflowTodo.js +691 -0
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +5 -0
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +75 -0
- package/lib/client/nodes/manual/index.d.ts +62 -0
- package/lib/client/nodes/manual/index.js +137 -0
- package/lib/client/nodes/parallel.d.ts +12 -7
- package/lib/client/nodes/parallel.js +32 -39
- package/lib/client/nodes/query.d.ts +11 -19
- package/lib/client/nodes/query.js +40 -47
- package/lib/client/nodes/request.d.ts +77 -42
- package/lib/client/nodes/request.js +123 -69
- package/lib/client/nodes/update.d.ts +33 -29
- package/lib/client/nodes/update.js +14 -7
- package/lib/client/schemas/collection.d.ts +0 -3
- package/lib/client/schemas/collection.js +2 -7
- package/lib/client/schemas/executions.js +1 -1
- package/lib/client/schemas/workflows.js +1 -1
- package/lib/client/style.js +51 -9
- package/lib/client/triggers/collection.d.ts +44 -15
- package/lib/client/triggers/collection.js +104 -82
- package/lib/client/triggers/index.d.ts +6 -3
- package/lib/client/triggers/index.js +167 -74
- package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -3
- package/lib/client/triggers/schedule/ScheduleConfig.js +15 -17
- package/lib/client/triggers/schedule/index.d.ts +7 -6
- package/lib/client/triggers/schedule/index.js +39 -81
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +38 -0
- package/lib/client/variable.d.ts +21 -0
- package/lib/client/variable.js +147 -0
- package/lib/server/Plugin.d.ts +3 -3
- package/lib/server/Plugin.js +12 -21
- package/lib/server/Processor.d.ts +9 -2
- package/lib/server/Processor.js +33 -33
- package/lib/server/actions/index.js +2 -4
- package/lib/server/actions/workflows.d.ts +1 -0
- package/lib/server/actions/workflows.js +80 -23
- package/lib/server/collections/executions.js +5 -7
- package/lib/server/collections/flow_nodes.js +6 -18
- package/lib/server/collections/jobs.js +3 -1
- package/lib/server/collections/workflows.js +8 -4
- package/lib/server/constants.d.ts +9 -3
- package/lib/server/constants.js +11 -5
- package/lib/server/functions/index.d.ts +4 -0
- package/lib/server/functions/index.js +38 -0
- package/lib/server/index.d.ts +0 -1
- package/lib/server/index.js +0 -14
- package/lib/server/instructions/calculation.d.ts +2 -7
- package/lib/server/instructions/calculation.js +32 -37
- package/lib/server/instructions/condition.d.ts +4 -4
- package/lib/server/instructions/condition.js +126 -54
- package/lib/server/instructions/index.js +1 -1
- package/lib/server/instructions/manual/actions.js +101 -0
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.d.ts +2 -0
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.js +2 -1
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.js +10 -10
- package/lib/server/instructions/manual/index.d.ts +25 -0
- package/lib/server/instructions/manual/index.js +200 -0
- package/lib/server/instructions/parallel.js +11 -7
- package/lib/server/instructions/request.d.ts +5 -4
- package/lib/server/instructions/request.js +60 -79
- package/lib/server/migrations/20230221032941-change-request-body-type.d.ts +5 -0
- package/lib/server/migrations/20230221032941-change-request-body-type.js +113 -0
- package/lib/server/migrations/20230221071831-calculation-expression.d.ts +4 -0
- package/lib/server/migrations/20230221071831-calculation-expression.js +143 -0
- package/lib/server/migrations/20230221121203-condition-calculation.d.ts +4 -0
- package/lib/server/migrations/20230221121203-condition-calculation.js +126 -0
- package/lib/server/migrations/20230221162902-jsonb-to-json.d.ts +4 -0
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +81 -0
- package/lib/server/triggers/schedule.js +11 -3
- package/package.json +10 -10
- package/lib/client/calculators.d.ts +0 -89
- package/lib/client/calculators.js +0 -668
- package/lib/client/components/CollectionFieldSelect.d.ts +0 -2
- package/lib/client/components/CollectionFieldSelect.js +0 -106
- package/lib/client/components/EjsTextArea.d.ts +0 -2
- package/lib/client/components/EjsTextArea.js +0 -232
- package/lib/server/actions/jobs.d.ts +0 -2
- package/lib/server/actions/jobs.js +0 -39
- package/lib/server/calculators/index.d.ts +0 -40
- package/lib/server/calculators/index.js +0 -187
- package/lib/server/extensions/assignees/actions.js +0 -75
- package/lib/server/extensions/assignees/index.d.ts +0 -2
- package/lib/server/extensions/assignees/index.js +0 -273
- package/lib/server/extensions/index.d.ts +0 -3
- package/lib/server/extensions/index.js +0 -13
- package/lib/server/instructions/prompt.d.ts +0 -19
- package/lib/server/instructions/prompt.js +0 -131
- /package/lib/server/{extensions/assignees → instructions/manual}/actions.d.ts +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.d.ts +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.js +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.d.ts +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WorkflowTodoBlockInitializer = WorkflowTodoBlockInitializer;
|
|
7
|
+
|
|
8
|
+
function _react() {
|
|
9
|
+
const data = _interopRequireDefault(require("react"));
|
|
10
|
+
|
|
11
|
+
_react = function _react() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _icons() {
|
|
19
|
+
const data = require("@ant-design/icons");
|
|
20
|
+
|
|
21
|
+
_icons = function _icons() {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _client() {
|
|
29
|
+
const data = require("@nocobase/client");
|
|
30
|
+
|
|
31
|
+
_client = function _client() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const _excluded = ["insert"];
|
|
39
|
+
|
|
40
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
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; }
|
|
51
|
+
|
|
52
|
+
function WorkflowTodoBlockInitializer(_ref) {
|
|
53
|
+
let insert = _ref.insert,
|
|
54
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
55
|
+
|
|
56
|
+
return _react().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({
|
|
57
|
+
icon: _react().default.createElement(_icons().TableOutlined, null)
|
|
58
|
+
}, props), {}, {
|
|
59
|
+
onClick: () => {
|
|
60
|
+
insert({
|
|
61
|
+
type: 'void',
|
|
62
|
+
'x-decorator': 'WorkflowTodo.Decorator',
|
|
63
|
+
'x-decorator-props': {},
|
|
64
|
+
'x-component': 'CardItem',
|
|
65
|
+
'x-designer': 'TableBlockDesigner',
|
|
66
|
+
properties: {
|
|
67
|
+
todos: {
|
|
68
|
+
type: 'void',
|
|
69
|
+
'x-component': 'WorkflowTodo'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
|
+
import { CollectionFieldInitializers } from '../../components/CollectionFieldInitializers';
|
|
3
|
+
import { SchemaConfig, SchemaConfigButton } from './SchemaConfig';
|
|
4
|
+
import { ModeConfig } from './ModeConfig';
|
|
5
|
+
import { AssigneesSelect } from './AssigneesSelect';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
type: string;
|
|
9
|
+
group: string;
|
|
10
|
+
fieldset: {
|
|
11
|
+
assignees: {
|
|
12
|
+
type: string;
|
|
13
|
+
title: string;
|
|
14
|
+
'x-decorator': string;
|
|
15
|
+
'x-component': string;
|
|
16
|
+
'x-component-props': {};
|
|
17
|
+
required: boolean;
|
|
18
|
+
default: any[];
|
|
19
|
+
};
|
|
20
|
+
mode: {
|
|
21
|
+
type: string;
|
|
22
|
+
title: string;
|
|
23
|
+
'x-decorator': string;
|
|
24
|
+
'x-component': string;
|
|
25
|
+
default: number;
|
|
26
|
+
'x-reactions': {
|
|
27
|
+
dependencies: string[];
|
|
28
|
+
fulfill: {
|
|
29
|
+
state: {
|
|
30
|
+
visible: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
schema: {
|
|
36
|
+
type: string;
|
|
37
|
+
title: string;
|
|
38
|
+
'x-decorator': string;
|
|
39
|
+
'x-component': string;
|
|
40
|
+
properties: {
|
|
41
|
+
schema: {
|
|
42
|
+
type: string;
|
|
43
|
+
'x-component': string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
view: {};
|
|
49
|
+
scope: {};
|
|
50
|
+
components: {
|
|
51
|
+
SchemaConfigButton: typeof SchemaConfigButton;
|
|
52
|
+
SchemaConfig: typeof SchemaConfig;
|
|
53
|
+
ModeConfig: typeof ModeConfig;
|
|
54
|
+
AssigneesSelect: typeof AssigneesSelect;
|
|
55
|
+
};
|
|
56
|
+
getOptions(config: any, types: any): any;
|
|
57
|
+
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
58
|
+
initializers: {
|
|
59
|
+
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export default _default;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
function _client() {
|
|
9
|
+
const data = require("@nocobase/client");
|
|
10
|
+
|
|
11
|
+
_client = function _client() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var _CollectionBlockInitializer = require("../../components/CollectionBlockInitializer");
|
|
19
|
+
|
|
20
|
+
var _CollectionFieldInitializers = require("../../components/CollectionFieldInitializers");
|
|
21
|
+
|
|
22
|
+
var _variable = require("../../variable");
|
|
23
|
+
|
|
24
|
+
var _locale = require("../../locale");
|
|
25
|
+
|
|
26
|
+
var _SchemaConfig = require("./SchemaConfig");
|
|
27
|
+
|
|
28
|
+
var _ModeConfig = require("./ModeConfig");
|
|
29
|
+
|
|
30
|
+
var _AssigneesSelect = require("./AssigneesSelect");
|
|
31
|
+
|
|
32
|
+
const MULTIPLE_ASSIGNED_MODE = {
|
|
33
|
+
SINGLE: Symbol('single'),
|
|
34
|
+
ALL: Symbol('all'),
|
|
35
|
+
ANY: Symbol('any'),
|
|
36
|
+
ALL_PERCENTAGE: Symbol('all percentage'),
|
|
37
|
+
ANY_PERCENTAGE: Symbol('any percentage')
|
|
38
|
+
}; // TODO(optimize): change to register way
|
|
39
|
+
|
|
40
|
+
const initializerGroup = _client().BlockInitializers.items.find(group => group.key === 'media');
|
|
41
|
+
|
|
42
|
+
if (!initializerGroup.children.find(item => item.key === 'workflowTodos')) {
|
|
43
|
+
initializerGroup.children.push({
|
|
44
|
+
key: 'workflowTodos',
|
|
45
|
+
type: 'item',
|
|
46
|
+
title: `{{t("Workflow todos", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
47
|
+
component: 'WorkflowTodoBlockInitializer',
|
|
48
|
+
icon: 'CheckSquareOutlined'
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var _default = {
|
|
53
|
+
title: `{{t("Manual", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
54
|
+
type: 'manual',
|
|
55
|
+
group: 'manual',
|
|
56
|
+
fieldset: {
|
|
57
|
+
assignees: {
|
|
58
|
+
type: 'array',
|
|
59
|
+
title: `{{t("Assignees", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
60
|
+
'x-decorator': 'FormItem',
|
|
61
|
+
'x-component': 'AssigneesSelect',
|
|
62
|
+
'x-component-props': {// multiple: true,
|
|
63
|
+
},
|
|
64
|
+
required: true,
|
|
65
|
+
default: []
|
|
66
|
+
},
|
|
67
|
+
mode: {
|
|
68
|
+
type: 'number',
|
|
69
|
+
title: `{{t("Mode", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
70
|
+
'x-decorator': 'FormItem',
|
|
71
|
+
'x-component': 'ModeConfig',
|
|
72
|
+
default: 1,
|
|
73
|
+
'x-reactions': {
|
|
74
|
+
dependencies: ['assignees'],
|
|
75
|
+
fulfill: {
|
|
76
|
+
state: {
|
|
77
|
+
visible: '{{$deps[0].length > 1}}'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
schema: {
|
|
83
|
+
type: 'void',
|
|
84
|
+
title: `{{t("User interface", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
85
|
+
'x-decorator': 'FormItem',
|
|
86
|
+
'x-component': 'SchemaConfigButton',
|
|
87
|
+
properties: {
|
|
88
|
+
schema: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
'x-component': 'SchemaConfig'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
view: {},
|
|
96
|
+
scope: {},
|
|
97
|
+
components: {
|
|
98
|
+
SchemaConfigButton: _SchemaConfig.SchemaConfigButton,
|
|
99
|
+
SchemaConfig: _SchemaConfig.SchemaConfig,
|
|
100
|
+
ModeConfig: _ModeConfig.ModeConfig,
|
|
101
|
+
AssigneesSelect: _AssigneesSelect.AssigneesSelect
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
getOptions(config, types) {
|
|
105
|
+
var _config$schema$collec, _config$schema, _config$schema$collec2;
|
|
106
|
+
|
|
107
|
+
const fields = ((_config$schema$collec = (_config$schema = config.schema) === null || _config$schema === void 0 ? void 0 : (_config$schema$collec2 = _config$schema.collection) === null || _config$schema$collec2 === void 0 ? void 0 : _config$schema$collec2.fields) !== null && _config$schema$collec !== void 0 ? _config$schema$collec : []).map(field => ({
|
|
108
|
+
key: field.name,
|
|
109
|
+
value: field.name,
|
|
110
|
+
label: field.uiSchema.title,
|
|
111
|
+
title: field.uiSchema.title
|
|
112
|
+
}));
|
|
113
|
+
const filteredFields = (0, _variable.filterTypedFields)(fields, types);
|
|
114
|
+
return filteredFields.length ? filteredFields : null;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
useInitializers(node) {
|
|
118
|
+
var _node$config$schema, _node$config$schema$c, _node$config$schema$c2, _node$title;
|
|
119
|
+
|
|
120
|
+
if (!((_node$config$schema = node.config.schema) === null || _node$config$schema === void 0 ? void 0 : (_node$config$schema$c = _node$config$schema.collection) === null || _node$config$schema$c === void 0 ? void 0 : (_node$config$schema$c2 = _node$config$schema$c.fields) === null || _node$config$schema$c2 === void 0 ? void 0 : _node$config$schema$c2.length) || node.config.mode) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
type: 'item',
|
|
126
|
+
title: (_node$title = node.title) !== null && _node$title !== void 0 ? _node$title : `#${node.id}`,
|
|
127
|
+
component: _CollectionBlockInitializer.CollectionBlockInitializer,
|
|
128
|
+
collection: node.config.schema.collection,
|
|
129
|
+
dataSource: `{{$jobsMapByNodeId.${node.id}}}`
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
initializers: {
|
|
134
|
+
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
exports.default = _default;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
+
import { RadioWithTooltip } from "../components/RadioWithTooltip";
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
4
|
type: string;
|
|
4
5
|
group: string;
|
|
5
6
|
fieldset: {
|
|
6
|
-
|
|
7
|
+
mode: {
|
|
7
8
|
type: string;
|
|
8
|
-
name: string;
|
|
9
9
|
title: string;
|
|
10
10
|
'x-decorator': string;
|
|
11
11
|
'x-component': string;
|
|
12
|
-
'x-component-props': {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
'x-component-props': {
|
|
13
|
+
options: {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
tooltip: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
17
19
|
default: string;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
view: {};
|
|
21
23
|
render(data: any): JSX.Element;
|
|
24
|
+
components: {
|
|
25
|
+
RadioWithTooltip: typeof RadioWithTooltip;
|
|
26
|
+
};
|
|
22
27
|
};
|
|
23
28
|
export default _default;
|
|
@@ -55,6 +55,8 @@ var _style = require("../style");
|
|
|
55
55
|
|
|
56
56
|
var _locale = require("../locale");
|
|
57
57
|
|
|
58
|
+
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
59
|
+
|
|
58
60
|
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); }
|
|
59
61
|
|
|
60
62
|
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; }
|
|
@@ -76,44 +78,26 @@ var _default = {
|
|
|
76
78
|
type: 'parallel',
|
|
77
79
|
group: 'control',
|
|
78
80
|
fieldset: {
|
|
79
|
-
|
|
81
|
+
mode: {
|
|
80
82
|
type: 'string',
|
|
81
|
-
name: 'config.mode',
|
|
82
83
|
title: `{{t("Mode", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
83
84
|
'x-decorator': 'FormItem',
|
|
84
|
-
'x-component': '
|
|
85
|
-
'x-component-props': {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
placement: "bottom"
|
|
101
|
-
}, (0, _locale.lang)('Any succeeded'), " ", _react().default.createElement(_icons().QuestionCircleOutlined, {
|
|
102
|
-
style: {
|
|
103
|
-
color: '#999'
|
|
104
|
-
}
|
|
105
|
-
}))
|
|
106
|
-
}, {
|
|
107
|
-
value: 'race',
|
|
108
|
-
label: _react().default.createElement(_antd().Tooltip, {
|
|
109
|
-
title: (0, _locale.lang)('Continue after any branch succeeded, or exit after any branch failed'),
|
|
110
|
-
placement: "bottom"
|
|
111
|
-
}, (0, _locale.lang)('Any succeeded or failed'), " ", _react().default.createElement(_icons().QuestionCircleOutlined, {
|
|
112
|
-
style: {
|
|
113
|
-
color: '#999'
|
|
114
|
-
}
|
|
115
|
-
}))
|
|
116
|
-
}],
|
|
85
|
+
'x-component': 'RadioWithTooltip',
|
|
86
|
+
'x-component-props': {
|
|
87
|
+
options: [{
|
|
88
|
+
value: 'all',
|
|
89
|
+
label: `{{t('All succeeded', { ns: "${_locale.NAMESPACE}" })}}`,
|
|
90
|
+
tooltip: `{{t('Continue after all branches succeeded', { ns: "${_locale.NAMESPACE}" })}}`
|
|
91
|
+
}, {
|
|
92
|
+
value: 'any',
|
|
93
|
+
label: `{{t('Any succeeded', { ns: "${_locale.NAMESPACE}" })}}`,
|
|
94
|
+
tooltip: `{{t('Continue after any branch succeeded', { ns: "${_locale.NAMESPACE}" })}}`
|
|
95
|
+
}, {
|
|
96
|
+
value: 'race',
|
|
97
|
+
label: `{{t('Any succeeded or failed', { ns: "${_locale.NAMESPACE}" })}}`,
|
|
98
|
+
tooltip: `{{t('Continue after any branch succeeded, or exit after any branch failed', { ns: "${_locale.NAMESPACE}" })}}`
|
|
99
|
+
}]
|
|
100
|
+
},
|
|
117
101
|
default: 'all'
|
|
118
102
|
}
|
|
119
103
|
},
|
|
@@ -124,6 +108,7 @@ var _default = {
|
|
|
124
108
|
mode = data.config.mode;
|
|
125
109
|
|
|
126
110
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
111
|
+
workflow = _useFlowContext.workflow,
|
|
127
112
|
nodes = _useFlowContext.nodes;
|
|
128
113
|
|
|
129
114
|
const branches = nodes.reduce((result, node) => {
|
|
@@ -169,7 +154,8 @@ var _default = {
|
|
|
169
154
|
}, _react().default.createElement(_antd().Button, {
|
|
170
155
|
shape: "circle",
|
|
171
156
|
icon: _react().default.createElement(_icons().PlusOutlined, null),
|
|
172
|
-
onClick: () => setBranchCount(branchCount - 1)
|
|
157
|
+
onClick: () => setBranchCount(branchCount - 1),
|
|
158
|
+
disabled: workflow.executed
|
|
173
159
|
})) : null
|
|
174
160
|
}))), _react().default.createElement("div", {
|
|
175
161
|
className: (0, _css().css)`
|
|
@@ -177,7 +163,10 @@ var _default = {
|
|
|
177
163
|
height: 2em;
|
|
178
164
|
`
|
|
179
165
|
}, _react().default.createElement(_antd().Tooltip, {
|
|
180
|
-
title: (0, _locale.lang)('Add branch')
|
|
166
|
+
title: (0, _locale.lang)('Add branch'),
|
|
167
|
+
className: (0, _css().css)`
|
|
168
|
+
visibility: ${workflow.executed ? 'hidden' : 'visible'}
|
|
169
|
+
`
|
|
181
170
|
}, _react().default.createElement(_antd().Button, {
|
|
182
171
|
icon: _react().default.createElement(_icons().PlusOutlined, null),
|
|
183
172
|
className: (0, _css().css)`
|
|
@@ -189,9 +178,13 @@ var _default = {
|
|
|
189
178
|
transform: rotate(-45deg);
|
|
190
179
|
}
|
|
191
180
|
`,
|
|
192
|
-
onClick: () => setBranchCount(branchCount + 1)
|
|
181
|
+
onClick: () => setBranchCount(branchCount + 1),
|
|
182
|
+
disabled: workflow.executed
|
|
193
183
|
})))));
|
|
194
|
-
}
|
|
184
|
+
},
|
|
195
185
|
|
|
186
|
+
components: {
|
|
187
|
+
RadioWithTooltip: _RadioWithTooltip.RadioWithTooltip
|
|
188
|
+
}
|
|
196
189
|
};
|
|
197
190
|
exports.default = _default;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useCollectionDataSource } from '@nocobase/client';
|
|
2
|
-
import {
|
|
1
|
+
import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
|
|
2
|
+
import { CollectionFieldInitializers } from '../components/CollectionFieldInitializers';
|
|
3
|
+
import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
6
|
type: string;
|
|
6
7
|
group: string;
|
|
7
8
|
fieldset: {
|
|
8
|
-
|
|
9
|
+
collection: {
|
|
9
10
|
type: string;
|
|
10
11
|
title: string;
|
|
11
|
-
name: string;
|
|
12
12
|
required: boolean;
|
|
13
13
|
'x-reactions': string[];
|
|
14
14
|
'x-decorator': string;
|
|
@@ -17,26 +17,14 @@ declare const _default: {
|
|
|
17
17
|
placeholder: string;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
params: {
|
|
21
21
|
type: string;
|
|
22
22
|
title: string;
|
|
23
|
-
name: string;
|
|
24
|
-
'x-decorator': string;
|
|
25
|
-
'x-component': string;
|
|
26
|
-
'x-component-props': {
|
|
27
|
-
disabled: boolean;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
'config.params': {
|
|
31
|
-
type: string;
|
|
32
|
-
name: string;
|
|
33
|
-
title: string;
|
|
34
23
|
'x-decorator': string;
|
|
35
24
|
properties: {
|
|
36
25
|
filter: {
|
|
37
26
|
type: string;
|
|
38
27
|
title: string;
|
|
39
|
-
name: string;
|
|
40
28
|
'x-decorator': string;
|
|
41
29
|
'x-decorator-props': {
|
|
42
30
|
labelAlign: string;
|
|
@@ -59,8 +47,12 @@ declare const _default: {
|
|
|
59
47
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
60
48
|
};
|
|
61
49
|
components: {
|
|
62
|
-
|
|
50
|
+
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
51
|
+
};
|
|
52
|
+
getOptions(config: any, types: any): any;
|
|
53
|
+
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
54
|
+
initializers: {
|
|
55
|
+
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
63
56
|
};
|
|
64
|
-
getter(props: any): JSX.Element;
|
|
65
57
|
};
|
|
66
58
|
export default _default;
|
|
@@ -5,16 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function _react() {
|
|
9
|
-
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
_react = function _react() {
|
|
12
|
-
return data;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
8
|
function _client() {
|
|
19
9
|
const data = require("@nocobase/client");
|
|
20
10
|
|
|
@@ -25,37 +15,36 @@ function _client() {
|
|
|
25
15
|
return data;
|
|
26
16
|
}
|
|
27
17
|
|
|
28
|
-
var
|
|
18
|
+
var _collection = require("../schemas/collection");
|
|
29
19
|
|
|
30
|
-
var
|
|
20
|
+
var _locale = require("../locale");
|
|
31
21
|
|
|
32
|
-
var
|
|
22
|
+
var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
|
|
33
23
|
|
|
34
|
-
var
|
|
24
|
+
var _CollectionFieldInitializers = require("../components/CollectionFieldInitializers");
|
|
35
25
|
|
|
36
|
-
var
|
|
26
|
+
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
37
27
|
|
|
38
|
-
|
|
28
|
+
var _variable = require("../variable");
|
|
39
29
|
|
|
40
30
|
var _default = {
|
|
41
31
|
title: `{{t("Query record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
42
32
|
type: 'query',
|
|
43
33
|
group: 'collection',
|
|
44
34
|
fieldset: {
|
|
45
|
-
|
|
46
|
-
'config.multiple': {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
35
|
+
collection: _collection.collection,
|
|
36
|
+
// 'config.multiple': {
|
|
37
|
+
// type: 'boolean',
|
|
38
|
+
// title: `{{t("Multiple records", { ns: "${NAMESPACE}" })}}`,
|
|
39
|
+
// name: 'config.multiple',
|
|
40
|
+
// 'x-decorator': 'FormItem',
|
|
41
|
+
// 'x-component': 'Checkbox',
|
|
42
|
+
// 'x-component-props': {
|
|
43
|
+
// disabled: true
|
|
44
|
+
// }
|
|
45
|
+
// },
|
|
46
|
+
params: {
|
|
57
47
|
type: 'object',
|
|
58
|
-
name: 'config.params',
|
|
59
48
|
title: '',
|
|
60
49
|
'x-decorator': 'FormItem',
|
|
61
50
|
properties: {
|
|
@@ -68,30 +57,34 @@ var _default = {
|
|
|
68
57
|
useCollectionDataSource: _client().useCollectionDataSource
|
|
69
58
|
},
|
|
70
59
|
components: {
|
|
71
|
-
|
|
60
|
+
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent
|
|
72
61
|
},
|
|
73
62
|
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
getOptions(config, types) {
|
|
64
|
+
return (0, _variable.useCollectionFieldOptions)({
|
|
65
|
+
collection: config.collection,
|
|
66
|
+
types
|
|
67
|
+
});
|
|
68
|
+
},
|
|
76
69
|
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
useInitializers(node) {
|
|
71
|
+
var _node$title;
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
if (!node.config.collection) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
return {
|
|
78
|
+
type: 'item',
|
|
79
|
+
title: (_node$title = node.title) !== null && _node$title !== void 0 ? _node$title : `#${node.id}`,
|
|
80
|
+
component: _CollectionBlockInitializer.CollectionBlockInitializer,
|
|
81
|
+
collection: node.config.collection,
|
|
82
|
+
dataSource: `{{$jobsMapByNodeId.${node.id}}}`
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
collection: config.collection,
|
|
89
|
-
value: value,
|
|
90
|
-
onChange: path => {
|
|
91
|
-
_onChange(`{{$jobsMapByNodeId.${options.nodeId}.${path}}}`);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
86
|
+
initializers: {
|
|
87
|
+
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
94
88
|
}
|
|
95
|
-
|
|
96
89
|
};
|
|
97
90
|
exports.default = _default;
|