@nocobase/plugin-workflow-cc 2.2.0-alpha.7 → 2.2.0-beta.10
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-v2 → client}/flow/RemoteFlowModelRenderer.d.ts +5 -5
- package/dist/client/index.js +1 -1
- package/dist/client/instruction/SchemaConfig.d.ts +17 -0
- package/dist/client/instruction/index.d.ts +128 -2
- package/dist/{client-v2 → client}/models/CCBlockGridModel.d.ts +1 -2
- package/dist/{client-v2/nodes/components/cc.d.ts → client/models/CCChildPageModel.d.ts} +4 -3
- package/dist/{client-v2/models/registerModelLoaders.d.ts → client/models/CCChildPageTabModel.d.ts} +5 -2
- package/dist/{client-v2 → client}/models/CCTaskCardDetailsAssociationFieldGroupModel.d.ts +2 -3
- package/dist/{client-v2 → client}/models/CCTaskCardDetailsItemModel.d.ts +10 -16
- package/dist/{client-v2 → client}/models/CCTaskCardDetailsModel.d.ts +9 -6
- package/dist/{client-v2 → client}/models/CCTaskCardGridModel.d.ts +4 -2
- package/dist/{client-v2 → client}/models/CCTriggerBlockGridModel.d.ts +1 -2
- package/dist/externalVersion.js +12 -12
- package/dist/locale/en-US.json +0 -6
- package/dist/locale/zh-CN.json +0 -4
- package/package.json +3 -8
- package/client-v2.d.ts +0 -2
- package/client-v2.js +0 -3
- package/dist/client/164.feee9c6f7d571d46.js +0 -10
- package/dist/client/208.4406c513173afef7.js +0 -10
- package/dist/client/352.4012efde85e3acaf.js +0 -10
- package/dist/client/437.78f2b52a4a3fac84.js +0 -10
- package/dist/client/458.da07eac3bc1412d1.js +0 -10
- package/dist/client/486.5966b38a176b8313.js +0 -10
- package/dist/client/746.9362358210d85302.js +0 -10
- package/dist/client/86.e6c4759f3e699b2d.js +0 -10
- package/dist/client-v2/164.e2c25964de2486b9.js +0 -10
- package/dist/client-v2/352.a8dbaca3691905cb.js +0 -10
- package/dist/client-v2/437.cbf01251aba7d74f.js +0 -10
- package/dist/client-v2/458.51f1362d12aefe62.js +0 -10
- package/dist/client-v2/486.d0a505ec5bea795c.js +0 -10
- package/dist/client-v2/679.bcd3a82a92a57455.js +0 -10
- package/dist/client-v2/746.b0fb6ac7c4f7e83b.js +0 -10
- package/dist/client-v2/86.f7881bb89e51a4b6.js +0 -10
- package/dist/client-v2/components/FlowModelConfigInput.d.ts +0 -20
- package/dist/client-v2/hooks/useTempAssociationSources.d.ts +0 -11
- package/dist/client-v2/index.d.ts +0 -10
- package/dist/client-v2/index.js +0 -10
- package/dist/client-v2/locale.d.ts +0 -12
- package/dist/client-v2/models/CCChildPageModel.d.ts +0 -23
- package/dist/client-v2/nodes/cc.d.ts +0 -21
- package/dist/client-v2/nodes/components/RecipientsInput.d.ts +0 -19
- package/dist/client-v2/plugin.d.ts +0 -16
- package/dist/client-v2/tasks.d.ts +0 -15
- package/dist/client-v2/utils/registerWorkflowCcCollections.d.ts +0 -10
- package/dist/client-v2/workflowPluginCompat.d.ts +0 -41
|
@@ -6,18 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { DetailsItemModel } from '@nocobase/client
|
|
10
|
-
import {
|
|
9
|
+
import { DetailsItemModel } from '@nocobase/client';
|
|
10
|
+
import { Collection, FlowModelContext } from '@nocobase/flow-engine';
|
|
11
11
|
type CCTaskAssociationContext = {
|
|
12
|
-
flowEngine:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
title?: string;
|
|
16
|
-
}>;
|
|
17
|
-
workflow?: {
|
|
18
|
-
id?: number | string;
|
|
19
|
-
title?: string;
|
|
20
|
-
};
|
|
12
|
+
flowEngine: FlowModelContext['model']['flowEngine'];
|
|
13
|
+
workflow?: any;
|
|
14
|
+
nodes?: any[];
|
|
21
15
|
};
|
|
22
16
|
type TempAssociationSource = {
|
|
23
17
|
collection: string;
|
|
@@ -31,13 +25,13 @@ export type CCTaskTempAssociationFieldConfig = {
|
|
|
31
25
|
nodeType: 'workflow' | 'node';
|
|
32
26
|
};
|
|
33
27
|
type CCTaskAssociationMetadata = CCTaskTempAssociationFieldConfig & {
|
|
34
|
-
dataSourceKey: string;
|
|
35
28
|
fieldName: string;
|
|
36
|
-
target: string;
|
|
37
29
|
title?: string;
|
|
30
|
+
dataSourceKey: string;
|
|
31
|
+
target: string;
|
|
38
32
|
};
|
|
39
33
|
export declare const getEligibleTempAssociationSources: (sources?: TempAssociationSource[], collection?: Collection) => CCTaskAssociationMetadata[];
|
|
40
|
-
export declare const updateWorkflowCcTaskAssociationFields: ({ flowEngine, nodes, tempAssociationSources,
|
|
34
|
+
export declare const updateWorkflowCcTaskAssociationFields: ({ flowEngine, workflow, nodes, tempAssociationSources, }: CCTaskAssociationContext & {
|
|
41
35
|
tempAssociationSources?: TempAssociationSource[];
|
|
42
36
|
}) => void;
|
|
43
37
|
export declare class CCTaskCardDetailsItemModel extends DetailsItemModel {
|
|
@@ -66,6 +60,6 @@ export declare class CCTaskCardDetailsItemModel extends DetailsItemModel {
|
|
|
66
60
|
};
|
|
67
61
|
};
|
|
68
62
|
}[];
|
|
69
|
-
onInit(options:
|
|
63
|
+
onInit(options: any): void;
|
|
70
64
|
}
|
|
71
|
-
export
|
|
65
|
+
export {};
|
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { DetailsBlockModel } from '@nocobase/client-v2';
|
|
10
|
-
import { SingleRecordResource, type FlowModelContext } from '@nocobase/flow-engine';
|
|
11
9
|
import React from 'react';
|
|
10
|
+
import { SingleRecordResource } from '@nocobase/flow-engine';
|
|
11
|
+
import { DetailsBlockModel } from '@nocobase/client';
|
|
12
|
+
/**
|
|
13
|
+
* 抄送任务卡片详情:隐藏顶部按钮,保留详情卡片的字段/标题配置,不支持卡片级操作按钮。
|
|
14
|
+
*/
|
|
12
15
|
export declare class CCTaskCardDetailsModel extends DetailsBlockModel {
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
get hidden(): boolean;
|
|
17
|
+
set hidden(value: boolean);
|
|
18
|
+
onInit(options: any): void;
|
|
19
|
+
createResource(ctx: any, params: any): SingleRecordResource<unknown>;
|
|
15
20
|
refresh(): Promise<void>;
|
|
16
|
-
getCurrentRecord(): any;
|
|
17
21
|
renderComponent(): React.JSX.Element;
|
|
18
22
|
}
|
|
19
|
-
export default CCTaskCardDetailsModel;
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { DetailsGridModel } from '@nocobase/client
|
|
9
|
+
import { DetailsGridModel } from '@nocobase/client';
|
|
10
10
|
import React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* 抄送任务卡片详情的字段网格
|
|
13
|
+
*/
|
|
11
14
|
export declare class CCTaskCardGridModel extends DetailsGridModel {
|
|
12
15
|
private lastTempAssociationSnapshot?;
|
|
13
16
|
private readonly tempAssociationSyncHandler;
|
|
@@ -18,4 +21,3 @@ export declare class CCTaskCardGridModel extends DetailsGridModel {
|
|
|
18
21
|
renderAddSubModelButton(): React.JSX.Element;
|
|
19
22
|
render(): React.JSX.Element;
|
|
20
23
|
}
|
|
21
|
-
export default CCTaskCardGridModel;
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { BlockGridModel } from '@nocobase/client
|
|
9
|
+
import { BlockGridModel } from '@nocobase/client';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
export declare class CCTriggerBlockGridModel extends BlockGridModel {
|
|
12
12
|
renderAddSubModelButton(): React.JSX.Element;
|
|
13
13
|
}
|
|
14
|
-
export default CCTriggerBlockGridModel;
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "2.2.0-
|
|
13
|
-
"@nocobase/plugin-workflow": "2.2.0-
|
|
12
|
+
"@nocobase/client": "2.2.0-beta.10",
|
|
13
|
+
"@nocobase/plugin-workflow": "2.2.0-beta.10",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"antd-style": "3.7.1",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"react-router-dom": "6.30.1",
|
|
18
18
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/
|
|
20
|
-
"@nocobase/
|
|
19
|
+
"@nocobase/utils": "2.2.0-beta.10",
|
|
20
|
+
"@nocobase/plugin-ui-schema-storage": "2.2.0-beta.10",
|
|
21
|
+
"@nocobase/actions": "2.2.0-beta.10",
|
|
22
|
+
"@nocobase/server": "2.2.0-beta.10",
|
|
23
|
+
"@nocobase/database": "2.2.0-beta.10",
|
|
24
|
+
"@nocobase/data-source-manager": "2.2.0-beta.10",
|
|
25
|
+
"@nocobase/flow-engine": "2.2.0-beta.10",
|
|
26
|
+
"@formily/shared": "2.3.7",
|
|
27
|
+
"@formily/react": "2.3.7",
|
|
21
28
|
"@ant-design/icons": "5.6.1",
|
|
22
|
-
"
|
|
23
|
-
"@nocobase/utils": "2.2.0-alpha.7",
|
|
24
|
-
"@nocobase/plugin-ui-schema-storage": "2.2.0-alpha.7",
|
|
25
|
-
"@nocobase/actions": "2.2.0-alpha.7",
|
|
26
|
-
"@nocobase/server": "2.2.0-alpha.7",
|
|
27
|
-
"@nocobase/database": "2.2.0-alpha.7",
|
|
28
|
-
"@nocobase/data-source-manager": "2.2.0-alpha.7",
|
|
29
|
-
"@nocobase/plugin-notification-manager": "2.2.0-alpha.7"
|
|
29
|
+
"@formily/antd-v5": "1.2.3"
|
|
30
30
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"CC": "CC",
|
|
3
|
-
"CC node": "CC node",
|
|
4
3
|
"CC to me": "CC to me",
|
|
5
4
|
"CC information": "CC information",
|
|
6
5
|
"Configure user interface": "Configure user interface",
|
|
@@ -12,19 +11,14 @@
|
|
|
12
11
|
"Mark all as read": "Mark all as read",
|
|
13
12
|
"Mark as read": "Mark as read",
|
|
14
13
|
"Mark as unread": "Mark as unread",
|
|
15
|
-
"Please wait for the workflow model configuration to finish opening.": "Please wait for the workflow model configuration to finish opening.",
|
|
16
14
|
"Refresh": "Refresh",
|
|
17
15
|
"Filter": "Filter",
|
|
18
|
-
"Execution": "Execution",
|
|
19
|
-
"Load failed": "Load failed",
|
|
20
|
-
"Workflow": "Workflow",
|
|
21
16
|
"Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.": "Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.",
|
|
22
17
|
"Read": "Read",
|
|
23
18
|
"Recipients": "Recipients",
|
|
24
19
|
"Task card": "Task card",
|
|
25
20
|
"Task title": "Task title",
|
|
26
21
|
"Title of each CC item in tasks center. Could use variables in string template. Default to node title.": "Title of each CC item in tasks center. Could use variables in string template. Default to node title.",
|
|
27
|
-
"Status": "Status",
|
|
28
22
|
"Read at": "Read at",
|
|
29
23
|
"Created at": "Created at",
|
|
30
24
|
"Updated at": "Updated at",
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -13,18 +13,14 @@
|
|
|
13
13
|
"Mark all as read": "全部标为已读",
|
|
14
14
|
"Mark as read": "标为已读",
|
|
15
15
|
"Mark as unread": "标为未读",
|
|
16
|
-
"Please wait for the workflow model configuration to finish opening.": "请等待工作流模型配置打开完成。",
|
|
17
16
|
"Refresh": "刷新",
|
|
18
17
|
"Filter": "筛选",
|
|
19
|
-
"Execution": "执行",
|
|
20
|
-
"Load failed": "加载失败",
|
|
21
18
|
"Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.": "在工作流中提供抄送功能,将审批或其他任意信息抄送给特定的用户。",
|
|
22
19
|
"Read": "已读",
|
|
23
20
|
"Recipients": "接收人",
|
|
24
21
|
"Task card": "任务卡片",
|
|
25
22
|
"Task title": "任务标题",
|
|
26
23
|
"Status": "状态",
|
|
27
|
-
"Workflow": "工作流",
|
|
28
24
|
"Read at": "阅读时间",
|
|
29
25
|
"Created at": "创建时间",
|
|
30
26
|
"Updated at": "更新时间",
|
package/package.json
CHANGED
|
@@ -10,25 +10,20 @@
|
|
|
10
10
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/workflow-cc",
|
|
11
11
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow-cc",
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
|
-
"version": "2.2.0-
|
|
13
|
+
"version": "2.2.0-beta.10",
|
|
14
14
|
"main": "dist/server/index.js",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@nocobase/actions": "2.x",
|
|
17
17
|
"@nocobase/client": "2.x",
|
|
18
|
-
"@nocobase/client-v2": "2.x",
|
|
19
|
-
"@nocobase/flow-engine": "2.x",
|
|
20
|
-
"@nocobase/plugin-flow-engine": "2.x",
|
|
21
|
-
"@nocobase/plugin-notification-manager": "2.x",
|
|
22
18
|
"@nocobase/plugin-ui-schema-storage": "2.x",
|
|
23
19
|
"@nocobase/plugin-users": "2.x",
|
|
24
20
|
"@nocobase/plugin-workflow": "2.x",
|
|
25
21
|
"@nocobase/server": "2.x",
|
|
26
22
|
"@nocobase/test": "2.x",
|
|
27
|
-
"@nocobase/utils": "2.x"
|
|
28
|
-
"ahooks": "^3.7.2"
|
|
23
|
+
"@nocobase/utils": "2.x"
|
|
29
24
|
},
|
|
30
25
|
"keywords": [
|
|
31
26
|
"Workflow"
|
|
32
27
|
],
|
|
33
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d572beec24de46df948f28db72b25303a63bf62d"
|
|
34
29
|
}
|
package/client-v2.d.ts
DELETED
package/client-v2.js
DELETED
|
@@ -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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["164"],{303:function(e,t,r){r.r(t),r.d(t,{CCTaskCardDetailsModel:function(){return b}});var n=r(485),o=r(694),i=r(155),l=r.n(i),c=r(488);function u(e,t,r,n,o,i,l){try{var c=e[i](l),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function l(e){u(i,n,o,l,c,"next",e)}function c(e){u(i,n,o,l,c,"throw",e)}l(void 0)})}}function s(e,t,r){return(s="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r||e):o.value}})(e,t,r||e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function y(e,t){var r,n,o,i={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),c=Object.defineProperty;return c(l,"next",{value:u(0)}),c(l,"throw",{value:u(1)}),c(l,"return",{value:u(2)}),"function"==typeof Symbol&&c(l,Symbol.iterator,{value:function(){return this}}),l;function u(c){return function(u){var a=[c,u];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=f(e),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(e,t||[],f(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&p(r,e),t=[{key:"onInit",value:function(e){s(f(r.prototype),"onInit",this).call(this,e),this.setDecoratorProps({size:"small"}),this.context.defineMethod("aclCheck",function(){return!0}),this.context.defineProperty("disableFieldClickToOpen",{get:function(){return!0}})}},{key:"createResource",value:function(e){var t=e.createResource(o.SingleRecordResource);return t.isNewRecord=!1,t.refresh=function(){return a(function(){return y(this,function(e){return[2]})})()},t}},{key:"refresh",value:function(){return a(function(){return y(this,function(e){return[2]})})()}},{key:"getCurrentRecord",value:function(){var e=this.context.workflowCcTaskRecord;return e&&(void 0===e?"undefined":d(e))==="object"&&!Array.isArray(e)?e:s(f(r.prototype),"getCurrentRecord",this).call(this)}},{key:"renderComponent",value:function(){var e=this.props,t=e.colon,r=e.labelAlign,i=e.labelWidth,c=e.labelWrap,u=e.layout;return l().createElement(n.FormComponent,{model:this,layoutProps:{colon:t,labelAlign:r,labelWidth:i,labelWrap:c,layout:u}},l().createElement(o.FlowModelRenderer,{model:this.subModels.grid,showFlowSettings:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(n.DetailsBlockModel);b.define({hide:!0}),b.registerFlow({key:"cardSettings",title:(0,c.MZ)("Card settings"),steps:{titleDescription:{title:(0,c.MZ)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,c.MZ)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,c.MZ)("Description")}},defaultParams:function(e){var t;return{title:null==(t=e.model.context.workflow)?void 0:t.title}},handler:function(e,t){e.model.setDecoratorProps({description:e.t(t.description),title:e.t(t.title)})}}}}),b.registerFlow({key:"detailsSettings",title:(0,c.MZ)("Details settings"),sort:150,steps:{refresh:{handler:function(e){return a(function(){return y(this,function(t){switch(t.label){case 0:if(!e.resource)throw Error("Resource is not initialized");return[4,e.model.applySubModelsBeforeRenderFlows("grid")];case 1:return t.sent(),[2]}})})()}},layout:{use:"layout",title:(0,c.MZ)("Layout")}}}),t.default=b}}]);
|
|
@@ -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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["208"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return C},getEligibleTempAssociationSources:function(){return k},updateWorkflowCcTaskAssociationFields:function(){return S}});var r=n(485),o=n(197),i=n(694),l=n(170),a=n(488);function u(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 c(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,v()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if(e){if("string"==typeof e)return u(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 u(e,t)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var h=["node","job","workflow","execution","user"],w=function(e){function t(){return s(this,t),c(this,t,arguments)}return m(t,e),f(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var r,i=(0,l.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var a=function(e){if(Array.isArray(e))return e}(r=(0,o.parseCollectionName)(e.collection))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(r)||b(r,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.")}(),u=a[0],c=a[1];c&&n.set(i,{dataSourceKey:u||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:c,title:e.nodeKey})}}),Array.from(n.values())},S=function(e){var t=e.flowEngine,n=e.nodes,r=e.tempAssociationSources,o=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var l=k(r||[],i);l.length&&l.map(function(e){var t,r,i,l,a=null==(l=[o].concat(function(e){if(Array.isArray(e))return u(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||b(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:l.title;return t=function(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}({},e),r=r={title:a||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}).forEach(function(e){i.addField(new w({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},C=function(e){function t(){return s(this,t),c(this,t,arguments)}return m(t,e),f(t,[{key:"onInit",value:function(e){var n=this;p(y(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(S({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(r){var o=t.getDefaultBindingByField(e,r,{fallbackToTargetTitleField:!0});if(!o||h.includes(r.name)||r.name.startsWith(l.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(r.name):r.name;return{key:i,label:r.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,l,a;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(a=e.model.context.blockModel)||null==(l=a.collection)?void 0:l.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:o.modelName,props:"function"==typeof o.defaultProps?o.defaultProps(e,r):o.defaultProps}}}}}}).filter(Boolean)}}]),t}(r.DetailsItemModel);C.define({label:(0,a.MZ)("CC information",{ns:a.CU}),sort:100}),t.default=C},427:function(e,t,n){n.d(t,{CCFieldset:function(){return J}});var r=n(197),o=n(59),i=n(155),l=n.n(i),a=n(375),u=n(694),c=n(625),s=n(770);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=n(488),p=n(813),y=n(628),m=[n(42).A,{name:"flow_nodes",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{type:"uid",name:"key"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{name:"workflow",type:"belongsTo",target:"workflows"},{name:"upstream",type:"belongsTo",target:"flow_nodes"},{name:"downstream",type:"belongsTo",target:"flow_nodes"},{type:"string",name:"type"},{type:"json",name:"config",defaultValue:{}}]},{name:"workflows",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},{name:"key",type:"uid"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Name")}}',"x-component":"Input",required:!0}},{type:"string",name:"type"},{type:"jsonb",name:"config",defaultValue:{}},{type:"boolean",name:"enabled",defaultValue:!1}]}];function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){b(i,r,o,l,a,"next",e)}function a(e){b(i,r,o,l,a,"throw",e)}l(void 0)})}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(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){h(e,t,n[t])})}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 S(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 i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||O(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 C(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function O(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function M(e,t){var n,r,o,i={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),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var j=["ccUid","taskCardUid"],P=["tempAssociationFields"],E=new Map,T=new WeakMap,x=new WeakMap,A=new WeakMap;function I(e){var t=T.get(e);return!!(t&&Array.from(t.values()).some(function(e){return e>0}))}function F(e){var t=e.form,n=e.message,r=e.nodeId,o=e.pending;if(null!=r){if(!x.has(t)){var i=t.validateFields.bind(t);x.set(t,t.validateFields),t.validateFields=function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return v(function(){return M(this,function(e){return I(t)?[2,Promise.reject({values:t.getFieldsValue(!0),errorFields:[{name:["config"],errors:[n]}],outOfDate:!1})]:[2,i.apply(void 0,function(e){if(Array.isArray(e))return g(e)}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||O(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())]})})()}}if(!A.has(t)){var l=t.submit.bind(t);A.set(t,t.submit),t.submit=function(){return I(t)?void t.validateFields().catch(function(){}):l()}}var a=T.get(t);a||(a=new Map,T.set(t,a));var u=a.get(r)||0,c=o?u+1:Math.max(0,u-1);c?a.set(r,c):a.delete(r)}}function D(){return{async:!0,subType:"object",use:"CCBlockGridModel"}}function _(){return{use:"CCChildPageTabModel",stepParams:{pageTabSettings:{tab:{title:'{{t("Details")}}'}}},subModels:{grid:D()}}}function U(e){var t,n=e.disabled,a=e.form,f=e.kind,g=e.node,b=e.nodes,h=e.onGeneratedUidChange,O=e.onModelReady,j=e.onNodeConfigPatch,P=e.uid,E=e.uidPrefix,T=e.upstreams,x=e.workflow,A=(0,u.useFlowEngine)(),I=o.theme.useToken().token,F=(0,c.useMemoizedFn)(function(e){var t,n,o,i;return"interface"===f?(o=(n=S(function(e){if(!e)return["main","users"];var t=(0,r.parseCollectionName)(e);return(null==t?void 0:t[0])&&(null==t?void 0:t[1])?t:["main",e]}(null==x||null==(t=x.config)?void 0:t.collection),2))[0],i=n[1],{async:!0,subType:"object",uid:e,use:"CCChildPageModel",props:{displayTitle:!1,enableTabs:!1,title:'{{t("User interface", { ns: "@nocobase/plugin-workflow-cc" })}}'},subModels:{tabs:[_()]},stepParams:{pageSettings:{general:{displayTitle:!1,enableTabs:!1,title:'{{t("User interface", { ns: "@nocobase/plugin-workflow-cc" })}}'}},CCChildPageSettings:{init:{collectionName:i,dataSourceKey:o}}}}):{async:!0,subType:"object",uid:e,use:"CCTaskCardDetailsModel",stepParams:{resourceSettings:{init:{dataSourceKey:"main",collectionName:"workflowCcTasks"}},detailsSettings:{layout:{layout:"horizontal"}}},subModels:{grid:{subType:"object",use:"CCTaskCardGridModel"}}}}),U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,s.y)();return(0,i.useMemo)(function(){if(!e)return[];var r,o,i,l,a,u=null==(a=n.getTrigger(e.type))||null==(l=a.useTempAssociationSource)?void 0:l.call(a,e.config,e),c=u||"string"!=typeof(i=null==(r=e)||null==(o=r.config)?void 0:o.collection)||!i||(null==r?void 0:r.id)==null?null:{collection:i,nodeId:r.id,nodeKey:"workflow",nodeType:"workflow"},s=t.map(function(e){var t,r;return null==(r=n.getInstruction(e.type))||null==(t=r.useTempAssociationSource)?void 0:t.call(r,e)}).filter(Boolean);return u||c?[u||c].concat(function(e){if(Array.isArray(e))return d(e)}(s)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e){if(e){if("string"==typeof e)return d(e,void 0);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 d(e,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):s},[t,e,n])}(x,T||[]),K=(0,i.useMemo)(function(){return U.map(function(e){return"".concat(e.nodeType,":").concat(e.nodeKey)}).join("|")},[U]),B=(0,c.useMemoizedFn)(function(e){var t=g.config||{};if(!n&&t.tempAssociationFields!==e){g.config=k(w({},t),{tempAssociationFields:e});var r=t&&(void 0===t?"undefined":C(t))==="object"?a.getFieldValue(["config"]):void 0;a.setFieldsValue({config:k(w({},r&&(void 0===r?"undefined":C(r))==="object"?r:{}),{tempAssociationFields:e})}),j({tempAssociationFields:e}).catch(function(){})}}),G=(0,c.useRequest)(function(){return v(function(){var e;return M(this,function(t){var r,o,i,l,a;switch(t.label){case 0:return t.trys.push([0,,7,8]),(0,p.W)(A),(i=null==(o=A.dataSourceManager)||null==(r=o.getDataSource)?void 0:r.call(o,"main"))&&m.forEach(function(e){var t,n,r;null!=(t=i.getCollection)&&t.call(i,e.name)||i.addCollection(new u.Collection((n=function(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}({},e),r=r={hidden:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)))}),[4,function(e){return v(function(e){var t,n,r,o,i,l,a,c,s,d,f;return M(this,function(p){var y,m;switch(p.label){case 0:return t=e.canRegenerateUid,n=e.createModelOptions,r=e.flowEngine,o=e.onGeneratedUidChange,i=e.uid,l=e.uidPrefix,s="string"==typeof(y=c=n(i)).use?y.use:null==(m=y.use)?void 0:m.name,[4,r.loadOrCreateModel(c)];case 1:if(!(null==(d=p.sent())?void 0:d.uid)||!s||(null==d?void 0:d.use)===s||!t)return[2,d];return null==(a=r.removeModelWithSubModels)||a.call(r,d.uid),f=(0,u.randomId)(l),[4,null==o?void 0:o(f)];case 2:if(!1===p.sent())return[2,null];return[4,r.loadOrCreateModel(n(f))];case 3:return[2,p.sent()]}})}).apply(this,arguments)}({canRegenerateUid:!!h,createModelOptions:F,flowEngine:A,onGeneratedUidChange:h,uid:P,uidPrefix:E})];case 1:if(!(e=t.sent()))return[2,null];if("interface"!==f)return[3,3];return[4,(l=e,v(function(){var e,t,n,r,o,i,a,u,c,s,d;return M(this,function(f){switch(f.label){case 0:var p,y,m,g;if(r=!1,(null==(o=null==(t=(n=l).subModels)||null==(e=t.tabs)?void 0:e[0])?void 0:o.uid)||!n.addSubModel||(o=n.addSubModel("tabs",_()),r=!0),!(null==o?void 0:o.uid)||Array.isArray(m=null==(p=a=null==(i=o.subModels)?void 0:i.grid)||null==(y=p.subModels)?void 0:y.items)&&m.length>0)return[3,5];return[4,(g=o.uid,v(function(){var e,t;return M(this,function(n){switch(n.label){case 0:return[4,null==(e=A.getModelClassAsync)?void 0:e.call(A,"CCBlockGridModel")];case 1:return n.sent(),[4,null==(t=A.loadModel)?void 0:t.call(A,{parentId:g,refresh:!0,subKey:"grid"})];case 2:return[2,n.sent()]}})})())];case 1:if(!(null==(u=f.sent())?void 0:u.uid))return[3,2];return null==(c=o.setSubModel)||c.call(o,"grid",u),[3,5];case 2:if(!(null==a?void 0:a.uid))return[3,4];return[4,null==(s=a.save)?void 0:s.call(a)];case 3:return f.sent(),[3,5];case 4:(null==a?void 0:a.uid)||!o.setSubModel?(null==a?void 0:a.uid)||!o.addSubModel||(o.addSubModel("grid",D()),r=!0):(o.setSubModel("grid",D()),r=!0),f.label=5;case 5:if(!r)return[3,7];return[4,null==(d=n.save)?void 0:d.call(n)];case 6:f.sent(),f.label=7;case 7:return[2]}})})())];case 2:return t.sent(),[3,6];case 3:return[4,(a=e,v(function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:if((null==(e=(n=a).subModels)?void 0:e.grid)||!n.addSubModel)return[2];return n.addSubModel("grid",{subType:"object",use:"CCTaskCardGridModel"}),[4,null==(t=n.save)?void 0:t.call(n)];case 1:return r.sent(),[2]}})})())];case 4:return t.sent(),[4,v(function(){var e,t,n,r,o,i;return M(this,function(l){switch(l.label){case 0:return o=["CCTaskCardDetailsItemModel","CCTaskCardDetailsAssociationFieldGroupModel","TaskCardCommonItemModel"],((null==(i=null==(t=A.context)||null==(e=t.app)?void 0:e.pm)||null==(n=i.get)?void 0:n.call(i,"ui-templates"))||(null==i||null==(r=i.get)?void 0:r.call(i,"@nocobase/plugin-ui-templates")))&&o.push("SubModelTemplateImporterModel"),[4,Promise.all(o.map(function(e){var t;return null==(t=A.getModelClassAsync)?void 0:t.call(A,e)}))];case 1:return l.sent(),[2]}})})()];case 5:t.sent(),(0,y.updateWorkflowCcTaskAssociationFields)({flowEngine:A,workflow:x,nodes:T,tempAssociationSources:U}),t.label=6;case 6:return e.context.defineProperty("flowSettingsEnabled",{get:function(){return!n},cache:!1}),e.context.defineProperty("view",{value:{inputArgs:{flowContext:{workflow:x,nodes:(null==b?void 0:b.length)?b:[g]},availableUpstreams:T||[],node:g,nodeConfig:(null==g?void 0:g.config)||{},workflowCcConfigDialog:!0}}}),e.context.defineProperty("workflow",{get:function(){return x},cache:!1}),e.context.defineProperty("nodes",{get:function(){return b||[]},cache:!1}),e.context.defineProperty("tempAssociationSources",{get:function(){return U},cache:!1}),e.context.defineProperty("ccTaskTempAssociationSync",{get:function(){return B},cache:!1}),[2,e];case 7:return null==O||O(),[7];case 8:return[2]}})})()},{refreshDeps:[P,n,f,null==x||null==(t=x.config)?void 0:t.collection,null==g?void 0:g.key,null==b?void 0:b.length,K]}),R=G.data,N=G.loading;return((0,i.useEffect)(function(){"taskCard"===f&&(0,y.updateWorkflowCcTaskAssociationFields)({flowEngine:A,workflow:x,nodes:T,tempAssociationSources:U})},[A,f,U,K,T,x]),!N&&(null==R?void 0:R.uid))?l().createElement(u.FlowModelRenderer,{model:R,hideRemoveInSettings:!0,showFlowSettings:"taskCard"===f}):l().createElement(o.Spin,{style:{display:"block",margin:I.marginLG}})}var K=function(e){var t=e.configKey,n=e.disabled,s=e.kind,d=e.legacyConfigKey,p=e.onChange,y=e.value,m=(0,u.useFlowContext)(),g=(0,f.kj)(),b=o.theme.useToken().token,k=o.Form.useFormInstance(),O=(0,r.useCurrentWorkflowContext)(),T=(0,r.useNodeContext)(),x=(0,r.useFlowContext)(),A=(0,r.useAvailableUpstreams)(T),I=(0,i.useRef)(null==T?void 0:T.id),D=(0,i.useRef)(w({},(null==T?void 0:T.config)||{})),_=(0,i.useRef)(!1),K=S((0,i.useState)(!1),2),B=K[0],G=K[1],R=o.Form.useWatch(["config",d||"__workflowCcLegacyConfig__"],k),N=null!=R?R:d?k.getFieldValue(["config",d]):void 0,z="interface"===s?g("User interface"):g("Task card"),W="interface"===s?"cc_interface_":"cc_task_card_",V=g("Please wait for the workflow model configuration to finish opening.");I.current!==(null==T?void 0:T.id)&&(I.current=null==T?void 0:T.id,D.current=w({},(null==T?void 0:T.config)||{}));var H=(0,c.useMemoizedFn)(function(e){return v(function(){var t,r,o;return M(this,function(i){switch(i.label){case 0:if(null==T.id)return[2,!1];F({form:k,message:V,nodeId:t=T.id,pending:!0}),r=E.get(t),o=v(function(){var t,o;return M(this,function(i){switch(i.label){case 0:if(!r)return[3,2];return[4,r.catch(function(){return null})];case 1:return t=i.sent(),[3,3];case 2:t=null,i.label=3;case 3:return[4,function(e){return v(function(e){var t,n,r,o,i,l,a,u,c;return M(this,function(s){switch(s.label){case 0:if(t=e.baseConfig,n=e.ctx,r=e.disabled,o=e.node,i=e.patch,r||null==o.id||!(null==(u=null==(a=n.api)||null==(l=a.resource)?void 0:l.call(a,"flow_nodes"))?void 0:u.update))return[2,null];return c=w({},t,i),[4,u.update({filterByTk:o.id,values:{config:c}})];case 1:return s.sent(),[2,c]}})}).apply(this,arguments)}({baseConfig:function(e){var t=e.fallback,n=e.form,r=e.node,o=w({},t),i=!0,l=!1,a=void 0;try{for(var u,c=j[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var s,d=u.value,f=null==(s=r.config)?void 0:s[d];void 0!==f&&(o[d]=f)}}catch(e){l=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(l)throw a}}var p=n.getFieldValue(["config"]),y=!0,m=!1,g=void 0;try{for(var b,v=P[Symbol.iterator]();!(y=(b=v.next()).done);y=!0){var h=b.value;p&&(void 0===p?"undefined":C(p))==="object"&&h in p&&(o[h]=p[h])}}catch(e){m=!0,g=e}finally{try{y||null==v.return||v.return()}finally{if(m)throw g}}return o}({fallback:t||D.current,form:k,node:T}),ctx:m,disabled:n,node:T,patch:e})];case 4:if(!(o=i.sent()))return[2,!1];return D.current=o,!function(e){var t=e.form,n=e.node,r=e.patch,o=e.persistedConfig,i=t.getFieldValue(["config"]),l=w({},o,i&&(void 0===i?"undefined":C(i))==="object"?i:{},r),a=!0,u=!1,c=void 0;try{for(var s,d=j[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var f=s.value,p=o[f];void 0!==p&&(l[f]=p)}}catch(e){u=!0,c=e}finally{try{a||null==d.return||d.return()}finally{if(u)throw c}}t.setFieldsValue({config:l}),n.config=w({},o,n.config||{},r);var y=!0,m=!1,g=void 0;try{for(var b,v=j[Symbol.iterator]();!(y=(b=v.next()).done);y=!0){var h=b.value,k=o[h];void 0!==k&&(n.config[h]=k)}}catch(e){m=!0,g=e}finally{try{y||null==v.return||v.return()}finally{if(m)throw g}}}({form:k,node:T,patch:e,persistedConfig:o}),[2,o]}})})(),E.set(t,o),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,o];case 2:return[2,Boolean.apply(void 0,[i.sent()])];case 3:return F({form:k,message:V,nodeId:t,pending:!1}),E.get(t)===o&&E.delete(t),[7];case 4:return[2]}})})()}),L=(0,c.useMemoizedFn)(function(e){return v(function(){return M(this,function(n){switch(n.label){case 0:return[4,H(h({},t,e))];case 1:if(!n.sent())return[2,!1];return null==p||p(e),[2,!0]}})})()}),q=(0,c.useMemoizedFn)(function(){return v(function(){var e,t,r,o,i;return M(this,function(a){switch(a.label){case 0:if(n||_.current)return[2];_.current=!0,G(!0),a.label=1;case 1:if(a.trys.push([1,6,7,8]),e=!y,t=y||(0,u.randomId)(W),r=null==T?void 0:T.id,y)return[3,5];F({form:k,message:V,nodeId:r,pending:!0}),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,L(t)];case 3:if(!a.sent())return[2];return[3,5];case 4:return F({form:k,message:V,nodeId:r,pending:!1}),[7];case 5:return e&&(i=!1,F({form:k,message:V,nodeId:r,pending:!0}),o=function(){i||(i=!0,F({form:k,message:V,nodeId:r,pending:!1}))}),m.viewer.dialog({width:800,closable:!0,onClose:o,title:z,styles:"taskCard"===s?{body:{padding:0,backgroundColor:"var(--nb-box-bg)"}}:{body:{padding:b.paddingLG,backgroundColor:"var(--nb-box-bg)"},content:{padding:0},header:{padding:"".concat(b.padding,"px ").concat(b.paddingLG,"px"),marginBottom:0}},content:function(){return l().createElement(U,{disabled:n,form:k,kind:s,node:T,nodes:null==x?void 0:x.nodes,onGeneratedUidChange:e?L:void 0,onNodeConfigPatch:H,onModelReady:o,uid:t,uidPrefix:W,upstreams:A,workflow:O})}}),[3,8];case 6:return a.sent(),[3,8];case 7:return _.current=!1,G(!1),[7];case 8:return[2]}})})()}),$=(0,c.useMemoizedFn)(function(){return v(function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:if(!d||!N)return[2];return[4,m.api.request({method:"POST",url:"uiSchemas:remove/".concat(N)})];case 1:return r.sent(),k.setFieldValue(["config",d],null),null==x||null==(e=x.refresh)||e.call(x),null==(n=m.message)||null==(t=n.success)||t.call(n,g("Deleted successfully")),[2]}})})()}),X=(0,c.useMemoizedFn)(function(e){e.stopPropagation(),o.Modal.confirm({title:g("Delete v1 configuration"),onOk:$})}),Z=[{key:"v1",label:l().createElement(o.Space,null,l().createElement("span",null,g("v1 (Legacy)")),l().createElement(a.DeleteOutlined,{onClick:X}))},{key:"v2",label:g("v2"),disabled:n||B,onClick:q}],J="interface"===s?l().createElement(a.SettingOutlined,{"aria-hidden":!0}):l().createElement(a.CreditCardOutlined,{"aria-hidden":!0}),Q="interface"===s?"primary":"default";return"interface"===s&&N?l().createElement(o.Dropdown,{menu:{items:Z},trigger:["hover"]},l().createElement(o.Button,{disabled:n,icon:J,loading:B,type:Q},g("Go to configure")," ",l().createElement(a.DownOutlined,{"aria-hidden":!0}))):l().createElement(o.Button,{disabled:n||B,icon:J,loading:B,onClick:q,type:Q},g("Go to configure"))},B=n(341);function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function 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 i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||z(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 N(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(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 z(e,t){if(e){if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(e,t)}}function W(e){return"number"==typeof e?String(e):e}function V(e,t){return"number"==typeof t&&e===String(t)?t:e}function H(e){var t=e.disabled,n=e.onChange,r=e.value,u=void 0===r?[]:r,s=(0,f.kj)(),d=R((0,i.useState)(!1),2),p=d[0],y=d[1],m=(0,c.useMemoizedFn)(function(e){null==n||n(N(u).concat([e])),y(!1)}),g=l().createElement(o.Button,{block:!0,disabled:t,icon:l().createElement(a.PlusOutlined,null),type:"dashed"},s("Add"));return t?null:l().createElement(o.Popover,{content:l().createElement(o.Space,{direction:"vertical",size:"small"},l().createElement(o.Button,{type:"text",onClick:function(){return m("")}},s("Select users")),l().createElement(o.Button,{type:"text",onClick:function(){return m({filter:{}})}},s("Query users"))),onOpenChange:y,open:p,placement:"bottom"},g)}function L(e){var t=e.disabled,n=e.index,r=e.item,i=e.onMoveDown,u=e.onMoveUp,c=e.onRemove,s=e.onUpdate,d=e.total,p=o.theme.useToken().token,y=(0,f.kj)();return l().createElement(o.Flex,{gap:"small",align:"center"},l().createElement(o.Button,{"aria-label":y("Sort recipient"),disabled:!0,icon:l().createElement(a.HolderOutlined,null),size:"small",style:{color:p.colorTextTertiary,cursor:"grab",height:p.controlHeight,minWidth:p.fontSizeLG,paddingInline:0,width:p.fontSizeLG},type:"text"}),l().createElement("div",{style:{flex:1,minWidth:0}},l().createElement(B.UserSelect,{value:W(r),onChange:function(e){return s(V(e,r))}})),t?null:l().createElement(l().Fragment,null,l().createElement(o.Button,{"aria-label":y("Move recipient up"),disabled:0===n,icon:l().createElement(a.UpOutlined,null),onClick:u,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"}),l().createElement(o.Button,{"aria-label":y("Move recipient down"),disabled:n===d-1,icon:l().createElement(a.DownOutlined,null),onClick:i,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"}),l().createElement(o.Button,{"aria-label":y("Remove recipient"),icon:l().createElement(a.DeleteOutlined,null),onClick:c,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"})))}var q=function(e){var t=e.disabled,n=e.onChange,r=e.value,i=void 0===r?[]:r,a=o.theme.useToken().token,u=(0,c.useMemoizedFn)(function(e,t){null==n||n(i.map(function(n,r){return r===e?t:n}))}),s=(0,c.useMemoizedFn)(function(e){null==n||n(e.map(function(e,t){return V(e,i[t])}))}),d=(0,c.useMemoizedFn)(function(e){null==n||n(i.filter(function(t,n){return n!==e}))}),f=(0,c.useMemoizedFn)(function(e,t){var r=N(i),o=R(r.splice(e,1),1)[0];r.splice(t,0,o),null==n||n(r)});return l().createElement(o.Flex,{vertical:!0},i.length?l().createElement(o.Flex,{vertical:!0,gap:"small",style:{marginBottom:a.marginLG}},i.map(function(e,n){return l().createElement(L,{key:"".concat(n),disabled:t,index:n,item:e,onMoveDown:function(){return f(n,n+1)},onMoveUp:function(){return f(n,n-1)},onRemove:function(){return d(n)},onUpdate:function(e){return u(n,e)},total:i.length})})):null,l().createElement(H,{value:i.map(W),onChange:s,disabled:t}))};function $(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function X(e){return"".concat(e,":")}function Z(){return null}function J(){var e=(0,f.kj)(),t=(0,r.useNodeContext)(),n={paddingBottom:o.theme.useToken().token.marginXXL};return l().createElement("div",{className:"nb-workflow-cc-node-fieldset",style:n},l().createElement(o.Form.Item,{name:["config","users"],label:X(e("Recipients")),required:!0,rules:[{validator:function(t,n){var r;return(r=function(){return function(e,t){var n,r,o,i={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),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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){if(Array.isArray(n)&&n.filter(Boolean).length>0)return[2];throw Error(e("The field value is required"))})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function l(e){$(i,n,o,l,a,"next",e)}function a(e){$(i,n,o,l,a,"throw",e)}l(void 0)})})()}}]},l().createElement(q,null)),l().createElement(o.Form.Item,{name:["config","ccUid"],label:X(e("User interface"))},l().createElement(K,{configKey:"ccUid",kind:"interface",legacyConfigKey:"ccDetail"})),l().createElement(o.Form.Item,{name:["config","taskCardUid"],label:X(e("Task card"))},l().createElement(K,{configKey:"taskCardUid",kind:"taskCard"})),l().createElement(o.Form.Item,{hidden:!0,name:["config","tempAssociationFields"],noStyle:!0},l().createElement(Z,null)),l().createElement(o.Form.Item,{label:X(e("Task title")),extra:e("Title of each CC item in tasks center. Could use variables in string template. Default to node title.")},l().createElement(o.Form.Item,{name:["config","title"],initialValue:null==t?void 0:t.title,noStyle:!0},l().createElement(r.WorkflowVariableInput,null))))}},770:function(e,t,n){n.d(t,{y:function(){return u}});var r=n(694),o=n(197),i=n(155);function l(e,t){try{var n;return null==e||null==(n=e.get)?void 0:n.call(e,t)}catch(e){return}}function a(e){var t,n,r=null==e||null==(n=e.context)||null==(t=n.app)?void 0:t.pm,i=[l(r,"workflow"),l(r,"@nocobase/plugin-workflow"),l(r,o.PluginWorkflowClientV2)];return i.filter(function(e,t){return e&&i.indexOf(e)===t})}function u(){var e=(0,r.useFlowEngine)();return(0,i.useMemo)(function(){return{getInstruction:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,l=a(e)[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var u=i.value,c=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getInstruction)?void 0:r.call(e,t))?n:null==(i=e.instructions)||null==(o=i.get)?void 0:o.call(i,t)}(u,t);if(c)return c}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}}(e,t)},getTrigger:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,l=a(e)[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var u=i.value,c=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getTriggerOptions)?void 0:r.call(e,t))?n:null==(i=e.triggers)||null==(o=i.get)?void 0:o.call(i,t)}(u,t);if(c)return c}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}}(e,t)}}},[e])}},170:function(e,t,n){n.d(t,{G:function(){return r},P:function(){return o}});var r="ccTempAssoc_",o=function(e,t){return"".concat(r).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["352"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return C},getEligibleTempAssociationSources:function(){return O},updateWorkflowCcTaskAssociationFields:function(){return w}});var o=n(485),r=n(197),i=n(694),a=n(170),l=n(488);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function u(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,g()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if(e){if("string"==typeof e)return c(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 c(e,t)}}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}var v=["node","job","workflow","execution","user"],S=function(e){function t(){return s(this,t),u(this,t,arguments)}return m(t,e),d(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var o,i=(0,a.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var l=function(e){if(Array.isArray(e))return e}(o=(0,r.parseCollectionName)(e.collection))||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return r}}(o)||b(o,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.")}(),c=l[0],u=l[1];u&&n.set(i,{dataSourceKey:c||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:u,title:e.nodeKey})}}),Array.from(n.values())},w=function(e){var t=e.flowEngine,n=e.nodes,o=e.tempAssociationSources,r=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var a=O(o||[],i);a.length&&a.map(function(e){var t,o,i,a,l=null==(a=[r].concat(function(e){if(Array.isArray(e))return c(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||b(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:a.title;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),o=o={title:l||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}).forEach(function(e){i.addField(new S({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},C=function(e){function t(){return s(this,t),u(this,t,arguments)}return m(t,e),d(t,[{key:"onInit",value:function(e){var n=this;p(y(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(w({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(o){var r=t.getDefaultBindingByField(e,o,{fallbackToTargetTitleField:!0});if(!r||v.includes(o.name)||o.name.startsWith(a.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(o.name):o.name;return{key:i,label:o.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,a,l;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(l=e.model.context.blockModel)||null==(a=l.collection)?void 0:a.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:r.modelName,props:"function"==typeof r.defaultProps?r.defaultProps(e,o):r.defaultProps}}}}}}).filter(Boolean)}}]),t}(o.DetailsItemModel);C.define({label:(0,l.MZ)("CC information",{ns:l.CU}),sort:100}),t.default=C},923:function(e,t,n){n.r(t),n.d(t,{CCTaskCardGridModel:function(){return m}});var o=n(375),r=n(485),i=n(694),a=n(155),l=n.n(a),c=n(170),u=n(628);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t,n){return(f="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var m=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=d(t),s(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(t,o||[],d(this).constructor):t.apply(this,o)),"lastTempAssociationSnapshot",void 0),s(e,"tempAssociationSyncHandler",function(){e.syncTempAssociationFields()}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&p(n,e),t=[{key:"onMount",value:function(){f(d(n.prototype),"onMount",this).call(this),this.emitter.on("onSubModelAdded",this.tempAssociationSyncHandler),this.emitter.on("onSubModelDestroyed",this.tempAssociationSyncHandler)}},{key:"onUnmount",value:function(){this.emitter.off("onSubModelAdded",this.tempAssociationSyncHandler),this.emitter.off("onSubModelDestroyed",this.tempAssociationSyncHandler),f(d(n.prototype),"onUnmount",this).call(this)}},{key:"getTempAssociationFieldNames",value:function(){return Array.from(new Set(this.mapSubModels("items",function(e){var t,n=null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath;if(!n)return null;var o=n.split(".")[0];return o.startsWith(c.G)?o:null}).filter(Boolean)))}},{key:"syncTempAssociationFields",value:function(){if(this.context.flowSettingsEnabled){var e=this.context.ccTaskTempAssociationSync;if("function"==typeof e){var t=new Map((0,u.getEligibleTempAssociationSources)(this.context.tempAssociationSources||[]).map(function(e){return[e.fieldName,e]})),n=this.getTempAssociationFieldNames().map(function(e){return t.get(e)}).filter(Boolean).map(function(e){return{nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType}}).sort(function(e,t){return e.nodeKey.localeCompare(t.nodeKey)}),o=JSON.stringify(n);o!==this.lastTempAssociationSnapshot&&(this.lastTempAssociationSnapshot=o,e(n))}}}},{key:"renderAddSubModelButton",value:function(){return this.context.flowSettingsEnabled?l().createElement(i.AddSubModelButton,{model:this,subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("CCTaskCardDetailsItemModel"),this.context.getModelClassName("CCTaskCardDetailsAssociationFieldGroupModel"),this.context.getModelClassName("TaskCardCommonItemModel")].filter(Boolean),keepDropdownOpen:!0},l().createElement(i.FlowSettingsButton,{icon:l().createElement(o.SettingOutlined,null)},this.translate("Fields"))):null}},{key:"render",value:function(){return this.props.heightMode="defaultHeight",f(d(n.prototype),"render",this).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.DetailsGridModel);m.define({hide:!0}),t.default=m},170:function(e,t,n){n.d(t,{G:function(){return o},P:function(){return r}});var o="ccTempAssoc_",r=function(e,t){return"".concat(o).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["437"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return P},getEligibleTempAssociationSources:function(){return O},updateWorkflowCcTaskAssociationFields:function(){return S}});var o=n(485),r=n(197),i=n(694),a=n(170),c=n(488);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function u(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,h()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(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)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var v=["node","job","workflow","execution","user"],w=function(e){function t(){return f(this,t),u(this,t,arguments)}return b(t,e),d(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var o,i=(0,a.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var c=function(e){if(Array.isArray(e))return e}(o=(0,r.parseCollectionName)(e.collection))||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return r}}(o)||m(o,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.")}(),l=c[0],u=c[1];u&&n.set(i,{dataSourceKey:l||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:u,title:e.nodeKey})}}),Array.from(n.values())},S=function(e){var t=e.flowEngine,n=e.nodes,o=e.tempAssociationSources,r=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var a=O(o||[],i);a.length&&a.map(function(e){var t,o,i,a,c=null==(a=[r].concat(function(e){if(Array.isArray(e))return l(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||m(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:a.title;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),o=o={title:c||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}).forEach(function(e){i.addField(new w({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},P=function(e){function t(){return f(this,t),u(this,t,arguments)}return b(t,e),d(t,[{key:"onInit",value:function(e){var n=this;p(y(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(S({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(o){var r=t.getDefaultBindingByField(e,o,{fallbackToTargetTitleField:!0});if(!r||v.includes(o.name)||o.name.startsWith(a.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(o.name):o.name;return{key:i,label:o.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,a,c;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(c=e.model.context.blockModel)||null==(a=c.collection)?void 0:a.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:r.modelName,props:"function"==typeof r.defaultProps?r.defaultProps(e,o):r.defaultProps}}}}}}).filter(Boolean)}}]),t}(o.DetailsItemModel);P.define({label:(0,c.MZ)("CC information",{ns:c.CU}),sort:100}),t.default=P},170:function(e,t,n){n.d(t,{G:function(){return o},P:function(){return r}});var o="ccTempAssoc_",r=function(e,t){return"".concat(o).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["458"],{401:function(e,t,n){n.r(t),n.d(t,{CCChildPageModel:function(){return O},CCChildPageTabModel:function(){return P}});var r=n(485),o=n(694),l=n(625),i=n(155),u=n.n(i),c=n(813);function a(e,t,n,r,o,l,i){try{var u=e[l](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function s(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,g()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function b(e,t,n){return(b="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function k(e){return{async:!0,parentId:e,subType:"object",subKey:"grid",use:"CCBlockGridModel"}}function C(e,t){var n,r;(null==(r=e.view)||null==(n=r.inputArgs)?void 0:n.workflowCcConfigDialog)&&t.context.defineProperty("disableBlockGridPadding",{get:function(){return!0},cache:!1})}function w(e,t){var n,r,o,l=e.model;return(null==(n=l.subModels)?void 0:n.grid)!==t&&(null==(o=l.setSubModel)||o.call(l,"grid",t)),(null==(r=t.parent)?void 0:r.uid)!==l.uid&&t.context.addDelegate(e),C(e,t),t}function m(e){var t,n,i,s=e.ctx,f=e.options,d=(0,o.useFlowEngine)(),p=(0,l.useRequest)(function(){var e;return(e=function(){var e,t,n,r,o,l,i;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var a=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:var a,p,b;if(Array.isArray(b=null==(a=o=null==(e=s.model.subModels)?void 0:e.grid)||null==(p=a.subModels)?void 0:p.items)&&b.length>0)return C(s,o),[2,o];return(0,c.W)(d),[4,null==(t=d.getModelClassAsync)?void 0:t.call(d,"CCBlockGridModel")];case 1:return u.sent(),[4,null==(n=d.loadModel)?void 0:n.call(d,{parentId:f.parentId,refresh:!0,subKey:f.subKey})];case 2:if(null==(l=u.sent())?void 0:l.uid)return[2,w(s,l)];if(null==o?void 0:o.uid)return C(s,o),[2,o];return[4,null==(r=d.loadOrCreateModel)?void 0:r.call(d,f,{skipSave:!0})];case 3:return[2,(null==(i=u.sent())?void 0:i.uid)?w(s,i):null]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){a(l,r,o,i,u,"next",e)}function u(e){a(l,r,o,i,u,"throw",e)}i(void 0)})})()},{refreshDeps:[s.model.uid,null==(n=s.model.subModels)||null==(t=n.grid)?void 0:t.uid,d]}),b=p.data,y=p.loading,v=(null==s?void 0:s.isMobileLayout)?8:null==s||null==(i=s.themeToken)?void 0:i.marginBlock;return!y&&(null==b?void 0:b.uid)?u().createElement(o.FlowModelRenderer,{model:b,fallback:u().createElement(r.SkeletonFallback,{style:{margin:v}})}):u().createElement(r.SkeletonFallback,{style:{margin:v}})}var O=function(e){function t(){return f(this,t),s(this,t,arguments)}return v(t,e),p(t,[{key:"onInit",value:function(e){b(y(t.prototype),"onInit",this).call(this,e),this.context.defineMethod("aclCheck",function(){return!0}),this.context.defineProperty("disableFieldClickToOpen",{get:function(){return!0}})}},{key:"setCollectionCtx",value:function(e){var t=this,n=e.dataSourceKey,r=e.collectionName;this.context.defineProperty("collection",{get:function(){return t.context.dataSourceManager.getCollection(n,r)},cache:!1})}},{key:"renderFirstTab",value:function(){var e=this.getFirstTab();return(null==e?void 0:e.uid)?u().createElement(m,{ctx:e.context,options:k(e.uid)}):null}}]),t}(r.ChildPageModel);O.define({hide:!0}),O.registerFlow({key:"CCChildPageSettings",steps:{init:{handler:function(e,t){e.model.setCollectionCtx(t)}}}});var P=function(e){function t(){return f(this,t),s(this,t,arguments)}return v(t,e),p(t,[{key:"renderChildren",value:function(){return u().createElement(m,{ctx:this.context,options:k(this.uid)})}}]),t}(r.ChildPageTabModel);t.default=O}}]);
|
|
@@ -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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["486"],{429:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsAssociationFieldGroupModel:function(){return y}});var o,r=n(485),i=n(694),l=n(488);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return a(e,void 0);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 a(e,void 0)}}(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 s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var d=["job","execution","user","node.*","job.*","workflow.*","execution.*"],p=["workflow.title","node.title"],b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.blacklist,o=t.whitelist,r=function(t){return!!t.includes(e)||t.some(function(t){if(t.endsWith("*")){var n=t.slice(0,-1);return e.startsWith(n)}return!1})};return!r(f(p).concat(f(void 0===o?[]:o)))&&!!r(f(d).concat(f(void 0===n?[]:n)))},y=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=c(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(e,t||[],c(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&u(n,e),t=[{key:"defineChildren",value:function(e){var t=this.itemModelName;return function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.getToOneAssociationFields().map(function(n){var r=o?"".concat(o,".").concat(n.name):n.name;return b(r)||!n.targetCollection?null:{key:"".concat(r,"-assocationField"),label:n.title,children:function(){return[{key:"".concat(r,"-children-collectionField"),label:"Display fields",type:"group",children:n.targetCollection.getFields().map(function(n){var o="".concat(r,".").concat(n.name),l=i.DisplayItemModel.getDefaultBindingByField(e,n,{fallbackToTargetTitleField:!0});return!l||n.target||b(o)?null:{key:"c-".concat(r,".").concat(n.name),label:n.title,useModel:t,toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===o},createModelOptions:{stepParams:{fieldSettings:{init:{dataSourceKey:e.collection.dataSourceKey,collectionName:e.collection.name,fieldPath:o,associationPathName:r}}},subModels:{field:{use:l.modelName}}}}}).filter(Boolean)}].filter(function(e){return e.children.length>0})}}}).filter(Boolean)}(e.collection)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n,t),n}(r.DetailsAssociationFieldGroupModel);(o="itemModelName")in y?Object.defineProperty(y,o,{value:"CCTaskCardDetailsItemModel",enumerable:!0,configurable:!0,writable:!0}):y[o]="CCTaskCardDetailsItemModel",y.define({label:(0,l.MZ)("Other information",{ns:l.CU})}),t.default=y}}]);
|
|
@@ -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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["746"],{561:function(e,t,r){r.r(t),r.d(t,{CCBlockGridModel:function(){return w}});var n=r(375),o=r(485),l=r(694),u=r(155),i=r.n(u),c=r(488),a=r(770);function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function b(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}function v(e){var t=!1,r=e.map(function(e){var r=function(e){if(!e||"function"==typeof e)return e;var t,r=null==(t=e.stepParams)?void 0:t.resourceSettings,n=null==r?void 0:r.init,o=function(e){var t,r,n,o=null==e?void 0:e.collectionName;if("string"!=typeof o||!o.includes(":"))return e;var l=(r=(t=o.split(":")).pop(),n=t[0]||"main",r?{collectionName:r,dataSourceKey:n}:null);return l?d(s({},e),{dataSourceKey:l.dataSourceKey,collectionName:l.collectionName}):e}(n);return o===n?e:d(s({},e),{stepParams:d(s({},e.stepParams),{resourceSettings:d(s({},r),{init:o})})})}(e.createModelOptions),n=Array.isArray(e.children)?v(e.children):e.children;return r===e.createModelOptions&&n===e.children?e:(t=!0,d(s({},e),{children:n,createModelOptions:r}))});return t?r:e}function g(e){return Array.isArray(e.children)&&e.children.length>0}function h(e){var t,r,o=e.model,f=(0,a.y)(),s=(null==(t=o.context.view)?void 0:t.inputArgs)||{},d=null==(r=s.flowContext)?void 0:r.workflow,p=s.availableUpstreams,y=(0,u.useMemo)(function(){var e,t,r=p||[],n=[],o=b(null==(t=f.getTrigger(null==d?void 0:d.type))||null==(e=t.getCreateModelMenuItem)?void 0:e.call(t,{config:(null==d?void 0:d.config)||{},nodeType:"cc",workflow:d})),l=v(o);o.length&&n.push({key:"triggers",label:'{{t("Trigger", { ns: "workflow" })}}',children:l});var u=v(r.flatMap(function(e){var t,r;return b(null==(r=f.getInstruction(e.type))||null==(t=r.getCreateModelMenuItem)?void 0:t.call(r,{node:e,workflow:d}))}));return u.length&&n.push({key:"nodes",label:'{{t("Node result", { ns: "workflow" })}}',children:u}),[{key:"dataBlocks",type:"group",label:(0,c.MZ)("Data blocks"),children:n},{key:"otherBlocks",type:"group",label:(0,c.MZ)("Other blocks"),children:[{key:"markdown",label:(0,c.MZ)("Markdown"),useModel:"MarkdownBlockModel",createModelOptions:{use:"MarkdownBlockModel"}},{key:"jsBlock",label:(0,c.MZ)("JS block"),useModel:"JSBlockModel",createModelOptions:{use:"JSBlockModel"}}]}].filter(g)},[p,d,f]);return i().createElement(l.AddSubModelButton,{model:o,subModelKey:"items",items:y},i().createElement(l.FlowSettingsButton,{icon:i().createElement(n.PlusOutlined,null)},o.context.t("Add block")))}var w=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=f(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(e,t||[],f(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&p(r,e),t=[{key:"renderAddSubModelButton",value:function(){return this.context.flowSettingsEnabled?i().createElement(h,{model:this}):null}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(o.BlockGridModel);w.define({hide:!0}),t.default=w},770:function(e,t,r){r.d(t,{y:function(){return c}});var n=r(694),o=r(197),l=r(155);function u(e,t){try{var r;return null==e||null==(r=e.get)?void 0:r.call(e,t)}catch(e){return}}function i(e){var t,r,n=null==e||null==(r=e.context)||null==(t=r.app)?void 0:t.pm,l=[u(n,"workflow"),u(n,"@nocobase/plugin-workflow"),u(n,o.PluginWorkflowClientV2)];return l.filter(function(e,t){return e&&l.indexOf(e)===t})}function c(){var e=(0,n.useFlowEngine)();return(0,l.useMemo)(function(){return{getInstruction:function(t){return function(e,t){var r=!0,n=!1,o=void 0;try{for(var l,u=i(e)[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var c=l.value,a=function(e,t){var r,n,o,l;return null!=(r=null==(n=e.getInstruction)?void 0:n.call(e,t))?r:null==(l=e.instructions)||null==(o=l.get)?void 0:o.call(l,t)}(c,t);if(a)return a}}catch(e){n=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(n)throw o}}}(e,t)},getTrigger:function(t){return function(e,t){var r=!0,n=!1,o=void 0;try{for(var l,u=i(e)[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var c=l.value,a=function(e,t){var r,n,o,l;return null!=(r=null==(n=e.getTriggerOptions)?void 0:n.call(e,t))?r:null==(l=e.triggers)||null==(o=l.get)?void 0:o.call(l,t)}(c,t);if(a)return a}}catch(e){n=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(n)throw o}}}(e,t)}}},[e])}}}]);
|
|
@@ -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_cc=self.webpackChunk_nocobase_plugin_workflow_cc||[]).push([["86"],{29:function(e,t,o){o.r(t),o.d(t,{CCTriggerBlockGridModel:function(){return d}});var n=o(375),r=o(485),l=o(694),c=o(155),u=o.n(c),i=o(488);function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return e=o,t=arguments,e=a(e),function(e,t){var o;if(t&&("object"==((o=t)&&"u">typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&s(o,e),t=[{key:"renderAddSubModelButton",value:function(){if(!this.context.flowSettingsEnabled)return null;var e=[{key:"otherBlocks",type:"group",label:(0,i.MZ)("Other blocks"),children:[{key:"markdown",label:(0,i.MZ)("Markdown"),useModel:"MarkdownBlockModel",createModelOptions:{use:"MarkdownBlockModel"}},{key:"jsBlock",label:(0,i.MZ)("JS block"),useModel:"JSBlockModel",createModelOptions:{use:"JSBlockModel"}}]}];return u().createElement(l.AddSubModelButton,{model:this,subModelKey:"items",items:e},u().createElement(l.FlowSettingsButton,{icon:u().createElement(n.PlusOutlined,null)},this.context.t("Add block")))}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(o.prototype,t),o}(r.BlockGridModel);d.define({hide:!0}),t.default=d}}]);
|
|
@@ -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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["164"],{303:function(e,t,r){r.r(t),r.d(t,{CCTaskCardDetailsModel:function(){return b}});var n=r(485),o=r(694),i=r(155),l=r.n(i),c=r(488);function u(e,t,r,n,o,i,l){try{var c=e[i](l),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function l(e){u(i,n,o,l,c,"next",e)}function c(e){u(i,n,o,l,c,"throw",e)}l(void 0)})}}function s(e,t,r){return(s="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r||e):o.value}})(e,t,r||e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function y(e,t){var r,n,o,i={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),c=Object.defineProperty;return c(l,"next",{value:u(0)}),c(l,"throw",{value:u(1)}),c(l,"return",{value:u(2)}),"function"==typeof Symbol&&c(l,Symbol.iterator,{value:function(){return this}}),l;function u(c){return function(u){var a=[c,u];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=f(e),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(e,t||[],f(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&p(r,e),t=[{key:"onInit",value:function(e){s(f(r.prototype),"onInit",this).call(this,e),this.setDecoratorProps({size:"small"}),this.context.defineMethod("aclCheck",function(){return!0}),this.context.defineProperty("disableFieldClickToOpen",{get:function(){return!0}})}},{key:"createResource",value:function(e){var t=e.createResource(o.SingleRecordResource);return t.isNewRecord=!1,t.refresh=function(){return a(function(){return y(this,function(e){return[2]})})()},t}},{key:"refresh",value:function(){return a(function(){return y(this,function(e){return[2]})})()}},{key:"getCurrentRecord",value:function(){var e=this.context.workflowCcTaskRecord;return e&&(void 0===e?"undefined":d(e))==="object"&&!Array.isArray(e)?e:s(f(r.prototype),"getCurrentRecord",this).call(this)}},{key:"renderComponent",value:function(){var e=this.props,t=e.colon,r=e.labelAlign,i=e.labelWidth,c=e.labelWrap,u=e.layout;return l().createElement(n.FormComponent,{model:this,layoutProps:{colon:t,labelAlign:r,labelWidth:i,labelWrap:c,layout:u}},l().createElement(o.FlowModelRenderer,{model:this.subModels.grid,showFlowSettings:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(n.DetailsBlockModel);b.define({hide:!0}),b.registerFlow({key:"cardSettings",title:(0,c.MZ)("Card settings"),steps:{titleDescription:{title:(0,c.MZ)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,c.MZ)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,c.MZ)("Description")}},defaultParams:function(e){var t;return{title:null==(t=e.model.context.workflow)?void 0:t.title}},handler:function(e,t){e.model.setDecoratorProps({description:e.t(t.description),title:e.t(t.title)})}}}}),b.registerFlow({key:"detailsSettings",title:(0,c.MZ)("Details settings"),sort:150,steps:{refresh:{handler:function(e){return a(function(){return y(this,function(t){switch(t.label){case 0:if(!e.resource)throw Error("Resource is not initialized");return[4,e.model.applySubModelsBeforeRenderFlows("grid")];case 1:return t.sent(),[2]}})})()}},layout:{use:"layout",title:(0,c.MZ)("Layout")}}}),t.default=b}}]);
|
|
@@ -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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["352"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return C},getEligibleTempAssociationSources:function(){return O},updateWorkflowCcTaskAssociationFields:function(){return w}});var o=n(485),r=n(197),i=n(694),a=n(170),l=n(488);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function u(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,g()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if(e){if("string"==typeof e)return c(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 c(e,t)}}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}var v=["node","job","workflow","execution","user"],S=function(e){function t(){return s(this,t),u(this,t,arguments)}return m(t,e),d(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var o,i=(0,a.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var l=function(e){if(Array.isArray(e))return e}(o=(0,r.parseCollectionName)(e.collection))||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return r}}(o)||b(o,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.")}(),c=l[0],u=l[1];u&&n.set(i,{dataSourceKey:c||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:u,title:e.nodeKey})}}),Array.from(n.values())},w=function(e){var t=e.flowEngine,n=e.nodes,o=e.tempAssociationSources,r=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var a=O(o||[],i);a.length&&a.map(function(e){var t,o,i,a,l=null==(a=[r].concat(function(e){if(Array.isArray(e))return c(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||b(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:a.title;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),o=o={title:l||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}).forEach(function(e){i.addField(new S({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},C=function(e){function t(){return s(this,t),u(this,t,arguments)}return m(t,e),d(t,[{key:"onInit",value:function(e){var n=this;p(y(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(w({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(o){var r=t.getDefaultBindingByField(e,o,{fallbackToTargetTitleField:!0});if(!r||v.includes(o.name)||o.name.startsWith(a.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(o.name):o.name;return{key:i,label:o.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,a,l;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(l=e.model.context.blockModel)||null==(a=l.collection)?void 0:a.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:r.modelName,props:"function"==typeof r.defaultProps?r.defaultProps(e,o):r.defaultProps}}}}}}).filter(Boolean)}}]),t}(o.DetailsItemModel);C.define({label:(0,l.MZ)("CC information",{ns:l.CU}),sort:100}),t.default=C},923:function(e,t,n){n.r(t),n.d(t,{CCTaskCardGridModel:function(){return m}});var o=n(375),r=n(485),i=n(694),a=n(155),l=n.n(a),c=n(170),u=n(628);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t,n){return(f="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var m=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=d(t),s(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(t,o||[],d(this).constructor):t.apply(this,o)),"lastTempAssociationSnapshot",void 0),s(e,"tempAssociationSyncHandler",function(){e.syncTempAssociationFields()}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&p(n,e),t=[{key:"onMount",value:function(){f(d(n.prototype),"onMount",this).call(this),this.emitter.on("onSubModelAdded",this.tempAssociationSyncHandler),this.emitter.on("onSubModelDestroyed",this.tempAssociationSyncHandler)}},{key:"onUnmount",value:function(){this.emitter.off("onSubModelAdded",this.tempAssociationSyncHandler),this.emitter.off("onSubModelDestroyed",this.tempAssociationSyncHandler),f(d(n.prototype),"onUnmount",this).call(this)}},{key:"getTempAssociationFieldNames",value:function(){return Array.from(new Set(this.mapSubModels("items",function(e){var t,n=null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath;if(!n)return null;var o=n.split(".")[0];return o.startsWith(c.G)?o:null}).filter(Boolean)))}},{key:"syncTempAssociationFields",value:function(){if(this.context.flowSettingsEnabled){var e=this.context.ccTaskTempAssociationSync;if("function"==typeof e){var t=new Map((0,u.getEligibleTempAssociationSources)(this.context.tempAssociationSources||[]).map(function(e){return[e.fieldName,e]})),n=this.getTempAssociationFieldNames().map(function(e){return t.get(e)}).filter(Boolean).map(function(e){return{nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType}}).sort(function(e,t){return e.nodeKey.localeCompare(t.nodeKey)}),o=JSON.stringify(n);o!==this.lastTempAssociationSnapshot&&(this.lastTempAssociationSnapshot=o,e(n))}}}},{key:"renderAddSubModelButton",value:function(){return this.context.flowSettingsEnabled?l().createElement(i.AddSubModelButton,{model:this,subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("CCTaskCardDetailsItemModel"),this.context.getModelClassName("CCTaskCardDetailsAssociationFieldGroupModel"),this.context.getModelClassName("TaskCardCommonItemModel")].filter(Boolean),keepDropdownOpen:!0},l().createElement(i.FlowSettingsButton,{icon:l().createElement(o.SettingOutlined,null)},this.translate("Fields"))):null}},{key:"render",value:function(){return this.props.heightMode="defaultHeight",f(d(n.prototype),"render",this).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.DetailsGridModel);m.define({hide:!0}),t.default=m},170:function(e,t,n){n.d(t,{G:function(){return o},P:function(){return r}});var o="ccTempAssoc_",r=function(e,t){return"".concat(o).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["437"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return P},getEligibleTempAssociationSources:function(){return O},updateWorkflowCcTaskAssociationFields:function(){return S}});var o=n(485),r=n(197),i=n(694),a=n(170),c=n(488);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function u(e,t,n){return t=y(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,h()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(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)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var v=["node","job","workflow","execution","user"],w=function(e){function t(){return f(this,t),u(this,t,arguments)}return b(t,e),d(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var o,i=(0,a.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var c=function(e){if(Array.isArray(e))return e}(o=(0,r.parseCollectionName)(e.collection))||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,a=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(a)throw n}}return r}}(o)||m(o,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.")}(),l=c[0],u=c[1];u&&n.set(i,{dataSourceKey:l||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:u,title:e.nodeKey})}}),Array.from(n.values())},S=function(e){var t=e.flowEngine,n=e.nodes,o=e.tempAssociationSources,r=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var a=O(o||[],i);a.length&&a.map(function(e){var t,o,i,a,c=null==(a=[r].concat(function(e){if(Array.isArray(e))return l(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||m(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:a.title;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),o=o={title:c||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t}).forEach(function(e){i.addField(new w({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},P=function(e){function t(){return f(this,t),u(this,t,arguments)}return b(t,e),d(t,[{key:"onInit",value:function(e){var n=this;p(y(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(S({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(o){var r=t.getDefaultBindingByField(e,o,{fallbackToTargetTitleField:!0});if(!r||v.includes(o.name)||o.name.startsWith(a.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(o.name):o.name;return{key:i,label:o.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,a,c;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(c=e.model.context.blockModel)||null==(a=c.collection)?void 0:a.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:r.modelName,props:"function"==typeof r.defaultProps?r.defaultProps(e,o):r.defaultProps}}}}}}).filter(Boolean)}}]),t}(o.DetailsItemModel);P.define({label:(0,c.MZ)("CC information",{ns:c.CU}),sort:100}),t.default=P},170:function(e,t,n){n.d(t,{G:function(){return o},P:function(){return r}});var o="ccTempAssoc_",r=function(e,t){return"".concat(o).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/g,"_"))}}}]);
|