@nocobase/plugin-workflow 2.3.0-beta.5 → 2.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/142.99ee85375434b414.js +10 -0
- package/dist/client/276.0cd7d4f4b21299f2.js +10 -0
- package/dist/client/{382.d37fba14a6b91b0b.js → 382.163a5272789260ab.js} +1 -1
- package/dist/client/{394.a37310b78419ad7a.js → 394.2b986ad5ec8d2cd0.js} +1 -1
- package/dist/client/438.28614549f862fdd2.js +10 -0
- package/dist/client/{509.280de53e5e3e8874.js → 509.971ffa173109dc8d.js} +1 -1
- package/dist/client/{54.d81b710f7b4c1cd5.js → 54.6a0f9054f5aeb5cf.js} +1 -1
- package/dist/client/{618.1aa6c21d0f2840cb.js → 618.3a1c7678cb08cbe0.js} +1 -1
- package/dist/client/635.639988ea0ebdd8f3.js +10 -0
- package/dist/client/{67.92c849b5dbe07c33.js → 67.d69365d72db04f02.js} +1 -1
- package/dist/client/719.27165958caf83d8e.js +10 -0
- package/dist/client/728.f57b6314d6786870.js +10 -0
- package/dist/client/828.9bf3e7291b964688.js +10 -0
- package/dist/client/87.b62b1123d4d560fb.js +10 -0
- package/dist/client/{938.26493fc09ba1ccbc.js → 938.68d591853136f00d.js} +1 -1
- package/dist/client/{964.5ab736effd480a42.js → 964.618e49037c20a31b.js} +1 -1
- package/dist/client/components/UsersSelect.d.ts +2 -9
- package/dist/client/index.js +1 -1
- package/dist/client/workflowTasksResponsive.d.ts +14 -0
- package/dist/client-v2/32.3aff0d3127924f37.js +10 -0
- package/dist/client-v2/{387.5e61d648d16dbf1b.js → 387.e002f8eb34aa77e3.js} +1 -1
- package/dist/client-v2/438.9c0478e42e1c0801.js +10 -0
- package/dist/client-v2/513.d2d8fcc3befccfe3.js +10 -0
- package/dist/client-v2/{677.687ffa76229d7e48.js → 677.596ea9b75658598c.js} +1 -1
- package/dist/client-v2/components/FilterDynamicComponent.d.ts +4 -1
- package/dist/client-v2/components/UsersSelect.d.ts +39 -0
- package/dist/client-v2/constants.d.ts +4 -8
- package/dist/client-v2/index.d.ts +2 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/legacySettingsRedirect.d.ts +15 -0
- package/dist/client-v2/plugin.d.ts +1 -1
- package/dist/common/collections/jobs.d.ts +3 -0
- package/dist/common/collections/jobs.js +2 -1
- package/dist/externalVersion.js +13 -13
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +5 -5
- package/package.json +2 -2
- package/dist/client/142.fb4936d78fc80007.js +0 -10
- package/dist/client/276.69fb2aea13bc7c37.js +0 -10
- package/dist/client/438.255c1f798203a3fc.js +0 -10
- package/dist/client/635.ff6085589e23d39b.js +0 -10
- package/dist/client/719.f011fde3ad54571e.js +0 -10
- package/dist/client/728.e54be200a2eaac45.js +0 -10
- package/dist/client/828.eda52a8918f0a56c.js +0 -10
- package/dist/client/87.083467b89aaf3e53.js +0 -10
- package/dist/client/972.dd7f074d5f12e171.js +0 -10
- package/dist/client-v2/32.e076de47eaf18733.js +0 -10
- package/dist/client-v2/438.76337ed02ad35e77.js +0 -10
- package/dist/client-v2/513.028d9992cc415e73.js +0 -10
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
type LegacyWorkflowLocation = {
|
|
10
|
+
pathname: string;
|
|
11
|
+
search: string;
|
|
12
|
+
hash: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildLegacyWorkflowSettingsTarget(rootPublicPath: string, location: LegacyWorkflowLocation): string;
|
|
15
|
+
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { Plugin } from '@nocobase/client-v2';
|
|
10
|
-
import type
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
11
|
import type { TaskTypeOptions } from './taskCenter';
|
|
12
12
|
import type { Instruction } from './canvas/Instruction';
|
|
13
13
|
import type { Trigger } from './triggers';
|
package/dist/externalVersion.js
CHANGED
|
@@ -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.
|
|
15
|
-
"@nocobase/utils": "2.
|
|
14
|
+
"@nocobase/client": "2.4.0-alpha.1",
|
|
15
|
+
"@nocobase/utils": "2.4.0-alpha.1",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"@ant-design/icons": "5.6.1",
|
|
18
|
-
"@nocobase/flow-engine": "2.
|
|
18
|
+
"@nocobase/flow-engine": "2.4.0-alpha.1",
|
|
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.
|
|
26
|
-
"@nocobase/client-v2": "2.
|
|
25
|
+
"@nocobase/plugin-mobile": "2.4.0-alpha.1",
|
|
26
|
+
"@nocobase/client-v2": "2.4.0-alpha.1",
|
|
27
27
|
"sequelize": "6.35.2",
|
|
28
|
-
"@nocobase/server": "2.
|
|
29
|
-
"@nocobase/database": "2.
|
|
30
|
-
"@nocobase/data-source-manager": "2.
|
|
31
|
-
"@nocobase/logger": "2.
|
|
32
|
-
"@nocobase/evaluators": "2.
|
|
28
|
+
"@nocobase/server": "2.4.0-alpha.1",
|
|
29
|
+
"@nocobase/database": "2.4.0-alpha.1",
|
|
30
|
+
"@nocobase/data-source-manager": "2.4.0-alpha.1",
|
|
31
|
+
"@nocobase/logger": "2.4.0-alpha.1",
|
|
32
|
+
"@nocobase/evaluators": "2.4.0-alpha.1",
|
|
33
33
|
"@emotion/css": "11.13.0",
|
|
34
34
|
"@formily/antd-v5": "1.2.3",
|
|
35
35
|
"@formily/reactive": "2.3.7",
|
|
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.
|
|
40
|
-
"@nocobase/plugin-workflow-test": "2.
|
|
41
|
-
"@nocobase/test": "2.
|
|
39
|
+
"@nocobase/actions": "2.4.0-alpha.1",
|
|
40
|
+
"@nocobase/plugin-workflow-test": "2.4.0-alpha.1",
|
|
41
|
+
"@nocobase/test": "2.4.0-alpha.1",
|
|
42
42
|
"@dnd-kit/sortable": "7.0.2"
|
|
43
43
|
};
|
|
@@ -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-
|
|
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-09-02T04:19:34.928Z"}
|
|
@@ -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-
|
|
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-09-02T04:19:34.664Z"}
|
|
@@ -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-
|
|
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-09-02T04:19:33.954Z"}
|
|
@@ -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-
|
|
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-09-02T04:19:33.802Z"}
|
|
@@ -82,22 +82,22 @@ class StaticScheduleTrigger {
|
|
|
82
82
|
currentDate.setMilliseconds(nextSecond ? 1e3 : 0);
|
|
83
83
|
const timestamp = currentDate.getTime();
|
|
84
84
|
const startTime = (0, import_utils.parseDateWithoutMs)(config.startsOn);
|
|
85
|
+
const endTime = config.endsOn ? (0, import_utils.parseDateWithoutMs)(config.endsOn) : null;
|
|
85
86
|
if (startTime > timestamp && typeof config.repeat !== "string") {
|
|
86
|
-
return startTime;
|
|
87
|
+
return endTime && endTime < startTime ? null : startTime;
|
|
87
88
|
}
|
|
88
89
|
if (config.repeat) {
|
|
89
|
-
const endTime = config.endsOn ? (0, import_utils.parseDateWithoutMs)(config.endsOn) : null;
|
|
90
90
|
if (endTime && endTime < timestamp) {
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
if (typeof config.repeat === "string") {
|
|
94
94
|
const base = startTime > timestamp ? new Date(startTime - 1e3) : currentDate;
|
|
95
95
|
const interval = import_cron_parser.default.parseExpression(config.repeat, { currentDate: base });
|
|
96
|
-
const next = interval.next();
|
|
97
|
-
return next
|
|
96
|
+
const next = interval.next().getTime();
|
|
97
|
+
return endTime && endTime < next ? null : next;
|
|
98
98
|
} else if (typeof config.repeat === "number") {
|
|
99
99
|
const next = timestamp + config.repeat - (timestamp - startTime) % config.repeat;
|
|
100
|
-
return next;
|
|
100
|
+
return endTime && endTime < next ? null : next;
|
|
101
101
|
} else {
|
|
102
102
|
return null;
|
|
103
103
|
}
|
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.
|
|
9
|
+
"version": "2.4.0-alpha.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@nocobase/test": "2.x",
|
|
52
52
|
"@nocobase/utils": "2.x"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "82ecd3aed067e4cc98c32e7a0039b6e55cee76a7",
|
|
55
55
|
"keywords": [
|
|
56
56
|
"Workflow"
|
|
57
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([["142"],{693:function(e,n,t){t.d(n,{QueryFieldset:function(){return d},QueryPresetFieldset:function(){return p}});var l=t(9155),o=t.n(l),a=t(2059),r=t(2235),c=t(8198),i=t(9785),s=t(9488),u=t(5329),m=t(6855);function f(){var e=(0,s.kj)(),n=a.Form.useWatch(["config","collection"]);return n?o().createElement(o().Fragment,null,o().createElement(m.F,{collection:n,required:!1}),o().createElement(a.Form.Item,{name:["config","params","sort"],label:e("Sort")},o().createElement(c.o5,{collection:n})),o().createElement(c.uc,{pageName:["config","params","page"],pageSizeName:["config","params","pageSize"]}),o().createElement(a.Form.Item,{name:["config","params","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},o().createElement(c.Kr,{collection:n}))):null}function d(){var e,n,t=(0,s.kj)(),c=(0,r.TA)(),m=a.Form.useFormInstance(),d=[{label:(e=(0,s.kj)())("Single record"),value:!1,tooltip:e("The result will be an object of the first matching record only, or null if no matched record.")},{label:e("Multiple records"),value:!0,tooltip:e("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.")}];return(0,l.useEffect)(function(){void 0===m.getFieldValue(["config","multiple"])&&m.setFieldValue(["config","multiple"],!1)},[m]),o().createElement(o().Fragment,null,o().createElement(u.F,{disabled:!!(null==c||null==(n=c.config)?void 0:n.collection),onCollectionChanged:function(){m.setFieldValue(["config","params"],{})}}),o().createElement(a.Form.Item,{name:["config","multiple"],label:t("Result type")},o().createElement(i.$,{options:d})),o().createElement(f,null),o().createElement(a.Form.Item,{name:["config","failOnEmpty"],valuePropName:"checked"},o().createElement(a.Checkbox,null,t("Exit when query result is null"))))}function p(){return o().createElement(u.F,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([["276"],{9671:function(e,n,t){t.d(n,{DestroyFieldset:function(){return s},DestroyPresetFieldset:function(){return f}});var l=t(9155),o=t.n(l),r=t(2059),c=t(2235),u=t(5329),i=t(6855);function a(){var e=r.Form.useWatch(["config","collection"]);return e?o().createElement(i.F,{collection:e}):null}function s(){var e,n=(0,c.TA)(),t=r.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(u.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{})}}),o().createElement(a,null))}function f(){return o().createElement(u.F,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([["438"],{1736:function(e,t,n){n.d(t,{i:function(){return h}});var r=n(9155),o=n.n(r),l=n(2059),a=n(7375),i=n(5477),u=n(7694),c=n(5980),s=n(1611),f=n(2235),d=n(3052),m=n(9488),p=n(8743),y=n(3284);function v(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 b(){var e,t=(0,c.A)().styles,n=(0,m.kj)(),r=(0,u.useFlowEngine)(),i=(0,d.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var f=r.context.app.pm.get(p.q),y=null==f?void 0:f.getInstruction(s.type),v=y?n(y.title):s.type;return o().createElement("div",{className:t.clipboardPreviewClass},o().createElement("div",{className:"workflow-clipboard-header"},o().createElement("span",null,n("Copied node")),o().createElement(l.Button,{type:"text",size:"small",icon:o().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),o().createElement("div",{className:"workflow-clipboard-card"},o().createElement("div",{className:"workflow-clipboard-type"},v),o().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function h(e){var t,n,a=e.entry,u=(0,c.A)(),d=u.styles,p=u.cx,h=(0,m.kj)(),E=(0,f.S8)();(null!=(n=(0,f.$K)())?n:{}).workflow;var w=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(100))||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 v(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 v(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.")}(),g=w[0],k=w[1];return o().createElement("div",{className:p(d.workflowPageClass,(0,i.css)({height:"100%"}))},o().createElement("div",{className:"workflow-canvas-wrapper"},o().createElement("div",{className:"workflow-canvas",style:{zoom:g/100}},o().createElement("div",{className:p(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement("div",{className:d.branchClass},E?o().createElement(l.Alert,{type:"warning",showIcon:!0,message:h("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,o().createElement(y.Vo,null),o().createElement("div",{className:p(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement(s.l,{entry:a})),o().createElement("div",{className:d.terminalClass},h("End"))))),o().createElement(b,null),o().createElement("div",{className:"workflow-canvas-zoomer"},o().createElement(l.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:g,onChange:k}))))}},7653:function(e,t,n){n.r(t),n.d(t,{default:function(){return _}});var r,o=n(7694),l=n(2625),a=n(2059),i=n(9155),u=n.n(i),c=n(4442),s=n(3485),f=n(1736),d=n(2235),m=n(8761),p=n(7375),y=n(9239),v=n(7001),b=n(9488),h=n(8401);function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=(E(r={},y.GO.QUEUEING,u().createElement(p.HourglassOutlined,null)),E(r,y.GO.STARTED,u().createElement(p.LoadingOutlined,null)),E(r,y.GO.RESOLVED,u().createElement(p.CheckOutlined,null)),E(r,y.GO.FAILED,u().createElement(p.ExclamationOutlined,null)),E(r,y.GO.ERROR,u().createElement(p.CloseOutlined,null)),E(r,y.GO.ABORTED,u().createElement(p.MinusOutlined,{rotate:90})),E(r,y.GO.CANCELED,u().createElement(p.MinusOutlined,{rotate:45})),E(r,y.GO.REJECTED,u().createElement(p.MinusOutlined,null)),E(r,y.GO.RETRY_NEEDED,u().createElement(p.RedoOutlined,null)),r);function g(e){var t,n=e.value,r=(0,b.kj)(),o=a.theme.useToken().token,l=y.m2[n];if(!l)return null;var i=null!=(t=w[n])?t:u().createElement(p.ClockCircleOutlined,null),c=o.controlHeightSM;return u().createElement(a.Tooltip,{title:r(l.label)},u().createElement(a.Tag,{color:l.color,style:{marginInlineEnd:o.marginXS,borderRadius:"50%",padding:0,width:c,height:c,lineHeight:"".concat(c,"px"),textAlign:"center"}},i))}var k=n(2404);function S(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 O(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 C(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)||A(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 x(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return S(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 S(e,t)}}function T(e){var t=e.execution,n=e.refresh,r=(0,o.useFlowContext)(),c=a.theme.useToken().token,s=r.api.resource("executions"),f=(0,l.useRequest)(function(){var e;return(e=function(){var e,n,r,o,l,a,i,u;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(c){switch(c.label){case 0:return[4,Promise.all([s.list({filter:{key:t.key,id:{$lt:t.id}},sort:"-id",pageSize:10,fields:["id","status","createdAt"]}),s.list({filter:{key:t.key,id:{$gt:t.id}},sort:"id",pageSize:10,fields:["id","status","createdAt"]})])];case 1:return a=(l=C.apply(void 0,[c.sent(),2]))[0],i=l[1],u=null!=(e=null==a||null==(r=a.data)?void 0:r.data)?e:[],[2,x((null!=(n=null==i||null==(o=i.data)?void 0:o.data)?n:[]).slice().reverse()).concat([t],x(u))]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){O(l,r,o,a,i,"next",e)}function i(e){O(l,r,o,a,i,"throw",e)}a(void 0)})})()},{manual:!0}),d=f.data,m=f.run,y=(0,l.useMemoizedFn)(function(e){var n=e.key;String(n)!==String(t.id)&&r.router.navigate((0,h.Pq)(n))}),v=(0,i.useMemo)(function(){return(null!=d?d:[t]).map(function(e){var t;return{key:"".concat(e.id),icon:u().createElement(g,{value:null!=(t=e.status)?t:null}),label:u().createElement("span",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:c.marginXL,minWidth:5*c.sizeXXL}},u().createElement("span",null,"#".concat(e.id)),u().createElement("time",{style:{fontSize:c.fontSizeSM,color:c.colorTextTertiary}},(0,k.fU)(e.createdAt)))}})},[d,t,c]);return u().createElement(a.Space,{size:c.marginXXS},u().createElement(a.Dropdown,{trigger:["click"],onOpenChange:function(e){return e&&m()},menu:{onClick:y,selectedKeys:["".concat(t.id)],items:v}},u().createElement(a.Space,{style:{cursor:"pointer"}},u().createElement("strong",null,"#".concat(t.id)),u().createElement(p.DownOutlined,null))),n?u().createElement(a.Button,{type:"link",size:"small",icon:u().createElement(p.ReloadOutlined,null),onClick:n}):null)}function j(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 R(e){var t,n=e.execution,r=(0,b.kj)(),o=y.m2[n.status];if(!o)return null;var l=n.reason?y.QQ[n.reason]:void 0;return u().createElement(a.Tag,{color:o.color},u().createElement(a.Space,{size:4},r(o.label),n.reason?u().createElement(a.Tooltip,{title:r(null!=(t=null==l?void 0:l.label)?t:n.reason),placement:"bottom"},u().createElement(p.QuestionCircleOutlined,null)):null))}function I(e){var t=e.execution,n=e.resource,r=e.refresh,o=(0,b.ec)().t,i=(0,b.kj)(),s=(0,v.TD)().getWorkflowCanvasPath,f=a.theme.useToken().token,d=a.App.useApp(),m=d.modal,h=d.message,E=t.workflow,w=t.status===y.GO.STARTED||t.status===y.GO.QUEUEING,g=(0,l.useMemoizedFn)(function(){m.confirm({title:o("Cancel the execution"),content:o("Are you sure you want to cancel the execution?"),onOk:function(){var e;return(e=function(){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(e){switch(e.label){case 0:return[4,n.cancel({filterByTk:t.id})];case 1:return e.sent(),h.success(o("Operation succeeded")),r(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){j(l,r,o,a,i,"next",e)}function i(e){j(l,r,o,a,i,"throw",e)}a(void 0)})})()}})});return u().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:f.margin,flexWrap:"wrap",padding:"".concat(f.paddingSM,"px ").concat(f.padding,"px"),background:f.colorBgContainer,borderBottom:"1px solid ".concat(f.colorBorderSecondary)}},u().createElement(a.Breadcrumb,{items:[{title:u().createElement(c.Link,{to:"/admin/settings/workflow"},o("Workflow"))},{title:(null==E?void 0:E.id)!=null?u().createElement(a.Tooltip,{title:"Key: ".concat(E.key)},u().createElement(c.Link,{to:s(E.id)},i(E.title||""))):i((null==E?void 0:E.title)||"")},{title:u().createElement(T,{execution:{id:t.id,key:t.key,status:t.status,createdAt:t.createdAt},refresh:r})}]}),u().createElement("div",{style:{display:"flex",alignItems:"center",gap:f.marginXS}},u().createElement(R,{execution:t}),w?u().createElement(a.Tooltip,{title:o("Cancel the execution")},u().createElement(a.Button,{type:"link",danger:!0,shape:"circle",size:"small",icon:u().createElement(p.StopOutlined,null),onClick:g})):null,u().createElement("time",{style:{opacity:.65}},(0,k.fU)(t.updatedAt))))}var D=n(2723),N=n(7060),P=n(5980),B=n(8364);function M(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 G(e){var t,n=e.jobId,r=(0,o.useFlowContext)(),i=(0,b.kj)(),c=(0,P.A)().styles,s=(0,l.useRequest)(function(){var e;return(e=function(){var e,t,o;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(l){switch(l.label){case 0:return[4,r.api.resource("jobs").get({filterByTk:n})];case 1:return[2,null!=(e=null==(o=l.sent())||null==(t=o.data)?void 0:t.data)?e:null]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){M(l,r,o,a,i,"next",e)}function i(e){M(l,r,o,a,i,"throw",e)}a(void 0)})})()}),f=s.data;return s.loading?u().createElement(a.Spin,null):u().createElement(u().Fragment,null,u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Status"),":"),u().createElement(N._T,{value:null!=(t=null==f?void 0:f.status)?t:null})),u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Executed at"),":"),u().createElement("div",null,(0,k.fU)(null==f?void 0:f.updatedAt))),u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Node result"),":"),u().createElement(a.Input.TextArea,{value:(0,B.S)(null==f?void 0:f.result),disabled:!0,autoSize:{minRows:4,maxRows:20},className:c.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}),(null==f?void 0:f.log)?u().createElement(u().Fragment,null,u().createElement("div",{style:{marginTop:16,marginBottom:8,fontWeight:500}},i("Log")),u().createElement(a.Input.TextArea,{value:f.log,disabled:!0,autoSize:{minRows:4,maxRows:20},style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}})):null)}function z(){var e,t,n,r,o=null!=(e=(0,d.$K)())?e:{},l=o.viewJob,i=o.setViewJob,c=(0,b.kj)(),s=(0,D.Y)(null==l||null==(t=l.node)?void 0:t.type),f=(0,P.A)().styles;return u().createElement(a.Modal,{open:!!l,onCancel:function(){return null==i?void 0:i(null)},footer:null,width:980,title:u().createElement("div",{className:f.nodeTitleClass},u().createElement(a.Tag,null,s?c(s.title):null==l||null==(n=l.node)?void 0:n.type),u().createElement("strong",null,null==l||null==(r=l.node)?void 0:r.title)),destroyOnClose:!0,modalRender:function(e){return u().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},(null==l?void 0:l.id)!=null?u().createElement(G,{jobId:l.id}):null)}function L(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 F(e,t){if(e){if("string"==typeof e)return L(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 L(e,t)}}var U=function(e){var t,n=e.record,r=e.resource,o=e.refresh,l=(0,b.ec)().t,c=(0,s.useApp)(),p=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null))||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)||F(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=p[0],v=p[1],h=null!=n?n:{},E=h.jobs,w=void 0===E?[]:E,g=h.workflow,k=function(e,t){if(null==e)return{};var n,r,o,l={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}if(l=function(e,t){if(null==e)return{};var n,r,o={},l=Object.getOwnPropertyNames(e);for(r=0;r<l.length;r++)n=l[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}(h,["jobs","workflow"]),S=(0,i.useMemo)(function(){var e,t,n=function(e){if(Array.isArray(e))return L(e)}(e=null!=(t=null==g?void 0:g.nodes)?t:[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||F(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return(0,m.K)(n),!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;e.forEach(function(e){e.jobs=[],n.set(e.id,e)}),t.forEach(function(e){var t=n.get(e.nodeId);t&&(t.jobs.push(e),e.node={id:t.id,key:t.key,title:t.title,type:t.type})}),e.forEach(function(e){e.jobs=e.jobs.sort(function(e,t){return e.id-t.id})})}(n,w),n},[w,null==g?void 0:g.nodes]),O=(0,i.useMemo)(function(){var e;return null!=(e=S.find(function(e){return!e.upstream}))?e:null},[S]);return((0,i.useEffect)(function(){if(null==y?void 0:y.id){var e=w.find(function(e){return String(e.id)===String(y.id)});e&&v(e)}},[w,null==y?void 0:y.id]),g)?u().createElement(d.cB.Provider,{value:{workflow:g.type?g:null,nodes:S,execution:k,viewJob:y,setViewJob:v}},u().createElement(I,{execution:n,resource:r,refresh:o}),u().createElement(f.i,{entry:O}),u().createElement(z,null)):u().createElement(a.Result,{status:"404",title:l("Not found"),subTitle:l("Workflow of execution is not existed"),extra:u().createElement(a.Button,{href:c.getHref(c.pluginSettingsManager.getRoutePath("workflow"))},l("Back to Workflow List"))})};function W(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 _(){var e=(0,b.ec)().t,t=(0,o.useFlowContext)(),n=a.theme.useToken().token,r=(0,c.useParams)().id,s=t.api.resource("executions"),f=(0,l.useRequest)(function(){var e;return(e=function(){var e;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(t){switch(t.label){case 0:if(!r)return[2,null];return[4,s.get({filterByTk:r,appends:["jobs","workflow","workflow.nodes","workflow.versionStats","workflow.stats"],except:["jobs.result","workflow.options"]})];case 1:return e=t.sent(),[2,(0,k.iD)(e)]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){W(l,r,o,a,i,"next",e)}function i(e){W(l,r,o,a,i,"throw",e)}a(void 0)})})()},{refreshDeps:[r]}),d=f.data,m=f.refresh,p=(null==d?void 0:d.id)!=null&&String(d.id)===String(r)?d:null;return((0,i.useEffect)(function(){if(p){var t,n=null==(t=p.workflow)?void 0:t.title;document.title="".concat(n?"".concat(n," - "):"").concat(e("Execution history")," - NocoBase")}},[p,e]),r)?p?u().createElement("div",{style:{display:"flex",flexDirection:"column",height:"100dvh",minHeight:0,overflow:"hidden",width:"100%",boxSizing:"border-box",background:n.colorBgLayout}},u().createElement("div",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative",width:"100%"}},u().createElement(U,{record:p,resource:s,refresh:m}))):u().createElement(a.Spin,null):null}},7001:function(e,t,n){n.d(t,{TD:function(){return i}});var r=n(2625),o=n(3485),l=n(8401);function a(){return"modern"===(0,o.getRouteRuntimeVersion)()}function i(){var e=(0,r.useMemoizedFn)(function(e){return a()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return a()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:a(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return l},QQ:function(){return u},hi:function(){return a},m2:function(){return i}});var r=n(358);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:l.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:l.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:l.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:l.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:l.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:l.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:l.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:l.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:l.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=a.reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{}),u=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{})}}]);
|
|
@@ -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 g},UpdatePresetFieldset:function(){return p}});var t=n(9155),o=n.n(t),a=n(2059),i=n(2235),r=n(8198),s=n(9785),c=n(9488),u=n(5329),d=n(6855),m=function(e){return!(0,r.Cg)(e)||"belongsTo"===e.type};function f(){var e,l,n=(0,c.kj)(),u=a.Form.useFormInstance(),f=(0,i.Zt)(),g=a.Form.useWatch(["config","collection"]),p=a.Form.useWatch(["config","params","individualHooks"],u),F=[{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.")}],h=!0!==p,v=!!(null==f||null==(l=f.versionStats)?void 0:l.executed);return((0,t.useEffect)(function(){g&&(u.setFieldValue(["config","usingAssignFormSchema"],void 0),u.setFieldValue(["config","assignFormSchema"],void 0),void 0===u.getFieldValue(["config","params","individualHooks"])&&u.setFieldValue(["config","params","individualHooks"],!1))},[g,u]),g)?o().createElement(o().Fragment,null,o().createElement(a.Form.Item,{name:["config","params","individualHooks"],label:n("Update mode")},o().createElement(s.$,{options:F})),o().createElement(d.F,{collection:g,label:n("Only update records matching conditions")}),o().createElement(a.Form.Item,{name:["config","params","values"],label:n("Fields values")},o().createElement(r.XH,{collection:g,fieldFilter:h?m:void 0,pruneFilteredValues:h,disabled:v}))):null}function g(){var e,l=(0,i.TA)(),n=a.Form.useFormInstance();return o().createElement(o().Fragment,null,o().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)}}),o().createElement(f,null))}function p(){return o().createElement(u.F,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([["719"],{1801:function(e,t,r){r.d(t,{N$:function(){return S},yr:function(){return F}});var n=r(3485),a=r(7694),o=r(2625),i=r(2059),l=r(9155),u=r.n(l),c=r(7768),s=r(4563),f=r(5737),d=r(9488),m=r(3943);function y(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 h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw n}}return o}}(e,t)||v(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 g(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function v(e,t){if(e){if("string"==typeof e)return y(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 y(e,t)}}var w=["yesterday","today","tomorrow","lastWeek","thisWeek","nextWeek","lastMonth","thisMonth","nextMonth","lastQuarter","thisQuarter","nextQuarter","lastYear","thisYear","nextYear","last7Days","next7Days","last30Days","next30Days","last90Days","next90Days"],x={yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",lastWeek:"Last week",thisWeek:"This week",nextWeek:"Next week",lastMonth:"Last month",thisMonth:"This month",nextMonth:"Next month",lastQuarter:"Last quarter",thisQuarter:"This quarter",nextQuarter:"Next quarter",lastYear:"Last year",thisYear:"This year",nextYear:"Next year",last7Days:"Last 7 days",next7Days:"Next 7 days",last30Days:"Last 30 days",next30Days:"Next 30 days",last90Days:"Last 90 days",next90Days:"Next 90 days"},O={resolvePathFromValue:function(e){return"string"==typeof e?(0,f.IB)(e):void 0},resolveValueFromPath:function(e){return(0,f.oS)(e)}};function j(e){return!!(e&&(void 0===e?"undefined":b(e))==="object"&&"logic"in e&&"items"in e)}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||(void 0===e?"undefined":b(e))!=="object"||Array.isArray(e))return t.length?[{path:t.join("."),operator:"$eq",value:e}]:[];var r=Object.entries(e),n=r.filter(function(e){return p(e,1)[0].startsWith("$")});return n.length?t.length?n.map(function(e){var r=p(e,2),n=r[0],a=r[1];return{path:t.join("."),operator:n,value:a}}):[]:r.flatMap(function(e){var r=p(e,2),n=r[0];return k(r[1],g(t).concat([n]))})}function A(e){return Array.isArray(e.$or)?"$or":Array.isArray(e.$and)?"$and":void 0}function E(e){var t;return j(e)?e:null!=(t=function e(t){if(!(!t||(void 0===t?"undefined":b(t))!=="object"||Array.isArray(t))){var r=A(t);if(!r){var n=k(t);return n.length?{logic:"$and",items:n}:void 0}var a=t[r].flatMap(function(t){if(!t||(void 0===t?"undefined":b(t))!=="object"||Array.isArray(t))return[];if(A(t)){var r=e(t);return r?[r]:[]}return k(t)}).filter(function(e){return!!e});return a.length?{logic:r,items:a}:void 0}}(e))?t:{logic:"$and",items:[]}}function S(e){var t=e.collection,r=e.value,f=e.onChange,y=e.disabled,p=e.rightAsVariable,b=void 0===p||p,v=e.maxAssociationFieldDepth,k=void 0===v?2:v,A=(0,a.useFlowEngine)(),S=(0,d.kj)(),F=!!(i.ConfigProvider.useConfig().componentDisabled||y),M=(0,o.useMemoizedFn)(function(e,t){return S(e,t)}),I=(0,s.P)(),P=(0,l.useMemo)(function(){var e,t;return e={name:"dateRange",title:M("Date range"),type:"object",paths:["$system","dateRange"],children:w.map(function(e){return{name:e,title:M(x[e]),type:"string",paths:["$system","dateRange",e]}})},(t=I.findIndex(function(e){return"$system"===e.name}))<0?g(I).concat([{name:"$system",title:M("System variables"),type:"",paths:["$system"],children:[e]}]):I.map(function(r,n){if(n!==t||"function"==typeof r.children)return r;var a,o,i=Array.isArray(r.children)?r.children.filter(function(e){return"dateRange"!==e.name}):[];return a=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){h(e,t,r[t])})}return e}({},r),o=o={children:g(i).concat([e])},Object.getOwnPropertyDescriptors?Object.defineProperties(a,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(a,e,Object.getOwnPropertyDescriptor(o,e))}),a})},[M,I]),D=(0,l.useMemo)(function(){return(0,m.X_)(A.context.dataSourceManager,t)},[A,t]),C=(0,l.useMemo)(function(){if(!D)return null;var e=A.createModel({uid:(0,a.randomId)("workflowFilter_"),use:a.FlowModel}),t=A.context.app;return t&&e.context.defineProperty("app",{value:t}),e.context.defineProperty("collection",{get:function(){return D}}),e},[D,A]);(0,l.useEffect)(function(){return function(){var e;null==C||null==(e=C.remove)||e.call(C)}},[C]);var N=(0,l.useRef)();N.current||(N.current=(0,a.observable)(E(r)));var T=(0,l.useRef)(null);(0,l.useEffect)(function(){var e=JSON.stringify(null!=r?r:{});if(T.current!==e){var t=E(r);N.current&&(N.current.logic=t.logic,N.current.items=t.items,T.current=e)}},[r]),(0,l.useEffect)(function(){if(N.current)return(0,a.reaction)(function(){return JSON.stringify((0,a.toJS)(N.current))},function(e){var t,r=JSON.parse(e),n=Array.isArray(r.items)?r.items.length:0,a=(0,c.removeInvalidFilterItems)(r);if(!a.items.length){n||null==f||f({});return}var o=null!=(t=function e(t){if(null==t||null==(r=t.items)?void 0:r.length){var r,n=t.items.map(function(t){if(j(t))return e(t);if("string"==typeof t.path&&"string"==typeof t.operator&&t.path&&t.operator)return function(e,t){for(var r=e.split("."),n=t,a=r.length-1;a>=0;a--)n=h({},r[a],n);return n}(t.path,h({},t.operator,t.value))}).filter(function(e){return!!e});if(n.length)return h({},t.logic,n)}}(a))?t:{};T.current=JSON.stringify(o),null==f||f(o)},{fireImmediately:!1})},[f]);var W=(0,l.useMemo)(function(){if(!C)return null;var e=function(e){var t=e.value;return u().createElement(a.FlowModelProvider,{model:C},u().createElement(n.VariableFilterItem,{value:t,model:C,disabled:F,rightAsVariable:b,rightMetaTree:P,rightVariableConverters:O,maxAssociationFieldDepth:k}))};return e.displayName="WorkflowVariableFilterItem",e},[C,k,F,b,P]);return u().createElement(n.FilterGroup,{value:N.current,FilterItem:null!=W?W:void 0,disabled:F})}var F=S},6242:function(e,t,r){r.r(t),r.d(t,{TriggerModeField:function(){return p},default:function(){return v},CollectionPresetConfig:function(){return b},SyncTransactionNotice:function(){return h},CollectionTriggerConfig:function(){return g}});var n=r(5477),a=r(2059),o=r(9155),i=r.n(o),l=r(2235),u=r(1801),c=r(8198),s=r(9488),f=[{label:'{{t("After record added", { ns: "'.concat(s.CU,'" })}}'),value:1},{label:'{{t("After record updated", { ns: "'.concat(s.CU,'" })}}'),value:2},{label:'{{t("After record added or updated", { ns: "'.concat(s.CU,'" })}}'),value:3},{label:'{{t("After record deleted", { ns: "'.concat(s.CU,'" })}}'),value:4}];function d(e,t){return(Number(e)&t)===t}function m(){var e,t,r=(e=["\n .ant-select.auto-width {\n width: auto;\n min-width: 6em;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return m=function(){return r},r}function y(e){return!e.hidden&&(!e.uiSchema||!e.uiSchema["x-read-pretty"])&&!["linkTo","hasOne","hasMany","belongsToMany"].includes(e.type)}function h(){var e=(0,s.kj)();return i().createElement(a.Alert,{type:"info",showIcon:!0,style:{marginBottom:"1em"},message:e("Synchronous collection event workflows run within the trigger transaction by default. Related data operations automatically use this transaction.")})}function p(){var e=(0,s.kj)(),t=a.Form.useWatch(["config","collection"]),r=(0,o.useMemo)(function(){return f.map(function(t){return{value:t.value,label:e(t.label)}})},[e]);return t?i().createElement(a.Form.Item,{name:["config","mode"],label:e("Trigger on"),rules:[{required:!0}]},i().createElement(a.Select,{popupMatchSelectWidth:!1,placeholder:e("Trigger on"),className:"auto-width",options:r})):null}function g(){var e=(0,s.kj)(),t=(0,l.Zt)(),r=a.Form.useWatch(["config","collection"]),o=Number(a.Form.useWatch(["config","mode"])||0),f=null==t?void 0:t.sync;return i().createElement("fieldset",{className:(0,n.css)(m())},i().createElement(a.Form.Item,{name:["config","collection"],label:e("Collection")},i().createElement(c.XJ,{disabled:!0})),i().createElement(p,null),r&&d(o,2)?i().createElement(a.Form.Item,{name:["config","changed"],label:e("Changed fields"),extra:e("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added, any field is considered to have been changed.")},i().createElement(c.WY,{mode:"multiple",placeholder:e("Select field"),filter:y})):null,r&&!d(o,4)?i().createElement(a.Form.Item,{name:["config","condition"],label:e("Only triggers when match conditions")},i().createElement(u.yr,{collection:r,rightAsVariable:!1})):null,r&&!d(o,4)?i().createElement(a.Form.Item,{name:["config","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},i().createElement(c.Kr,{collection:r})):null,f?i().createElement(h,null):null,f?i().createElement(a.Form.Item,{name:["config","rollbackOnFailure"],valuePropName:"checked",extra:e("Only available in synchronous mode. When enabled, if the workflow execution ends with a failed status, the data operation that triggered it will fail and be rolled back."),initialValue:!1},i().createElement(a.Checkbox,null,e("Rollback when workflow execution fails"))):null)}function b(){var e=(0,s.kj)();return i().createElement(a.Form.Item,{name:["config","collection"],label:e("Collection"),rules:[{required:!0}]},i().createElement(c.XJ,null))}var v=g}}]);
|
|
@@ -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([["728"],{2891:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var r=n(7694),o=n(3485),a=n(7375),l=n(5477),i=n(2625),u=n(2059),c=n(9155),s=n.n(c),p=n(4442),d=n(8401),f=n(250),y=n(9488),g=n(6767);function m(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 k(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){k(a,r,o,l,i,"next",e)}function i(e){k(a,r,o,l,i,"throw",e)}l(void 0)})}}function h(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 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 a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(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 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 w(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)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 a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}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 T(){var e,t,n=(e=["\n > div > .ant-tabs > .ant-tabs-nav {\n background: ",";\n margin: 0;\n padding-inline: ","px ","px;\n padding-left: ","px;\n }\n\n > div > .ant-tabs > .ant-tabs-content-holder {\n padding: ","px;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return T=function(){return n},n}var E=null;function x(e,t){e&&t&&((null==E?void 0:E.taskTypeKey)!==e||E.popupId!==t)||(E=null)}function S(){var e=(0,p.useParams)(),t=(0,p.useLocation)(),n=(0,f.e3)(e.status),r=/(^|\/)(mobile\/page|page)\/workflow-tasks(\/|$)/.test(t.pathname);return{taskType:e.taskType,status:n,popupId:e.popupId,isMobileRoute:r,search:t.search,hash:t.hash}}function M(e,t){return"".concat(e).concat(t.search||"").concat(t.hash||"")}function I(e){var t=e.type,n=e.status,r=e.mobile,o=e.reload,a=e.workflowKey,l=e.workflowPendingCount,g=(0,p.useNavigate)(),m=(0,y.kj)(),k=u.theme.useToken().token,b=t.Actions,h=S(),v=(0,c.useMemo)(function(){return f._l.map(function(e){return{key:e,value:e,label:m(e===f.Rr.PENDING?"Pending":e===f.Rr.COMPLETED?"Completed":"All")}})},[m]),w=(0,i.useMemoizedFn)(function(e){g(M((0,d.T0)(t.key,String(e),void 0,h.isMobileRoute),h))});return r?s().createElement(u.Flex,{"data-testid":"workflow-task-status-controls",align:"center",justify:"space-between",gap:k.marginSM,wrap:"wrap"},s().createElement(u.Segmented,{value:n,options:v.map(function(e){return{value:e.value,label:e.label}}),onChange:w,style:{minWidth:0}}),b?s().createElement(b,{onlyIcon:!0,reload:o,workflowKey:a,workflowPendingCount:l}):null):s().createElement(u.Tabs,{activeKey:n,onChange:w,items:v.map(function(e){return{key:e.key,label:e.label}}),tabBarStyle:{marginBottom:0},tabBarExtraContent:b?{right:s().createElement(b,{reload:o,workflowKey:a,workflowPendingCount:l})}:void 0})}function O(e){var t=e.mobile,n=e.onPageChange,r=e.page,o=e.total,l=u.theme.useToken().token,c=(0,y.kj)(),p=Math.max(1,Math.ceil(Math.max(o,1)/f.JJ)),d=r>1,g=r<p,m=(0,i.useMemoizedFn)(function(){d&&n(r-1)}),k=(0,i.useMemoizedFn)(function(){g&&n(r+1)});return s().createElement(u.Flex,{align:"center",className:"ant-pagination","data-testid":"workflow-task-pagination",gap:t?l.marginXXS:l.marginSM,justify:"end",style:{width:"100%"}},s().createElement(u.Flex,{align:"center",gap:l.marginXXS},s().createElement(u.Button,{"aria-label":c("Previous page"),className:"ant-pagination-prev".concat(d?"":" ant-pagination-disabled"),disabled:!d,icon:s().createElement(a.LeftOutlined,null),onClick:m,size:"small",style:{height:l.controlHeightSM,width:l.controlHeightSM},type:"text"}),s().createElement(u.Typography.Text,{"data-testid":"workflow-task-current-page",style:{lineHeight:"".concat(l.controlHeightSM,"px"),minWidth:l.sizeSM,textAlign:"center"}},r),s().createElement(u.Button,{"aria-label":c("Next page"),className:"ant-pagination-next".concat(g?"":" ant-pagination-disabled"),disabled:!g,icon:s().createElement(a.RightOutlined,null),onClick:k,size:"small",style:{height:l.controlHeightSM,width:l.controlHeightSM},type:"text"})),t?null:s().createElement(u.Select,{"aria-label":c("Page size"),className:"ant-pagination-options",options:[{label:"".concat(f.JJ," / page"),value:f.JJ}],popupMatchSelectWidth:!1,size:"middle",style:{width:112},value:f.JJ}))}function P(e){var t=e.records,n=e.loading,r=e.mobile,o=e.total,a=e.page,l=e.onPageChange,c=e.onOpenRecord,p=e.refresh,d=e.Item,g=u.theme.useToken().token,m=(0,y.kj)(),k=o>0||t.length>0,b=(0,i.useMemoizedFn)(function(e,t){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(t))});return s().createElement(s().Fragment,null,s().createElement(u.List,{dataSource:t,loading:n,rowKey:function(e){var t;return String(null!=(t=(0,f.Zu)(e))?t:"")},locale:{emptyText:m("No data yet")},split:!1,style:{background:g.colorBgLayout,flex:"1 1 0%",minHeight:0,overflow:"auto"},renderItem:function(e,t){return s().createElement(f.xT.Provider,{value:{record:e,openRecord:c,refresh:p}},s().createElement(u.List.Item,{role:"button",tabIndex:0,onClick:function(){return c(e)},onKeyDown:function(t){return b(t,e)},style:{cursor:"pointer",padding:r?"0.5em 0.5em ".concat(g.lineWidth,"px"):"".concat(0===t?g.paddingLG:g.paddingXS,"px ").concat(g.paddingLG,"px ").concat(g.paddingXXS,"px"),background:g.colorBgLayout}},s().createElement("div",{"data-testid":"workflow-task-list-item-content",style:{width:"100%"}},s().createElement(d,null))))}}),k?s().createElement(u.Flex,{justify:"end",style:{background:g.colorBgLayout,flexShrink:0,padding:r?"0.5em":"".concat(g.padding,"px ").concat(g.paddingLG,"px")}},s().createElement(O,{mobile:r,onPageChange:l,page:a,total:o})):null)}function j(e,t){if(e)return t.split(".").reduce(function(e,t){if(e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object")return e[t]},e)}function C(e){var t=e.children,n=e.record,r=e.mobile,o=e.onClose,a=e.title,l=u.theme.useToken().token;return s().createElement(u.Modal,{open:!!n,title:a,footer:null,width:"80vw",onCancel:o,destroyOnClose:!0,styles:{body:{maxHeight:r?"calc(100dvh - ".concat(2*l.sizeXXL,"px)"):void 0,overflow:"auto"}}},t)}function B(e){var t=e.children,n=e.onClose,r=u.theme.useToken().token,o=(0,y.kj)(),i=(0,l.css)(T(),r.colorBgContainer,r.padding,r.padding,r.controlHeight+r.paddingSM,r.padding);return s().createElement("div",{"data-testid":"workflow-task-mobile-detail-page",style:{background:r.colorBgLayout,flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"}},s().createElement(u.Button,{"aria-label":o("Back"),icon:s().createElement(a.LeftOutlined,null),onClick:n,style:{left:r.paddingXS,position:"absolute",top:r.paddingSM,zIndex:1},type:"text"}),s().createElement("div",{"data-testid":"workflow-task-mobile-detail-content",className:i,style:{minWidth:0}},t))}function K(e){var t,n,r,a,l,m,k=e.availableTaskTypeKeys,T=e.countsState,O=e.ctx,K=e.currentTaskType,L=e.currentTaskTypeKey,z=e.taskTypes,R=T.counts,F=T.reload,H=S(),N=(0,o.useMobileLayout)().isMobileLayout,J=H.isMobileRoute||N,X=(0,p.useNavigate)(),A=u.App.useApp().message,D=(0,y.kj)(),W=u.theme.useToken().token,G=(0,g.vR)().selectedWorkflow,_=v((0,c.useState)([]),2),Z=_[0],$=_[1],U=v((0,c.useState)(function(){var e=H.popupId;if(E&&E.taskTypeKey===L&&E.popupId===e){var t=E.record;return E=null,t}return(L||e)&&(E=null),null}),2),q=U[0],Q=U[1],V=v((0,c.useState)(0),2),Y=V[0],ee=V[1],et="".concat(null!=L?L:"","\n").concat(H.status,"\n").concat(null!=(l=null==G?void 0:G.workflowKey)?l:"","\n").concat(H.search),en=v((0,c.useState)({signature:"",page:1}),2),er=en[0],eo=en[1],ea=er.signature===et?er.page:1,el=v((0,c.useState)(!1),2),ei=el[0],eu=el[1],ec=(0,c.useRef)(0),es=(0,c.useRef)(0),ep=(0,c.useRef)(q&&H.popupId&&L?{popupId:H.popupId,taskTypeKey:L}:null),ed=(0,c.useRef)(ep.current),ef=(0,i.useMemoizedFn)(function(){A.error(D("Load failed"))});(0,c.useEffect)(function(){var e=document.title;return(null==K?void 0:K.title)&&(document.title="".concat(D("Workflow todos"),": ").concat(D(K.title)," - NocoBase")),function(){document.title=e}},[null==K?void 0:K.title,D]),(0,c.useEffect)(function(){!H.taskType&&k.length&&X(M((0,d.T0)(k[0],H.status,void 0,H.isMobileRoute),H),{replace:!0})},[k,X,H,H.isMobileRoute,H.status,H.taskType]),(0,c.useEffect)(function(){er.signature!==et&&eo({signature:et,page:1})},[et,er.signature]);var ey=(0,i.useMemoizedFn)(function(){return b(function(){var e,t,n,r,o,a,l,i,u;return w(this,function(c){switch(c.label){case 0:if(t=++ec.current,!(null==O?void 0:O.api)||!K||!(n=O.api.resource(K.collection)[null!=(e=K.action)?e:"list"]))return $([]),ee(0),eu(!1),[2];eu(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),a=null!=(r=null==(o=K.useActionParams)?void 0:o.call(K,H.status,null==G?void 0:G.workflowKey))?r:{},[4,n(h({page:ea,pageSize:f.JJ,sort:["-createdAt"]},a))];case 2:if(l=c.sent(),i=(0,f.z1)(l),t!==ec.current)return[2];return $(i.data),ee("number"==typeof i.meta.count?i.meta.count:!0===i.meta.hasNext?ea*f.JJ+1:(ea-1)*f.JJ+i.data.length),[3,5];case 3:if(u=c.sent(),t!==ec.current)return[2];throw $([]),ee(0),u;case 4:return t===ec.current&&eu(!1),[7];case 5:return[2]}})})()}),eg=(0,i.useMemoizedFn)(function(){return b(function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([ey(),F()])];case 1:return e.sent(),[2]}})})()});(0,c.useEffect)(function(){return ey().catch(function(e){console.error("Failed to load workflow tasks",e),ef()}),function(){ec.current+=1}},[L,ey,ea,H.search,H.status,null==G?void 0:G.workflowKey,ef]);var em=(0,i.useMemoizedFn)(function(){return b(function(){var e,t,n,r,o,a;return w(this,function(l){switch(l.label){case 0:if(e=++es.current,!(null==O?void 0:O.api)||!K||!H.popupId)return ep.current=null,ed.current=null,x(),Q(null),[2];l.label=1;case 1:if(l.trys.push([1,6,,7]),!K.getPopupRecord)return[3,3];return[4,K.getPopupRecord(O.api,{params:{filterByTk:H.popupId}})];case 2:return o=l.sent(),[3,5];case 3:return[4,null==(n=(r=O.api.resource(K.collection)).get)?void 0:n.call(r,{filterByTk:H.popupId})];case 4:o=l.sent(),l.label=5;case 5:return t=o,[3,7];case 6:if(a=l.sent(),e!==es.current)return[2];throw a;case 7:if(e!==es.current)return[2];return ep.current={taskTypeKey:K.key,popupId:H.popupId},x(K.key,H.popupId),Q((0,f.y$)(t)),[2]}})})()});(0,c.useEffect)(function(){if(!H.popupId){ed.current||(es.current+=1,ep.current=null,x(),Q(null));return}ed.current=null;var e=H.popupId;return Q(function(t){var n=ep.current,r=t?(0,f.Zu)(t):void 0;return t&&(null==n?void 0:n.taskTypeKey)===L&&String(r)===e?t:(ep.current=null,x(),null)}),em().catch(function(e){console.error("Failed to load workflow task detail",e),ep.current=null,ed.current=null,x(L,H.popupId),Q(null),ef()}),function(){es.current+=1}},[L,em,H.popupId,H.status,ef]);var ek=(0,i.useMemoizedFn)(function(e){if(K){var t=(0,f.Zu)(e);es.current+=1,ep.current=null==t?null:{taskTypeKey:K.key,popupId:String(t)},ed.current=ep.current,E=ep.current?{popupId:ep.current.popupId,record:e,taskTypeKey:K.key}:null,Q(e),null!=t&&X(M((0,d.T0)(K.key,H.status,String(t),H.isMobileRoute),H))}}),eb=(0,i.useMemoizedFn)(function(){es.current+=1,ep.current=null,ed.current=null,x(),Q(null),K&&X(M((0,d.T0)(K.key,H.status,void 0,H.isMobileRoute),H),{replace:!0})}),eh=(0,i.useMemoizedFn)(function(e){eo({signature:et,page:e})}),ev=(0,c.useMemo)(function(){return k.map(function(e){var t,n,r;return{key:e,title:(null==z||null==(t=z.get(e))?void 0:t.title)?D(null==(n=z.get(e))?void 0:n.title):e,count:(null==(r=R[e])?void 0:r.pending)||0}})},[k,R,D,z]),ew=(0,i.useMemoizedFn)(function(e){X(M((0,d.T0)(e,f.Rr.PENDING,void 0,H.isMobileRoute),H))});if(!K||!L)return s().createElement(u.Result,{status:H.taskType?"error":"info",title:H.taskType?D("Task type {{type}} is invalid",{type:H.taskType}):D("No workflow tasks available. Please contact the administrator.")});var eT=s().createElement(u.Flex,{vertical:!0,gap:J?W.marginXS:W.marginXXS},J?null:s().createElement(u.Typography.Title,{level:4,style:{lineHeight:"".concat(W.controlHeight,"px"),margin:0}},D(K.title)),s().createElement(I,{type:K,status:H.status,mobile:J,reload:eg,workflowKey:null==G?void 0:G.workflowKey,workflowPendingCount:null==G?void 0:G.stats.pending})),eE=null!=(m=K.DetailModal)?m:C,ex=K.Detail,eS=D("string"==typeof(a=null!=(t=null!=(n=null!=(r=j(q,"node.title"))?r:j(q,"title"))?n:j(q,"workflow.title"))?t:K.title)&&a?a:K.title),eM=q?s().createElement(f.xT.Provider,{value:{record:q,refresh:eg,openRecord:Q}},s().createElement(ex,null)):null,eI=J&&!!q;return s().createElement(u.Layout,{"data-testid":J?"workflow-tasks-mobile":"workflow-tasks-desktop",style:{minHeight:J?0:"100%",height:"100%",background:W.colorBgLayout}},eI?null:s().createElement(g.Xq,{currentTypeKey:L,mobile:J,onTaskTypeSelect:ew,taskTypes:ev,t:D}),J&&!eI?s().createElement(u.Layout.Header,{style:{height:"auto",lineHeight:"normal",padding:0,background:W.colorBgContainer,borderBottom:"".concat(W.lineWidth,"px ").concat(W.lineType," ").concat(W.colorBorderSecondary)}},s().createElement("div",{style:{padding:W.paddingSM}},eT)):null,s().createElement(u.Layout,{style:{background:W.colorBgLayout}},s().createElement(u.Layout.Content,{style:{display:"flex",flex:"1 1 0%",flexDirection:"column",minHeight:0,padding:0,overflow:"hidden"}},J||eI?null:s().createElement("div",{style:{padding:"".concat(W.padding,"px ").concat(W.paddingLG,"px 0"),background:W.colorBgContainer,borderBottom:"".concat(W.lineWidth,"px ").concat(W.lineType," ").concat(W.colorBorderSecondary)}},eT),eI?s().createElement(B,{onClose:eb},eM):s().createElement("div",{"data-testid":"workflow-task-list-region",style:{background:W.colorBgLayout,display:"flex",flex:"1 1 0%",flexDirection:"column",minHeight:0}},s().createElement(P,{records:Z,loading:ei,mobile:J,total:Y,page:ea,onPageChange:eh,onOpenRecord:ek,refresh:eg,Item:K.Item})))),eI?null:s().createElement(eE,{type:K,record:q,mobile:J,title:eS,onClose:eb},eM))}function L(){var e,t,n,o,a,l,u,p,d,y=(0,r.useFlowContext)(),m=(0,f.e0)(y),k=(0,f.yg)(y,m),v=(e=k.counts,n=S().taskType,o=(0,c.useMemo)(function(){return(0,f.Bf)(m)},[m]),a=(0,c.useMemo)(function(){return(0,f.EC)(m,e)},[e,m]),l=null!=(t=null!=n?n:a[0])?t:o[0],{taskTypeKeys:o,availableTaskTypeKeys:a,currentTaskType:l?null==m?void 0:m.get(l):void 0,currentTaskTypeKey:l}),T=(0,i.useMemoizedFn)(function(e){return b(function(){var t;return w(this,function(n){return[2,(t=null==y?void 0:y.api.resource("userWorkflowTaskStats").listMine)?t(e):{data:{data:[],meta:{}}}]})})()});return s().createElement(g.UI,{eventBus:null==y||null==(d=y.app)?void 0:d.eventBus,loadWorkflowTaskStats:T,typeKey:v.currentTaskTypeKey},s().createElement(K,(u=h({},v),p=p={countsState:k,ctx:y,taskTypes:m},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(p)).forEach(function(e){Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(p,e))}),u)))}}}]);
|
|
@@ -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
|
-
(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["828"],{7264:function(e){e.exports=function(e,t,r){e=e||{};var n=t.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(e,t,r,o){return n.fromToBase(e,t,r,o)}r.en.relativeTime=o,n.fromToBase=function(t,n,l,a,i){for(var u,c,s,f=l.$locale().relativeTime||o,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=d.length,m=0;m<p;m+=1){var y=d[m];y.d&&(u=a?r(t).diff(l,y.d,!0):l.diff(t,y.d,!0));var v=(e.rounding||Math.round)(Math.abs(u));if(s=u>0,v<=y.r||!y.r){v<=1&&m>0&&(y=d[m-1]);var b=f[y.l];i&&(v=i(""+v)),c="string"==typeof b?b.replace("%d",v):b(v,n,y.l,s);break}}if(n)return c;var h=s?f.future:f.past;return"function"==typeof h?h(c):h.replace("%s",c)},n.to=function(e,t){return l(e,t,this,!0)},n.from=function(e,t){return l(e,t,this)};var a=function(e){return e.$u?r.utc():r()};n.toNow=function(e){return this.to(a(this),e)},n.fromNow=function(e){return this.from(a(this),e)}}},1736:function(e,t,r){"use strict";r.d(t,{i:function(){return h}});var n=r(9155),o=r.n(n),l=r(2059),a=r(7375),i=r(5477),u=r(7694),c=r(5980),s=r(1611),f=r(2235),d=r(3052),p=r(9488),m=r(8743),y=r(3284);function v(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 b(){var e,t=(0,c.A)().styles,r=(0,p.kj)(),n=(0,u.useFlowEngine)(),i=(0,d.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var f=n.context.app.pm.get(m.q),y=null==f?void 0:f.getInstruction(s.type),v=y?r(y.title):s.type;return o().createElement("div",{className:t.clipboardPreviewClass},o().createElement("div",{className:"workflow-clipboard-header"},o().createElement("span",null,r("Copied node")),o().createElement(l.Button,{type:"text",size:"small",icon:o().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),o().createElement("div",{className:"workflow-clipboard-card"},o().createElement("div",{className:"workflow-clipboard-type"},v),o().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function h(e){var t,r,a=e.entry,u=(0,c.A)(),d=u.styles,m=u.cx,h=(0,p.kj)(),g=(0,f.S8)();(null!=(r=(0,f.$K)())?r:{}).workflow;var w=function(e){if(Array.isArray(e))return e}(t=(0,n.useState)(100))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return v(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 v(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.")}(),k=w[0],E=w[1];return o().createElement("div",{className:m(d.workflowPageClass,(0,i.css)({height:"100%"}))},o().createElement("div",{className:"workflow-canvas-wrapper"},o().createElement("div",{className:"workflow-canvas",style:{zoom:k/100}},o().createElement("div",{className:m(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement("div",{className:d.branchClass},g?o().createElement(l.Alert,{type:"warning",showIcon:!0,message:h("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,o().createElement(y.Vo,null),o().createElement("div",{className:m(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement(s.l,{entry:a})),o().createElement("div",{className:d.terminalClass},h("End"))))),o().createElement(b,null),o().createElement("div",{className:"workflow-canvas-zoomer"},o().createElement(l.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:k,onChange:E}))))}},3359:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return q}});var n=r(3485),o=r(7694),l=r(2625),a=r(2059),i=r(9155),u=r.n(i),c=r(4442),s=r(9488);function f(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 d(e,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function p(e){var t,r=e.record,n=e.resource,o=e.onChanged,c=(0,s.ec)().t,p=a.App.useApp().message,m=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=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return f(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 f(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.")}(),y=m[0],v=m[1],b=(0,l.useMemoizedFn)(function(e){var t;return(t=function(){return function(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:v(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,n.update({filterByTk:r.id,values:{enabled:e}})];case 2:return t.sent(),o(e),[3,5];case 3:return t.sent(),p.error(c("Operation failed")),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var l=t.apply(e,r);function a(e){d(l,n,o,a,i,"next",e)}function i(e){d(l,n,o,a,i,"throw",e)}a(void 0)})})()});return u().createElement(a.Switch,{checked:!!r.enabled,loading:y,onChange:b,checkedChildren:c("On"),unCheckedChildren:c("Off")})}var m=r(7375),y=r(7001),v=r(1652),b=r(5980),h=r(2404);function g(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 w(e,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function k(e){var t,r,n=e.record,o=e.open,c=e.onClose,f=e.resource,d=e.refresh,p=(0,s.ec)().t,m=(0,b.A)().styles,y=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null!=(r=n.description)?r:""))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return g(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 g(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.")}(),v=y[0],k=y[1];(0,i.useEffect)(function(){if(o){var e;k(null!=(e=n.description)?e:"")}},[o,n.description]);var E=(0,l.useMemoizedFn)(function(e){k(e.target.value)}),x=(0,l.useMemoizedFn)(function(e){var t;return(t=function(){var t,r;return function(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:if((r=e.target.value)===(null!=(t=n.description)?t:""))return[2];return[4,f.update({filterByTk:n.id,values:{description:r}})];case 1:return o.sent(),d(),[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var l=t.apply(e,r);function a(e){w(l,n,o,a,i,"next",e)}function i(e){w(l,n,o,a,i,"throw",e)}a(void 0)})})()});return u().createElement(a.Modal,{open:o,title:p("Details"),width:640,footer:null,onCancel:c},u().createElement(a.Descriptions,{bordered:!0,column:2,size:"small"},u().createElement(a.Descriptions.Item,{label:"Key",span:2},n.key||"-"),u().createElement(a.Descriptions.Item,{label:p("Created by")},(0,h.ts)(n.createdBy)),u().createElement(a.Descriptions.Item,{label:p("Created at")},(0,h.fU)(n.createdAt)),u().createElement(a.Descriptions.Item,{label:p("Last updated by")},(0,h.ts)(n.updatedBy)),u().createElement(a.Descriptions.Item,{label:p("Last updated at")},(0,h.fU)(n.updatedAt)),u().createElement(a.Descriptions.Item,{label:p("Description"),span:2},u().createElement(a.Input.TextArea,{"aria-label":p("Description"),value:v,onChange:E,onBlur:x,placeholder:"-",className:m.workflowDetailsDescriptionClass,autoSize:{minRows:3,maxRows:8}}))))}function E(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,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function S(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){x(l,n,o,a,i,"next",e)}function i(e){x(l,n,o,a,i,"throw",e)}a(void 0)})}}function O(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var C="/admin/settings/workflow";function j(e){var t,r,n=e.record,c=e.revisions,f=e.resource,d=e.refresh,p=(0,s.ec)().t,b=(0,o.useFlowContext)(),g=(0,y.TD)().getWorkflowCanvasPath,w=a.App.useApp(),x=w.modal,j=w.message,A=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=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return E(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 E(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.")}(),T=A[0],I=A[1],P=Number((null==(r=n.stats)?void 0:r.executed)||0)>0,B=(0,l.useMemoizedFn)(function(){b.viewer.drawer({width:"60%",closable:!0,title:p("Execution history"),content:function(){return u().createElement(v.S,{workflowKey:n.key})}})}),F=(0,l.useMemoizedFn)(function(){return S(function(){var e,t;return O(this,function(r){switch(r.label){case 0:return[4,f.revision({filterByTk:n.id,filter:{key:n.key}})];case 1:return e=r.sent(),t=(0,h.iD)(e),j.success(p("Operation succeeded")),(null==t?void 0:t.id)!=null&&b.router.navigate(g(t.id)),[2]}})})()}),M=(0,l.useMemoizedFn)(function(){var e=n.current?p("Delete a main version will cause all other revisions to be deleted too."):p("Current version will be deleted (without affecting other versions).");x.confirm({title:p("Are you sure you want to delete it?"),content:e,onOk:function(){return S(function(){var e;return O(this,function(t){switch(t.label){case 0:return[4,f.destroy({filterByTk:n.id})];case 1:if(t.sent(),j.success(p("Operation succeeded")),n.current)return b.router.navigate(C),[2];return e=c.find(function(e){return e.current}),b.router.navigate((null==e?void 0:e.id)!=null?g(e.id):C),[2]}})})()}})}),D=(0,l.useMemoizedFn)(function(e){switch(e.key){case"details":I(!0);return;case"refresh":d();return;case"history":B();return;case"revision":F();return;case"delete":M();return}});return u().createElement(u().Fragment,null,u().createElement(a.Dropdown,{menu:{onClick:D,items:[{key:"details",label:p("Details")},{type:"divider"},{key:"refresh",label:p("Refresh")},{key:"history",label:p("Execution history"),disabled:!P},{key:"revision",label:p("Copy to new version")},{type:"divider"},{key:"delete",label:p("Delete"),danger:!0}]}},u().createElement(a.Button,{"aria-label":"more",type:"text",icon:u().createElement(m.EllipsisOutlined,null)})),u().createElement(k,{record:n,open:T,onClose:function(){return I(!1)},resource:f,refresh:d}))}var A=r(9185),T=r.n(A),I=r(7264),P=r.n(I);function B(e,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function F(e){var t=e.record,r=e.resource,n=(0,s.ec)().t,c=(0,o.useFlowContext)(),f=(0,y.TD)().getWorkflowCanvasPath,d=(0,b.A)(),p=d.cx,v=d.styles,h=(0,l.useRequest)(function(){var e;return(e=function(){var e,n,o;return function(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:return[4,r.list({filter:{key:t.key},fields:["id","createdAt","current","enabled","versionStats.executed"],sort:"-id"})];case 1:return[2,null!=(e=null==(o=l.sent())||null==(n=o.data)?void 0:n.data)?e:[]]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){B(l,n,o,a,i,"next",e)}function i(e){B(l,n,o,a,i,"throw",e)}a(void 0)})})()},{manual:!0}),g=h.data,w=h.run,k=(0,l.useMemoizedFn)(function(e){var r=e.key;String(r)!==String(t.id)&&c.router.navigate(f(r))}),E=(0,i.useMemo)(function(){return null!=g?g:[]},[g]);return u().createElement(a.Dropdown,{className:"workflow-versions",trigger:["click"],onOpenChange:function(e){return e&&w()},menu:{onClick:k,selectedKeys:["".concat(t.id)],className:p(v.dropdownClass,v.workflowVersionDropdownClass),items:E.slice().sort(function(e,t){return Number(t.id)-Number(e.id)}).map(function(e){var t,r;return{key:"".concat(e.id),icon:e.current?u().createElement(m.RightOutlined,null):null,className:p({executed:Number((null==(t=e.versionStats)?void 0:t.executed)||0)>0,unexecuted:0===Number((null==(r=e.versionStats)?void 0:r.executed)||0),enabled:e.enabled}),label:u().createElement(u().Fragment,null,u().createElement("strong",null,"#".concat(e.id)),u().createElement("time",null,e.createdAt?T()(e.createdAt).fromNow():""))}})}},u().createElement(a.Button,{type:"text","aria-label":"version"},u().createElement("span",{style:{opacity:.65,marginRight:4}},n("Version")),u().createElement("span",null,null!=t.id?"#".concat(t.id):null),u().createElement(m.DownOutlined,null)))}T().extend(P());var M=r(2990),D=r(5927);function N(e){var t=e.record,r=e.revisions,n=e.resource,o=e.refresh,l=(0,s.ec)().t,i=(0,s.kj)(),f=a.theme.useToken().token;return u().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:f.margin,flexWrap:"wrap",padding:"".concat(f.paddingSM,"px ").concat(f.padding,"px"),background:f.colorBgContainer,borderBottom:"1px solid ".concat(f.colorBorderSecondary)}},u().createElement("div",{style:{display:"flex",alignItems:"center",gap:f.marginSM}},u().createElement(a.Breadcrumb,{items:[{title:u().createElement(c.Link,{to:"/admin/settings/workflow"},l("Workflow"))},{title:u().createElement(a.Tooltip,{title:"Key: ".concat(t.key)},u().createElement("strong",null,i(t.title||"")))}]}),u().createElement(D.t,{value:t.sync})),u().createElement("div",{style:{display:"flex",alignItems:"center",gap:f.marginXS}},u().createElement(M.jx,{record:t,refresh:o}),u().createElement(F,{record:t,resource:n}),u().createElement(p,{record:t,resource:n,onChanged:function(){return o()}}),u().createElement(j,{record:t,revisions:r,resource:n,refresh:o})))}var R=r(2235),z=r(1736),L=r(8761),W=r(8701),V=r(222),K=r(3052),$=r(379);function G(e,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function U(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){G(l,n,o,a,i,"next",e)}function i(e){G(l,n,o,a,i,"throw",e)}a(void 0)})}}function _(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function q(){var e=(0,o.useFlowContext)(),t=(0,n.useApp)(),r=(0,s.kj)(),f=a.theme.useToken().token,d=(0,c.useParams)().id,p=e.api.resource("workflows"),m=(0,l.useRequest)(function(){return U(function(){var e;return _(this,function(t){switch(t.label){case 0:if(!d)return[2,null];return[4,p.get({filterByTk:d,appends:["nodes","stats","versionStats","createdBy","updatedBy"]})];case 1:return e=t.sent(),[2,(0,h.iD)(e)]}})})()},{refreshDeps:[d]}),y=m.data,v=m.loading,b=m.refresh,g=(0,l.useRequest)(function(){return U(function(){var e,t,r;return _(this,function(n){switch(n.label){case 0:if(!(null==y?void 0:y.key))return[2,[]];return[4,p.list({filter:{key:y.key},fields:["id","current","enabled"],sort:"-id"})];case 1:return[2,null!=(e=null==(r=n.sent())||null==(t=r.data)?void 0:t.data)?e:[]]}})})()},{refreshDeps:[null==y?void 0:y.key]}).data,w=(null==y?void 0:y.id)!=null&&String(y.id)===String(d)?y:null,k=(0,i.useMemo)(function(){return null!=g?g:[]},[g]),E=(0,i.useMemo)(function(){var e,t,r=null!=(e=null==w?void 0:w.nodes)?e:[];return(0,L.K)(r),{nodes:r,entry:null!=(t=r.find(function(e){return!e.upstream}))?t:null}},[w]),x=E.nodes,S=E.entry,O=(0,i.useMemo)(function(){return{workflow:w,nodes:x,refresh:b}},[w,x,b]);return((0,i.useEffect)(function(){(null==w?void 0:w.title)&&(document.title="".concat(r("Workflow"),": ").concat(r(w.title)," - NocoBase"))},[null==w?void 0:w.title,r]),d)?w?u().createElement(R.cB.Provider,{value:O},u().createElement("div",{style:{display:"flex",flexDirection:"column",height:"100dvh",minHeight:0,overflow:"hidden",width:"100%",boxSizing:"border-box",background:f.colorBgLayout}},u().createElement(N,{record:w,revisions:k,resource:p,refresh:b}),u().createElement("div",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative",width:"100%"}},u().createElement(W.y,null,u().createElement(V.J,null,u().createElement($.b,null,u().createElement(K.L,null,u().createElement(z.i,{entry:S})))))))):v?u().createElement(a.Spin,null):u().createElement(a.Result,{status:"404",title:r("Workflow does not exist"),extra:u().createElement(a.Button,{type:"primary",href:t.getHref(t.pluginSettingsManager.getRoutePath("workflow"))},r("Back to Workflow List"))}):null}},2990:function(e,t,r){"use strict";r.d(t,{LZ:function(){return S},jx:function(){return x}});var n=r(9155),o=r.n(n),l=r(2625),a=r(2059),i=r(3485),u=r(7694),c=r(9239),s=r(2235),f=r(7470),d=r(7001),p=r(9488),m=r(8743),y=r(4442),v=r(5953),b=r(358);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 g(e,t,r,n,o,l,a){try{var i=e[l](a),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,o)}function w(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 l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(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 h(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 k(e){var t,r=e.execution,n=(0,p.kj)(),l=(0,d.TD)().getWorkflowExecutionPath,i=r?c.m2[String(r.status)]:null;if(!i)return o().createElement("span",null,n("Workflow not executed"));var u=n(i.label);return o().createElement(v.Trans,{ns:b.C,values:{statusText:u}},"Workflow executed, the result status is ",o().createElement(a.Tag,{color:i.color},"{{statusText}}"),o().createElement(y.Link,{to:l(null!=(t=r.id)?t:"")},"View the execution"))}function E(e){var t,r=e.workflow,c=(e.trigger,e.TriggerFieldsetLoader),m=e.valid,y=e.onSubmitted,v=(0,u.useFlowContext)(),b=(0,u.useFlowView)(),h=(0,p.kj)(),E=a.theme.useToken().token,x=a.App.useApp().message,S=(0,d.TD)().getWorkflowCanvasPath,O=w(a.Form.useForm(),1)[0],C=w((0,n.useState)(!1),2),j=C[0],A=C[1],T=!!(null==(t=r.versionStats)?void 0:t.executed),I=(0,n.useMemo)(function(){return(0,n.lazy)(c)},[c]),P=!m,B=(0,l.useMemoizedFn)(function(){var e;return(e=function(){var e,t,n,l,a,i;return function(e,t){var r,n,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(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=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:if(!m)return[2];return[4,O.validateFields()];case 1:t=(e=u.sent()).autoRevision,n=function(e,t){if(null==e)return{};var r,n,o,l={};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)&&(l[n]=e[n]);return l}if(l=function(e,t){if(null==e)return{};var r,n,o={},l=Object.getOwnPropertyNames(e);for(n=0;n<l.length;n++)r=l[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)&&(l[n]=e[n]);return l}(e,["autoRevision"]),A(!0),u.label=2;case 2:return u.trys.push([2,,5,6]),[4,v.api.resource("workflows").execute(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}({filterByTk:r.id,values:n},!T&&t?{autoRevision:1}:{}))];case 3:return i=null==(a=u.sent())||null==(l=a.data)?void 0:l.data,x.open({type:(null==i?void 0:i.execution)?"info":"warning",content:o().createElement(k,{execution:null==i?void 0:i.execution}),duration:5}),[4,b.close()];case 4:return u.sent(),(null==i?void 0:i.newVersionId)?v.router.navigate(S(i.newVersionId)):null==y||y(),[3,6];case 5:return A(!1),[7];case 6:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var l=e.apply(t,r);function a(e){g(l,n,o,a,i,"next",e)}function i(e){g(l,n,o,a,i,"throw",e)}a(void 0)})})()}),F=o().createElement(a.Space,null,o().createElement(a.Button,{disabled:P,onClick:function(){return b.close()}},h("Cancel")),o().createElement(a.Button,{type:"primary",loading:j,disabled:P,onClick:B},h("Confirm")));return o().createElement(s.AA.Provider,{value:r},o().createElement(f.W.Provider,{value:!0},o().createElement(i.DialogFormLayout,{title:h("Execute manually"),onSubmit:B,submitting:j,submitText:h("Confirm"),cancelText:h("Cancel"),footer:F},o().createElement(a.Form,{form:O,layout:"vertical",initialValues:{autoRevision:!0},disabled:P},o().createElement(a.Alert,{message:h("Trigger variables need to be filled for executing."),type:"info",style:{marginBottom:E.margin}}),o().createElement(a.Form.Item,{label:h("Trigger variables")},o().createElement("div",{style:{padding:E.padding,border:"".concat(E.lineWidth,"px solid ").concat(E.colorBorderSecondary),borderRadius:E.borderRadiusLG}},o().createElement(n.Suspense,{fallback:o().createElement(a.Skeleton,{active:!0,paragraph:{rows:2}})},o().createElement(I,null)))),T?null:o().createElement(a.Form.Item,{name:"autoRevision",valuePropName:"checked"},o().createElement(a.Checkbox,null,h("Automatically create a new version after execution")))))))}function x(e){var t,r,i=e.record,c=e.refresh,s=(0,u.useFlowContext)(),f=(0,p.kj)(),d=s.app.pm.get(m.q),y=i.type?d.getTriggerOptions(i.type):void 0,v=null!=(t=null==y?void 0:y.validate(null!=(r=i.config)?r:{}))&&t,b=(0,n.useMemo)(function(){return y?y.TriggerFieldsetLoader?"":f("This type of trigger has not been supported to be executed manually."):f("This trigger type is not available in the new canvas yet.")},[f,y]),h=(0,l.useMemoizedFn)(function(){y&&!b&&y.TriggerFieldsetLoader&&S({ctx:s,workflow:i,trigger:y,TriggerFieldsetLoader:y.TriggerFieldsetLoader,valid:v,refresh:c})});return o().createElement(a.Tooltip,{title:b||void 0},o().createElement("span",null,o().createElement(a.Button,{disabled:!!b,onClick:h},f("Execute manually"))))}function S(e){e.ctx.viewer.dialog({width:520,closable:!0,content:function(){return o().createElement(E,{workflow:e.workflow,trigger:e.trigger,TriggerFieldsetLoader:e.TriggerFieldsetLoader,valid:e.valid,onSubmitted:e.refresh})}})}}}]);
|
|
@@ -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([["87"],{5927:function(e,t,n){n.d(t,{t:function(){return c}});var r=n(2059),o=n(9155),l=n.n(o),a=n(9488);function c(e){var t=e.value,n=(0,a.ec)().t;return t?l().createElement(r.Tag,{color:"orange"},n("Synchronously")):l().createElement(r.Tag,{color:"cyan"},n("Asynchronously"))}},1652:function(e,t,n){n.d(t,{S:function(){return T}});var r,o=n(7375),l=n(3485),a=n(7694),c=n(2625),u=n(2059),i=n(9185),s=n.n(i),d=n(9155),f=n.n(d),m=n(6358),E=n(9239),b=n(9488);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=(p(r={},E.GO.QUEUEING,f().createElement(o.HourglassOutlined,null)),p(r,E.GO.STARTED,f().createElement(o.LoadingOutlined,null)),p(r,E.GO.RESOLVED,f().createElement(o.CheckOutlined,null)),p(r,E.GO.FAILED,f().createElement(o.ExclamationOutlined,null)),p(r,E.GO.ERROR,f().createElement(o.CloseOutlined,null)),p(r,E.GO.ABORTED,f().createElement(o.MinusOutlined,{rotate:90})),p(r,E.GO.CANCELED,f().createElement(o.MinusOutlined,{rotate:45})),p(r,E.GO.REJECTED,f().createElement(o.MinusOutlined,null)),p(r,E.GO.RETRY_NEEDED,f().createElement(o.RedoOutlined,null)),r);function v(e){var t=e.value,n=(0,b.kj)(),r=E.m2[t];if(!r)return null;var o=y[t];return f().createElement(u.Tag,{color:r.color,icon:o},n(r.label))}var g=n(7001);function w(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 O(e,t,n,r,o,l,a){try{var c=e[l](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){O(l,r,o,a,c,"next",e)}function c(e){O(l,r,o,a,c,"throw",e)}a(void 0)})}}function C(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 k(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 R(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,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){c=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(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 w(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 S(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),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var i=[c,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}var D=["workflow"];function A(e){var t=e.workflowKey,n=(0,b.ec)().t,r=(0,b.kj)(),i=(0,a.useFlowContext)(),m=(0,a.useFlowEngine)(),p=(0,g.TD)().getWorkflowExecutionPath,y=u.theme.useToken().token,w=u.App.useApp(),O=w.modal,C=w.message,k=i.api.resource("executions"),A=(0,d.useMemo)(function(){var e,t,n,r;return null==(r=m.context.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"executions")},[m]),T=R((0,d.useState)(1),2),x=T[0],j=T[1],P=R((0,d.useState)(20),2),M=P[0],G=P[1],F=R((0,d.useState)(void 0),2),I=F[0],N=F[1],z=R((0,d.useState)([]),2),L=z[0],B=z[1],U=(0,c.useMemoizedFn)(function(e){N(e),j(1)}),_=(0,c.useRequest)(function(){return h(function(){var e;return S(this,function(n){switch(n.label){case 0:return e=I?{$and:[{key:t},I]}:{key:t},[4,k.list({page:x,pageSize:M,sort:["-id"],except:["context","output","stack"],filter:e})];case 1:var r,o,l,a,c;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:(c=(null==o?void 0:o.meta)||(null==l?void 0:l.meta)||{}).count||c.total||a.length}]}})})()},{refreshDeps:[x,M,I,t]}),K=_.data,Q=_.loading,V=_.refresh,Y=(0,c.useMemoizedFn)(function(e,t){if(t!==M){G(t),j(1);return}j(e)}),J=(0,c.useMemoizedFn)(function(e){O.confirm({title:n("Delete record"),content:n("Are you sure you want to delete it?"),onOk:function(){return h(function(){return S(this,function(t){switch(t.label){case 0:return[4,k.destroy({filterByTk:e})];case 1:return t.sent(),B([]),V(),[2]}})})()}})}),q=(0,c.useMemoizedFn)(function(){O.confirm({title:n("Clear all executions"),content:n("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?"),onOk:function(){return h(function(){return S(this,function(e){switch(e.label){case 0:return[4,k.destroy({filter:{key:t}})];case 1:return e.sent(),C.success(n("Operation succeeded")),B([]),V(),[2]}})})()}})}),H=(0,c.useMemoizedFn)(function(e){O.confirm({title:n("Cancel the execution"),icon:f().createElement(o.ExclamationCircleFilled,null),content:n("Are you sure you want to cancel the execution?"),onOk:function(){return h(function(){return S(this,function(t){switch(t.label){case 0:return[4,k.cancel({filterByTk:e.id})];case 1:return t.sent(),C.success(n("Operation succeeded")),V(),[2]}})})()}})}),W=(0,c.useMemoizedFn)(function(e){var t,n;null==(n=i.view)||null==(t=n.close)||t.call(n),i.router.navigate(p(e.id))}),$=(0,d.useMemo)(function(){return[{title:n("ID"),dataIndex:"id"},{title:n("Triggered at"),dataIndex:"createdAt",render:function(e){return e?s()(e).format("YYYY-MM-DD HH:mm:ss"):null}},{title:n("Version"),dataIndex:"workflowId",render:function(e){return null!=e?"#".concat(e):null}},{title:n("Status"),dataIndex:"status",render:function(e,t){return f().createElement(u.Space,null,f().createElement(v,{value:e}),t.status===E.GO.STARTED||t.status===E.GO.QUEUEING?f().createElement(u.Tooltip,{title:n("Cancel the execution")},f().createElement(u.Button,{type:"link",danger:!0,onClick:function(){return H(t)},shape:"circle",size:"small",icon:f().createElement(o.StopOutlined,null)})):null)}},{title:n("Actions"),width:160,render:function(e,t){return f().createElement(u.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},f().createElement("a",{onClick:function(){return W(t)}},n("View")),t.status!==E.GO.STARTED?f().createElement("a",{onClick:function(){return J(t.id)}},n("Delete")):null)}}]},[H,J,W,n]);return f().createElement("div",null,f().createElement(u.Flex,{justify:"space-between",align:"center",style:{marginBottom:y.margin}},f().createElement(l.CollectionFilter,{collection:A,nonfilterableFieldNames:D,onChange:U,t:r}),f().createElement(u.Space,null,f().createElement(u.Button,{icon:f().createElement(o.ReloadOutlined,null),onClick:function(){return V()}},n("Refresh")),f().createElement(u.Button,{icon:f().createElement(o.DeleteOutlined,null),disabled:!L.length,onClick:function(){return J(L)}},n("Delete")),f().createElement(u.Button,{danger:!0,onClick:q},n("Clear")))),f().createElement(l.Table,{rowKey:"id",loading:Q,columns:$,dataSource:(null==K?void 0:K.records)||[],rowSelection:{selectedRowKeys:L,onChange:B},pagination:{current:x,pageSize:M,total:(null==K?void 0:K.total)||0,onChange:Y}}))}function T(e){var t=e.workflowKey,n=(0,b.kj)(),r=(0,d.useMemo)(function(){var e=E.hi.map(function(e){return{value:e.value,label:n(e.label)}});return[k(C({},m.A),{fields:m.A.fields.map(function(t){return(null==t?void 0:t.name)==="status"&&t.uiSchema?k(C({},t),{uiSchema:k(C({},t.uiSchema),{enum:e})}):t})})]},[n]);return f().createElement(l.ExtendCollectionsProvider,{collections:r},f().createElement(A,{workflowKey:t}))}},7001:function(e,t,n){n.d(t,{TD:function(){return c}});var r=n(2625),o=n(3485),l=n(8401);function a(){return"modern"===(0,o.getRouteRuntimeVersion)()}function c(){var e=(0,r.useMemoizedFn)(function(e){return a()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return a()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:a(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return l},QQ:function(){return u},hi:function(){return a},m2:function(){return c}});var r=n(358);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:l.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:l.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:l.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:l.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:l.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:l.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:l.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:l.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:l.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],c=a.reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{}),u=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{})}}]);
|
|
@@ -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([["972"],{1801:function(e,t,r){r.d(t,{N$:function(){return D},yr:function(){return F}});var n=r(3485),o=r(7694),a=r(2625),i=r(2059),l=r(9155),u=r.n(l),c=r(7768),s=r(4563),f=r(5737),d=r(9488),y=r(3943);function v(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 m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(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 a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||g(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 h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function g(e,t){if(e){if("string"==typeof e)return v(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 v(e,t)}}var w=["yesterday","today","tomorrow","lastWeek","thisWeek","nextWeek","lastMonth","thisMonth","nextMonth","lastQuarter","thisQuarter","nextQuarter","lastYear","thisYear","nextYear","last7Days","next7Days","last30Days","next30Days","last90Days","next90Days"],x={yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",lastWeek:"Last week",thisWeek:"This week",nextWeek:"Next week",lastMonth:"Last month",thisMonth:"This month",nextMonth:"Next month",lastQuarter:"Last quarter",thisQuarter:"This quarter",nextQuarter:"Next quarter",lastYear:"Last year",thisYear:"This year",nextYear:"Next year",last7Days:"Last 7 days",next7Days:"Next 7 days",last30Days:"Last 30 days",next30Days:"Next 30 days",last90Days:"Last 90 days",next90Days:"Next 90 days"},j={resolvePathFromValue:function(e){return"string"==typeof e?(0,f.IB)(e):void 0},resolveValueFromPath:function(e){return(0,f.oS)(e)}};function O(e){return!!(e&&(void 0===e?"undefined":b(e))==="object"&&"logic"in e&&"items"in e)}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||(void 0===e?"undefined":b(e))!=="object"||Array.isArray(e))return t.length?[{path:t.join("."),operator:"$eq",value:e}]:[];var r=Object.entries(e),n=r.filter(function(e){return p(e,1)[0].startsWith("$")});return n.length?t.length?n.map(function(e){var r=p(e,2),n=r[0],o=r[1];return{path:t.join("."),operator:n,value:o}}):[]:r.flatMap(function(e){var r=p(e,2),n=r[0];return A(r[1],h(t).concat([n]))})}function k(e){return Array.isArray(e.$or)?"$or":Array.isArray(e.$and)?"$and":void 0}function S(e){var t;return O(e)?e:null!=(t=function e(t){if(!(!t||(void 0===t?"undefined":b(t))!=="object"||Array.isArray(t))){var r=k(t);if(!r){var n=A(t);return n.length?{logic:"$and",items:n}:void 0}var o=t[r].flatMap(function(t){if(!t||(void 0===t?"undefined":b(t))!=="object"||Array.isArray(t))return[];if(k(t)){var r=e(t);return r?[r]:[]}return A(t)}).filter(function(e){return!!e});return o.length?{logic:r,items:o}:void 0}}(e))?t:{logic:"$and",items:[]}}function D(e){var t=e.collection,r=e.value,f=e.onChange,v=e.disabled,p=e.rightAsVariable,b=void 0===p||p,g=e.maxAssociationFieldDepth,A=void 0===g?2:g,k=(0,o.useFlowEngine)(),D=(0,d.kj)(),F=!!(i.ConfigProvider.useConfig().componentDisabled||v),P=(0,a.useMemoizedFn)(function(e,t){return D(e,t)}),M=(0,s.P)(),E=(0,l.useMemo)(function(){var e,t;return e={name:"dateRange",title:P("Date range"),type:"object",paths:["$system","dateRange"],children:w.map(function(e){return{name:e,title:P(x[e]),type:"string",paths:["$system","dateRange",e]}})},(t=M.findIndex(function(e){return"$system"===e.name}))<0?h(M).concat([{name:"$system",title:P("System variables"),type:"",paths:["$system"],children:[e]}]):M.map(function(r,n){if(n!==t||"function"==typeof r.children)return r;var o,a,i=Array.isArray(r.children)?r.children.filter(function(e){return"dateRange"!==e.name}):[];return o=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){m(e,t,r[t])})}return e}({},r),a=a={children:h(i).concat([e])},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o})},[P,M]),I=(0,l.useMemo)(function(){return(0,y.X_)(k.context.dataSourceManager,t)},[k,t]),C=(0,l.useMemo)(function(){if(!I)return null;var e=k.createModel({uid:(0,o.randomId)("workflowFilter_"),use:o.FlowModel}),t=k.context.app;return t&&e.context.defineProperty("app",{value:t}),e.context.defineProperty("collection",{get:function(){return I}}),e},[I,k]);(0,l.useEffect)(function(){return function(){var e;null==C||null==(e=C.remove)||e.call(C)}},[C]);var $=(0,l.useRef)();$.current||($.current=(0,o.observable)(S(r)));var N=(0,l.useRef)(null);(0,l.useEffect)(function(){var e=JSON.stringify(null!=r?r:{});if(N.current!==e){var t=S(r);$.current&&($.current.logic=t.logic,$.current.items=t.items,N.current=e)}},[r]),(0,l.useEffect)(function(){if($.current)return(0,o.reaction)(function(){return JSON.stringify((0,o.toJS)($.current))},function(e){var t,r=JSON.parse(e),n=Array.isArray(r.items)?r.items.length:0,o=(0,c.removeInvalidFilterItems)(r);if(!o.items.length){n||null==f||f({});return}var a=null!=(t=function e(t){if(null==t||null==(r=t.items)?void 0:r.length){var r,n=t.items.map(function(t){if(O(t))return e(t);if("string"==typeof t.path&&"string"==typeof t.operator&&t.path&&t.operator)return function(e,t){for(var r=e.split("."),n=t,o=r.length-1;o>=0;o--)n=m({},r[o],n);return n}(t.path,m({},t.operator,t.value))}).filter(function(e){return!!e});if(n.length)return m({},t.logic,n)}}(o))?t:{};N.current=JSON.stringify(a),null==f||f(a)},{fireImmediately:!1})},[f]);var T=(0,l.useMemo)(function(){if(!C)return null;var e=function(e){var t=e.value;return u().createElement(o.FlowModelProvider,{model:C},u().createElement(n.VariableFilterItem,{value:t,model:C,disabled:F,rightAsVariable:b,rightMetaTree:E,rightVariableConverters:j,maxAssociationFieldDepth:A}))};return e.displayName="WorkflowVariableFilterItem",e},[C,A,F,b,E]);return u().createElement(n.FilterGroup,{value:$.current,FilterItem:null!=T?T:void 0,disabled:F})}var F=D},5329:function(e,t,r){r.d(t,{F:function(){return c}});var n=r(9155),o=r.n(n),a=r(2059),i=r(8198),l=r(9488);function u(e){var t=e.value,r=e.onChange,a=e.disabled,l=e.onCollectionChanged,u=(0,n.useRef)();return o().createElement(i.XJ,{value:t,disabled:a,onChange:function(e){var n,o=null!=(n=u.current)?n:t;null==r||r(e),o&&o!==e&&(null==l||l(o,e)),u.current=e}})}function c(e){var t=e.disabled,r=e.onCollectionChanged,n=(0,l.kj)();return o().createElement(a.Form.Item,{name:["config","collection"],label:n("Collection"),rules:[{required:!0}]},o().createElement(u,{disabled:t,onCollectionChanged:r}))}},6855:function(e,t,r){r.d(t,{F:function(){return f}});var n=r(9155),o=r.n(n),a=r(2059),i=r(7768),l=r(1801),u=r(2235),c=r(9488);function s(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,o)}function f(e){var t,r=e.collection,n=e.label,f=e.name,d=e.required,y=e.maxAssociationFieldDepth,v=(0,c.kj)(),m=(0,u.Zt)(),p=!!(null==m||null==(t=m.versionStats)?void 0:t.executed);return o().createElement(a.Form.Item,{name:void 0===f?["config","params","filter"]:f,label:null!=n?n:v("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===d||d?[{validator:function(e,t){var r;return(r=function(){return function(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var c=[l,u];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){if(!(0,i.isValidFilter)(t))throw Error(v("Please add at least one condition"));return[2]})},function(){var e=this,t=arguments;return new Promise(function(n,o){var a=r.apply(e,t);function i(e){s(a,n,o,i,l,"next",e)}function l(e){s(a,n,o,i,l,"throw",e)}i(void 0)})})()}}]:void 0},o().createElement(l.N$,{collection:r,disabled:p,maxAssociationFieldDepth:void 0===y?2:y}))}}}]);
|