@nocobase/plugin-workflow 2.2.0-alpha.3 → 2.2.0-alpha.4

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.
Files changed (60) hide show
  1. package/dist/client/{142.d84a976875799df4.js → 142.fb4936d78fc80007.js} +1 -1
  2. package/dist/client/{159.3d5abee06b818db3.js → 159.cc9a0f2d92cab2c1.js} +1 -1
  3. package/dist/client/{382.80ebd002a9971b65.js → 382.d37fba14a6b91b0b.js} +1 -1
  4. package/dist/client/{394.d7eacf666590a6ae.js → 394.a37310b78419ad7a.js} +1 -1
  5. package/dist/client/{438.c4de8f085e490158.js → 438.6c6409d821d8c353.js} +1 -1
  6. package/dist/client/509.0504f44820a39d45.js +10 -0
  7. package/dist/client/{54.c452a382e9b3953d.js → 54.d3d5d9f2f2115201.js} +1 -1
  8. package/dist/client/618.1aa6c21d0f2840cb.js +10 -0
  9. package/dist/client/635.42814cddec653cdd.js +10 -0
  10. package/dist/client/67.ea0c78153b4842ef.js +10 -0
  11. package/dist/client/719.cd8ca7c9f00584be.js +10 -0
  12. package/dist/client/739.49407722fca8d236.js +10 -0
  13. package/dist/client/782.e0f0d84dd5cfac2a.js +10 -0
  14. package/dist/client/{828.77de843c49fb307a.js → 828.78ff0c90212276c0.js} +1 -1
  15. package/dist/client/{87.d2c2b5b1cae08bfc.js → 87.083467b89aaf3e53.js} +1 -1
  16. package/dist/client/{938.77649c32dae1c225.js → 938.26493fc09ba1ccbc.js} +1 -1
  17. package/dist/client/972.600a190e71978122.js +10 -0
  18. package/dist/client/index.js +1 -1
  19. package/dist/client/variable.d.ts +3 -9
  20. package/dist/client-v2/142.fe4f9b7869876ff1.js +10 -0
  21. package/dist/client-v2/{276.43297f402f31970e.js → 276.8ca10542a0424df3.js} +1 -1
  22. package/dist/client-v2/387.eae325172ba209e5.js +10 -0
  23. package/dist/client-v2/{513.ab2bdd96ad9ece4d.js → 513.19fe2e75d7cb18f8.js} +1 -1
  24. package/dist/client-v2/635.d14f99a9520d336b.js +10 -0
  25. package/dist/client-v2/677.d3294a45cd038c72.js +10 -0
  26. package/dist/client-v2/{739.906e94bbe6d52a3d.js → 739.5b60845103064f8d.js} +1 -1
  27. package/dist/client-v2/canvas/BranchContext.d.ts +11 -2
  28. package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +1 -0
  29. package/dist/client-v2/canvas/contexts.d.ts +2 -0
  30. package/dist/client-v2/components/FilterDynamicComponent.d.ts +6 -1
  31. package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +8 -1
  32. package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +0 -21
  33. package/dist/client-v2/index.d.ts +1 -3
  34. package/dist/client-v2/index.js +1 -1
  35. package/dist/client-v2/nodes/components/filter.d.ts +2 -1
  36. package/dist/client-v2/utils/contextSingleton.d.ts +9 -0
  37. package/dist/common/defaultWorkflowFilter.d.ts +21 -0
  38. package/dist/common/defaultWorkflowFilter.js +38 -0
  39. package/dist/externalVersion.js +13 -13
  40. package/dist/locale/en-US.json +6 -0
  41. package/dist/locale/zh-CN.json +6 -0
  42. package/dist/locale/zh-TW.json +6 -0
  43. package/dist/node_modules/cron-parser/package.json +1 -1
  44. package/dist/node_modules/joi/package.json +1 -1
  45. package/dist/node_modules/lru-cache/package.json +1 -1
  46. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  47. package/package.json +3 -2
  48. package/dist/client/509.2f72dd97808f12d1.js +0 -10
  49. package/dist/client/618.a97bc812678ab2a7.js +0 -10
  50. package/dist/client/635.3f165e9ed7e940b2.js +0 -10
  51. package/dist/client/67.4117e04bd42f9d42.js +0 -10
  52. package/dist/client/719.5801e3f1cf81b97b.js +0 -10
  53. package/dist/client/739.955f18b3dc31ae3a.js +0 -10
  54. package/dist/client/782.332fd345a98b82c2.js +0 -10
  55. package/dist/client/972.4da2796f3f2df874.js +0 -10
  56. package/dist/client-v2/142.3d386748090ff6d3.js +0 -10
  57. package/dist/client-v2/224.44a5e1227bee33fb.js +0 -10
  58. package/dist/client-v2/387.ab3eac2eb447f36f.js +0 -10
  59. package/dist/client-v2/635.37de4abe241b30e8.js +0 -10
  60. package/dist/client-v2/canvas/WorkflowVariableSelect.d.ts +0 -29
@@ -7,10 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- export declare function NodeFilterField({ collection, label, name, required, }: {
10
+ export declare function NodeFilterField({ collection, label, name, required, maxAssociationFieldDepth, }: {
11
11
  collection?: string;
12
12
  label?: string;
13
13
  name?: Array<string | number>;
14
14
  required?: boolean;
15
+ maxAssociationFieldDepth?: number;
15
16
  }): React.JSX.Element;
16
17
  export default NodeFilterField;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function getWorkflowSingleton<T>(name: string, factory: () => T): T;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const defaultWorkflowFilter: {
10
+ $and: ({
11
+ title: {
12
+ $includes: string;
13
+ };
14
+ type?: undefined;
15
+ } | {
16
+ type: {
17
+ $eq: any;
18
+ };
19
+ title?: undefined;
20
+ })[];
21
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var defaultWorkflowFilter_exports = {};
28
+ __export(defaultWorkflowFilter_exports, {
29
+ defaultWorkflowFilter: () => defaultWorkflowFilter
30
+ });
31
+ module.exports = __toCommonJS(defaultWorkflowFilter_exports);
32
+ const defaultWorkflowFilter = {
33
+ $and: [{ title: { $includes: "" } }, { type: { $eq: void 0 } }]
34
+ };
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ defaultWorkflowFilter
38
+ });
@@ -11,33 +11,33 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.7",
13
13
  "@formily/react": "2.3.7",
14
- "@nocobase/client": "2.2.0-alpha.3",
15
- "@nocobase/utils": "2.2.0-alpha.3",
14
+ "@nocobase/client": "2.2.0-alpha.4",
15
+ "@nocobase/utils": "2.2.0-alpha.4",
16
16
  "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
- "@nocobase/flow-engine": "2.2.0-alpha.3",
18
+ "@nocobase/flow-engine": "2.2.0-alpha.4",
19
19
  "ahooks": "3.7.8",
20
20
  "react-router-dom": "6.30.1",
21
21
  "react-i18next": "11.18.6",
22
22
  "lodash": "4.18.1",
23
23
  "@dnd-kit/core": "6.1.0",
24
24
  "@formily/shared": "2.3.7",
25
- "@nocobase/plugin-mobile": "2.2.0-alpha.3",
26
- "@nocobase/client-v2": "2.2.0-alpha.3",
25
+ "@nocobase/plugin-mobile": "2.2.0-alpha.4",
26
+ "@nocobase/client-v2": "2.2.0-alpha.4",
27
27
  "sequelize": "6.35.2",
28
- "@nocobase/server": "2.2.0-alpha.3",
29
- "@nocobase/database": "2.2.0-alpha.3",
30
- "@nocobase/data-source-manager": "2.2.0-alpha.3",
31
- "@nocobase/logger": "2.2.0-alpha.3",
32
- "@nocobase/evaluators": "2.2.0-alpha.3",
28
+ "@nocobase/server": "2.2.0-alpha.4",
29
+ "@nocobase/database": "2.2.0-alpha.4",
30
+ "@nocobase/data-source-manager": "2.2.0-alpha.4",
31
+ "@nocobase/logger": "2.2.0-alpha.4",
32
+ "@nocobase/evaluators": "2.2.0-alpha.4",
33
33
  "@formily/antd-v5": "1.2.3",
34
34
  "@formily/reactive": "2.3.7",
35
35
  "@emotion/css": "11.13.0",
36
36
  "@formily/json-schema": "2.3.7",
37
37
  "antd-style": "3.7.1",
38
38
  "dayjs": "1.11.13",
39
- "@nocobase/actions": "2.2.0-alpha.3",
40
- "@nocobase/plugin-workflow-test": "2.2.0-alpha.3",
41
- "@nocobase/test": "2.2.0-alpha.3",
39
+ "@nocobase/actions": "2.2.0-alpha.4",
40
+ "@nocobase/plugin-workflow-test": "2.2.0-alpha.4",
41
+ "@nocobase/test": "2.2.0-alpha.4",
42
42
  "@dnd-kit/sortable": "7.0.2"
43
43
  };
