@nocobase/plugin-workflow 0.9.1-alpha.1 → 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/lib/client/AddButton.js +40 -29
- package/lib/client/WorkflowCanvas.js +1 -2
- package/lib/client/components/CollectionFieldset.js +4 -8
- package/lib/client/nodes/calculation.d.ts +2 -4
- package/lib/client/nodes/calculation.js +6 -12
- package/lib/client/nodes/condition.d.ts +4 -8
- package/lib/client/nodes/condition.js +9 -17
- package/lib/client/nodes/create.d.ts +2 -4
- package/lib/client/nodes/create.js +2 -10
- package/lib/client/nodes/delay.d.ts +2 -4
- package/lib/client/nodes/delay.js +2 -4
- package/lib/client/nodes/destroy.d.ts +2 -5
- package/lib/client/nodes/destroy.js +2 -3
- package/lib/client/nodes/index.js +172 -111
- package/lib/client/nodes/manual/AssigneesSelect.js +2 -1
- package/lib/client/nodes/manual/index.d.ts +3 -5
- package/lib/client/nodes/manual/index.js +4 -13
- package/lib/client/nodes/parallel.d.ts +1 -2
- package/lib/client/nodes/parallel.js +10 -5
- package/lib/client/nodes/query.d.ts +2 -5
- package/lib/client/nodes/query.js +2 -3
- package/lib/client/nodes/request.d.ts +7 -14
- package/lib/client/nodes/request.js +8 -15
- package/lib/client/nodes/update.d.ts +31 -27
- package/lib/client/nodes/update.js +12 -5
- package/lib/client/schemas/collection.d.ts +0 -3
- package/lib/client/schemas/collection.js +1 -6
- package/lib/client/style.js +51 -5
- package/lib/client/triggers/collection.d.ts +37 -12
- package/lib/client/triggers/collection.js +77 -46
- package/lib/client/triggers/index.d.ts +1 -1
- package/lib/client/triggers/index.js +149 -78
- 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 +0 -1
- package/lib/client/triggers/schedule/index.js +1 -2
- package/package.json +10 -10
|
@@ -6,6 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.triggers = exports.TriggerConfig = void 0;
|
|
7
7
|
exports.useTrigger = useTrigger;
|
|
8
8
|
|
|
9
|
+
function _react() {
|
|
10
|
+
const data = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
_react = function _react() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
function _css() {
|
|
10
20
|
const data = require("@emotion/css");
|
|
11
21
|
|
|
@@ -16,10 +26,10 @@ function _css() {
|
|
|
16
26
|
return data;
|
|
17
27
|
}
|
|
18
28
|
|
|
19
|
-
function
|
|
29
|
+
function _react2() {
|
|
20
30
|
const data = require("@formily/react");
|
|
21
31
|
|
|
22
|
-
|
|
32
|
+
_react2 = function _react2() {
|
|
23
33
|
return data;
|
|
24
34
|
};
|
|
25
35
|
|
|
@@ -46,26 +56,6 @@ function _antd() {
|
|
|
46
56
|
return data;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
function _react2() {
|
|
50
|
-
const data = _interopRequireDefault(require("react"));
|
|
51
|
-
|
|
52
|
-
_react2 = function _react2() {
|
|
53
|
-
return data;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return data;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function _reactI18next() {
|
|
60
|
-
const data = require("react-i18next");
|
|
61
|
-
|
|
62
|
-
_reactI18next = function _reactI18next() {
|
|
63
|
-
return data;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return data;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
59
|
function _icons() {
|
|
70
60
|
const data = require("@ant-design/icons");
|
|
71
61
|
|
|
@@ -98,12 +88,28 @@ var _locale = require("../locale");
|
|
|
98
88
|
|
|
99
89
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
100
90
|
|
|
91
|
+
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); }
|
|
92
|
+
|
|
93
|
+
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; }
|
|
94
|
+
|
|
101
95
|
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; }
|
|
102
96
|
|
|
103
97
|
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; }
|
|
104
98
|
|
|
105
99
|
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; }
|
|
106
100
|
|
|
101
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
102
|
+
|
|
103
|
+
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."); }
|
|
104
|
+
|
|
105
|
+
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); }
|
|
106
|
+
|
|
107
|
+
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; }
|
|
108
|
+
|
|
109
|
+
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; }
|
|
110
|
+
|
|
111
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
112
|
+
|
|
107
113
|
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); } }
|
|
108
114
|
|
|
109
115
|
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); }); }; }
|
|
@@ -111,10 +117,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
111
117
|
function useUpdateConfigAction() {
|
|
112
118
|
var _useFlowContext;
|
|
113
119
|
|
|
114
|
-
const
|
|
115
|
-
t = _useTranslation.t;
|
|
116
|
-
|
|
117
|
-
const form = (0, _react().useForm)();
|
|
120
|
+
const form = (0, _react2().useForm)();
|
|
118
121
|
const api = (0, _client2().useAPIClient)();
|
|
119
122
|
|
|
120
123
|
const _ref = (_useFlowContext = (0, _FlowContext.useFlowContext)()) !== null && _useFlowContext !== void 0 ? _useFlowContext : {},
|
|
@@ -131,7 +134,7 @@ function useUpdateConfigAction() {
|
|
|
131
134
|
var _api$resource$update, _api$resource;
|
|
132
135
|
|
|
133
136
|
if (workflow.executed) {
|
|
134
|
-
_antd().message.error(
|
|
137
|
+
_antd().message.error((0, _locale.lang)('Trigger in executed workflow cannot be modified'));
|
|
135
138
|
|
|
136
139
|
return;
|
|
137
140
|
}
|
|
@@ -139,7 +142,9 @@ function useUpdateConfigAction() {
|
|
|
139
142
|
yield form.submit();
|
|
140
143
|
yield (_api$resource$update = (_api$resource = api.resource('workflows')).update) === null || _api$resource$update === void 0 ? void 0 : _api$resource$update.call(_api$resource, {
|
|
141
144
|
filterByTk: workflow.id,
|
|
142
|
-
values:
|
|
145
|
+
values: {
|
|
146
|
+
config: form.values
|
|
147
|
+
}
|
|
143
148
|
});
|
|
144
149
|
ctx.setVisible(false);
|
|
145
150
|
refresh();
|
|
@@ -168,13 +173,13 @@ function TriggerExecution() {
|
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
const trigger = triggers.get(workflow.type);
|
|
171
|
-
return
|
|
176
|
+
return _react().default.createElement(_client2().SchemaComponent, {
|
|
172
177
|
schema: {
|
|
173
178
|
type: 'void',
|
|
174
179
|
name: 'execution',
|
|
175
180
|
'x-component': 'Action',
|
|
176
181
|
'x-component-props': {
|
|
177
|
-
title:
|
|
182
|
+
title: _react().default.createElement(_icons().InfoOutlined, null),
|
|
178
183
|
shape: 'circle',
|
|
179
184
|
className: 'workflow-node-job-button',
|
|
180
185
|
type: 'primary'
|
|
@@ -187,9 +192,9 @@ function TriggerExecution() {
|
|
|
187
192
|
initialValue: execution
|
|
188
193
|
},
|
|
189
194
|
'x-component': 'Action.Modal',
|
|
190
|
-
title:
|
|
195
|
+
title: _react().default.createElement("div", {
|
|
191
196
|
className: (0, _css().cx)(_style.nodeTitleClass)
|
|
192
|
-
},
|
|
197
|
+
}, _react().default.createElement(_antd().Tag, null, compile(trigger.title)), _react().default.createElement("strong", null, workflow.title), _react().default.createElement("span", {
|
|
193
198
|
className: "workflow-node-id"
|
|
194
199
|
}, "#", execution.id)),
|
|
195
200
|
properties: {
|
|
@@ -224,45 +229,114 @@ function TriggerExecution() {
|
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
const TriggerConfig = () => {
|
|
227
|
-
const
|
|
228
|
-
t = _useTranslation2.t;
|
|
229
|
-
|
|
232
|
+
const api = (0, _client2().useAPIClient)();
|
|
230
233
|
const compile = (0, _client2().useCompile)();
|
|
231
234
|
|
|
232
235
|
const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
|
|
233
|
-
workflow = _useFlowContext3.workflow
|
|
236
|
+
workflow = _useFlowContext3.workflow,
|
|
237
|
+
refresh = _useFlowContext3.refresh;
|
|
234
238
|
|
|
235
239
|
if (!workflow || !workflow.type) {
|
|
236
240
|
return null;
|
|
237
241
|
}
|
|
238
242
|
|
|
239
|
-
const
|
|
243
|
+
const title = workflow.title,
|
|
244
|
+
type = workflow.type,
|
|
240
245
|
config = workflow.config,
|
|
241
246
|
executed = workflow.executed;
|
|
242
247
|
|
|
243
248
|
const _triggers$get = triggers.get(type),
|
|
244
|
-
|
|
249
|
+
typeTitle = _triggers$get.title,
|
|
245
250
|
fieldset = _triggers$get.fieldset,
|
|
246
251
|
scope = _triggers$get.scope,
|
|
247
252
|
components = _triggers$get.components;
|
|
248
253
|
|
|
249
254
|
const detailText = executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
|
250
|
-
const titleText = `${(0, _locale.lang)('Trigger')}: ${compile(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
const titleText = `${(0, _locale.lang)('Trigger')}: ${compile(typeTitle)}`;
|
|
256
|
+
|
|
257
|
+
const _useState = (0, _react().useState)(title !== null && title !== void 0 ? title : typeTitle),
|
|
258
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
259
|
+
editingTitle = _useState2[0],
|
|
260
|
+
setEditingTitle = _useState2[1];
|
|
261
|
+
|
|
262
|
+
const _useState3 = (0, _react().useState)(false),
|
|
263
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
264
|
+
editingConfig = _useState4[0],
|
|
265
|
+
setEditingConfig = _useState4[1];
|
|
266
|
+
|
|
267
|
+
function onChangeTitle(_x) {
|
|
268
|
+
return _onChangeTitle.apply(this, arguments);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function _onChangeTitle() {
|
|
272
|
+
_onChangeTitle = _asyncToGenerator(function* (next) {
|
|
273
|
+
var _api$resource$update2, _api$resource2;
|
|
274
|
+
|
|
275
|
+
const t = next || typeTitle;
|
|
276
|
+
setEditingTitle(t);
|
|
277
|
+
|
|
278
|
+
if (t === title) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
yield (_api$resource$update2 = (_api$resource2 = api.resource('workflows')).update) === null || _api$resource$update2 === void 0 ? void 0 : _api$resource$update2.call(_api$resource2, {
|
|
283
|
+
filterByTk: workflow.id,
|
|
284
|
+
values: {
|
|
285
|
+
title: t
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
refresh();
|
|
289
|
+
});
|
|
290
|
+
return _onChangeTitle.apply(this, arguments);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function onOpenDrawer(ev) {
|
|
294
|
+
if (ev.target === ev.currentTarget) {
|
|
295
|
+
setEditingConfig(true);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const whiteSet = new Set(['workflow-node-meta', 'workflow-node-config-button', 'ant-input-disabled']);
|
|
300
|
+
|
|
301
|
+
for (let el = ev.target; el && el !== ev.currentTarget; el = el.parentNode) {
|
|
302
|
+
if (Array.from(el.classList).some(name => whiteSet.has(name))) {
|
|
303
|
+
setEditingConfig(true);
|
|
304
|
+
ev.stopPropagation();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return _react().default.createElement("div", {
|
|
311
|
+
className: (0, _css().cx)(_style.nodeCardClass),
|
|
312
|
+
onClick: onOpenDrawer
|
|
313
|
+
}, _react().default.createElement("div", {
|
|
314
|
+
className: (0, _css().cx)(_style.nodeMetaClass, 'workflow-node-meta')
|
|
315
|
+
}, _react().default.createElement(_antd().Tag, {
|
|
258
316
|
color: "gold"
|
|
259
|
-
},
|
|
317
|
+
}, titleText)), _react().default.createElement("div", null, _react().default.createElement(_antd().Input.TextArea, {
|
|
318
|
+
value: editingTitle,
|
|
319
|
+
onChange: ev => setEditingTitle(ev.target.value),
|
|
320
|
+
onBlur: ev => onChangeTitle(ev.target.value),
|
|
321
|
+
autoSize: true
|
|
322
|
+
})), _react().default.createElement(TriggerExecution, null), _react().default.createElement(_client2().ActionContext.Provider, {
|
|
323
|
+
value: {
|
|
324
|
+
visible: editingConfig,
|
|
325
|
+
setVisible: setEditingConfig
|
|
326
|
+
}
|
|
327
|
+
}, _react().default.createElement(_client2().SchemaComponent, {
|
|
260
328
|
schema: {
|
|
261
329
|
type: 'void',
|
|
262
|
-
title: detailText,
|
|
263
|
-
'x-component': 'Action.Link',
|
|
264
|
-
name: 'drawer',
|
|
265
330
|
properties: {
|
|
331
|
+
config: {
|
|
332
|
+
type: 'void',
|
|
333
|
+
'x-content': detailText,
|
|
334
|
+
'x-component': _antd().Button,
|
|
335
|
+
'x-component-props': {
|
|
336
|
+
type: 'link',
|
|
337
|
+
className: 'workflow-node-config-button'
|
|
338
|
+
}
|
|
339
|
+
},
|
|
266
340
|
drawer: {
|
|
267
341
|
type: 'void',
|
|
268
342
|
title: titleText,
|
|
@@ -273,41 +347,38 @@ const TriggerConfig = () => {
|
|
|
273
347
|
|
|
274
348
|
useValues(options) {
|
|
275
349
|
return (0, _client2().useRequest)(() => Promise.resolve({
|
|
276
|
-
data:
|
|
277
|
-
config
|
|
278
|
-
}
|
|
350
|
+
data: config
|
|
279
351
|
}), options);
|
|
280
352
|
}
|
|
281
353
|
|
|
282
354
|
},
|
|
283
|
-
properties: {
|
|
284
|
-
|
|
355
|
+
properties: _objectSpread(_objectSpread({}, executed ? {
|
|
356
|
+
alert: {
|
|
357
|
+
'x-component': _antd().Alert,
|
|
358
|
+
'x-component-props': {
|
|
359
|
+
type: 'warning',
|
|
360
|
+
showIcon: true,
|
|
361
|
+
message: `{{t("Trigger in executed workflow cannot be modified", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
362
|
+
className: (0, _css().css)`
|
|
363
|
+
width: 100%;
|
|
364
|
+
font-size: 85%;
|
|
365
|
+
margin-bottom: 2em;
|
|
366
|
+
`
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
} : {}), {}, {
|
|
370
|
+
fieldset: {
|
|
285
371
|
type: 'void',
|
|
286
|
-
name: 'config',
|
|
287
372
|
'x-component': 'fieldset',
|
|
288
373
|
'x-component-props': {
|
|
289
374
|
className: (0, _css().css)`
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
375
|
+
.ant-select{
|
|
376
|
+
width: auto;
|
|
377
|
+
min-width: 6em;
|
|
378
|
+
}
|
|
379
|
+
`
|
|
295
380
|
},
|
|
296
|
-
properties:
|
|
297
|
-
alert: {
|
|
298
|
-
'x-component': _antd().Alert,
|
|
299
|
-
'x-component-props': {
|
|
300
|
-
type: 'warning',
|
|
301
|
-
showIcon: true,
|
|
302
|
-
message: `{{t("Trigger in executed workflow cannot be modified", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
303
|
-
className: (0, _css().css)`
|
|
304
|
-
width: 100%;
|
|
305
|
-
font-size: 85%;
|
|
306
|
-
margin-bottom: 2em;
|
|
307
|
-
`
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
} : {}), fieldset)
|
|
381
|
+
properties: fieldset
|
|
311
382
|
},
|
|
312
383
|
actions: executed ? null : {
|
|
313
384
|
type: 'void',
|
|
@@ -330,13 +401,13 @@ const TriggerConfig = () => {
|
|
|
330
401
|
}
|
|
331
402
|
}
|
|
332
403
|
}
|
|
333
|
-
}
|
|
404
|
+
})
|
|
334
405
|
}
|
|
335
406
|
}
|
|
336
407
|
},
|
|
337
408
|
scope: scope,
|
|
338
409
|
components: components
|
|
339
|
-
}));
|
|
410
|
+
})));
|
|
340
411
|
};
|
|
341
412
|
|
|
342
413
|
exports.TriggerConfig = TriggerConfig;
|
|
@@ -64,8 +64,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
64
64
|
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; }
|
|
65
65
|
|
|
66
66
|
const DateFieldsSelect = (0, _react2().observer)(props => {
|
|
67
|
-
var _values$config;
|
|
68
|
-
|
|
69
67
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
70
68
|
t = _useTranslation.t;
|
|
71
69
|
|
|
@@ -77,7 +75,7 @@ const DateFieldsSelect = (0, _react2().observer)(props => {
|
|
|
77
75
|
const _useForm = (0, _react2().useForm)(),
|
|
78
76
|
values = _useForm.values;
|
|
79
77
|
|
|
80
|
-
const fields = getCollectionFields(values === null || values === void 0 ? void 0 :
|
|
78
|
+
const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
|
|
81
79
|
return _react().default.createElement(_antd().Select, _objectSpread({
|
|
82
80
|
placeholder: t('Select Field')
|
|
83
81
|
}, props), fields.filter(field => !field.hidden && (field.uiSchema ? field.type === 'date' : false)).map(field => {
|
|
@@ -109,14 +109,14 @@ const ModeFieldsets = {
|
|
|
109
109
|
'x-decorator': 'FormItem',
|
|
110
110
|
'x-component': 'RepeatField',
|
|
111
111
|
'x-reactions': [{
|
|
112
|
-
target: '
|
|
112
|
+
target: 'endsOn',
|
|
113
113
|
fulfill: {
|
|
114
114
|
state: {
|
|
115
115
|
visible: '{{!!$self.value}}'
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}, {
|
|
119
|
-
target: '
|
|
119
|
+
target: 'limit',
|
|
120
120
|
fulfill: {
|
|
121
121
|
state: {
|
|
122
122
|
visible: '{{!!$self.value}}'
|
|
@@ -150,7 +150,7 @@ const ModeFieldsets = {
|
|
|
150
150
|
collection: _objectSpread(_objectSpread({}, _collection.collection), {}, {
|
|
151
151
|
'x-reactions': [..._collection.collection['x-reactions'], {
|
|
152
152
|
// only full path works
|
|
153
|
-
target: '
|
|
153
|
+
target: 'startsOn',
|
|
154
154
|
fulfill: {
|
|
155
155
|
state: {
|
|
156
156
|
visible: '{{!!$self.value}}'
|
|
@@ -164,7 +164,7 @@ const ModeFieldsets = {
|
|
|
164
164
|
'x-decorator': 'FormItem',
|
|
165
165
|
'x-component': 'OnField',
|
|
166
166
|
'x-reactions': [{
|
|
167
|
-
target: '
|
|
167
|
+
target: 'repeat',
|
|
168
168
|
fulfill: {
|
|
169
169
|
state: {
|
|
170
170
|
visible: '{{!!$self.value}}'
|
|
@@ -180,14 +180,14 @@ const ModeFieldsets = {
|
|
|
180
180
|
'x-decorator': 'FormItem',
|
|
181
181
|
'x-component': 'RepeatField',
|
|
182
182
|
'x-reactions': [{
|
|
183
|
-
target: '
|
|
183
|
+
target: 'endsOn',
|
|
184
184
|
fulfill: {
|
|
185
185
|
state: {
|
|
186
186
|
visible: '{{!!$self.value}}'
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}, {
|
|
190
|
-
target: '
|
|
190
|
+
target: 'limit',
|
|
191
191
|
fulfill: {
|
|
192
192
|
state: {
|
|
193
193
|
visible: '{{!!$self.value}}'
|
|
@@ -228,22 +228,19 @@ const ScheduleConfig = () => {
|
|
|
228
228
|
values = _useForm$values === void 0 ? {} : _useForm$values,
|
|
229
229
|
clearFormGraph = _useForm.clearFormGraph;
|
|
230
230
|
|
|
231
|
-
const
|
|
232
|
-
config = _values$config === void 0 ? {} : _values$config;
|
|
233
|
-
|
|
234
|
-
const _useState = (0, _react().useState)(config.mode),
|
|
231
|
+
const _useState = (0, _react().useState)(values.mode),
|
|
235
232
|
_useState2 = _slicedToArray(_useState, 2),
|
|
236
233
|
mode = _useState2[0],
|
|
237
234
|
setMode = _useState2[1];
|
|
238
235
|
|
|
239
236
|
(0, _react2().useFormEffects)(() => {
|
|
240
|
-
(0, _core().onFieldValueChange)('
|
|
237
|
+
(0, _core().onFieldValueChange)('mode', field => {
|
|
241
238
|
setMode(field.value);
|
|
242
|
-
clearFormGraph('
|
|
243
|
-
clearFormGraph('
|
|
244
|
-
clearFormGraph('
|
|
245
|
-
clearFormGraph('
|
|
246
|
-
clearFormGraph('
|
|
239
|
+
clearFormGraph('collection');
|
|
240
|
+
clearFormGraph('startsOn');
|
|
241
|
+
clearFormGraph('repeat');
|
|
242
|
+
clearFormGraph('endsOn');
|
|
243
|
+
clearFormGraph('limit');
|
|
247
244
|
});
|
|
248
245
|
});
|
|
249
246
|
return _react().default.createElement(_react().default.Fragment, null, _react().default.createElement(_client().SchemaComponent, {
|
|
@@ -256,7 +253,8 @@ const ScheduleConfig = () => {
|
|
|
256
253
|
'x-component-props': {
|
|
257
254
|
options: scheduleModeOptions
|
|
258
255
|
},
|
|
259
|
-
required: true
|
|
256
|
+
required: true,
|
|
257
|
+
default: _constants.SCHEDULE_MODE.STATIC
|
|
260
258
|
}
|
|
261
259
|
}), _react().default.createElement(_client().SchemaComponent, {
|
|
262
260
|
schema: {
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow",
|
|
3
|
-
"version": "0.9.1-alpha.
|
|
3
|
+
"version": "0.9.1-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "0.9.1-alpha.
|
|
10
|
-
"@nocobase/client": "0.9.1-alpha.
|
|
11
|
-
"@nocobase/database": "0.9.1-alpha.
|
|
12
|
-
"@nocobase/evaluators": "0.9.1-alpha.
|
|
13
|
-
"@nocobase/resourcer": "0.9.1-alpha.
|
|
14
|
-
"@nocobase/server": "0.9.1-alpha.
|
|
15
|
-
"@nocobase/utils": "0.9.1-alpha.
|
|
9
|
+
"@nocobase/actions": "0.9.1-alpha.2",
|
|
10
|
+
"@nocobase/client": "0.9.1-alpha.2",
|
|
11
|
+
"@nocobase/database": "0.9.1-alpha.2",
|
|
12
|
+
"@nocobase/evaluators": "0.9.1-alpha.2",
|
|
13
|
+
"@nocobase/resourcer": "0.9.1-alpha.2",
|
|
14
|
+
"@nocobase/server": "0.9.1-alpha.2",
|
|
15
|
+
"@nocobase/utils": "0.9.1-alpha.2",
|
|
16
16
|
"antd": "4.22.8",
|
|
17
17
|
"axios": "^0.27.2",
|
|
18
18
|
"classnames": "^2.3.1",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"react-js-cron": "^1.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@nocobase/test": "0.9.1-alpha.
|
|
25
|
+
"@nocobase/test": "0.9.1-alpha.2",
|
|
26
26
|
"@types/ejs": "^3.1.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d588a68eca4feed4642a4cb317301011266fe5c9"
|
|
29
29
|
}
|