@nocobase/plugin-workflow 0.9.1-alpha.1 → 0.9.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client/AddButton.js +50 -86
- package/lib/client/Branch.js +0 -13
- package/lib/client/ExecutionCanvas.js +16 -63
- package/lib/client/ExecutionLink.js +3 -21
- package/lib/client/ExecutionPage.js +1 -19
- package/lib/client/ExecutionResourceProvider.js +6 -23
- package/lib/client/FlowContext.js +0 -8
- package/lib/client/WorkflowCanvas.js +57 -129
- package/lib/client/WorkflowLink.js +3 -21
- package/lib/client/WorkflowPage.js +1 -19
- package/lib/client/WorkflowProvider.js +24 -47
- package/lib/client/WorkflowShortcut.js +0 -16
- package/lib/client/components/CollectionBlockInitializer.js +12 -22
- package/lib/client/components/CollectionFieldInitializers.js +5 -24
- package/lib/client/components/CollectionFieldset.js +33 -85
- package/lib/client/components/Duration.js +0 -14
- package/lib/client/components/DynamicExpression.d.ts +4 -0
- package/lib/client/components/DynamicExpression.js +102 -0
- package/lib/client/components/FieldsSelect.d.ts +2 -0
- package/lib/client/components/FieldsSelect.js +66 -0
- package/lib/client/components/FilterDynamicComponent.js +1 -10
- package/lib/client/components/NullRender.js +0 -1
- package/lib/client/components/OpenDrawer.js +10 -35
- package/lib/client/components/RadioWithTooltip.js +5 -27
- package/lib/client/components/renderEngineReference.d.ts +1 -0
- package/lib/client/components/renderEngineReference.js +55 -0
- package/lib/client/constants.js +0 -9
- package/lib/client/index.js +0 -6
- package/lib/client/interfaces/expression.d.ts +3 -0
- package/lib/client/interfaces/expression.js +37 -0
- package/lib/client/locale/index.js +5 -15
- package/lib/client/locale/pt-BR.d.ts +130 -0
- package/lib/client/locale/pt-BR.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +16 -1
- package/lib/client/locale/zh-CN.js +17 -2
- package/lib/client/nodes/calculation.d.ts +56 -7
- package/lib/client/nodes/calculation.js +141 -74
- package/lib/client/nodes/condition.d.ts +5 -9
- package/lib/client/nodes/condition.js +30 -93
- package/lib/client/nodes/create.d.ts +36 -12
- package/lib/client/nodes/create.js +14 -28
- package/lib/client/nodes/delay.d.ts +3 -7
- package/lib/client/nodes/delay.js +5 -14
- package/lib/client/nodes/destroy.d.ts +3 -11
- package/lib/client/nodes/destroy.js +14 -12
- package/lib/client/nodes/index.d.ts +2 -2
- package/lib/client/nodes/index.js +181 -222
- package/lib/client/nodes/manual/AssigneesSelect.js +8 -18
- package/lib/client/nodes/manual/ModeConfig.js +0 -27
- package/lib/client/nodes/manual/SchemaConfig.js +87 -449
- package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
- package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
- package/lib/client/nodes/manual/forms/customForm.js +411 -0
- package/lib/client/nodes/manual/index.d.ts +15 -6
- package/lib/client/nodes/manual/index.js +58 -54
- package/lib/client/nodes/parallel.d.ts +1 -2
- package/lib/client/nodes/parallel.js +16 -45
- package/lib/client/nodes/query.d.ts +30 -12
- package/lib/client/nodes/query.js +17 -25
- package/lib/client/nodes/request.d.ts +9 -17
- package/lib/client/nodes/request.js +13 -37
- package/lib/client/nodes/update.d.ts +27 -28
- package/lib/client/nodes/update.js +17 -18
- package/lib/client/schemas/collection.d.ts +20 -7
- package/lib/client/schemas/collection.js +27 -28
- package/lib/client/schemas/executions.js +3 -18
- package/lib/client/schemas/workflows.js +10 -33
- package/lib/client/style.js +75 -26
- package/lib/client/triggers/collection.d.ts +47 -18
- package/lib/client/triggers/collection.js +65 -123
- package/lib/client/triggers/index.d.ts +3 -6
- package/lib/client/triggers/index.js +146 -146
- package/lib/client/triggers/schedule/DateFieldsSelect.js +7 -32
- package/lib/client/triggers/schedule/EndsByField.js +1 -18
- package/lib/client/triggers/schedule/OnField.js +10 -38
- package/lib/client/triggers/schedule/RepeatField.js +4 -32
- package/lib/client/triggers/schedule/ScheduleConfig.js +25 -68
- package/lib/client/triggers/schedule/index.d.ts +21 -1
- package/lib/client/triggers/schedule/index.js +22 -24
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +31 -10
- package/lib/client/variable.d.ts +7 -6
- package/lib/client/variable.js +132 -71
- package/lib/index.js +0 -2
- package/lib/server/Plugin.d.ts +7 -7
- package/lib/server/Plugin.js +76 -111
- package/lib/server/Processor.d.ts +2 -0
- package/lib/server/Processor.js +62 -125
- package/lib/server/actions/index.js +3 -10
- package/lib/server/actions/nodes.js +34 -87
- package/lib/server/actions/workflows.js +46 -96
- package/lib/server/collections/executions.js +1 -1
- package/lib/server/collections/flow_nodes.js +7 -4
- package/lib/server/collections/jobs.js +1 -1
- package/lib/server/collections/workflows.js +3 -4
- package/lib/server/fields/expression-field.d.ts +8 -0
- package/lib/server/fields/expression-field.js +26 -0
- package/lib/server/fields/index.d.ts +1 -0
- package/lib/server/fields/index.js +12 -0
- package/lib/server/functions/index.js +3 -14
- package/lib/server/index.js +0 -6
- package/lib/server/instructions/calculation.js +22 -17
- package/lib/server/instructions/condition.js +8 -52
- package/lib/server/instructions/create.js +31 -15
- package/lib/server/instructions/delay.js +4 -32
- package/lib/server/instructions/destroy.js +6 -12
- package/lib/server/instructions/index.js +6 -23
- package/lib/server/instructions/manual/actions.js +22 -31
- package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
- package/lib/server/instructions/manual/index.d.ts +13 -12
- package/lib/server/instructions/manual/index.js +9 -47
- package/lib/server/instructions/parallel.js +9 -36
- package/lib/server/instructions/query.js +17 -15
- package/lib/server/instructions/request.js +7 -30
- package/lib/server/instructions/update.js +8 -14
- package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
- package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
- package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
- package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
- package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
- package/lib/server/models/Execution.js +0 -5
- package/lib/server/models/FlowNode.js +0 -5
- package/lib/server/models/Job.js +0 -5
- package/lib/server/models/Workflow.js +0 -5
- package/lib/server/triggers/collection.js +39 -61
- package/lib/server/triggers/index.js +3 -22
- package/lib/server/triggers/schedule.js +72 -194
- package/package.json +14 -11
|
@@ -5,25 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FlowContext = void 0;
|
|
7
7
|
exports.useFlowContext = useFlowContext;
|
|
8
|
-
|
|
9
8
|
function _react() {
|
|
10
9
|
const data = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
10
|
_react = function _react() {
|
|
13
11
|
return data;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return data;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
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); }
|
|
20
|
-
|
|
21
16
|
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; }
|
|
22
|
-
|
|
23
17
|
const FlowContext = _react().default.createContext({});
|
|
24
|
-
|
|
25
18
|
exports.FlowContext = FlowContext;
|
|
26
|
-
|
|
27
19
|
function useFlowContext() {
|
|
28
20
|
return (0, _react().useContext)(FlowContext);
|
|
29
21
|
}
|
|
@@ -4,149 +4,98 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowCanvas = WorkflowCanvas;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireWildcard(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _reactRouterDom() {
|
|
19
15
|
const data = require("react-router-dom");
|
|
20
|
-
|
|
21
16
|
_reactRouterDom = function _reactRouterDom() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _antd() {
|
|
29
22
|
const data = require("antd");
|
|
30
|
-
|
|
31
23
|
_antd = function _antd() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _icons() {
|
|
39
29
|
const data = require("@ant-design/icons");
|
|
40
|
-
|
|
41
30
|
_icons = function _icons() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _css() {
|
|
49
36
|
const data = require("@emotion/css");
|
|
50
|
-
|
|
51
37
|
_css = function _css() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _classnames() {
|
|
59
43
|
const data = _interopRequireDefault(require("classnames"));
|
|
60
|
-
|
|
61
44
|
_classnames = function _classnames() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
function _reactI18next() {
|
|
69
50
|
const data = require("react-i18next");
|
|
70
|
-
|
|
71
51
|
_reactI18next = function _reactI18next() {
|
|
72
52
|
return data;
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
return data;
|
|
76
55
|
}
|
|
77
|
-
|
|
78
56
|
function _client() {
|
|
79
57
|
const data = require("@nocobase/client");
|
|
80
|
-
|
|
81
58
|
_client = function _client() {
|
|
82
59
|
return data;
|
|
83
60
|
};
|
|
84
|
-
|
|
85
61
|
return data;
|
|
86
62
|
}
|
|
87
|
-
|
|
88
63
|
var _FlowContext = require("./FlowContext");
|
|
89
|
-
|
|
90
64
|
var _style = require("./style");
|
|
91
|
-
|
|
92
65
|
var _triggers = require("./triggers");
|
|
93
|
-
|
|
94
66
|
var _Branch = require("./Branch");
|
|
95
|
-
|
|
96
67
|
var _executions = require("./schemas/executions");
|
|
97
|
-
|
|
98
68
|
var _ExecutionLink = require("./ExecutionLink");
|
|
99
|
-
|
|
100
69
|
var _locale = require("./locale");
|
|
101
|
-
|
|
102
70
|
var _utils = require("./utils");
|
|
103
|
-
|
|
104
71
|
const _excluded = ["request", "filter"],
|
|
105
|
-
|
|
106
|
-
|
|
72
|
+
_excluded2 = ["nodes", "revisions"];
|
|
107
73
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
108
|
-
|
|
109
74
|
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); }
|
|
110
|
-
|
|
111
75
|
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; }
|
|
112
|
-
|
|
113
76
|
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); } }
|
|
114
|
-
|
|
115
77
|
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); }); }; }
|
|
116
|
-
|
|
117
78
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
118
|
-
|
|
119
79
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
120
|
-
|
|
121
80
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
122
|
-
|
|
123
81
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
124
|
-
|
|
125
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
126
|
-
|
|
82
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
127
83
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
128
|
-
|
|
129
84
|
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; }
|
|
130
|
-
|
|
131
85
|
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; }
|
|
132
|
-
|
|
133
|
-
function
|
|
134
|
-
|
|
86
|
+
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; }
|
|
87
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
88
|
+
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); }
|
|
135
89
|
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; }
|
|
136
|
-
|
|
137
90
|
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; }
|
|
138
|
-
|
|
139
91
|
function ExecutionResourceProvider(_ref) {
|
|
140
92
|
var _request$params;
|
|
141
|
-
|
|
142
93
|
let request = _ref.request,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
94
|
+
_ref$filter = _ref.filter,
|
|
95
|
+
filter = _ref$filter === void 0 ? {} : _ref$filter,
|
|
96
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
147
97
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
148
|
-
|
|
149
|
-
|
|
98
|
+
workflow = _useFlowContext.workflow;
|
|
150
99
|
const props = _objectSpread(_objectSpread({}, others), {}, {
|
|
151
100
|
request: _objectSpread(_objectSpread({}, request), {}, {
|
|
152
101
|
params: _objectSpread(_objectSpread({}, request === null || request === void 0 ? void 0 : request.params), {}, {
|
|
@@ -156,57 +105,42 @@ function ExecutionResourceProvider(_ref) {
|
|
|
156
105
|
})
|
|
157
106
|
})
|
|
158
107
|
});
|
|
159
|
-
|
|
160
108
|
return _react().default.createElement(_client().ResourceActionProvider, _objectSpread({}, props));
|
|
161
109
|
}
|
|
162
|
-
|
|
163
110
|
function WorkflowCanvas() {
|
|
164
111
|
var _data$data2;
|
|
165
|
-
|
|
166
112
|
const history = (0, _reactRouterDom().useHistory)();
|
|
167
|
-
|
|
168
113
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
169
|
-
|
|
170
|
-
|
|
114
|
+
t = _useTranslation.t;
|
|
171
115
|
const _useResourceActionCon = (0, _client().useResourceActionContext)(),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
116
|
+
data = _useResourceActionCon.data,
|
|
117
|
+
refresh = _useResourceActionCon.refresh,
|
|
118
|
+
loading = _useResourceActionCon.loading;
|
|
176
119
|
const _useResourceContext = (0, _client().useResourceContext)(),
|
|
177
|
-
|
|
178
|
-
|
|
120
|
+
resource = _useResourceContext.resource;
|
|
179
121
|
const _useDocumentTitle = (0, _client().useDocumentTitle)(),
|
|
180
|
-
|
|
181
|
-
|
|
122
|
+
setTitle = _useDocumentTitle.setTitle;
|
|
182
123
|
const _useState = (0, _react().useState)(false),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
124
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
125
|
+
visible = _useState2[0],
|
|
126
|
+
setVisible = _useState2[1];
|
|
187
127
|
(0, _react().useEffect)(() => {
|
|
188
128
|
var _data$data;
|
|
189
|
-
|
|
190
129
|
const _ref2 = (_data$data = data === null || data === void 0 ? void 0 : data.data) !== null && _data$data !== void 0 ? _data$data : {},
|
|
191
|
-
|
|
192
|
-
|
|
130
|
+
title = _ref2.title;
|
|
193
131
|
setTitle === null || setTitle === void 0 ? void 0 : setTitle(`${(0, _locale.lang)('Workflow')}${title ? `: ${title}` : ''}`);
|
|
194
132
|
}, [data === null || data === void 0 ? void 0 : data.data]);
|
|
195
|
-
|
|
196
133
|
if (!(data === null || data === void 0 ? void 0 : data.data) && !loading) {
|
|
197
134
|
return _react().default.createElement("div", null, (0, _locale.lang)('Load failed'));
|
|
198
135
|
}
|
|
199
|
-
|
|
200
136
|
const _ref3 = (_data$data2 = data === null || data === void 0 ? void 0 : data.data) !== null && _data$data2 !== void 0 ? _data$data2 : {},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
137
|
+
_ref3$nodes = _ref3.nodes,
|
|
138
|
+
nodes = _ref3$nodes === void 0 ? [] : _ref3$nodes,
|
|
139
|
+
_ref3$revisions = _ref3.revisions,
|
|
140
|
+
revisions = _ref3$revisions === void 0 ? [] : _ref3$revisions,
|
|
141
|
+
workflow = _objectWithoutProperties(_ref3, _excluded2);
|
|
207
142
|
(0, _utils.linkNodes)(nodes);
|
|
208
143
|
const entry = nodes.find(item => !item.upstream);
|
|
209
|
-
|
|
210
144
|
function onSwitchVersion({
|
|
211
145
|
key
|
|
212
146
|
}) {
|
|
@@ -214,11 +148,9 @@ function WorkflowCanvas() {
|
|
|
214
148
|
history.push(key);
|
|
215
149
|
}
|
|
216
150
|
}
|
|
217
|
-
|
|
218
|
-
function onToggle(_x) {
|
|
151
|
+
function onToggle(_x2) {
|
|
219
152
|
return _onToggle.apply(this, arguments);
|
|
220
153
|
}
|
|
221
|
-
|
|
222
154
|
function _onToggle() {
|
|
223
155
|
_onToggle = _asyncToGenerator(function* (value) {
|
|
224
156
|
yield resource.update({
|
|
@@ -231,32 +163,26 @@ function WorkflowCanvas() {
|
|
|
231
163
|
});
|
|
232
164
|
return _onToggle.apply(this, arguments);
|
|
233
165
|
}
|
|
234
|
-
|
|
235
166
|
function onRevision() {
|
|
236
167
|
return _onRevision.apply(this, arguments);
|
|
237
168
|
}
|
|
238
|
-
|
|
239
169
|
function _onRevision() {
|
|
240
170
|
_onRevision = _asyncToGenerator(function* () {
|
|
241
171
|
const _yield$resource$revis = yield resource.revision({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
172
|
+
filterByTk: workflow.id,
|
|
173
|
+
filter: {
|
|
174
|
+
key: workflow.key
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
revision = _yield$resource$revis.data.data;
|
|
249
178
|
_antd().message.success(t('Operation succeeded'));
|
|
250
|
-
|
|
251
179
|
history.push(`${revision.id}`);
|
|
252
180
|
});
|
|
253
181
|
return _onRevision.apply(this, arguments);
|
|
254
182
|
}
|
|
255
|
-
|
|
256
|
-
function onMenuCommand(_x2) {
|
|
183
|
+
function onMenuCommand(_x3) {
|
|
257
184
|
return _onMenuCommand.apply(this, arguments);
|
|
258
185
|
}
|
|
259
|
-
|
|
260
186
|
function _onMenuCommand() {
|
|
261
187
|
_onMenuCommand = _asyncToGenerator(function* ({
|
|
262
188
|
key
|
|
@@ -265,24 +191,20 @@ function WorkflowCanvas() {
|
|
|
265
191
|
case 'history':
|
|
266
192
|
setVisible(true);
|
|
267
193
|
return;
|
|
268
|
-
|
|
269
194
|
case 'revision':
|
|
270
195
|
return onRevision();
|
|
271
|
-
|
|
272
196
|
default:
|
|
273
197
|
break;
|
|
274
198
|
}
|
|
275
199
|
});
|
|
276
200
|
return _onMenuCommand.apply(this, arguments);
|
|
277
201
|
}
|
|
278
|
-
|
|
279
202
|
const revisionable = workflow.executed && !revisions.find(item => !item.executed && new Date(item.createdAt) > new Date(workflow.createdAt));
|
|
280
203
|
return _react().default.createElement(_FlowContext.FlowContext.Provider, {
|
|
281
204
|
value: {
|
|
282
205
|
workflow,
|
|
283
206
|
nodes,
|
|
284
|
-
|
|
285
|
-
onNodeRemoved: refresh
|
|
207
|
+
refresh
|
|
286
208
|
}
|
|
287
209
|
}, _react().default.createElement("div", {
|
|
288
210
|
className: "workflow-toolbar"
|
|
@@ -295,16 +217,19 @@ function WorkflowCanvas() {
|
|
|
295
217
|
overlay: _react().default.createElement(_antd().Menu, {
|
|
296
218
|
onClick: onSwitchVersion,
|
|
297
219
|
defaultSelectedKeys: [`${workflow.id}`],
|
|
298
|
-
className: (0, _css().cx)(_style.workflowVersionDropdownClass)
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
220
|
+
className: (0, _css().cx)(_style.workflowVersionDropdownClass),
|
|
221
|
+
items: revisions.sort((a, b) => b.id - a.id).map((item, index) => ({
|
|
222
|
+
key: `${item.id}`,
|
|
223
|
+
icon: item.current ? _react().default.createElement(_icons().RightOutlined, null) : null,
|
|
224
|
+
label: _react().default.createElement("span", {
|
|
225
|
+
className: (0, _classnames().default)({
|
|
226
|
+
executed: item.executed,
|
|
227
|
+
unexecuted: !item.executed,
|
|
228
|
+
enabled: item.enabled
|
|
229
|
+
})
|
|
230
|
+
}, _react().default.createElement("strong", null, `#${item.id}`), _react().default.createElement("time", null, new Date(item.createdAt).toLocaleString()))
|
|
231
|
+
}))
|
|
232
|
+
})
|
|
308
233
|
}, _react().default.createElement(_antd().Button, {
|
|
309
234
|
type: "text"
|
|
310
235
|
}, _react().default.createElement("label", null, (0, _locale.lang)('Version')), _react().default.createElement("span", null, (workflow === null || workflow === void 0 ? void 0 : workflow.id) ? `#${workflow.id}` : null), _react().default.createElement(_icons().DownOutlined, null)))), _react().default.createElement(_antd().Switch, {
|
|
@@ -314,14 +239,17 @@ function WorkflowCanvas() {
|
|
|
314
239
|
unCheckedChildren: (0, _locale.lang)('Off')
|
|
315
240
|
}), _react().default.createElement(_antd().Dropdown, {
|
|
316
241
|
overlay: _react().default.createElement(_antd().Menu, {
|
|
242
|
+
items: [{
|
|
243
|
+
key: 'history',
|
|
244
|
+
label: (0, _locale.lang)('Execution history'),
|
|
245
|
+
disabled: !workflow.allExecuted
|
|
246
|
+
}, {
|
|
247
|
+
key: 'revision',
|
|
248
|
+
label: (0, _locale.lang)('Copy to new version'),
|
|
249
|
+
disabled: !revisionable
|
|
250
|
+
}],
|
|
317
251
|
onClick: onMenuCommand
|
|
318
|
-
}
|
|
319
|
-
key: "history",
|
|
320
|
-
disabled: !workflow.allExecuted
|
|
321
|
-
}, (0, _locale.lang)('Execution history')), _react().default.createElement(_antd().Menu.Item, {
|
|
322
|
-
key: "revision",
|
|
323
|
-
disabled: !revisionable
|
|
324
|
-
}, (0, _locale.lang)('Copy to new version')))
|
|
252
|
+
})
|
|
325
253
|
}, _react().default.createElement(_antd().Button, {
|
|
326
254
|
type: "text",
|
|
327
255
|
icon: _react().default.createElement(_icons().EllipsisOutlined, null)
|
|
@@ -343,7 +271,7 @@ function WorkflowCanvas() {
|
|
|
343
271
|
}, _react().default.createElement(_Branch.Branch, {
|
|
344
272
|
entry: entry
|
|
345
273
|
})), _react().default.createElement("div", {
|
|
346
|
-
className: (0, _css().cx)(_style.nodeCardClass)
|
|
274
|
+
className: (0, _css().cx)('end', _style.nodeCardClass)
|
|
347
275
|
}, _react().default.createElement("div", {
|
|
348
276
|
className: (0, _css().cx)(_style.nodeMetaClass)
|
|
349
277
|
}, _react().default.createElement(_antd().Tag, {
|
|
@@ -4,63 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowLink = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _reactI18next() {
|
|
19
15
|
const data = require("react-i18next");
|
|
20
|
-
|
|
21
16
|
_reactI18next = function _reactI18next() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _reactRouterDom() {
|
|
29
22
|
const data = require("react-router-dom");
|
|
30
|
-
|
|
31
23
|
_reactRouterDom = function _reactRouterDom() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _client() {
|
|
39
29
|
const data = require("@nocobase/client");
|
|
40
|
-
|
|
41
30
|
_client = function _client() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
-
|
|
50
36
|
const WorkflowLink = () => {
|
|
51
37
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
t = _useTranslation.t;
|
|
54
39
|
const _useRecord = (0, _client().useRecord)(),
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
id = _useRecord.id;
|
|
57
41
|
const _useActionContext = (0, _client().useActionContext)(),
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
setVisible = _useActionContext.setVisible;
|
|
60
43
|
return _react().default.createElement(_reactRouterDom().Link, {
|
|
61
44
|
to: `/admin/settings/workflow/workflows/${id}`,
|
|
62
45
|
onClick: () => setVisible(false)
|
|
63
46
|
}, t('View'));
|
|
64
47
|
};
|
|
65
|
-
|
|
66
48
|
exports.WorkflowLink = WorkflowLink;
|
|
@@ -4,57 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowPage = void 0;
|
|
7
|
-
|
|
8
7
|
function _css() {
|
|
9
8
|
const data = require("@emotion/css");
|
|
10
|
-
|
|
11
9
|
_css = function _css() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _react() {
|
|
19
15
|
const data = _interopRequireDefault(require("react"));
|
|
20
|
-
|
|
21
16
|
_react = function _react() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _reactRouterDom() {
|
|
29
22
|
const data = require("react-router-dom");
|
|
30
|
-
|
|
31
23
|
_reactRouterDom = function _reactRouterDom() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _client() {
|
|
39
29
|
const data = require("@nocobase/client");
|
|
40
|
-
|
|
41
30
|
_client = function _client() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _style = require("./style");
|
|
49
|
-
|
|
50
36
|
var _WorkflowCanvas = require("./WorkflowCanvas");
|
|
51
|
-
|
|
52
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
53
|
-
|
|
54
38
|
const WorkflowPage = () => {
|
|
55
39
|
const _useRouteMatch = (0, _reactRouterDom().useRouteMatch)(),
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
params = _useRouteMatch.params;
|
|
58
41
|
return _react().default.createElement("div", {
|
|
59
42
|
className: (0, _css().cx)(_style.workflowPageClass)
|
|
60
43
|
}, _react().default.createElement(_client().SchemaComponent, {
|
|
@@ -88,5 +71,4 @@ const WorkflowPage = () => {
|
|
|
88
71
|
}
|
|
89
72
|
}));
|
|
90
73
|
};
|
|
91
|
-
|
|
92
74
|
exports.WorkflowPage = WorkflowPage;
|