@@ -118,6 +118,7 @@
118
118
  "False": "False",
119
119
  "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
120
120
  "Fields values": "Fields values",
121
+ "Failed to save trigger": "Failed to save trigger",
121
122
  "First condition": "First condition",
122
123
  "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.",
123
124
  "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.": "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.",
@@ -196,6 +197,7 @@
196
197
  "Scope variables": "Scope variables",
197
198
  "Seconds": "Seconds",
198
199
  "Select context": "Select context",
200
+ "Select field": "Select field",
199
201
  "Select users": "Select users",
200
202
  "Select workflow": "Select workflow",
201
203
  "Set output data of this workflow. When this one is executed as a subflow, the output could be used as variables in downstream nodes of super workflow. You can also use this node in an AI employee workflow, to define what to output. If this node is added multiple times, the value of the last executed node prevails.": "Set output data of this workflow. When this one is executed as a subflow, the output could be used as variables in downstream nodes of super workflow. You can also use this node in an AI employee workflow, to define what to output. If this node is added multiple times, the value of the last executed node prevails.",
@@ -234,6 +236,8 @@
234
236
  "This node contains branches, deleting will also be preformed to them, are you sure?": "This node contains branches, deleting will also be preformed to them, are you sure?",
235
237
  "This node type is not available in the new canvas yet.": "This node type is not available in the new canvas yet.",
236
238
  "This node's configuration has not been migrated to the new canvas yet.": "This node's configuration has not been migrated to the new canvas yet.",
239
+ "This trigger type is not available in the new canvas yet.": "This trigger type is not available in the new canvas yet.",
240
+ "This trigger's configuration has not been migrated to the new canvas yet.": "This trigger's configuration has not been migrated to the new canvas yet.",
237
241
  "This type of trigger has not been supported to be executed manually.": "This type of trigger has not been supported to be executed manually.",
238
242
  "This will perform all the actions configured in the workflow. Are you sure you want to continue?": "This will perform all the actions configured in the workflow. Are you sure you want to continue?",
239
243
  "Trigger": "Trigger",
@@ -243,6 +247,7 @@
243
247
  "Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
244
248
  "Trigger mode": "Trigger mode",
245
249
  "Trigger on": "Trigger on",
250
+ "Trigger title": "Trigger title",
246
251
  "Trigger time": "Trigger time",
247
252
  "Trigger type": "Trigger type",
248
253
  "Trigger variables": "Trigger variables",
@@ -274,6 +279,7 @@
274
279
  "When no condition matches": "When no condition matches",
275
280
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
276
281
  "Workflow": "Workflow",
282
+ "Workflow title": "Workflow title",
277
283
  "Workflow canvas editor is being migrated to the new UI.": "Workflow canvas editor is being migrated to the new UI.",
278
284
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
279
285
  "Workflow of execution is not existed": "Workflow of execution is not existed",
@@ -122,6 +122,7 @@
122
122
  "False": "假",
123
123
  "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
124
124
  "Fields values": "字段值",
125
+ "Failed to save trigger": "保存触发器失败",
125
126
  "First condition": "第一个条件",
126
127
  "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "适用于需要即时反馈的用户操作。不能在此模式下使用异步节点,并且不建议在同步模式下执行耗时的操作。",
127
128
  "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.": "从左到右,基于配置的条件,依次尝试每个分支。只有满足条件的分支才会被执行,否则尝试下一个分支。如果没有任何分支满足条件,可以根据配置选择退出流程或继续下一个节点。",
@@ -200,6 +201,7 @@
200
201
  "Scope variables": "局域变量",
201
202
  "Seconds": "秒",
202
203
  "Select context": "选择上下文",
204
+ "Select field": "选择字段",
203
205
  "Select users": "选择用户",
204
206
  "Select workflow": "选择工作流",
205
207
  "Set output data of this workflow. When this one is executed as a subflow, the output could be used as variables in downstream nodes of super workflow. You can also use this node in an AI employee workflow, to define what to output. If this node is added multiple times, the value of the last executed node prevails.": "设置工作流的输出数据。在作为子流程执行后可以被上级流程后续节点使用。你也可以在 AI 员工工作流中使用此节点,来定义输出内容。如果多次添加此节点,则以最后一个被执行的节点的值为准。",
@@ -242,6 +244,8 @@
242
244
  "This type of node can not be used in current type of workflow or execute mode.": "该类型的节点在当前类型的工作流或执行模式中不可用。",
243
245
  "This node type is not available in the new canvas yet.": "该节点类型尚未在新画布中支持。",
244
246
  "This node's configuration has not been migrated to the new canvas yet.": "该节点的配置尚未迁移到新画布。",
247
+ "This trigger type is not available in the new canvas yet.": "该触发器类型尚未在新画布中支持。",
248
+ "This trigger's configuration has not been migrated to the new canvas yet.": "该触发器的配置尚未迁移到新画布。",
245
249
  "This type of trigger has not been supported to be executed manually.": "该类型的触发器暂未支持手动执行。",
246
250
  "This will perform all the actions configured in the workflow. Are you sure you want to continue?": "将按照工作流中配置的所有操作执行,确定继续吗?",
247
251
  "Trigger": "触发器",
@@ -251,6 +255,7 @@
251
255
  "Trigger in executed workflow cannot be modified": "已执行的工作流中的触发器无法修改",
252
256
  "Trigger mode": "触发模式",
253
257
  "Trigger on": "触发时机",
258
+ "Trigger title": "触发器标题",
254
259
  "Trigger time": "触发时间",
255
260
  "Trigger type": "触发方式",
256
261
  "Trigger variables": "触发器变量",
@@ -282,6 +287,7 @@
282
287
  "When no condition matches": "未满足任何条件时",
283
288
  "Will be executed in the background as a queued task.": "将作为队列任务在后台执行。",
284
289
  "Workflow": "工作流",
290
+ "Workflow title": "工作流名称",
285
291
  "Workflow canvas editor is being migrated to the new UI.": "工作流画布编辑器正在迁移到新版界面。",
286
292
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "工作流已执行,结果状态为 <1>{{statusText}}</1><2>查看执行详情</2>",
287
293
  "Workflow of execution is not existed": "执行计划对应的工作流不存在",
@@ -114,6 +114,7 @@
114
114
  "Failed to satisfy node configurations.": "Failed to satisfy node configurations.",
115
115
  "False": "False",
116
116
  "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
117
+ "Failed to save trigger": "保存觸發器失敗",
117
118
  "First condition": "First condition",
118
119
  "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.",
119
120
  "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.": "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.",
@@ -186,6 +187,7 @@
186
187
  "Scope variables": "Scope variables",
187
188
  "Seconds": "秒",
188
189
  "Select context": "Select context",
190
+ "Select field": "選擇欄位",
189
191
  "Select users": "Select users",
190
192
  "Select workflow": "Select workflow",
191
193
  "Single record": "Single record",
@@ -254,6 +256,7 @@
254
256
  "When no condition matches": "When no condition matches",
255
257
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
256
258
  "Workflow": "Workflow",
259
+ "Workflow title": "工作流名稱",
257
260
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
258
261
  "Workflow of execution is not existed": "Workflow of execution is not existed",
259
262
  "Workflow tasks": "Workflow tasks",
@@ -273,7 +276,10 @@
273
276
  "Unsupported node": "Unsupported node",
274
277
  "This node type is not available in the new canvas yet.": "This node type is not available in the new canvas yet.",
275
278
  "This node's configuration has not been migrated to the new canvas yet.": "This node's configuration has not been migrated to the new canvas yet.",
279
+ "This trigger type is not available in the new canvas yet.": "此觸發器類型尚未在新畫布中支援。",
280
+ "This trigger's configuration has not been migrated to the new canvas yet.": "此觸發器的配置尚未遷移到新畫布。",
276
281
  "Node title": "Node title",
282
+ "Trigger title": "觸發器標題",
277
283
  "Failed to add node": "Failed to add node",
278
284
  "Failed to delete node": "Failed to delete node",
