@nocobase/plugin-workflow-action-trigger 1.0.0-alpha.9 → 1.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { SchemaInitializerItemType, useCollectionDataSource } from '@nocobase/client';
|
|
10
10
|
import { Trigger, useWorkflowAnyExecuted, CheckboxGroupWithTooltip, RadioWithTooltip } from '@nocobase/plugin-workflow/client';
|
|
11
|
+
declare function useVariables(config: any, options: any): import("@nocobase/plugin-workflow/client").VariableOption[];
|
|
11
12
|
export default class extends Trigger {
|
|
12
13
|
title: string;
|
|
13
14
|
description: string;
|
|
@@ -105,6 +106,7 @@ export default class extends Trigger {
|
|
|
105
106
|
CheckboxGroupWithTooltip: typeof CheckboxGroupWithTooltip;
|
|
106
107
|
};
|
|
107
108
|
isActionTriggerable: (config: any, context: any) => boolean;
|
|
108
|
-
useVariables
|
|
109
|
+
useVariables: typeof useVariables;
|
|
109
110
|
useInitializers(config: any): SchemaInitializerItemType | null;
|
|
110
111
|
}
|
|
112
|
+
export {};
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(function(o,
|
|
10
|
+
(function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("@formily/react"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/plugin-workflow/client","@formily/react","react-i18next"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o["@nocobase/plugin-workflow-action-trigger"]={},o["@nocobase/client"],o["@nocobase/plugin-workflow"],o["@formily/react"],o["react-i18next"]))})(this,function(o,t,e,f,p){"use strict";var v=Object.defineProperty,W=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var m=(o,t,e)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,b=(o,t)=>{for(var e in t||(t={}))I.call(t,e)&&m(o,e,t[e]);if(w)for(var e of w(t))O.call(t,e)&&m(o,e,t[e]);return o},h=(o,t)=>W(o,R(t));var a=(o,t,e)=>(m(o,typeof t!="symbol"?t+"":t,e),e);var C=(o,t,e)=>new Promise((f,p)=>{var i=r=>{try{u(e.next(r))}catch(d){p(d)}},c=r=>{try{u(e.throw(r))}catch(d){p(d)}},u=r=>r.done?f(r.value):Promise.resolve(r.value).then(i,c);u((e=e.apply(o,t)).next())});const i="workflow-action-trigger";function c(s,l={}){const{t:n}=u(l);return n(s)}function u(s){return p.useTranslation(i,s)}const r={CREATE:"create",UPDATE:"update",UPSERT:"updateOrCreate",DESTROY:"destroy"};function d(s,l){var x;const[n,g]=t.parseCollectionName(s.collection),T=t.useCompile(),A=e.useGetCollectionFields(n),S=e.useGetCollectionFields(),E=c("Trigger data"),F=c("User submitted action"),P=c("Role of user submitted action");return[...e.getCollectionFieldOptions(h(b({appends:["data",...((x=s.appends)==null?void 0:x.map($=>`data.${$}`))||[]]},l),{fields:[{collectionName:g,name:"data",type:"hasOne",target:g,uiSchema:{title:E}}],compile:T,getCollectionFields:A})),...e.getCollectionFieldOptions(h(b({appends:["user"]},l),{fields:[{collectionName:"users",name:"user",type:"hasOne",target:"users",uiSchema:{title:F}},{name:"roleName",uiSchema:{title:P}}],compile:T,getCollectionFields:S}))]}class k extends e.Trigger{constructor(){super(...arguments);a(this,"title",`{{t("Post-action event", { ns: "${i}" })}}`);a(this,"description",`{{t('Triggered after the completion of a request initiated through an action button or API, such as after adding, updating, or deleting data. Suitable for data processing, sending notifications, etc., after actions are completed.', { ns: "${i}" })}}`);a(this,"fieldset",{collection:{type:"string",required:!0,"x-decorator":"FormItem","x-decorator-props":{tooltip:`{{t("The collection to which the triggered data belongs.", { ns: "${i}" })}}`},"x-component":"DataSourceCollectionCascader","x-disabled":"{{ useWorkflowAnyExecuted() }}",title:`{{t("Collection", { ns: "${i}" })}}`,"x-reactions":[{target:"appends",effects:["onFieldValueChange"],fulfill:{state:{value:[]}}}]},global:{type:"boolean",title:`{{t("Trigger mode", { ns: "${i}" })}}`,"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{direction:"vertical",options:[{label:`{{t("Local mode, triggered after the completion of actions bound to this workflow", { ns: "${i}" })}}`,value:!1},{label:`{{t("Global mode, triggered after the completion of the following actions", { ns: "${i}" })}}`,value:!0}]},default:!1,"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]},actions:{type:"number",title:`{{t("Select actions", { ns: "${i}" })}}`,"x-decorator":"FormItem","x-component":"CheckboxGroupWithTooltip","x-component-props":{direction:"vertical",options:[{label:`{{t("Create record action", { ns: "${i}" })}}`,value:r.CREATE},{label:`{{t("Update record action", { ns: "${i}" })}}`,value:r.UPDATE}]},required:!0,"x-reactions":[{dependencies:["collection","global"],fulfill:{state:{visible:"{{!!$deps[0] && !!$deps[1]}}"}}}]},appends:{type:"array",title:`{{t("Associations to use", { ns: "${i}" })}}`,description:'{{t("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.", { ns: "workflow" })}}',"x-decorator":"FormItem","x-component":"AppendsTreeSelect","x-component-props":{multiple:!0,useCollection(){const{values:n}=f.useForm();return n==null?void 0:n.collection}},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]}});a(this,"scope",{useCollectionDataSource:t.useCollectionDataSource,useWorkflowAnyExecuted:e.useWorkflowAnyExecuted});a(this,"components",{RadioWithTooltip:e.RadioWithTooltip,CheckboxGroupWithTooltip:e.CheckboxGroupWithTooltip});a(this,"isActionTriggerable",(n,g)=>!n.global&&["submit","customize:save","customize:update"].includes(g.buttonAction));a(this,"useVariables",d)}useInitializers(n){return n.collection?{name:"triggerData",type:"item",key:"triggerData",title:`{{t("Trigger data", { ns: "${i}" })}}`,Component:e.CollectionBlockInitializer,collection:n.collection,dataPath:"$context.data"}:null}}class y extends t.Plugin{load(){return C(this,null,function*(){this.app.pm.get("workflow").registerTrigger("action",k),this.app.addScopes({useTriggerWorkflowsActionProps:e.useTriggerWorkflowsActionProps,useRecordTriggerWorkflowsActionProps:e.useRecordTriggerWorkflowsActionProps})})}}o.default=y,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/react": "2.3.0",
|
|
12
|
-
"@nocobase/client": "1.0.
|
|
13
|
-
"@nocobase/plugin-workflow": "1.0.
|
|
12
|
+
"@nocobase/client": "1.0.1-alpha.2",
|
|
13
|
+
"@nocobase/plugin-workflow": "1.0.1-alpha.2",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
16
|
"sequelize": "6.35.2",
|
|
17
|
-
"@nocobase/database": "1.0.
|
|
18
|
-
"@nocobase/server": "1.0.
|
|
19
|
-
"@nocobase/actions": "1.0.
|
|
20
|
-
"@nocobase/data-source-manager": "1.0.
|
|
21
|
-
"@nocobase/plugin-workflow-test": "1.0.
|
|
22
|
-
"@nocobase/test": "1.0.
|
|
23
|
-
"@nocobase/utils": "1.0.
|
|
17
|
+
"@nocobase/database": "1.0.1-alpha.2",
|
|
18
|
+
"@nocobase/server": "1.0.1-alpha.2",
|
|
19
|
+
"@nocobase/actions": "1.0.1-alpha.2",
|
|
20
|
+
"@nocobase/data-source-manager": "1.0.1-alpha.2",
|
|
21
|
+
"@nocobase/plugin-workflow-test": "1.0.1-alpha.2",
|
|
22
|
+
"@nocobase/test": "1.0.1-alpha.2",
|
|
23
|
+
"@nocobase/utils": "1.0.1-alpha.2"
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:操作后事件",
|
|
5
5
|
"description": "Triggered after the completion of a request initiated through an action button or API, such as after adding, updating, deleting data, or \"submit to workflow\". Suitable for data processing, sending notifications, etc., after actions are completed.",
|
|
6
6
|
"description.zh-CN": "通过操作按钮或 API 发起请求并在执行完成后触发,比如新增、更新、删除数据或者“提交至工作流”之后。适用于在操作完成后进行数据处理、发送通知等。",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.1-alpha.2",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/plugins/workflow-action-trigger",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@nocobase/server": "1.x",
|
|
22
22
|
"@nocobase/test": "1.x"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "fc5a8e3c812516f787cb22d3d198f058f45b1963",
|
|
25
25
|
"keywords": [
|
|
26
26
|
"Workflow"
|
|
27
27
|
]
|