@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
|
@@ -34,9 +34,8 @@ var _default = {
|
|
|
34
34
|
type: 'request',
|
|
35
35
|
group: 'extended',
|
|
36
36
|
fieldset: {
|
|
37
|
-
|
|
37
|
+
method: {
|
|
38
38
|
type: 'string',
|
|
39
|
-
name: 'config.method',
|
|
40
39
|
required: true,
|
|
41
40
|
title: `{{t("HTTP method", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
42
41
|
'x-decorator': 'FormItem',
|
|
@@ -63,9 +62,8 @@ var _default = {
|
|
|
63
62
|
}],
|
|
64
63
|
default: 'POST'
|
|
65
64
|
},
|
|
66
|
-
|
|
65
|
+
url: {
|
|
67
66
|
type: 'string',
|
|
68
|
-
name: 'config.url',
|
|
69
67
|
required: true,
|
|
70
68
|
title: `{{t("URL", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
71
69
|
'x-decorator': 'FormItem',
|
|
@@ -84,9 +82,8 @@ var _default = {
|
|
|
84
82
|
placeholder: 'https://www.nocobase.com'
|
|
85
83
|
}
|
|
86
84
|
},
|
|
87
|
-
|
|
85
|
+
headers: {
|
|
88
86
|
type: 'array',
|
|
89
|
-
name: 'config.headers',
|
|
90
87
|
'x-component': 'ArrayItems',
|
|
91
88
|
'x-decorator': 'FormItem',
|
|
92
89
|
title: `{{t("Headers", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -131,9 +128,8 @@ var _default = {
|
|
|
131
128
|
}
|
|
132
129
|
}
|
|
133
130
|
},
|
|
134
|
-
|
|
131
|
+
params: {
|
|
135
132
|
type: 'array',
|
|
136
|
-
name: 'config.params',
|
|
137
133
|
'x-component': 'ArrayItems',
|
|
138
134
|
'x-decorator': 'FormItem',
|
|
139
135
|
title: `{{t("Parameters", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -177,9 +173,8 @@ var _default = {
|
|
|
177
173
|
}
|
|
178
174
|
}
|
|
179
175
|
},
|
|
180
|
-
|
|
176
|
+
data: {
|
|
181
177
|
type: 'string',
|
|
182
|
-
name: 'config.data',
|
|
183
178
|
title: `{{t("Body", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
184
179
|
'x-decorator': 'FormItem',
|
|
185
180
|
'x-decorator-props': {},
|
|
@@ -191,15 +186,14 @@ var _default = {
|
|
|
191
186
|
},
|
|
192
187
|
placeholder: `{{t("Input request data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
193
188
|
className: (0, _css().css)`
|
|
194
|
-
font-size:
|
|
189
|
+
font-size: 90%;
|
|
195
190
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
196
191
|
`
|
|
197
192
|
},
|
|
198
193
|
description: `{{t("Only support standard JSON data", { ns: "${_locale.NAMESPACE}" })}}`
|
|
199
194
|
},
|
|
200
|
-
|
|
195
|
+
timeout: {
|
|
201
196
|
type: 'number',
|
|
202
|
-
name: 'config.timeout',
|
|
203
197
|
title: `{{t("Timeout config", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
204
198
|
'x-decorator': 'FormItem',
|
|
205
199
|
'x-decorator-props': {},
|
|
@@ -211,9 +205,8 @@ var _default = {
|
|
|
211
205
|
defaultValue: 5000
|
|
212
206
|
}
|
|
213
207
|
},
|
|
214
|
-
|
|
208
|
+
ignoreFail: {
|
|
215
209
|
type: 'boolean',
|
|
216
|
-
name: 'config.ignoreFail',
|
|
217
210
|
title: `{{t("Ignore fail request and continue workflow", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
218
211
|
'x-decorator': 'FormItem',
|
|
219
212
|
'x-component': 'Checkbox'
|
|
@@ -5,10 +5,9 @@ declare const _default: {
|
|
|
5
5
|
type: string;
|
|
6
6
|
group: string;
|
|
7
7
|
fieldset: {
|
|
8
|
-
|
|
8
|
+
collection: {
|
|
9
9
|
type: string;
|
|
10
10
|
title: string;
|
|
11
|
-
name: string;
|
|
12
11
|
required: boolean;
|
|
13
12
|
'x-reactions': string[];
|
|
14
13
|
'x-decorator': string;
|
|
@@ -17,35 +16,40 @@ declare const _default: {
|
|
|
17
16
|
placeholder: string;
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
title: string;
|
|
22
|
-
type: string;
|
|
23
|
-
name: string;
|
|
24
|
-
'x-decorator': string;
|
|
25
|
-
'x-decorator-props': {
|
|
26
|
-
labelAlign: string;
|
|
27
|
-
className: string;
|
|
28
|
-
};
|
|
29
|
-
'x-component': string;
|
|
30
|
-
'x-component-props': {
|
|
31
|
-
useProps(): {
|
|
32
|
-
options: any[];
|
|
33
|
-
className: string;
|
|
34
|
-
};
|
|
35
|
-
dynamicComponent: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
'config.params.values': {
|
|
19
|
+
params: {
|
|
39
20
|
type: string;
|
|
40
21
|
title: string;
|
|
41
|
-
name: string;
|
|
42
22
|
'x-decorator': string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
properties: {
|
|
24
|
+
filter: {
|
|
25
|
+
title: string;
|
|
26
|
+
type: string;
|
|
27
|
+
'x-decorator': string;
|
|
28
|
+
'x-decorator-props': {
|
|
29
|
+
labelAlign: string;
|
|
30
|
+
className: string;
|
|
31
|
+
};
|
|
32
|
+
'x-component': string;
|
|
33
|
+
'x-component-props': {
|
|
34
|
+
useProps(): {
|
|
35
|
+
options: any[];
|
|
36
|
+
className: string;
|
|
37
|
+
};
|
|
38
|
+
dynamicComponent: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
values: {
|
|
42
|
+
type: string;
|
|
43
|
+
title: string;
|
|
44
|
+
'x-decorator': string;
|
|
45
|
+
'x-decorator-props': {
|
|
46
|
+
labelAlign: string;
|
|
47
|
+
className: string;
|
|
48
|
+
};
|
|
49
|
+
'x-component': string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
46
52
|
};
|
|
47
|
-
'x-component': string;
|
|
48
|
-
description: string;
|
|
49
53
|
};
|
|
50
54
|
};
|
|
51
55
|
view: {};
|
|
@@ -36,11 +36,18 @@ var _default = {
|
|
|
36
36
|
type: 'update',
|
|
37
37
|
group: 'collection',
|
|
38
38
|
fieldset: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
collection: _collection.collection,
|
|
40
|
+
params: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
title: '',
|
|
43
|
+
'x-decorator': 'FormItem',
|
|
44
|
+
properties: {
|
|
45
|
+
filter: _objectSpread(_objectSpread({}, _collection.filter), {}, {
|
|
46
|
+
title: `{{t("Only update records matching conditions", { ns: "${_locale.NAMESPACE}" })}}`
|
|
47
|
+
}),
|
|
48
|
+
values: _collection.values
|
|
49
|
+
}
|
|
50
|
+
}
|
|
44
51
|
},
|
|
45
52
|
view: {},
|
|
46
53
|
scope: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const collection: {
|
|
2
2
|
type: string;
|
|
3
3
|
title: string;
|
|
4
|
-
name: string;
|
|
5
4
|
required: boolean;
|
|
6
5
|
'x-reactions': string[];
|
|
7
6
|
'x-decorator': string;
|
|
@@ -13,7 +12,6 @@ export declare const collection: {
|
|
|
13
12
|
export declare const values: {
|
|
14
13
|
type: string;
|
|
15
14
|
title: string;
|
|
16
|
-
name: string;
|
|
17
15
|
'x-decorator': string;
|
|
18
16
|
'x-decorator-props': {
|
|
19
17
|
labelAlign: string;
|
|
@@ -25,7 +23,6 @@ export declare const values: {
|
|
|
25
23
|
export declare const filter: {
|
|
26
24
|
type: string;
|
|
27
25
|
title: string;
|
|
28
|
-
name: string;
|
|
29
26
|
'x-decorator': string;
|
|
30
27
|
'x-decorator-props': {
|
|
31
28
|
labelAlign: string;
|
|
@@ -40,7 +40,6 @@ var _locale = require("../locale");
|
|
|
40
40
|
const collection = {
|
|
41
41
|
type: 'string',
|
|
42
42
|
title: '{{t("Collection")}}',
|
|
43
|
-
name: 'config.collection',
|
|
44
43
|
required: true,
|
|
45
44
|
'x-reactions': ['{{useCollectionDataSource()}}'],
|
|
46
45
|
'x-decorator': 'FormItem',
|
|
@@ -53,7 +52,6 @@ exports.collection = collection;
|
|
|
53
52
|
const values = {
|
|
54
53
|
type: 'object',
|
|
55
54
|
title: '{{t("Fields values")}}',
|
|
56
|
-
name: 'config.params.values',
|
|
57
55
|
'x-decorator': 'FormItem',
|
|
58
56
|
'x-decorator-props': {
|
|
59
57
|
labelAlign: 'left',
|
|
@@ -68,7 +66,6 @@ exports.values = values;
|
|
|
68
66
|
const filter = {
|
|
69
67
|
type: 'object',
|
|
70
68
|
title: '{{t("Filter")}}',
|
|
71
|
-
name: 'config.params.filter',
|
|
72
69
|
'x-decorator': 'FormItem',
|
|
73
70
|
'x-decorator-props': {
|
|
74
71
|
labelAlign: 'left',
|
|
@@ -79,12 +76,10 @@ const filter = {
|
|
|
79
76
|
'x-component': 'Filter',
|
|
80
77
|
'x-component-props': {
|
|
81
78
|
useProps() {
|
|
82
|
-
var _values$config;
|
|
83
|
-
|
|
84
79
|
const _useForm = (0, _react().useForm)(),
|
|
85
80
|
values = _useForm.values;
|
|
86
81
|
|
|
87
|
-
const options = (0, _client().useCollectionFilterOptions)(
|
|
82
|
+
const options = (0, _client().useCollectionFilterOptions)(values === null || values === void 0 ? void 0 : values.collection);
|
|
88
83
|
return {
|
|
89
84
|
options,
|
|
90
85
|
className: (0, _css().css)`
|
package/lib/client/style.js
CHANGED
|
@@ -172,19 +172,27 @@ const nodeClass = (0, _css().css)`
|
|
|
172
172
|
`;
|
|
173
173
|
exports.nodeClass = nodeClass;
|
|
174
174
|
const nodeCardClass = (0, _css().css)`
|
|
175
|
+
position: relative;
|
|
175
176
|
width: 20em;
|
|
176
177
|
background: #fff;
|
|
177
178
|
padding: 1em;
|
|
178
179
|
box-shadow: 0 .25em .5em rgba(0, 0, 0, .1);
|
|
180
|
+
border-radius: .5em;
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
transition: box-shadow .3s ease;
|
|
183
|
+
|
|
184
|
+
&.configuring{
|
|
185
|
+
box-shadow: 0 .25em 1em rgba(0, 100, 200, .25);
|
|
186
|
+
}
|
|
179
187
|
|
|
180
188
|
.workflow-node-remove-button,
|
|
181
189
|
.workflow-node-job-button{
|
|
182
190
|
position: absolute;
|
|
183
|
-
right: -.5em;
|
|
184
|
-
top: -.5em;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
.workflow-node-remove-button{
|
|
194
|
+
right: .5em;
|
|
195
|
+
top: .5em;
|
|
188
196
|
color: #999;
|
|
189
197
|
opacity: 0;
|
|
190
198
|
transition: opacity .3s ease;
|
|
@@ -200,8 +208,8 @@ const nodeCardClass = (0, _css().css)`
|
|
|
200
208
|
|
|
201
209
|
.workflow-node-job-button{
|
|
202
210
|
display: flex;
|
|
203
|
-
top:
|
|
204
|
-
right:
|
|
211
|
+
top: 1em;
|
|
212
|
+
right: 1em;
|
|
205
213
|
width: 1.25rem;
|
|
206
214
|
height: 1.25rem;
|
|
207
215
|
min-width: 1.25rem;
|
|
@@ -215,7 +223,32 @@ const nodeCardClass = (0, _css().css)`
|
|
|
215
223
|
}
|
|
216
224
|
}
|
|
217
225
|
|
|
226
|
+
.ant-input{
|
|
227
|
+
font-weight: bold;
|
|
228
|
+
|
|
229
|
+
&:not(:focus){
|
|
230
|
+
transition: background-color .3s ease, border-color .3s ease;
|
|
231
|
+
border-color: #f7f7f7;
|
|
232
|
+
background-color: #f7f7f7;
|
|
233
|
+
|
|
234
|
+
&:not(:disabled):hover{
|
|
235
|
+
border-color: #eee;
|
|
236
|
+
background-color: #eee;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&:disabled:hover{
|
|
240
|
+
border-color: #f7f7f7;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.workflow-node-config-button{
|
|
246
|
+
padding: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
218
249
|
&:hover{
|
|
250
|
+
box-shadow: 0 .25em .5em rgba(0, 0, 0, .25);
|
|
251
|
+
|
|
219
252
|
.workflow-node-remove-button{
|
|
220
253
|
opacity: 1;
|
|
221
254
|
}
|
|
@@ -228,13 +261,20 @@ const nodeHeaderClass = (0, _css().css)`
|
|
|
228
261
|
exports.nodeHeaderClass = nodeHeaderClass;
|
|
229
262
|
const nodeMetaClass = (0, _css().css)`
|
|
230
263
|
margin-bottom: .5em;
|
|
264
|
+
|
|
265
|
+
.workflow-node-id{
|
|
266
|
+
color: #999;
|
|
267
|
+
|
|
268
|
+
&:before{
|
|
269
|
+
content: "#"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
231
272
|
`;
|
|
232
273
|
exports.nodeMetaClass = nodeMetaClass;
|
|
233
274
|
const nodeTitleClass = (0, _css().css)`
|
|
234
275
|
display: flex;
|
|
235
276
|
align-items: center;
|
|
236
277
|
font-weight: normal;
|
|
237
|
-
|
|
238
278
|
.workflow-node-id{
|
|
239
279
|
color: #999;
|
|
240
280
|
}
|
|
@@ -249,5 +289,11 @@ exports.nodeSubtreeClass = nodeSubtreeClass;
|
|
|
249
289
|
const addButtonClass = (0, _css().css)`
|
|
250
290
|
flex-shrink: 0;
|
|
251
291
|
padding: 2em 0;
|
|
292
|
+
|
|
293
|
+
> .ant-btn{
|
|
294
|
+
&:disabled{
|
|
295
|
+
visibility: hidden;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
252
298
|
`;
|
|
253
299
|
exports.addButtonClass = addButtonClass;
|
|
@@ -5,18 +5,18 @@ declare const _default: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
type: string;
|
|
7
7
|
fieldset: {
|
|
8
|
-
|
|
8
|
+
collection: {
|
|
9
9
|
"x-reactions": (string | {
|
|
10
10
|
target: string;
|
|
11
|
+
effects: string[];
|
|
11
12
|
fulfill: {
|
|
12
13
|
state: {
|
|
13
|
-
|
|
14
|
+
value: any[];
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
})[];
|
|
17
18
|
type: string;
|
|
18
19
|
title: string;
|
|
19
|
-
name: string;
|
|
20
20
|
required: boolean;
|
|
21
21
|
'x-decorator': string;
|
|
22
22
|
'x-component': string;
|
|
@@ -24,10 +24,9 @@ declare const _default: {
|
|
|
24
24
|
placeholder: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
mode: {
|
|
28
28
|
type: string;
|
|
29
29
|
title: string;
|
|
30
|
-
name: string;
|
|
31
30
|
'x-decorator': string;
|
|
32
31
|
'x-component': string;
|
|
33
32
|
'x-component-props': {
|
|
@@ -38,18 +37,28 @@ declare const _default: {
|
|
|
38
37
|
placeholder: string;
|
|
39
38
|
};
|
|
40
39
|
required: boolean;
|
|
41
|
-
'x-reactions': {
|
|
40
|
+
'x-reactions': ({
|
|
41
|
+
dependencies: string[];
|
|
42
|
+
fulfill: {
|
|
43
|
+
state: {
|
|
44
|
+
visible: string;
|
|
45
|
+
disabled?: undefined;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
target?: undefined;
|
|
49
|
+
} | {
|
|
42
50
|
target: string;
|
|
43
51
|
fulfill: {
|
|
44
52
|
state: {
|
|
45
53
|
disabled: string;
|
|
54
|
+
visible?: undefined;
|
|
46
55
|
};
|
|
47
56
|
};
|
|
48
|
-
|
|
57
|
+
dependencies?: undefined;
|
|
58
|
+
})[];
|
|
49
59
|
};
|
|
50
|
-
|
|
60
|
+
changed: {
|
|
51
61
|
type: string;
|
|
52
|
-
name: string;
|
|
53
62
|
title: string;
|
|
54
63
|
description: string;
|
|
55
64
|
'x-decorator': string;
|
|
@@ -57,11 +66,27 @@ declare const _default: {
|
|
|
57
66
|
'x-component-props': {
|
|
58
67
|
mode: string;
|
|
59
68
|
placeholder: string;
|
|
69
|
+
filter(field: any): boolean;
|
|
60
70
|
};
|
|
71
|
+
'x-reactions': {
|
|
72
|
+
dependencies: string[];
|
|
73
|
+
fulfill: {
|
|
74
|
+
state: {
|
|
75
|
+
visible: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}[];
|
|
61
79
|
};
|
|
62
|
-
|
|
63
|
-
name: string;
|
|
80
|
+
condition: {
|
|
64
81
|
title: string;
|
|
82
|
+
'x-reactions': {
|
|
83
|
+
dependencies: string[];
|
|
84
|
+
fulfill: {
|
|
85
|
+
state: {
|
|
86
|
+
visible: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}[];
|
|
65
90
|
type: string;
|
|
66
91
|
'x-decorator': string;
|
|
67
92
|
'x-decorator-props': {
|
|
@@ -82,7 +107,7 @@ declare const _default: {
|
|
|
82
107
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
83
108
|
};
|
|
84
109
|
components: {
|
|
85
|
-
FieldsSelect: React.MemoExoticComponent<React.FunctionComponent<
|
|
110
|
+
FieldsSelect: React.MemoExoticComponent<React.FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
86
111
|
};
|
|
87
112
|
getOptions(config: any, types: any): any[];
|
|
88
113
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
@@ -25,16 +25,6 @@ function _antd() {
|
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function _core() {
|
|
29
|
-
const data = require("@formily/core");
|
|
30
|
-
|
|
31
|
-
_core = function _core() {
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return data;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
28
|
function _react2() {
|
|
39
29
|
const data = require("@formily/react");
|
|
40
30
|
|
|
@@ -65,6 +55,8 @@ var _CollectionFieldInitializers = require("../components/CollectionFieldInitial
|
|
|
65
55
|
|
|
66
56
|
var _locale = require("../locale");
|
|
67
57
|
|
|
58
|
+
const _excluded = ["filter"];
|
|
59
|
+
|
|
68
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
69
61
|
|
|
70
62
|
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; }
|
|
@@ -73,8 +65,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
73
65
|
|
|
74
66
|
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; }
|
|
75
67
|
|
|
68
|
+
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; }
|
|
69
|
+
|
|
70
|
+
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; }
|
|
71
|
+
|
|
76
72
|
const FieldsSelect = (0, _react2().observer)(props => {
|
|
77
|
-
|
|
73
|
+
const _props$filter = props.filter,
|
|
74
|
+
filter = _props$filter === void 0 ? () => true : _props$filter,
|
|
75
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
78
76
|
|
|
79
77
|
const compile = (0, _client().useCompile)();
|
|
80
78
|
|
|
@@ -82,18 +80,10 @@ const FieldsSelect = (0, _react2().observer)(props => {
|
|
|
82
80
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
83
81
|
|
|
84
82
|
const _useForm = (0, _react2().useForm)(),
|
|
85
|
-
values = _useForm.values
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const fields = getCollectionFields(values === null || values === void 0 ? void 0 : (_values$config = values.config) === null || _values$config === void 0 ? void 0 : _values$config.collection);
|
|
90
|
-
(0, _react2().useFormEffects)(() => {
|
|
91
|
-
(0, _core().onFieldValueChange)('config.collection', field => {
|
|
92
|
-
clearFormGraph('config.changed');
|
|
93
|
-
setValuesIn('config.condition', null);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
return _react().default.createElement(_antd().Select, _objectSpread({}, props), fields.filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true) && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type)).map(field => {
|
|
83
|
+
values = _useForm.values;
|
|
84
|
+
|
|
85
|
+
const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
|
|
86
|
+
return _react().default.createElement(_antd().Select, _objectSpread({}, others), fields.filter(filter).map(field => {
|
|
97
87
|
var _field$uiSchema;
|
|
98
88
|
|
|
99
89
|
return _react().default.createElement(_antd().Select.Option, {
|
|
@@ -125,34 +115,28 @@ var _default = {
|
|
|
125
115
|
title: `{{t("Collection event", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
126
116
|
type: 'collection',
|
|
127
117
|
fieldset: {
|
|
128
|
-
|
|
118
|
+
collection: _objectSpread(_objectSpread({}, _collection.collection), {}, {
|
|
129
119
|
['x-reactions']: [..._collection.collection['x-reactions'], {
|
|
130
|
-
target: '
|
|
131
|
-
|
|
132
|
-
state: {
|
|
133
|
-
visible: '{{!!$self.value}}'
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
target: 'config.changed',
|
|
120
|
+
target: 'changed',
|
|
121
|
+
effects: ['onFieldValueChange'],
|
|
138
122
|
fulfill: {
|
|
139
123
|
state: {
|
|
140
|
-
|
|
124
|
+
value: []
|
|
141
125
|
}
|
|
142
126
|
}
|
|
143
127
|
}, {
|
|
144
|
-
target: '
|
|
128
|
+
target: 'condition',
|
|
129
|
+
effects: ['onFieldValueChange'],
|
|
145
130
|
fulfill: {
|
|
146
131
|
state: {
|
|
147
|
-
|
|
132
|
+
value: null
|
|
148
133
|
}
|
|
149
134
|
}
|
|
150
135
|
}]
|
|
151
136
|
}),
|
|
152
|
-
|
|
137
|
+
mode: {
|
|
153
138
|
type: 'number',
|
|
154
139
|
title: `{{t("Trigger on", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
155
|
-
name: 'config.mode',
|
|
156
140
|
'x-decorator': 'FormItem',
|
|
157
141
|
'x-component': 'Select',
|
|
158
142
|
'x-component-props': {
|
|
@@ -161,7 +145,14 @@ var _default = {
|
|
|
161
145
|
},
|
|
162
146
|
required: true,
|
|
163
147
|
'x-reactions': [{
|
|
164
|
-
|
|
148
|
+
dependencies: ['collection'],
|
|
149
|
+
fulfill: {
|
|
150
|
+
state: {
|
|
151
|
+
visible: '{{!!$deps[0]}}'
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
target: 'changed',
|
|
165
156
|
fulfill: {
|
|
166
157
|
state: {
|
|
167
158
|
disabled: `{{!($self.value & ${COLLECTION_TRIGGER_MODE.UPDATED})}}`
|
|
@@ -169,22 +160,62 @@ var _default = {
|
|
|
169
160
|
}
|
|
170
161
|
}]
|
|
171
162
|
},
|
|
172
|
-
|
|
163
|
+
changed: {
|
|
173
164
|
type: 'array',
|
|
174
|
-
name: 'changed',
|
|
175
165
|
title: `{{t("Changed fields", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
176
166
|
description: `{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
177
167
|
'x-decorator': 'FormItem',
|
|
178
168
|
'x-component': 'FieldsSelect',
|
|
179
169
|
'x-component-props': {
|
|
180
170
|
mode: 'multiple',
|
|
181
|
-
placeholder: '{{t("Select Field")}}'
|
|
182
|
-
|
|
171
|
+
placeholder: '{{t("Select Field")}}',
|
|
172
|
+
|
|
173
|
+
filter(field) {
|
|
174
|
+
return !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true) && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
},
|
|
178
|
+
'x-reactions': [{
|
|
179
|
+
dependencies: ['collection'],
|
|
180
|
+
fulfill: {
|
|
181
|
+
state: {
|
|
182
|
+
visible: '{{!!$deps[0]}}'
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}]
|
|
183
186
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
condition: _objectSpread(_objectSpread({}, _collection.filter), {}, {
|
|
188
|
+
title: `{{t("Only triggers when match conditions", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
189
|
+
'x-reactions': [{
|
|
190
|
+
dependencies: ['collection'],
|
|
191
|
+
fulfill: {
|
|
192
|
+
state: {
|
|
193
|
+
visible: '{{!!$deps[0]}}'
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}]
|
|
197
|
+
}) // appends: {
|
|
198
|
+
// type: 'array',
|
|
199
|
+
// title: `{{t("Prefetch fields", { ns: "${NAMESPACE}" })}}`,
|
|
200
|
+
// description: `{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.", { ns: "${NAMESPACE}" })}}`,
|
|
201
|
+
// 'x-decorator': 'FormItem',
|
|
202
|
+
// 'x-component': 'FieldsSelect',
|
|
203
|
+
// 'x-component-props': {
|
|
204
|
+
// mode: 'multiple',
|
|
205
|
+
// placeholder: '{{t("Select Field")}}'
|
|
206
|
+
// },
|
|
207
|
+
// 'x-reactions': [
|
|
208
|
+
// {
|
|
209
|
+
// dependencies: ['collection'],
|
|
210
|
+
// fulfill: {
|
|
211
|
+
// state: {
|
|
212
|
+
// visible: '{{!!$deps[0]}}',
|
|
213
|
+
// },
|
|
214
|
+
// }
|
|
215
|
+
// },
|
|
216
|
+
// ]
|
|
217
|
+
// },
|
|
218
|
+
|
|
188
219
|
},
|
|
189
220
|
scope: {
|
|
190
221
|
useCollectionDataSource: _client().useCollectionDataSource
|