279
285
  "Failed to save node": "Failed to save node",
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-06-27T03:57:02.962Z"}
1
+ {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2026-07-01T07:57:34.832Z"}
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-27T03:57:02.697Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-01T07:57:34.573Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-06-27T03:57:01.983Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-07-01T07:57:34.136Z"}
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-06-27T03:57:01.820Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-07-01T07:57:34.037Z"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
7
7
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
8
8
  "description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
9
- "version": "2.2.0-alpha.3",
9
+ "version": "2.2.0-alpha.4",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -18,6 +18,7 @@
18
18
  "@formily/core": "2.x",
19
19
  "@formily/react": "2.x",
20
20
  "@types/ejs": "^3.1.1",
21
+ "ahooks": "^3.7.2",
21
22
  "antd": "5.x",
22
23
  "classnames": "^2.3.1",
23
24
  "cron-parser": "4.4.0",
@@ -50,7 +51,7 @@
50
51
  "@nocobase/test": "2.x",
51
52
  "@nocobase/utils": "2.x"
52
53
  },
53
- "gitHead": "e3ec19361fd7981af9fe2a7f24ad335025cbefcd",
54
+ "gitHead": "81bf8733db4bccf08a6bc5e6d97f274bce349161",
54
55
  "keywords": [
55
56
  "Workflow"
56
57
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["509"],{5764:function(e,t,n){n.r(t),n.d(t,{default:function(){return Y}});var r=n(7375),o=n(3485),l=n(5477),a=n(7694),i=n(2625),u=n(2059),c=n(9155),s=n.n(c),d=n(5827),f=n(5927),m=n(7001),p=n(9488),y=n(8743),b=n(1652),v=n(5953);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){h(l,r,o,a,i,"next",e)}function i(e){h(l,r,o,a,i,"throw",e)}a(void 0)})}}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||S(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function k(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var x=["red","magenta","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple","default"];function C(e){var t=(0,v.useTranslation)().t,n=x.map(function(e){return{value:e,label:s().createElement(u.Tag,{color:"default"===e?void 0:e},t(e.charAt(0).toUpperCase()+e.slice(1)))}});return s().createElement(u.Select,{allowClear:!0,value:e.value,options:n,onChange:e.onChange})}function F(e){var t=e.activeKey,n=e.onChange,r=e.categories,l=e.refreshCategories,d=e.className,f=(0,p.ec)().t,m=(0,p.kj)(),y=(0,a.useFlowContext)(),b=u.App.useApp().modal,v=y.api.resource("workflowCategories"),h=E((0,c.useState)(null),2),x=h[0],F=h[1],A=E((0,c.useState)(!1),2),O=A[0],T=A[1],I=E((0,c.useState)(!1),2),j=I[0],M=I[1],P=E(u.Form.useForm(),1)[0],z=(0,c.useMemo)(function(){return((function(e){if(Array.isArray(e))return g(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||S(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){var n,r;return(null!=(n=e.sort)?n:0)-(null!=(r=t.sort)?r:0)}).map(function(e){return{id:e.id,label:m(e.title),color:e.color}})},[r,m]),D=(0,i.useMemoizedFn)(function(e){return r.find(function(t){return String(t.id)===String(e)})}),B=(0,i.useMemoizedFn)(function(){F(null),P.resetFields(),T(!0)}),L=(0,i.useMemoizedFn)(function(e){var t=D(e);t&&(F(t),P.setFieldsValue({title:t.title,color:t.color}),T(!0))}),R=(0,i.useMemoizedFn)(function(e){var r=D(e);r&&b.confirm({title:f("Delete category"),content:f("Are you sure you want to delete it?"),onOk:function(){return w(function(){return k(this,function(e){switch(e.label){case 0:return[4,v.destroy({filterByTk:r.id})];case 1:return e.sent(),String(r.id)===t&&n("all"),l(),[2]}})})()}})}),G=(0,i.useMemoizedFn)(function(e,t){return w(function(){return k(this,function(n){switch(n.label){case 0:return[4,v.move({sourceId:e,targetId:t})];case 1:return n.sent(),l(),[2]}})})()}),N=(0,i.useMemoizedFn)(function(){return w(function(){var e;return k(this,function(t){switch(t.label){case 0:return[4,P.validateFields()];case 1:e=t.sent(),M(!0),t.label=2;case 2:if(t.trys.push([2,,7,8]),!x)return[3,4];return[4,v.update({filterByTk:x.id,values:e})];case 3:return t.sent(),[3,6];case 4:return[4,v.create({values:e})];case 5:t.sent(),t.label=6;case 6:return T(!1),l(),[3,8];case 7:return M(!1),[7];case 8:return[2]}})})()});return s().createElement(s().Fragment,null,s().createElement(o.SortableCategoryTabs,{className:d,activeKey:t,onChange:n,allTab:{key:"all",label:f("All")},categories:z,onAdd:B,onEdit:L,onDelete:R,onSort:G,menuLabels:{edit:f("Edit category"),delete:f("Delete category")}}),s().createElement(u.Modal,{title:x?f("Edit category"):f("Add category"),open:O,confirmLoading:j,onOk:N,onCancel:function(){return T(!1)},okText:f("Submit"),cancelText:f("Cancel"),destroyOnClose:!0},s().createElement(u.Form,{form:P,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:f("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"color",label:f("Color")},s().createElement(C,null)))))}var A=n(9239);function O(e){var t=e.value,n=e.onChange,o=e.disabled,l=(0,p.ec)().t,a=[{value:!1,label:l("Asynchronously"),tooltip:l("Will be executed in the background as a queued task.")},{value:!0,label:l("Synchronously"),tooltip:l("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.")}];return s().createElement(u.Radio.Group,{value:t,disabled:o,onChange:function(e){return null==n?void 0:n(e.target.value)}},a.map(function(e){return s().createElement(u.Radio,{key:String(e.value),value:e.value},s().createElement(u.Space,{size:"small"},e.label,s().createElement(u.Tooltip,{title:e.tooltip},s().createElement(r.QuestionCircleOutlined,null))))}))}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var I=[{value:1e3,label:"Seconds"},{value:6e4,label:"Minutes"},{value:36e5,label:"Hours"},{value:864e5,label:"Days"}];function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15552e6;return Math.min(Math.max(e,0),t)}function M(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4;return e&&null!=(t=null==(n=I.findLast(function(t){return e%t.value==0}))?void 0:n.value)?t:r}function P(e){var t,n=e.value,r=e.onChange,o=(0,p.ec)().t,l=j(Number(null!=n?n:0)),a=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(function(){return M(l)}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return T(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return T(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],d=a[1];(0,c.useEffect)(function(){0!==l&&d(function(e){return M(l,e)})},[l]);var f=0===l?0:l/i,m=15552e6/i;return s().createElement(u.Space.Compact,{style:{width:"50%"}},s().createElement(u.InputNumber,{min:0,max:m,precision:0,value:f,onChange:function(e){return null==r?void 0:r(j(Number(e)||0,m)*i)},style:{width:"70%"}}),s().createElement(u.Select,{value:i,style:{width:"30%"},options:I.map(function(e){return{value:e.value,label:o(e.label)}}),onChange:function(e){var t=j(Number(null!=n?n:0)),o=0===t?0:t/i;d(e),null==r||r(j(o*e))}}))}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e){var t,n=e.mode,r=e.plugin,l=e.record,d=e.categoryOptions,f=e.onSubmitted,m=(0,p.ec)().t,y=(0,p.kj)(),b=(0,a.useFlowContext)(),v=u.theme.useToken().token,g=b.api.resource("workflows"),h=B(u.Form.useForm(),1)[0],w=B((0,c.useState)(!1),2),E=w[0],S=w[1],k=(0,c.useMemo)(function(){var e=Array.from(r.triggers.getEntities()).map(function(e){var t=B(e,2),n=t[0],r=t[1];return{value:n,label:(null==r?void 0:r.title)?y(r.title):String(n),description:(null==r?void 0:r.description)?y(r.description):void 0}});return"edit"===n&&(null==l?void 0:l.type)&&!e.some(function(e){return e.value===l.type})&&e.push({value:l.type,label:l.type,description:void 0}),e.sort(function(e,t){return String(e.label).localeCompare(String(t.label))})},[r,y,n,l]),x=(0,c.useMemo)(function(){return A.hi.filter(function(e){return!!e.value}).map(function(e){return{value:e.value,label:y(e.label),color:e.color,description:e.description?y(e.description):void 0}})},[y]),C=(0,c.useMemo)(function(){if("edit"===n){var t,r,o;return{title:null==l?void 0:l.title,type:null==l?void 0:l.type,sync:null!=(t=null==l?void 0:l.sync)&&t,description:null==l?void 0:l.description,categories:(null!=(r=null==l?void 0:l.categories)?r:[]).map(function(e){return e.id}),options:null!=(o=null==l?void 0:l.options)?o:{}}}return{type:e.type,sync:!1,options:{},config:{}}},[n,l,e.type]);(0,c.useEffect)(function(){h.setFieldsValue(C)},[h,C]);var F=null!=(t=u.Form.useWatch("type",h))?t:e.type,T=(0,c.useMemo)(function(){return r.getTriggerOptions(F)},[r,F]),I=(null==T?void 0:T.sync)!=null;(0,c.useEffect)(function(){I&&h.setFieldValue("sync",T.sync)},[I,T,h]);var j=(0,c.useMemo)(function(){if("create"!==n)return null;var e=null==T?void 0:T.PresetFieldsetLoader;return e?(0,c.lazy)(e):null},[n,T]),M=(0,i.useMemoizedFn)(function(){h.setFieldValue("config",{})}),z=(0,i.useMemoizedFn)(function(){var e;return(e=function(){var e,t,r,o,a,i;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return[4,h.validateFields()];case 1:e=u.sent(),S(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==n)return[3,4];return[4,g.create({values:{title:e.title,type:e.type,sync:!!e.sync,current:!0,config:null!=(t=e.config)?t:{},description:e.description,categories:null!=(r=e.categories)?r:[],options:null!=(o=e.options)?o:{}}})];case 3:return u.sent(),[3,6];case 4:return[4,g.update({filterByTk:l.id,values:{title:e.title,sync:!!e.sync,description:e.description,categories:null!=(a=e.categories)?a:[],options:null!=(i=e.options)?i:{}}})];case 5:u.sent(),u.label=6;case 6:return f(),[3,8];case 7:return S(!1),[7];case 8:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){D(l,r,o,a,i,"next",e)}function i(e){D(l,r,o,a,i,"throw",e)}a(void 0)})})()});return s().createElement(o.DrawerFormLayout,{title:m("create"===n?"Add new":"Edit"),onSubmit:z,submitting:E,submitText:m("Submit"),cancelText:m("Cancel")},s().createElement(u.Form,{form:h,layout:"vertical",initialValues:C},s().createElement(u.Form.Item,{name:"title",label:m("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"type",label:m("Trigger type"),rules:[{required:!0}]},s().createElement(u.Select,{options:k,disabled:"edit"===n,onChange:M,showSearch:!0,optionFilterProp:"label",popupMatchSelectWidth:!0,optionRender:function(e){var t,n;return s().createElement(u.Space,{direction:"vertical"},s().createElement(u.Tag,{color:"gold"},null==(t=e.data)?void 0:t.label),(null==(n=e.data)?void 0:n.description)?s().createElement(u.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},e.data.description):null)}})),j?s().createElement("div",{style:{marginBottom:v.marginLG}},s().createElement("div",{style:{marginBottom:v.marginXS,fontWeight:600}},"".concat(m("Trigger configuration"),":")),s().createElement("div",{style:{padding:v.padding,border:"".concat(v.lineWidth,"px solid ").concat(v.colorBorderSecondary),borderRadius:v.borderRadiusLG}},s().createElement(c.Suspense,{fallback:s().createElement(u.Spin,null)},s().createElement(j,null)))):null,s().createElement(u.Form.Item,{name:"sync",label:m("Execute mode"),extra:m("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.")},s().createElement(O,{disabled:I||"edit"===n})),s().createElement(u.Form.Item,{name:"categories",label:m("Category")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:d,optionFilterProp:"label"})),s().createElement(u.Form.Item,{name:"description",label:m("Description")},s().createElement(u.Input.TextArea,{autoSize:{minRows:2}})),s().createElement(u.Form.Item,{label:m("Advance options")},s().createElement(u.Card,{size:"small"},s().createElement(u.Form.Item,{name:["options","timeout"],label:m("Timeout settings"),extra:m("0 means unlimited. If you set any other value and the execution is still not completed when the timeout is reached, the execution plan will be terminated and the remaining nodes will not be executed. Time spent in queue is not counted; timing starts only after it first enters a processor."),initialValue:0},s().createElement(P,null)),s().createElement(u.Form.Item,{name:["options","stackLimit"],label:m("Maximum number of cycling triggers"),extra:m("The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution."),initialValue:1},s().createElement(u.InputNumber,{min:1,precision:0,style:{width:"50%"}})),s().createElement(u.Form.Item,{name:["options","deleteExecutionOnStatus"],label:m("Auto delete history when execution is on end status")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:x,optionFilterProp:"label",optionRender:function(e){var t,n,r;return s().createElement(u.Space,null,s().createElement(u.Tag,{color:null==(t=e.data)?void 0:t.color},null==(n=e.data)?void 0:n.label),(null==(r=e.data)?void 0:r.description)?s().createElement("span",null,e.data.description):null)},tagRender:function(e){var t,n=e.value,r=e.label,o=e.closable,l=e.onClose;return s().createElement(u.Tag,{color:null==(t=A.m2[String(n)])?void 0:t.color,closable:o,onClose:l,onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},r)}}))))))}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function G(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function N(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){G(l,r,o,a,i,"next",e)}function i(e){G(l,r,o,a,i,"throw",e)}a(void 0)})}}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function _(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function U(){var e=W(["\n background: ",";\n padding: 0;\n "]);return U=function(){return e},e}function $(){var e=W(["\n padding: ","px ","px 0 calc(","px - ","px);\n background: ",";\n\n .ant-tabs {\n margin-bottom: 0;\n }\n\n .ant-tabs-nav {\n margin-bottom: 0;\n }\n\n .ant-tabs-content-holder {\n display: none;\n }\n "]);return $=function(){return e},e}function H(){var e=W(["\n margin: 0 ","px ","px;\n padding: ","px;\n background: ",";\n border-radius: 0 ","px ","px ","px;\n "]);return H=function(){return e},e}var Q=["id","description","categories"];function X(e){var t=e.record,n=e.resource,r=e.onChanged,o=(0,p.ec)().t,l=u.App.useApp().message,a=V((0,c.useState)(!1),2),d=a[0],f=a[1],m=(0,i.useMemoizedFn)(function(e){return N(function(){return K(this,function(a){switch(a.label){case 0:if((null==t?void 0:t.id)==null)return[2];f(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,n.update({filterByTk:t.id,values:{enabled:e}})];case 2:return a.sent(),setTimeout(function(){return r()},0),[3,5];case 3:return a.sent(),l.error(o("Operation failed")),[3,5];case 4:return f(!1),[7];case 5:return[2]}})})()});return s().createElement(u.Switch,{checked:!!(null==t?void 0:t.enabled),size:"small",disabled:d,loading:d,onClick:function(e,t){var n;return null==t||null==(n=t.stopPropagation)?void 0:n.call(t)},onChange:m})}function Z(e){var t=e.record,n=e.resource,r=e.onSubmitted,l=(0,p.ec)().t,a=V(u.Form.useForm(),1)[0],d=V((0,c.useState)(!1),2),f=d[0],m=d[1],y=(0,i.useMemoizedFn)(function(){return N(function(){var e;return K(this,function(o){switch(o.label){case 0:return[4,a.validateFields()];case 1:e=o.sent(),m(!0),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,n.revision({filterByTk:t.id,values:e})];case 3:return o.sent(),r(),[3,5];case 4:return m(!1),[7];case 5:return[2]}})})()});return s().createElement(o.DialogFormLayout,{title:l("Duplicate to new workflow"),onSubmit:y,submitting:f,submitText:l("Submit"),cancelText:l("Cancel")},s().createElement(u.Form,{form:a,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:l("Title")},s().createElement(u.Input,null))))}function J(){var e,t=(0,p.ec)().t,n=(0,p.kj)(),d=(0,a.useFlowContext)(),v=(0,m.TD)().getWorkflowCanvasPath,g=u.theme.useToken().token,h=u.App.useApp(),w=h.modal,E=h.message,S=d.api.resource("workflows"),k=d.app.pm.get(y.A),x=(0,l.css)(U(),g.colorBgLayout),C=(0,l.css)($(),g.padding,g.padding,g.padding,g.lineWidth,g.colorBgLayout),A=(0,l.css)(H(),g.padding,g.padding,g.paddingLG,g.colorBgContainer,g.borderRadiusLG,g.borderRadiusLG,g.borderRadiusLG),O=(0,c.useMemo)(function(){var e,t,n,r;return null==(r=d.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflows")},[d]),T=V((0,c.useState)("all"),2),I=T[0],j=T[1],M=V((0,c.useState)(1),2),P=M[0],z=M[1],D=V((0,c.useState)(o.DEFAULT_PAGE_SIZE),2),B=D[0],R=D[1],G=V((0,c.useState)([]),2),q=G[0],_=G[1],W=V((0,c.useState)(void 0),2),J=W[0],Y=W[1],ee=(0,i.useMemoizedFn)(function(e){Y(e),z(1)}),et=(0,i.useRequest)(function(){return N(function(){var e,t,n;return K(this,function(r){switch(r.label){case 0:return[4,d.api.resource("workflowCategories").list({paginate:!1,sort:["sort"]})];case 1:return[2,null!=(e=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?e:[]]}})})()}),en=et.data,er=et.refresh,eo=(0,c.useMemo)(function(){return en||[]},[en]),el=(0,c.useMemo)(function(){return eo.map(function(e){var t;return{value:e.id,label:n(null!=(t=e.title)?t:"")}})},[eo,n]),ea=(0,i.useRequest)(function(){return N(function(){var e,t;return K(this,function(n){switch(n.label){case 0:return e={current:!0},"all"!==I&&(e["categories.id"]=I),t=J?{$and:[e,J]}:e,[4,S.list({page:P,pageSize:B,sort:["-createdAt"],except:["config"],appends:["categories","stats"],filter:t})];case 1:var r,o,l,a,i;return[2,{records:a=Array.isArray(l=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?l:Array.isArray(null==l?void 0:l.data)?l.data:[],total:(i=(null==o?void 0:o.meta)||(null==l?void 0:l.meta)||{}).count||i.total||a.length}]}})})()},{refreshDeps:[P,B,I,J]}),ei=ea.data,eu=ea.loading,ec=ea.refresh,es=(0,i.useMemoizedFn)(function(e,t){if(t!==B){R(t),z(1);return}z(e)}),ed=(0,i.useMemoizedFn)(function(e){var t=e?k.getTriggerOptions(e):void 0;return(null==t?void 0:t.title)?n(t.title):e}),ef=(0,i.useMemoizedFn)(function(e,t){d.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(L,{mode:e,plugin:k,record:t,categoryOptions:el,onSubmitted:function(){return ec()}})}})}),em=(0,i.useMemoizedFn)(function(e){d.viewer.dialog({width:520,closable:!0,content:function(){return s().createElement(Z,{record:e,resource:S,onSubmitted:function(){return ec()}})}})}),ep=(0,i.useMemoizedFn)(function(e){d.router.navigate(v(e.id))}),ey=(0,i.useMemoizedFn)(function(e){d.viewer.drawer({width:"60%",closable:!0,title:t("Execution history"),content:function(){return s().createElement(b.S,{workflowKey:e.key})}})}),eb=(0,i.useMemoizedFn)(function(e){w.confirm({title:t("Delete record"),content:t("Are you sure you want to delete it?"),onOk:function(){return N(function(){return K(this,function(t){switch(t.label){case 0:return[4,S.destroy({filterByTk:e})];case 1:return t.sent(),_([]),ec(),[2]}})})()}})}),ev=(0,i.useMemoizedFn)(function(){return N(function(){return K(this,function(e){switch(e.label){case 0:return[4,S.sync()];case 1:return e.sent(),E.success(t("Operation succeeded")),ec(),[2]}})})()}),eg=!!((null==(e=d.app)?void 0:e.name)&&"main"!==d.app.name||d.app.pm.get("multi-app-share-collection")),eh=(0,c.useMemo)(function(){return[{title:t("Title"),dataIndex:"title"},{title:t("Category"),dataIndex:"categories",render:function(e){return s().createElement(u.Space,{size:[0,4],wrap:!0},(null!=e?e:[]).map(function(e){return s().createElement(u.Tag,{key:e.id,color:"default"===e.color?void 0:e.color},n(e.title))}))}},{title:t("Trigger type"),dataIndex:"type",render:function(e){return e?s().createElement(u.Tag,{color:"gold"},ed(e)):null}},{title:t("Execute mode"),dataIndex:"sync",width:140,render:function(e){return s().createElement(f.t,{value:e})}},{title:t("Enabled"),dataIndex:"enabled",width:100,render:function(e,t){return s().createElement(X,{record:t,resource:S,onChanged:ec})}},{title:t("Executed"),dataIndex:["stats","executed"],width:100,render:function(e,t){var n,r;return s().createElement("a",{"aria-label":"executed-".concat(t.title),onClick:function(){return ey(t)}},null!=(n=null==(r=t.stats)?void 0:r.executed)?n:0)}},{title:t("Actions"),width:260,render:function(e,n){return s().createElement(u.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},s().createElement("a",{onClick:function(){return ep(n)}},t("Configure")),s().createElement("a",{onClick:function(){return ef("edit",n)}},t("Edit")),s().createElement("a",{onClick:function(){return em(n)}},t("Duplicate")),s().createElement("a",{onClick:function(){return eb(n.id)}},t("Delete")))}}]},[eb,ep,em,ey,ef,ec,S,t,ed]);return s().createElement("div",{className:x},s().createElement(F,{className:C,activeKey:I,onChange:function(e){j(e),z(1)},categories:eo,refreshCategories:er}),s().createElement("div",{className:A},s().createElement(u.Flex,{justify:"space-between",align:"center",style:{marginBottom:g.margin}},s().createElement(o.CollectionFilter,{collection:O,nonfilterableFieldNames:Q,onChange:ee,t:n}),s().createElement(u.Space,null,s().createElement(u.Button,{icon:s().createElement(r.ReloadOutlined,null),onClick:function(){return ec()}},t("Refresh")),eg?s().createElement(u.Tooltip,{title:t("Sync enabled status of all workflows from database")},s().createElement(u.Button,{icon:s().createElement(r.SyncOutlined,null),onClick:ev},t("Sync"))):null,s().createElement(u.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!q.length,onClick:function(){return eb(q)}},t("Delete")),s().createElement(u.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null),onClick:function(){return ef("create")}},t("Add new")))),s().createElement(o.Table,{rowKey:"id",loading:eu,columns:eh,dataSource:(null==ei?void 0:ei.records)||[],rowSelection:{selectedRowKeys:q,onChange:_},pagination:{current:P,pageSize:B,total:(null==ei?void 0:ei.total)||0,onChange:es}})))}function Y(){var e=(0,p.kj)(),t=(0,a.useFlowContext)().app.pm.get(y.A),n=(0,c.useMemo)(function(){var n=Array.from(t.triggers.getEntities()).map(function(t){var n=V(t,2),r=n[0],o=n[1];return{value:r,label:(null==o?void 0:o.title)?e(o.title):String(r)}}).sort(function(e,t){return String(e.label).localeCompare(String(t.label))});return[_(q({},d.A),{hidden:!0,fields:d.A.fields.map(function(e){return(null==e?void 0:e.name)==="type"&&e.uiSchema?_(q({},e),{uiSchema:_(q({},e.uiSchema),{enum:n})}):e})})]},[t,e]);return s().createElement(o.ExtendCollectionsProvider,{collections:n},s().createElement(J,null))}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["618"],{5705:function(e,t,r){r.r(t),r.d(t,{WorkflowPane:function(){return eS}});var n,o,i=r(9155),c=r.n(i),a=r(2059),l=r(9452),u=r(5230),s=r(3342),p=r(4421);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var d=function(e){var t,r=e.request,n=(e.filter,function(e,t){if(null==e)return{};var r,n,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,r=Reflect.ownKeys(Object(e));o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}if(i=function(e,t){if(null==e)return{};var r,n,o={},i=Object.getOwnPropertyNames(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,["request","filter"])),o=(0,s.useRecord)(),i=f(m({},n),{request:f(m({},r),{params:f(m({disableDefaultAppends:!0},null==r?void 0:r.params),{filter:f(m({},null==r||null==(t=r.params)?void 0:t.filter),{key:o.key})})})});return c().createElement(s.ResourceActionProvider,i)},y=r(5953),b=r(4442),v=r(6072),g=function(){var e=(0,y.useTranslation)().t,t=(0,s.useRecord)().id,r=(0,s.useActionContext)().setVisible,n=(0,s.useGetAriaLabelOfAction)("Configure").getAriaLabel;return c().createElement(b.Link,{"aria-label":n(),to:(0,v.Yz)(t),onClick:function(){return r(!1)}},e("Configure"))};function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e){var t,r,n,o=e.component,a=e.children,l=function(e,t){if(null==e)return{};var r,n,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,r=Reflect.ownKeys(Object(e));o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}if(i=function(e,t){if(null==e)return{};var r,n,o={},i=Object.getOwnPropertyNames(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,["component","children"]),p=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(!1))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=p[0],f=p[1],d=(0,u.useFieldSchema)();return c().createElement(s.ActionContextProvider,{value:{visible:m,setVisible:f,fieldSchema:d}},c().createElement(void 0===o?"div":o,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},l),n=n={onClick:function(){f(!0)}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),a),c().createElement(s.SchemaComponent,{schema:d,onlyRenderProperties:!0}))}var O=r(3872),w=r(6481),C=r(7428),A=r(5827),S=r(2662);function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var j={title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-decorator":"FormItem",title:'{{t("Trigger type", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Select","x-component-props":{optionRender:"{{TriggerOptionRender}}",popupMatchSelectWidth:!0,listHeight:300},enum:"{{useTriggersOptions()}}",required:!0},sync:{type:"boolean",title:'{{ t("Execute mode", { ns: "'.concat(O.CU,'" }) }}'),description:'{{ t("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"SyncOptionSelect","x-component-props":{options:[{label:'{{ t("Asynchronously", { ns: "'.concat(O.CU,'" }) }}'),value:!1,tooltip:'{{ t("Will be executed in the background as a queued task.", { ns: "'.concat(O.CU,'" }) }}')},{label:'{{ t("Synchronously", { ns: "'.concat(O.CU,'" }) }}'),value:!0,tooltip:'{{ t("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.", { ns: "'.concat(O.CU,'" }) }}')}]}},triggerPreset:{type:"void","x-component":"TriggerPresetFieldset"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},categories:{type:"array",title:'{{ t("Category", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"CollectionField","x-collection-field":"workflows.categories"},options:{type:"object","x-decorator":"FormItem",title:'{{ t("Advance options", { ns: "'.concat(O.CU,'" }) }}'),"x-component":"Fieldset",properties:{timeout:{type:"number",title:'{{ t("Timeout settings", { ns: "'.concat(O.CU,'" }) }}'),description:'{{ t("0 means unlimited. If you set any other value and the execution is still not completed when the timeout is reached, the execution plan will be terminated and the remaining nodes will not be executed. Time spent in queue is not counted; timing starts only after it first enters a processor.", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"TimeoutInput",default:0},stackLimit:{type:"number",title:'{{ t("Maximum number of cycling triggers", { ns: "'.concat(O.CU,'" }) }}'),description:'{{ t("The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem",default:1,"x-component":"InputNumber","x-component-props":{min:1,precision:0,className:"auto-width"}},deleteExecutionOnStatus:{type:"array",title:'{{ t("Auto delete history when execution is on end status", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0,optionRender:S.Qg,tagRender:S.lP},enum:C.$A.filter(function(e){return!!e.value})}}}},E={name:"workflow",type:"void",properties:{provider:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:A.A,resourceName:"workflows",request:{resource:"workflows",action:"list",params:{filter:{current:!0},sort:["-createdAt"],except:["config"]}}},"x-component":"CategoryTabs",properties:{main:{type:"void","x-component":"CardItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{title:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useResourceFilterActionProps","x-component-props":{icon:"FilterOutlined",nonfilterable:["id","description","categories"]},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},sync:{type:"void",title:'{{t("Sync", { ns: "'.concat(O.CU,'" })}}'),"x-decorator":"Tooltip","x-decorator-props":{title:'{{ t("Sync enabled status of all workflows from database", { ns: "'.concat(O.CU,'" }) }}')},"x-component":"Action","x-component-props":{icon:"SyncOutlined",useAction:"{{ useSyncAction }}"},"x-reactions":["{{useWorkflowSyncReaction}}"]},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{current:!0}},title:'{{t("Add new")}}',properties:{title:j.title,type:j.type,triggerPreset:j.triggerPreset,sync:j.sync,categories:j.categories,description:j.description,options:j.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"array","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Title") }}',properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},categories:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Category", { ns: "'.concat(O.CU,'" }) }}'),properties:{categories:{type:"array","x-component":"EnumerationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"id",color:"color"}}}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Trigger type", { ns: "'.concat(O.CU,'" }) }}'),properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},sync:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Execute mode", { ns: "'.concat(O.CU,'" }) }}'),properties:{sync:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Enabled", { ns: "'.concat(O.CU,'" }) }}'),properties:{enabled:{type:"boolean","x-component":"WorkflowEnabledSwitch",default:!1}}},"stats.executed":{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Executed", { ns: "'.concat(O.CU,'" }) }}'),properties:{"stats.executed":{type:"number","x-decorator":"OpenDrawer","x-decorator-props":{component:function(e){var t=(0,s.useCollectionRecordData)();return c().createElement("a",P({"aria-label":"executed-".concat(t.title)},e))}},"x-component":"InputNumber","x-read-pretty":!0,properties:{drawer:w.M}}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{configure:{type:"void","x-component":"WorkflowLink"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{ t("Edit") }}',properties:{title:j.title,type:(n=P({},j.type),o=o={"x-disabled":!0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n),sync:j.sync,categories:j.categories,description:j.description,options:j.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},revision:{type:"void",title:'{{t("Duplicate", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Action.Link","x-component-props":{openSize:"small"},properties:{modal:{type:"void",title:'{{t("Duplicate to new workflow", { ns: "'.concat(O.CU,'" })}}'),"x-decorator":"FormV2","x-use-decorator-props":"useDuplicateWorkflowFormProps","x-component":"Action.Modal",properties:{title:j.title,description:j.description,footer:{type:"void","x-component":"Action.Modal.Footer",properties:{submit:{type:"void",title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useRevisionAction }}"}},cancel:{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"}}}}}}}}}}}}}},k=r(1134),F=r(3462),D=r(512);function T(e){var t=e.data,r=t.label,n=t.color,o=t.options,i=(0,s.useCompile)();return c().createElement(a.Space,{direction:"vertical"},c().createElement(a.Tag,{color:n},i(r)),c().createElement(a.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},i(o.description)))}var I=r(7375),R=r(6799),V=r(166),U=r(6773);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function N(e,t,r,n,o,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,o)}function L(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){N(i,n,o,c,a,"next",e)}function a(e){N(i,n,o,c,a,"throw",e)}c(void 0)})}}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function W(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:l(0)}),a(c,"throw",{value:l(1)}),a(c,"return",{value:l(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function z(){var e,t,r=(e=["\n .ant-tabs-nav-list > :first-child {\n border: none;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return z=function(){return r},r}function K(e){var t=(0,R.useDraggable)({id:e.id,data:e.data}),r=t.attributes,n=t.listeners,o=t.setNodeRef;return c().createElement("div",q({ref:o},n,r),c().createElement("div",null,e.children))}function _(e){var t=(0,R.useDroppable)({id:e.id,data:e.data}),r=t.isOver,n=t.setNodeRef;return c().createElement("div",{ref:n,style:r?{color:"green"}:void 0},e.children)}var G=(0,u.observer)(function(e){var t=e.item;return c().createElement(_,{id:t.id.toString(),data:t},c().createElement("div",null,c().createElement(K,{id:t.id.toString(),data:t},c().createElement(H,{item:t}))))},{displayName:"TabTitle"}),H=function(e){var t=e.item,r=(0,y.useTranslation)().t,n=(0,s.useCompile)();return c().createElement(a.Space,null,c().createElement(a.Badge,{color:t.color}),r(n(t.title)))},Q=(0,u.observer)(function(e){var t=B((0,i.useState)(null),2),r=t[0],n=t[1],o=(0,i.useContext)(Y).refresh,a=(0,s.useAPIClient)(),l=(0,R.useSensor)(R.MouseSensor,{activationConstraint:{distance:10}}),u=(0,R.useSensors)(l);return c().createElement(R.DndContext,{sensors:u,onDragEnd:function(e){return L(function(){var t,r;return $(this,function(i){switch(i.label){case 0:if(t=e.active,r=e.over,setTimeout(function(){n(null)}),!(r&&r.id!==t.id))return[3,2];return[4,a.resource("workflowCategories").move({sourceId:t.id,targetId:r.id})];case 1:i.sent(),o(),i.label=2;case 2:return[2]}})})()},onDragStart:function(e){var t;n(null==(t=e.active)?void 0:t.data.current)}},e.children,c().createElement(R.DragOverlay,null,r?c().createElement("span",{style:{whiteSpace:"nowrap"}},c().createElement(H,{item:r})):null))},{displayName:"DndProvider"}),Y=(0,i.createContext)({});function J(e){var t=e.values,r=e.onEdit,n=e.onRemove,o=(0,s.useCompile)(),l=(0,i.useCallback)(function(e){switch(e.key){case"edit":r(t);break;case"delete":n(t.id)}},[r,n,t]);return c().createElement(a.Dropdown,{menu:{items:[{key:"edit",label:(0,O.vV)("Edit category")},{key:"delete",label:(0,O.vV)("Delete category")}],onClick:l}},c().createElement(I.MenuOutlined,{role:"button","aria-label":o(t.title),style:{padding:8,margin:"-8px"}}))}function X(){var e,t=(0,s.useResourceActionContext)(),r=t.run,n=t.setState,o=t.defaultRequest,p=B((0,i.useState)({tab:"all"}),2),m=p[0],f=p[1],d=B((0,i.useState)(m.tab),2),y=d[0],b=d[1],v=(0,s.useCompile)(),g=(0,s.useAPIClient)(),h=(0,u.useFieldSchema)(),x=a.App.useApp().modal,w=(0,s.useRequest)({resource:"workflowCategories",action:"list",params:{paginate:!1,sort:["sort"]}}),C=w.data,A=w.refresh,S=B((0,i.useState)(!1),2),P=S[0],j=S[1],E=(0,i.useMemo)(function(){return(0,l.createForm)()},[]),k=(0,i.useCallback)(function(e){j(!0);var t=(0,U.cloneDeep)(e);E.setValues(t)},[E]),F=(0,i.useCallback)(function(){j(!1),E.reset()},[E]),D=(0,i.useCallback)(function(e){x.confirm({title:v("{{t('Delete category')}}"),content:v("{{t('Are you sure you want to delete it?')}}"),onOk:function(){return L(function(){return $(this,function(t){switch(t.label){case 0:return[4,g.resource("workflowCategories").destroy({filter:{id:e}})];case 1:return t.sent(),e===+m.tab&&f({tab:"all"}),A(),r(),[2]}})})()}})},[m.tab]),T=(0,i.useMemo)(function(){if(!(null==C?void 0:C.data))return[];var e=C.data.sort(function(e,t){return e.sort-t.sort}).concat().map(function(e){return W(q({},e),{schema:h.properties.main})});return e.find(function(e){return"all"===e.id})||e.unshift({title:'{{t("All", { ns: "'.concat(O.CU,'" })}}'),id:"all",sort:0,closable:!1,schema:h.properties.main}),e.map(function(e){return{label:"all"!==e.id?c().createElement("div",{"data-no-dnd":"true"},c().createElement(G,{item:e})):v(e.title),key:String(e.id),closable:e.closable,closeIcon:c().createElement(J,{values:e,onEdit:k,onRemove:D}),children:c().createElement(a.Card,{variant:"borderless",style:{borderRadius:"0 0.5em 0.5em 0.5em"}},c().createElement(u.RecursionField,{name:y,schema:e.schema,onlyRenderProperties:!0}))}})},[v,null==C?void 0:C.data,y,k,D,h.properties.main]),I=(0,i.useCallback)(function(e){if(f({tab:e}),b((0,V.uid)()),"all"!==e){var t,i={$and:[null==o||null==(t=o.params)?void 0:t.filter,{"categories.id":e}]};r({filter:i}),null==n||n({categories:[+e],params:[{filter:i}]})}else r(),null==n||n({categories:[],params:[]})},[null==o||null==(e=o.params)?void 0:e.filter,r,n]);return((0,i.useEffect)(function(){"all"!==m.tab&&I(m.tab)},[m.tab,I]),C)?c().createElement(Y.Provider,{value:{refresh:A}},c().createElement(Q,null,c().createElement(a.Tabs,{addIcon:c().createElement(s.SchemaComponent,{components:{AddCategory:er},schema:{type:"void",properties:{addCategories:{type:"void",title:'{{ t("Add category", { ns: "'.concat(O.CU,'" }) }}'),"x-component":"AddCategory","x-component-props":{type:"primary"}}}}}),onChange:I,defaultActiveKey:m.tab||"all",type:"editable-card",destroyInactiveTabPane:!0,tabBarStyle:{marginBottom:"0px"},className:(0,s.css)(z()),items:T})),c().createElement(s.ActionContextProvider,{value:{visible:P,setVisible:F,openSize:"small"}},c().createElement(s.SchemaComponent,{scope:{useFormProviderProps:ee,useCancelAction:s.useCancelAction,useEditSubmit:Z},schema:{name:(0,V.uid)(),type:"void","x-decorator":"FormV2","x-decorator-props":{form:E},title:'{{ t("Edit category", { ns: "'.concat(O.CU,'" }) }}'),"x-component":"Action.Modal","x-component-props":{delay:0},properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useEditSubmit }}",style:{marginLeft:"8px"}}}}}}}}))):null}function Z(){var e=(0,u.useForm)(),t=(0,s.useActionContext)(),r=(0,s.useResourceActionContext)(),n=(0,i.useContext)(Y).refresh,o=(0,s.useAPIClient)();return{run:function(){return L(function(){var i;return $(this,function(c){switch(c.label){case 0:return[4,e.submit()];case 1:return c.sent(),[4,o.resource("workflowCategories").update({filterByTk:null==(i=e.values)?void 0:i.id,values:e.values})];case 2:return c.sent(),t.setVisible(!1),[4,e.reset()];case 3:return c.sent(),null==n||n(),null==r||r.refresh(),[2]}})})()}}}function ee(){return{form:(0,u.useForm)()}}function et(){var e=(0,u.useForm)(),t=(0,s.useActionContext)().setVisible,r=(0,i.useContext)(Y).refresh,n=(0,s.useAPIClient)();return{run:function(){return L(function(){var o;return $(this,function(i){switch(i.label){case 0:return[4,e.submit()];case 1:return i.sent(),o=(0,U.cloneDeep)(e.values),[4,n.resource("workflowCategories").create({values:o})];case 2:return i.sent(),t(!1),e.reset(),r(),[2]}})})()}}}function er(e){var t=B((0,i.useState)(!1),2),r=t[0],n=t[1],o=(0,y.useTranslation)().t,a=(0,i.useMemo)(function(){return(0,l.createForm)()},[]);return c().createElement(s.ActionContextProvider,{value:{visible:r,setVisible:n,openSize:"small"}},c().createElement("div",{onClick:function(){return n(!0)},title:o("Add category")},c().createElement(I.PlusOutlined,null)),c().createElement(s.SchemaComponent,{schema:{name:"modal",type:"void","x-decorator":"FormV2","x-decorator-props":{form:a},title:'{{ t("Add category") }}',"x-component":"Action.Modal","x-component-props":W(q({},e),{delay:0}),properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateSubmit }}",style:{marginLeft:"8px"}}}}}}},scope:{useCancelAction:s.useCancelAction,useCreateSubmit:et}}))}function en(e){var t=e.value,r=e.multiple,n=e.fieldNames,o=void 0===n?s.defaultFieldNames:n,i=(0,s.useCompile)();return(r?null!=t?t:[]:t?[t]:[]).map(function(e){return c().createElement(a.Tag,{key:e[o.value],color:e[o.color]},i(e[o.label]))})}var eo=r(2815);function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ec=[{value:1e3,label:"Seconds"},{value:6e4,label:"Minutes"},{value:36e5,label:"Hours"},{value:864e5,label:"Days"}];function ea(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15552e6;return Math.min(Math.max(e,0),t)}function el(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4;return e&&null!=(t=null==(r=ec.findLast(function(t){return e%t.value==0}))?void 0:r.value)?t:n}var eu=(0,u.connect)(function(e){var t,r,n=ea(Number(null!=(r=e.value)?r:0)),o=function(e){if(Array.isArray(e))return e}(t=c().useState(function(){return el(n)}))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return ei(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ei(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],l=o[1];c().useEffect(function(){0!==n&&l(function(e){return el(n,e)})},[n]);var u=0===n?0:n/i,s=15552e6/i;return c().createElement(a.Space.Compact,null,c().createElement(a.InputNumber,{min:0,max:s,precision:0,value:u,onChange:function(t){var r;return null==(r=e.onChange)?void 0:r.call(e,ea(Number(t)||0,s)*i)},className:"auto-width"}),c().createElement(a.Select,{value:i,options:ec.map(function(e){var t,r;return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),r=r={label:(0,O.vV)(e.label)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}),onChange:function(t){var r,n,o=ea(Number(null!=(r=e.value)?r:0)),c=0===o?0:o/i;l(t),null==(n=e.onChange)||n.call(e,ea(c*t))},className:"auto-width"}))},(0,u.mapProps)(function(e){return e}),(0,u.mapReadPretty)(function(e){var t,r=Number(null!=(t=e.value)?t:0);if(0===r)return c().createElement(c().Fragment,null,(0,O.vV)("Unlimited"));var n=el(r),o=ec.find(function(e){return e.value===n});return c().createElement(c().Fragment,null,r/n," ",o?(0,O.vV)(o.label):"")}));function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ep(e,t,r,n,o,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,o)}function em(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){ep(i,n,o,c,a,"next",e)}function a(e){ep(i,n,o,c,a,"throw",e)}c(void 0)})}}function ef(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){a=!0,n=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return es(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return es(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ey(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:l(0)}),a(c,"throw",{value:l(1)}),a(c,"return",{value:l(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function eb(e){var t=(0,u.useField)(),r=(0,s.useRecord)(),n=(0,s.usePlugin)(k.default);return(0,u.useFormEffects)(function(e){(0,l.onFieldChange)("type",function(e){var o=r.id||!e.value;if(e.value){var i=n.triggers.get(e.value);null!=i.sync?(o=!0,t.setValue(i.sync)):t.setInitialValue(!1)}t.setPattern(o?"disabled":"editable")})}),(0,i.useEffect)(function(){if(r.id){t.setPattern("disabled");var o,i=n.triggers.get(r.type);null!=i.sync?t.setValue(i.sync):t.setInitialValue(null!=(o=e.value)&&o)}},[r.id,t,n.triggers,r.type,e.value]),c().createElement(F.$i,e)}function ev(e){var t=(0,s.useApp)();e.visible=!!((0,s.usePlugin)("multi-app-share-collection")||"main"!==t.name)}function eg(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useResourceContext)().resource;return{run:function(){return em(function(){return ey(this,function(n){switch(n.label){case 0:return[4,r.sync()];case 1:return n.sent(),e.success(t("Operation succeeded")),[2]}})})()}}}function eh(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useResourceActionContext)().refresh,n=(0,s.useResourceContext)(),o=n.resource,i=n.targetKey,c=(0,s.useActionContext)().setVisible,l=(0,s.useRecord)()[i],p=(0,u.useForm)(),m=(0,u.useField)();return{run:function(){return em(function(){return ey(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,p.submit()];case 1:return n.sent(),m.data=m.data||{},m.data.loading=!0,[4,o.revision({filterByTk:l,values:p.values})];case 2:return n.sent(),e.success(t("Operation succeeded")),r(),c(!1),[3,5];case 3:return console.error(n.sent()),[3,5];case 4:return m.data&&(m.data.loading=!1),[7];case 5:return[2]}})})()}}}function ex(e){var t,r;return{title:null!=(t=e.title)?t:"",description:null!=(r=e.description)?r:""}}function eO(){var e,t=null!=(e=(0,s.useRecord)())?e:{},r=t.title,n=t.description,o=(0,s.useActionContext)(),c=o.visible,a=o.setFormValueChanged,u=(0,i.useMemo)(function(){return(0,l.createForm)({initialValues:ex({title:r,description:n})})},[n,r]);return(0,i.useEffect)(function(){if(c){var e=ex({title:r,description:n});u.setInitialValues(e),u.setValues(e),u.reset(),null==a||a(!1)}},[n,u,a,r,c]),{form:u}}function ew(){var e,t,r=(0,s.usePlugin)(k.default),n=ed((0,i.useState)(null),2),o=n[0],a=n[1],p=(0,u.useForm)();(0,u.useFormEffects)(function(){(0,l.onFieldValueChange)("type",function(e){var t;a(null!=(t=e.value)?t:null),p.clearFormGraph("config.*")})});var m=o?r.triggers.get(o):null,f=(0,i.useMemo)(function(){return!(null==m?void 0:m.presetFieldset)&&(null==m?void 0:m.PresetFieldsetLoader)?(0,i.lazy)(m.PresetFieldsetLoader):null},[m]);return f?c().createElement(eC,{key:o,PresetFieldset:f,defaultConfig:null!=(e=null==m||null==(t=m.createDefaultConfig)?void 0:t.call(m))?e:{}}):(null==m?void 0:m.presetFieldset)?c().createElement(s.SchemaComponent,{key:o,components:m.components,scope:m.scope,schema:{type:"void",properties:{config:{type:"object","x-decorator":"FormItem",title:'{{t("Trigger configuration", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Fieldset",properties:m.presetFieldset}}}}):null}function eC(e){var t=e.PresetFieldset,r=e.defaultConfig,n=(0,u.useForm)(),o=ed(a.Form.useForm(),1)[0],l=(0,i.useCallback)(function(e,t){var r;n.setValuesIn("config",null!=(r=t.config)?r:{})},[n]);return(0,i.useEffect)(function(){var e,t,i=ef({},r,null!=(e=null==(t=n.values)?void 0:t.config)?e:{});o.setFieldsValue({config:i}),n.setValuesIn("config",i)},[r,o,n]),c().createElement(a.Form,{form:o,layout:"vertical",onValuesChange:l},c().createElement(a.Form.Item,{label:(0,O.vV)("Trigger configuration")},c().createElement(F.LB,null,c().createElement(i.Suspense,{fallback:c().createElement(a.Skeleton,{active:!0,paragraph:{rows:2}})},c().createElement(t,null)))))}function eA(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useRecord)(),n=(0,s.useResourceContext)().resource,o=(0,s.useResourceActionContext)().refresh,l=ed((0,i.useState)(!1),2),u=l[0],p=l[1],m=(0,i.useCallback)(function(i){return em(function(){return ey(this,function(c){switch(c.label){case 0:if(!(null==r?void 0:r.id))return[2];p(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,n.update({filterByTk:r.id,values:{enabled:i}})];case 2:return c.sent(),setTimeout(function(){return null==o?void 0:o()},0),[3,5];case 3:return console.error(c.sent()),e.error(t("Operation failed")),[3,5];case 4:return p(!1),[7];case 5:return[2]}})})()},[e,r,o,n,t]);return c().createElement(a.Switch,{checked:!!(null==r?void 0:r.enabled),size:"small",disabled:u||!(null==r?void 0:r.id),loading:u,onClick:function(e,t){var r;return null==t||null==(r=t.stopPropagation)?void 0:r.call(t)},onChange:m})}function eS(){var e,t,r=(0,i.useContext)(s.SchemaComponentContext),n=(0,s.usePlugin)(k.default).useTriggersOptions;return c().createElement(s.SchemaComponentContext.Provider,{value:(e=ef({},r),t=t={designable:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)},c().createElement(s.SchemaComponent,{schema:E,components:{CollectionProvider:s.CollectionProvider,WorkflowLink:g,ExecutionResourceProvider:d,ExecutionLink:p.d,OpenDrawer:x,SyncOptionSelect:eb,ExecutionStatusColumn:S.t_,Tooltip:a.Tooltip,CategoryTabs:X,EnumerationField:en,WorkflowEnabledSwitch:eA,TriggerPresetFieldset:ew,TimeoutInput:eu},scope:{useTriggersOptions:n,useWorkflowSyncReaction:ev,useSyncAction:eg,useResourceFilterActionProps:eo.A,useRefreshActionProps:D.t,useRevisionAction:eh,useDuplicateWorkflowFormProps:eO,TriggerOptionRender:T,ExecutionStatusOptions:C.$A}}))}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["635"],{8950:function(e,l,n){n.d(l,{UpdateFieldset:function(){return f},UpdatePresetFieldset:function(){return g}});var t=n(9155),a=n.n(t),o=n(2059),i=n(2235),r=n(7806),s=n(9785),c=n(9488),u=n(5329),d=n(6855);function m(){var e,l=(0,c.kj)(),n=o.Form.useFormInstance(),i=o.Form.useWatch(["config","collection"]),u=[{label:(e=(0,c.kj)())("Update in a batch"),value:!1,tooltip:e("Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.")},{label:e("Update one by one"),value:!0,tooltip:e("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.")}];return((0,t.useEffect)(function(){i&&(n.setFieldValue(["config","usingAssignFormSchema"],void 0),n.setFieldValue(["config","assignFormSchema"],void 0),void 0===n.getFieldValue(["config","params","individualHooks"])&&n.setFieldValue(["config","params","individualHooks"],!1))},[i,n]),i)?a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","params","individualHooks"],label:l("Update mode")},a().createElement(s.$,{options:u})),a().createElement(d.F,{collection:i,label:l("Only update records matching conditions")}),a().createElement(o.Form.Item,{name:["config","params","values"],label:l("Fields values")},a().createElement(r.XH,{collection:i}))):null}function f(){var e,l=(0,i.TA)(),n=o.Form.useFormInstance();return a().createElement(a().Fragment,null,a().createElement(u.F,{disabled:!!(null==l||null==(e=l.config)?void 0:e.collection),onCollectionChanged:function(){n.setFieldValue(["config","params","filter"],{}),n.setFieldValue(["config","params","values"],{}),n.setFieldValue(["config","usingAssignFormSchema"],void 0),n.setFieldValue(["config","assignFormSchema"],void 0)}}),a().createElement(m,null))}function g(){return a().createElement(u.F,null)}}}]);