@nocobase/plugin-workflow-manual 0.20.0-alpha.10 → 0.20.0-alpha.12
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/index.js +4 -4
- package/dist/client/instruction/SchemaConfig.d.ts +11 -3
- package/dist/client/instruction/forms/custom.d.ts +6 -2
- package/dist/externalVersion.js +9 -9
- package/package.json +2 -2
- package/src/client/__e2e__/createRecordForm.test.ts +56 -65
- package/src/client/__e2e__/customFormBlocks.test.ts +131 -66
- package/src/client/__e2e__/datablocks.test.ts +30 -30
- package/src/client/__e2e__/updateRecordForm.test.ts +41 -53
- package/src/client/__e2e__/workflowTodo.test.ts +7 -7
- package/src/client/index.ts +12 -4
- package/src/client/instruction/FormBlockInitializer.tsx +1 -1
- package/src/client/instruction/SchemaConfig.tsx +114 -6
- package/src/client/instruction/forms/create.tsx +1 -1
- package/src/client/instruction/forms/custom.tsx +18 -4
- package/src/client/instruction/forms/update.tsx +1 -1
package/dist/client/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(C,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("react/jsx-runtime"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("lodash"),require("@ant-design/icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/plugin-workflow/client","react/jsx-runtime","@formily/antd-v5","@formily/core","@formily/react","antd","react","react-i18next","@nocobase/utils/client","lodash","@ant-design/icons","dayjs"],e):(C=typeof globalThis!="undefined"?globalThis:C||self,e(C["@nocobase/plugin-workflow-manual"]={},C["@nocobase/client"],C["@nocobase/plugin-workflow"],C.jsxRuntime,C["@formily/antd-v5"],C["@formily/core"],C["@formily/react"],C.antd,C.react,C["react-i18next"],C["@nocobase/utils"],C.lodash,C["@ant-design/icons"],C.dayjs))})(this,function(C,e,d,s,E,U,b,S,h,j,T,J,K,ie){"use strict";var Re=Object.defineProperty,eo=Object.defineProperties;var oo=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var Q=(C,e,d)=>e in C?Re(C,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):C[e]=d,g=(C,e)=>{for(var d in e||(e={}))re.call(e,d)&&Q(C,d,e[d]);if(L)for(var d of L(e))se.call(e,d)&&Q(C,d,e[d]);return C},k=(C,e)=>eo(C,oo(e));var V=(C,e)=>{var d={};for(var s in C)re.call(C,s)&&e.indexOf(s)<0&&(d[s]=C[s]);if(C!=null&&L)for(var s of L(C))e.indexOf(s)<0&&se.call(C,s)&&(d[s]=C[s]);return d};var $=(C,e,d)=>(Q(C,typeof e!="symbol"?e+"":e,d),d);var _=(C,e,d)=>new Promise((s,E)=>{var U=h=>{try{S(d.next(h))}catch(j){E(j)}},b=h=>{try{S(d.throw(h))}catch(j){E(j)}},S=h=>h.done?s(h.value):Promise.resolve(h.value).then(U,b);S((d=d.apply(C,e)).next())});const y="workflow-manual";function w(o,n={}){const{t:r}=ae(n);return r(o)}function ae(o){return j.useTranslation(y,o)}function ce(o){const{execution:n,nodes:r}=d.useFlowContext(),t=h.useMemo(()=>r.reduce((c,u)=>Object.assign(c,{[u.id]:u.key}),{}),[r]),i=h.useMemo(()=>{var c;return{$context:n==null?void 0:n.context,$jobsMapByNodeKey:((c=n==null?void 0:n.jobs)!=null?c:[]).reduce((u,l)=>Object.assign(u,{[t[l.nodeId]]:l.result}),{})}},[n==null?void 0:n.context,n==null?void 0:n.jobs,t]);return h.useMemo(()=>T.parse(o)(i),[i,o])}function H(o){const n=b.useField(),r=h.useRef(null),{getAssociationAppends:t}=e.useAssociationNames(),{appends:i,updateAssociationValues:a}=t(),c=ce(o.dataSource),u=h.useMemo(()=>U.createForm({values:c,readPretty:!0}),[c]),l={appends:i},x={loading:!1,data:{data:c}},p=e.useAPIClient().resource(o.collection),m=e.useBlockRequestContext();return s.jsx(e.CollectionProvider_deprecated,{collection:o.collection,children:s.jsx(e.RecordProvider,{record:c,parent:null,children:s.jsx(e.BlockRequestContext_deprecated.Provider,{value:{block:"form",field:n,service:x,resource:p,__parent:m},children:s.jsx(e.FormBlockContext.Provider,{value:{params:l,form:u,field:n,service:x,updateAssociationValues:a,formBlockRef:r},children:o.children})})})})}function X(o){var N,q,G;const n=e.useRecord(),r=b.useFieldSchema(),t=b.useField(),i=h.useRef(null),a=o.dataSource||e.DEFAULT_DATA_SOURCE_KEY,{getAssociationAppends:c}=e.useAssociationNames(a),{appends:u,updateAssociationValues:l}=c(),[x]=Object.keys((N=r.toJSON().properties)!=null?N:{}),f=(q=n==null?void 0:n.result)==null?void 0:q[x],{findComponent:p}=e.useDesignable(),m=p((G=t.component)==null?void 0:G[0])||h.Fragment,v=h.useMemo(()=>U.createForm({initialValues:f}),[f]),A=h.useMemo(()=>g({appends:u},o.params),[u,o.params]),F=h.useMemo(()=>({loading:!1,data:{data:f}}),[f]),I=e.useAPIClient(),O=e.useDataSourceHeaders(a),D=I.resource(o.collection,void 0,O),B=e.useBlockRequestContext(),P=h.useMemo(()=>({params:A,form:v,field:t,service:F,updateAssociationValues:l,formBlockRef:i}),[t,v,A,F,l]);return!n.status||f?s.jsx(e.CollectionManagerProvider,{dataSource:a,children:s.jsx(e.CollectionProvider_deprecated,{collection:o.collection,children:s.jsx(e.RecordProvider,{record:f,parent:null,children:s.jsx(e.FormActiveFieldsProvider,{name:"form",children:s.jsx(e.BlockRequestContext_deprecated.Provider,{value:{block:"form",props:o,field:t,service:F,resource:D,__parent:B},children:s.jsx(e.FormBlockContext.Provider,{value:P,children:s.jsxs(m,k(g({},t.componentProps),{children:[s.jsx(e.FormV2.Templates,{style:{marginBottom:18},form:v}),s.jsx("div",{ref:i,children:s.jsx(b.RecursionField,{schema:r,onlyRenderProperties:!0})})]}))})})})})})}):null}function le(r){var t=r,{schema:o}=t,n=V(t,["schema"]);const{getTemplateSchemaByMode:i}=e.useSchemaTemplateManager(),{insert:a}=e.useSchemaInitializer(),c=e.useRecordCollectionDataSourceItems("FormItem");function u(x){return _(this,arguments,function*({item:l}){var A;const f=l.template?yield i(l):null,p=e.createFormBlockSchema(k(g({actionInitializers:"AddActionButton",actions:{resolve:{type:"void",title:`{{t("Continue the process", { ns: "${y}" })}}`,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:d.JOB_STATUS.RESOLVED},"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useSubmit }}"},"x-designer":"ManualActionDesigner","x-designer-props":{}}}},o),{template:f}));delete p["x-acl-action-props"],delete p["x-acl-action"];const[m]=Object.keys(p.properties),v=((A=Object.entries(p.properties[m].properties).find(([F,I])=>I["x-component"]==="ActionBar"))==null?void 0:A[0])||"actions";p.properties[m].properties[v]["x-decorator"]="ActionBarProvider",p.properties[m].properties[v]["x-component-props"].style={marginTop:"1.5em",flexWrap:"wrap"},d.traverseSchema(p,F=>{F["x-uid"]&&delete F["x-uid"]}),a(p)})}return s.jsx(e.SchemaInitializerItem,k(g({},n),{onClick:u,items:c}))}function Z(){var n,r;const o=e.useSchemaInitializerItem();return s.jsx(e.CollectionProvider_deprecated,{dataSource:(n=o.schema)==null?void 0:n.dataSource,collection:(r=o.schema)==null?void 0:r.collection,children:s.jsx(le,g({},o))})}function M(o,n,r=!1){const t=[];return o?n(o)&&(!r||!o.properties)?(t.push(o),t):(o.properties&&Object.keys(o.properties).forEach(i=>{t.push(...M(o.properties[i],n))}),t):t}function pe(){const{name:o,title:n}=e.useCollection_deprecated();return s.jsxs(e.GeneralSchemaDesigner,{title:n||o,children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsLinkageRules,{collectionName:o}),s.jsx(e.SchemaSettingsDataTemplates,{collectionName:o}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const de={title:`{{t("Create record form", { ns: "${y}" })}}`,config:{useInitializer({allCollections:o}){const n=h.useMemo(()=>o.map(({key:a,displayName:c,collections:u})=>({key:a,name:a,label:c,type:"subMenu",children:u.map(l=>({name:J.camelCase(`createRecordForm-child-${l.name}`),type:"item",title:l.title||l.tableName,schema:{collection:l.name,dataSource:a,title:`{{t("Create record", { ns: "${y}" })}}`,formType:"create","x-designer":"CreateFormDesigner"},Component:Z}))})),[o]),[r,t]=h.useState([]),i=e.useMenuSearch(n,r);return{name:"createRecordForm",key:"createRecordForm",type:"subMenu",title:`{{t("Create record form", { ns: "${y}" })}}`,componentProps:{onOpenChange(a){t(a)}},children:i}},initializers:{},components:{CreateFormDesigner:pe},parseFormOptions(o){const n={};return M(o,t=>t["x-decorator"]==="FormBlockProvider"&&t["x-decorator-props"].formType==="create").forEach(t=>{var u,l;const[i]=Object.keys(t.properties),a=t.properties[i],c=((u=Object.entries(a.properties).find(([x,f])=>f["x-component"]==="ActionBar"))==null?void 0:u[0])||"actions";n[i]={type:"create",title:((l=t["x-component-props"])==null?void 0:l.title)||i,actions:M(a.properties[c],x=>x["x-component"]==="Action").map(x=>{var f,p;return{status:x["x-decorator-props"].value,values:(p=(f=x["x-action-settings"])==null?void 0:f.assignedValues)==null?void 0:p.values,key:x.name}}),collection:t["x-decorator-props"].collection}}),n}},block:{scope:{},components:{}}};function W(o){var x,f,p,m;const[n,r]=h.useState((f=(x=o.collection)==null?void 0:x.fields)!=null?f:[]),t=e.useRecord(),i=b.useField(),a=b.useFieldSchema(),[c]=Object.keys((p=a.toJSON().properties)!=null?p:{}),u=(m=t==null?void 0:t.result)==null?void 0:m[c],l=h.useMemo(()=>U.createForm({initialValues:u}),[u]);return!t.status||u?s.jsx(e.CollectionProvider_deprecated,{collection:k(g({},o.collection),{fields:n}),children:s.jsx(e.RecordProvider,{record:u,parent:null,children:s.jsx(e.FormBlockContext.Provider,{value:{form:l,field:i,setCollectionFields:r},children:o.children})})}):null}function ue(){const{insert:o}=e.useSchemaInitializer(),n=e.useSchemaInitializerItem();return s.jsx(e.SchemaInitializerItem,k(g({},n),{onClick:()=>{o({type:"void","x-decorator":"CustomFormBlockProvider","x-decorator-props":{collection:{name:T.uid(),fields:[]}},"x-component":"CardItem","x-component-props":{title:'{{t("Form")}}'},"x-designer":"SimpleDesigner","x-designer-props":{type:"customForm"},properties:{[T.uid()]:{type:"void","x-component":"FormV2","x-component-props":{useProps:"{{ useFormBlockProps }}"},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"AddCustomFormField"},actions:{type:"void","x-decorator":"ActionBarProvider","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:"1.5em",flexWrap:"wrap"}},"x-initializer":"AddActionButton",properties:{resolve:{type:"void",title:`{{t("Continue the process", { ns: "${y}" })}}`,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:d.JOB_STATUS.RESOLVED},"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useSubmit }}"},"x-designer":"ManualActionDesigner"}}}}}}})}}))}const R={basic:'{{t("Basic")}}',choices:'{{t("Choices")}}',media:'{{t("Media")}}',datetime:'{{t("Date & Time")}}',relation:'{{t("Relation")}}',advanced:'{{t("Advanced type")}}',systemInfo:'{{t("System info")}}',others:'{{t("Others")}}'};function me(o){const n={};return Object.keys(o).forEach(r=>{const t=o[r],{group:i="others"}=t;n[i]=n[i]||{},J.set(n,[i,r],t)}),Object.keys(R).filter(r=>["basic","choices","datetime","media"].includes(r)).map(r=>({title:R[r],children:Object.keys(n[r]||{}).map(t=>{const i=n[r][t];return g({value:t,title:i.title,name:t},n[r][t])}).sort((t,i)=>t.order-i.order)}))}function fe(){const{interfaces:o}=e.useCollectionManager_deprecated();return me(o).map(r=>({name:r.title,type:"itemGroup",title:r.title,children:r.children.map(t=>({name:t.name,type:"item",title:t.title,Component:Ce,fieldInterface:t.name}))}))}const ee=h.createContext({}),he=o=>{const[n,r]=h.useState(null),[t,i]=h.useState(),a=fe(),c=e.useCollection_deprecated(),{setCollectionFields:u}=h.useContext(e.FormBlockContext);return s.jsxs(ee.Provider,{value:{onAddField(l){const v=J.cloneDeep(l),{properties:A}=v,F=A,{unique:x,type:f}=F,p=V(F,["unique","type"]),m=V(v,["properties"]);delete p.name["x-disabled"],r(k(g({},m),{properties:p}))},setCallback:i},children:[s.jsx(e.SchemaInitializerItems,k(g({},o),{items:a})),s.jsx(e.ActionContextProvider,{value:{visible:!!n},children:n?s.jsx(e.SchemaComponent,{schema:{type:"void",name:"drawer",title:'{{t("Configure field")}}',"x-decorator":"Form","x-component":"Action.Drawer",properties:k(g({},n.properties),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction(){const l=b.useForm();return{run(){return _(this,null,function*(){i(null),r(null),l.reset()})}}}}},submit:{type:"void",title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction(){const{values:l,query:x}=b.useForm(),f=[w("Field name existed in form")];return{run(){return _(this,null,function*(){var I,O,D,B;const{default:m}=n,v=T.uid();if(m.name=(I=l.name)!=null?I:v,m.uiSchema.title=(D=(O=l.uiSchema)==null?void 0:O.title)!=null?D:v,m.interface=n.name,(B=c.fields)==null?void 0:B.find(P=>P.name===m.name)){x("name").take().setFeedback({type:"error",messages:f});return}const F=T.merge(m,l);u([...c.fields,F]),t({name:m.name,type:m.uiSchema.type,"x-decorator":"FormItem","x-component":"CollectionField","x-component-props":{field:F},"x-collection-field":`${c.name}.${m.name}`,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem"}),i(null),r(null)})}}}}}}}})},components:{ArrayTable:E.ArrayTable}}):null})]})},xe=new e.SchemaInitializer({name:"AddCustomFormField",wrap:e.gridRowColWrap,insertPosition:"beforeEnd",title:"{{t('Configure fields')}}",ItemsComponent:he});function Ce(){const o=e.useSchemaInitializerItem(),{insert:n,setVisible:r}=e.useSchemaInitializer(),{onAddField:t,setCallback:i}=h.useContext(ee),{getInterface:a}=e.useCollectionManager_deprecated(),c=a(o.fieldInterface);return s.jsx(e.SchemaInitializerItem,g({onClick:()=>{i(()=>n),t(c),r(!1)}},o),o.fieldInterface)}const oe={title:`{{t("Custom form", { ns: "${y}" })}}`,config:{useInitializer(){return{name:"customForm",type:"item",title:`{{t("Custom form", { ns: "${y}" })}}`,Component:ue}},initializers:{},components:{CustomFormBlockProvider:W},parseFormOptions(o){const n={};return M(o,t=>t["x-decorator"]==="CustomFormBlockProvider").forEach(t=>{var l,x;const[i]=Object.keys(t.properties),a=t.properties[i],c=M(a.properties.grid,f=>f["x-component"]==="CollectionField",!0);t["x-decorator-props"].collection.fields=c.map(f=>{var p,m;return(m=(p=f["x-component-props"])==null?void 0:p.field)!=null?m:f["x-interface-options"]});const u=((l=Object.entries(a.properties).find(([f,p])=>p["x-component"]==="ActionBar"))==null?void 0:l[0])||"actions";n[i]={type:"custom",title:((x=t["x-component-props"])==null?void 0:x.title)||i,actions:M(a.properties[u],f=>f["x-component"]==="Action").map(f=>{var p,m;return{status:f["x-decorator-props"].value,values:(m=(p=f["x-action-settings"])==null?void 0:p.assignedValues)==null?void 0:m.values,key:f.name}}),collection:t["x-decorator-props"].collection}}),n}},block:{scope:{},components:{CustomFormBlockProvider:W}}};function ye(){const{name:o,title:n}=e.useCollection_deprecated(),r=b.useFieldSchema(),{t}=j.useTranslation(),{dn:i}=e.useDesignable();return s.jsxs(e.GeneralSchemaDesigner,{title:n||o,children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsActionModalItem,{title:t("Filter settings",{ns:y}),schema:{name:"filter",type:"object",title:'{{t("Filter")}}',"x-component":"Filter","x-component-props":{useProps(){var c;return{options:e.useCollectionFilterOptions((c=r==null?void 0:r["x-decorator-props"])==null?void 0:c.collection)}},dynamicComponent:"FilterDynamicComponent"}},initialValues:r==null?void 0:r["x-decorator-props"],onSubmit:({filter:a})=>{r["x-decorator-props"].filter=a,i.emit("patch",{schema:{"x-decorator-props":r["x-decorator-props"]}}),i.refresh()}}),s.jsx(e.SchemaSettingsLinkageRules,{collectionName:o}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const ge={title:`{{t("Update record form", { ns: "${y}" })}}`,config:{useInitializer({allCollections:o}){const n=h.useMemo(()=>o.map(({key:a,displayName:c,collections:u})=>({key:a,name:a,label:c,type:"subMenu",children:u.map(l=>({name:J.camelCase(`updateRecordForm-child-${l.name}`),type:"item",title:l.title||l.tableName,schema:{collection:l.name,dataSource:a,title:`{{t("Update record", { ns: "${y}" })}}`,formType:"update","x-designer":"UpdateFormDesigner"},Component:Z}))})),[o]),[r,t]=h.useState([]),i=e.useMenuSearch(n,r);return{name:"updateRecordForm",key:"updateRecordForm",type:"subMenu",title:`{{t("Update record form", { ns: "${y}" })}}`,componentProps:{onOpenChange(a){t(a)}},children:i}},initializers:{},components:{FilterDynamicComponent:d.FilterDynamicComponent,UpdateFormDesigner:ye},parseFormOptions(o){const n={};return M(o,t=>t["x-decorator"]==="FormBlockProvider"&&t["x-decorator-props"].formType==="update").forEach(t=>{var u,l;const[i]=Object.keys(t.properties),a=t.properties[i],c=((u=Object.entries(a.properties).find(([x,f])=>f["x-component"]==="ActionBar"))==null?void 0:u[0])||"actions";n[i]=k(g({},t["x-decorator-props"]),{type:"update",title:((l=t["x-component-props"])==null?void 0:l.title)||i,actions:M(a.properties[c],x=>x["x-component"]==="Action").map(x=>{var f,p;return{status:x["x-decorator-props"].value,values:(p=(f=x["x-action-settings"])==null?void 0:f.assignedValues)==null?void 0:p.values,key:x.name}})})}),n}},block:{scope:{},components:{}}},z=new T.Registry;z.register("customForm",oe),z.register("createForm",de),z.register("updateForm",ge);function be(){const{workflow:o}=d.useFlowContext(),n=d.useTrigger();return n.useInitializers?n.useInitializers(o.config):null}const Se={customForm:oe.title,record:`{{t("Data record", { ns: "${y}" })}}`};function ve(){var t,i;const o=b.useFieldSchema(),n=(i=Se[(t=o["x-designer-props"])==null?void 0:t.type])!=null?i:'{{t("Block")}}',r=e.useCompile();return s.jsxs(e.GeneralSchemaDesigner,{title:r(n),children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const Fe=new e.SchemaInitializer({name:"AddBlockButton",wrap:e.gridRowColWrap,title:'{{t("Add block")}}',items:[{type:"itemGroup",name:"dataBlocks",title:'{{t("Data blocks")}}',hideIfNoChildren:!0,useChildren(){const o=e.usePlugin(d),n=d.useNodeContext(),r=d.useAvailableUpstreams(n),t=[be()].filter(Boolean),i=r.map(c=>{var l;const u=o.instructions.get(c.type);return(l=u==null?void 0:u.useInitializers)==null?void 0:l.call(u,c)}).filter(Boolean);return[...t,...i.length?[{name:"nodes",type:"subMenu",title:`{{t("Node result", { ns: "${y}" })}}`,children:i}]:[]].filter(Boolean)}},{type:"itemGroup",name:"form",title:'{{t("Form")}}',useChildren(){const n=e.useDataSourceManager().getAllCollections();return Array.from(z.getValues()).map(r=>{const{useInitializer:t}=r.config;return t({allCollections:n})})}},{type:"itemGroup",name:"otherBlocks",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]});function ke(){var I,O,D;const o=h.useContext(e.SchemaComponentContext),{t:n}=j.useTranslation(),r=b.useFieldSchema(),t=d.useWorkflowVariableOptions(),[i,a]=h.useState(!1),[c,u]=h.useState((D=(O=(I=r==null?void 0:r["x-action-settings"])==null?void 0:I.assignedValues)==null?void 0:O.schema)!=null?D:{type:"void","x-component":"Grid","x-initializer":"CustomFormItemInitializers",properties:{}}),[l,x]=h.useState(null),{components:f}=e.useSchemaOptionsContext();h.useEffect(()=>{x(new b.Schema({properties:{grid:c}}))},[c]);const p=h.useMemo(()=>{var P,N;const B=(N=(P=r==null?void 0:r["x-action-settings"])==null?void 0:P.assignedValues)==null?void 0:N.values;return U.createForm({initialValues:T.lodash.cloneDeep(B),values:T.lodash.cloneDeep(B)})},[r]),m=e.useFormActiveFields(),v=n("Assign field values");function A(){a(!1)}function F(){r["x-action-settings"]||(r["x-action-settings"]={}),r["x-action-settings"].assignedValues||(r["x-action-settings"].assignedValues={}),r["x-action-settings"].assignedValues.schema=c,r["x-action-settings"].assignedValues.values=p.values,a(!1),setTimeout(()=>{var B;(B=o.refresh)==null||B.call(o)},300)}return s.jsxs(s.Fragment,{children:[s.jsx(e.SchemaSettingsItem,{title:v,onClick:()=>a(!0),children:v}),s.jsx(S.Modal,{width:"50%",title:v,open:i,onCancel:A,footer:s.jsxs(S.Space,{children:[s.jsx(S.Button,{onClick:A,children:n("Cancel")}),s.jsx(S.Button,{type:"primary",onClick:F,children:n("Submit")})]}),children:s.jsx(e.DefaultValueProvider,{isAllowToSetDefaultValue:()=>!1,children:s.jsx(e.VariableScopeProvider,{scope:t,children:s.jsx(e.FormActiveFieldsProvider,{name:"form",getActiveFieldsName:m==null?void 0:m.getActiveFieldsName,children:s.jsx(b.FormProvider,{form:p,children:s.jsxs(E.FormLayout,{layout:"vertical",children:[s.jsx(S.Alert,{message:w("Values preset in this form will override user submitted ones when continue or reject.")}),s.jsx("br",{}),i&&l&&s.jsx(e.SchemaComponentContext.Provider,{value:k(g({},o),{refresh(){u(T.lodash.get(l.toJSON(),"properties.grid"))}}),children:s.jsx(e.SchemaComponent,{schema:l,components:f})})]})})})})})})]})}function Ae(o){return s.jsxs(e.GeneralSchemaDesigner,k(g({},o),{disableInitializer:!0,children:[s.jsx(e.Action.Designer.ButtonEditor,{}),s.jsx(ke,{}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"ActionBar"}})]}))}function Ie(){const a=e.useSchemaInitializerItem(),{action:n,actionProps:r}=a,t=V(a,["action","actionProps"]),{insert:i}=e.useSchemaInitializer();return s.jsx(e.SchemaInitializerItem,k(g({},t),{onClick:()=>{i({type:"void",title:t.title,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:n},"x-component":"Action","x-component-props":k(g({},r),{useAction:"{{ useSubmit }}"}),"x-designer":"ManualActionDesigner","x-action-settings":{}})}}))}function te(){const o=e.useSchemaInitializerItem(),i=o,{action:n,actionProps:r}=i,t=V(i,["action","actionProps"]);return s.jsx(e.InitializerWithSwitch,k(g({},t),{item:o,schema:{type:"void",title:t.title,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:n},"x-component":"Action","x-component-props":k(g({},r),{useAction:"{{ useSubmit }}"}),"x-designer":"Action.Designer","x-action":`${n}`},type:"x-action"}))}const we=new e.SchemaInitializer({name:"AddActionButton",title:'{{t("Configure actions")}}',items:[{name:"jobStatusResolved",title:`{{t("Continue the process", { ns: "${y}" })}}`,Component:Ie,action:d.JOB_STATUS.RESOLVED,actionProps:{type:"primary"}},{name:"jobStatusRejected",title:`{{t("Terminate the process", { ns: "${y}" })}}`,Component:te,action:d.JOB_STATUS.REJECTED,actionProps:{danger:!0}},{name:"jobStatusPending",title:`{{t("Save temporarily", { ns: "${y}" })}}`,Component:te,action:d.JOB_STATUS.PENDING}]});function Be(){return{run(){}}}function Te({value:o,onChange:n}){const r=e.usePlugin(d),t=h.useContext(e.SchemaComponentContext),i=d.useNodeContext(),a=d.useAvailableUpstreams(i),c=b.useForm(),{workflow:u}=d.useFlowContext(),l={};a.forEach(p=>{const m=r.instructions.get(p.type);Object.assign(l,m.components)});const x=h.useMemo(()=>new b.Schema({properties:{drawer:{type:"void",title:`{{t("User interface", { ns: "${y}" })}}`,"x-decorator":"Form","x-component":"Action.Drawer","x-component-props":{className:e.css`
|
|
1
|
+
(function(C,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("react/jsx-runtime"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("react"),require("react-i18next"),require("@nocobase/utils/client"),require("lodash"),require("@ant-design/icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/plugin-workflow/client","react/jsx-runtime","@formily/antd-v5","@formily/core","@formily/react","antd","react","react-i18next","@nocobase/utils/client","lodash","@ant-design/icons","dayjs"],e):(C=typeof globalThis!="undefined"?globalThis:C||self,e(C["@nocobase/plugin-workflow-manual"]={},C["@nocobase/client"],C["@nocobase/plugin-workflow"],C.jsxRuntime,C["@formily/antd-v5"],C["@formily/core"],C["@formily/react"],C.antd,C.react,C["react-i18next"],C["@nocobase/utils"],C.lodash,C["@ant-design/icons"],C.dayjs))})(this,function(C,e,p,s,E,U,b,S,h,j,T,J,K,ue){"use strict";var to=Object.defineProperty,no=Object.defineProperties;var ro=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var H=(C,e,p)=>e in C?to(C,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):C[e]=p,y=(C,e)=>{for(var p in e||(e={}))pe.call(e,p)&&H(C,p,e[p]);if(Y)for(var p of Y(e))de.call(e,p)&&H(C,p,e[p]);return C},k=(C,e)=>no(C,ro(e));var V=(C,e)=>{var p={};for(var s in C)pe.call(C,s)&&e.indexOf(s)<0&&(p[s]=C[s]);if(C!=null&&Y)for(var s of Y(C))e.indexOf(s)<0&&de.call(C,s)&&(p[s]=C[s]);return p};var $=(C,e,p)=>(H(C,typeof e!="symbol"?e+"":e,p),p);var _=(C,e,p)=>new Promise((s,E)=>{var U=h=>{try{S(p.next(h))}catch(j){E(j)}},b=h=>{try{S(p.throw(h))}catch(j){E(j)}},S=h=>h.done?s(h.value):Promise.resolve(h.value).then(U,b);S((p=p.apply(C,e)).next())});const g="workflow-manual";function A(o,n={}){const{t:r}=me(n);return r(o)}function me(o){return j.useTranslation(g,o)}function fe(o){const{execution:n,nodes:r}=p.useFlowContext(),t=h.useMemo(()=>r.reduce((c,u)=>Object.assign(c,{[u.id]:u.key}),{}),[r]),i=h.useMemo(()=>{var c;return{$context:n==null?void 0:n.context,$jobsMapByNodeKey:((c=n==null?void 0:n.jobs)!=null?c:[]).reduce((u,l)=>Object.assign(u,{[t[l.nodeId]]:l.result}),{})}},[n==null?void 0:n.context,n==null?void 0:n.jobs,t]);return h.useMemo(()=>T.parse(o)(i),[i,o])}function X(o){const n=b.useField(),r=h.useRef(null),{getAssociationAppends:t}=e.useAssociationNames(),{appends:i,updateAssociationValues:a}=t(),c=fe(o.dataSource),u=h.useMemo(()=>U.createForm({values:c,readPretty:!0}),[c]),l={appends:i},x={loading:!1,data:{data:c}},d=e.useAPIClient().resource(o.collection),m=e.useBlockRequestContext();return s.jsx(e.CollectionProvider_deprecated,{collection:o.collection,children:s.jsx(e.RecordProvider,{record:c,parent:null,children:s.jsx(e.BlockRequestContext_deprecated.Provider,{value:{block:"form",field:n,service:x,resource:d,__parent:m},children:s.jsx(e.FormBlockContext.Provider,{value:{params:l,form:u,field:n,service:x,updateAssociationValues:a,formBlockRef:r},children:o.children})})})})}function Z(o){var N,q,G;const n=e.useRecord(),r=b.useFieldSchema(),t=b.useField(),i=h.useRef(null),a=o.dataSource||e.DEFAULT_DATA_SOURCE_KEY,{getAssociationAppends:c}=e.useAssociationNames(a),{appends:u,updateAssociationValues:l}=c(),[x]=Object.keys((N=r.toJSON().properties)!=null?N:{}),f=(q=n==null?void 0:n.result)==null?void 0:q[x],{findComponent:d}=e.useDesignable(),m=d((G=t.component)==null?void 0:G[0])||h.Fragment,v=h.useMemo(()=>U.createForm({initialValues:f}),[f]),w=h.useMemo(()=>y({appends:u},o.params),[u,o.params]),F=h.useMemo(()=>({loading:!1,data:{data:f}}),[f]),I=e.useAPIClient(),z=e.useDataSourceHeaders(a),O=I.resource(o.collection,void 0,z),B=e.useBlockRequestContext(),P=h.useMemo(()=>({params:w,form:v,field:t,service:F,updateAssociationValues:l,formBlockRef:i}),[t,v,w,F,l]);return!n.status||f?s.jsx(e.CollectionManagerProvider,{dataSource:a,children:s.jsx(e.CollectionProvider_deprecated,{collection:o.collection,children:s.jsx(e.RecordProvider,{record:f,parent:null,children:s.jsx(e.FormActiveFieldsProvider,{name:"form",children:s.jsx(e.BlockRequestContext_deprecated.Provider,{value:{block:"form",props:o,field:t,service:F,resource:O,__parent:B},children:s.jsx(e.FormBlockContext.Provider,{value:P,children:s.jsxs(m,k(y({},t.componentProps),{children:[s.jsx(e.FormV2.Templates,{style:{marginBottom:18},form:v}),s.jsx("div",{ref:i,children:s.jsx(b.RecursionField,{schema:r,onlyRenderProperties:!0})})]}))})})})})})}):null}function he(r){var t=r,{schema:o}=t,n=V(t,["schema"]);const{getTemplateSchemaByMode:i}=e.useSchemaTemplateManager(),{insert:a}=e.useSchemaInitializer(),c=e.useRecordCollectionDataSourceItems("FormItem");function u(x){return _(this,arguments,function*({item:l}){var w;const f=l.template?yield i(l):null,d=e.createFormBlockSchema(k(y({actionInitializers:"workflowManual:form:configureActions",actions:{resolve:{type:"void",title:`{{t("Continue the process", { ns: "${g}" })}}`,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:p.JOB_STATUS.RESOLVED},"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useSubmit }}"},"x-designer":"ManualActionDesigner","x-designer-props":{}}}},o),{template:f}));delete d["x-acl-action-props"],delete d["x-acl-action"];const[m]=Object.keys(d.properties),v=((w=Object.entries(d.properties[m].properties).find(([F,I])=>I["x-component"]==="ActionBar"))==null?void 0:w[0])||"actions";d.properties[m].properties[v]["x-decorator"]="ActionBarProvider",d.properties[m].properties[v]["x-component-props"].style={marginTop:"1.5em",flexWrap:"wrap"},p.traverseSchema(d,F=>{F["x-uid"]&&delete F["x-uid"]}),a(d)})}return s.jsx(e.SchemaInitializerItem,k(y({},n),{onClick:u,items:c}))}function W(){var n,r;const o=e.useSchemaInitializerItem();return s.jsx(e.CollectionProvider_deprecated,{dataSource:(n=o.schema)==null?void 0:n.dataSource,collection:(r=o.schema)==null?void 0:r.collection,children:s.jsx(he,y({},o))})}function D(o,n,r=!1){const t=[];return o?n(o)&&(!r||!o.properties)?(t.push(o),t):(o.properties&&Object.keys(o.properties).forEach(i=>{t.push(...D(o.properties[i],n))}),t):t}function xe(){const{name:o,title:n}=e.useCollection_deprecated();return s.jsxs(e.GeneralSchemaDesigner,{title:n||o,children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsLinkageRules,{collectionName:o}),s.jsx(e.SchemaSettingsDataTemplates,{collectionName:o}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const Ce={title:`{{t("Create record form", { ns: "${g}" })}}`,config:{useInitializer({allCollections:o}){const n=h.useMemo(()=>o.map(({key:a,displayName:c,collections:u})=>({key:a,name:a,label:c,type:"subMenu",children:u.map(l=>({name:J.camelCase(`createRecordForm-child-${l.name}`),type:"item",title:l.title||l.tableName,schema:{collection:l.name,dataSource:a,title:`{{t("Create record", { ns: "${g}" })}}`,formType:"create","x-designer":"CreateFormDesigner"},Component:W}))})),[o]),[r,t]=h.useState([]),i=e.useMenuSearch({data:n,openKeys:r});return{name:"createRecordForm",key:"createRecordForm",type:"subMenu",title:`{{t("Create record form", { ns: "${g}" })}}`,componentProps:{onOpenChange(a){t(a)}},children:i}},initializers:{},components:{CreateFormDesigner:xe},parseFormOptions(o){const n={};return D(o,t=>t["x-decorator"]==="FormBlockProvider"&&t["x-decorator-props"].formType==="create").forEach(t=>{var u,l;const[i]=Object.keys(t.properties),a=t.properties[i],c=((u=Object.entries(a.properties).find(([x,f])=>f["x-component"]==="ActionBar"))==null?void 0:u[0])||"actions";n[i]={type:"create",title:((l=t["x-component-props"])==null?void 0:l.title)||i,actions:D(a.properties[c],x=>x["x-component"]==="Action").map(x=>{var f,d;return{status:x["x-decorator-props"].value,values:(d=(f=x["x-action-settings"])==null?void 0:f.assignedValues)==null?void 0:d.values,key:x.name}}),collection:t["x-decorator-props"].collection}}),n}},block:{scope:{},components:{}}};function R(o){var x,f,d,m;const[n,r]=h.useState((f=(x=o.collection)==null?void 0:x.fields)!=null?f:[]),t=e.useRecord(),i=b.useField(),a=b.useFieldSchema(),[c]=Object.keys((d=a.toJSON().properties)!=null?d:{}),u=(m=t==null?void 0:t.result)==null?void 0:m[c],l=h.useMemo(()=>U.createForm({initialValues:u}),[u]);return!t.status||u?s.jsx(e.CollectionProvider_deprecated,{collection:k(y({},o.collection),{fields:n}),children:s.jsx(e.RecordProvider,{record:u,parent:null,children:s.jsx(e.FormBlockContext.Provider,{value:{form:l,field:i,setCollectionFields:r},children:o.children})})}):null}function ge(){const{insert:o}=e.useSchemaInitializer(),n=e.useSchemaInitializerItem();return s.jsx(e.SchemaInitializerItem,k(y({},n),{onClick:()=>{o({type:"void","x-decorator":"CustomFormBlockProvider","x-decorator-props":{collection:{name:T.uid(),fields:[]}},"x-component":"CardItem","x-component-props":{title:'{{t("Form")}}'},"x-designer":"SimpleDesigner","x-designer-props":{type:"customForm"},properties:{[T.uid()]:{type:"void","x-component":"FormV2","x-component-props":{useProps:"{{ useFormBlockProps }}"},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"workflowManual:customForm:configureFields"},actions:{type:"void","x-decorator":"ActionBarProvider","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:"1.5em",flexWrap:"wrap"}},"x-initializer":"workflowManual:form:configureActions",properties:{resolve:{type:"void",title:`{{t("Continue the process", { ns: "${g}" })}}`,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:p.JOB_STATUS.RESOLVED},"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useSubmit }}"},"x-designer":"ManualActionDesigner"}}}}}}})}}))}const ee={basic:'{{t("Basic")}}',choices:'{{t("Choices")}}',media:'{{t("Media")}}',datetime:'{{t("Date & Time")}}',relation:'{{t("Relation")}}',advanced:'{{t("Advanced type")}}',systemInfo:'{{t("System info")}}',others:'{{t("Others")}}'};function ye(o){const n={};return Object.keys(o).forEach(r=>{const t=o[r],{group:i="others"}=t;n[i]=n[i]||{},J.set(n,[i,r],t)}),Object.keys(ee).filter(r=>["basic","choices","datetime","media"].includes(r)).map(r=>({title:ee[r],children:Object.keys(n[r]||{}).map(t=>{const i=n[r][t];return y({value:t,title:i.title,name:t},n[r][t])}).sort((t,i)=>t.order-i.order)}))}function be(){const{interfaces:o}=e.useCollectionManager_deprecated();return ye(o).map(r=>({name:r.title,type:"itemGroup",title:r.title,children:r.children.map(t=>({name:t.name,type:"item",title:t.title,Component:ve,fieldInterface:t.name}))}))}const oe=h.createContext({}),te=o=>{const[n,r]=h.useState(null),[t,i]=h.useState(),a=be(),c=e.useCollection_deprecated(),{setCollectionFields:u}=h.useContext(e.FormBlockContext);return s.jsxs(oe.Provider,{value:{onAddField(l){const v=J.cloneDeep(l),{properties:w}=v,F=w,{unique:x,type:f}=F,d=V(F,["unique","type"]),m=V(v,["properties"]);delete d.name["x-disabled"],r(k(y({},m),{properties:d}))},setCallback:i},children:[s.jsx(e.SchemaInitializerItems,k(y({},o),{items:a})),s.jsx(e.ActionContextProvider,{value:{visible:!!n},children:n?s.jsx(e.SchemaComponent,{schema:{type:"void",name:"drawer",title:'{{t("Configure field")}}',"x-decorator":"Form","x-component":"Action.Drawer",properties:k(y({},n.properties),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction(){const l=b.useForm();return{run(){return _(this,null,function*(){i(null),r(null),l.reset()})}}}}},submit:{type:"void",title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction(){const{values:l,query:x}=b.useForm(),f=[A("Field name existed in form")];return{run(){return _(this,null,function*(){var I,z,O,B;const{default:m}=n,v=T.uid();if(m.name=(I=l.name)!=null?I:v,m.uiSchema.title=(O=(z=l.uiSchema)==null?void 0:z.title)!=null?O:v,m.interface=n.name,(B=c.fields)==null?void 0:B.find(P=>P.name===m.name)){x("name").take().setFeedback({type:"error",messages:f});return}const F=T.merge(m,l);u([...c.fields,F]),t({name:m.name,type:m.uiSchema.type,"x-decorator":"FormItem","x-component":"CollectionField","x-component-props":{field:F},"x-collection-field":`${c.name}.${m.name}`,"x-toolbar":"FormItemSchemaToolbar","x-settings":"fieldSettings:FormItem"}),i(null),r(null)})}}}}}}}})},components:{ArrayTable:E.ArrayTable}}):null})]})},ne=new e.CompatibleSchemaInitializer({name:"AddCustomFormField",wrap:e.gridRowColWrap,insertPosition:"beforeEnd",title:"{{t('Configure fields')}}",ItemsComponent:te}),Se=new e.CompatibleSchemaInitializer({name:"workflowManual:customForm:configureFields",wrap:e.gridRowColWrap,insertPosition:"beforeEnd",title:"{{t('Configure fields')}}",ItemsComponent:te},ne);function ve(){const o=e.useSchemaInitializerItem(),{insert:n,setVisible:r}=e.useSchemaInitializer(),{onAddField:t,setCallback:i}=h.useContext(oe),{getInterface:a}=e.useCollectionManager_deprecated(),c=a(o.fieldInterface);return s.jsx(e.SchemaInitializerItem,y({onClick:()=>{i(()=>n),t(c),r(!1)}},o),o.fieldInterface)}const re={title:`{{t("Custom form", { ns: "${g}" })}}`,config:{useInitializer(){return{name:"customForm",type:"item",title:`{{t("Custom form", { ns: "${g}" })}}`,Component:ge}},initializers:{},components:{CustomFormBlockProvider:R},parseFormOptions(o){const n={};return D(o,t=>t["x-decorator"]==="CustomFormBlockProvider").forEach(t=>{var l,x;const[i]=Object.keys(t.properties),a=t.properties[i],c=D(a.properties.grid,f=>f["x-component"]==="CollectionField",!0);t["x-decorator-props"].collection.fields=c.map(f=>{var d,m;return(m=(d=f["x-component-props"])==null?void 0:d.field)!=null?m:f["x-interface-options"]});const u=((l=Object.entries(a.properties).find(([f,d])=>d["x-component"]==="ActionBar"))==null?void 0:l[0])||"actions";n[i]={type:"custom",title:((x=t["x-component-props"])==null?void 0:x.title)||i,actions:D(a.properties[u],f=>f["x-component"]==="Action").map(f=>{var d,m;return{status:f["x-decorator-props"].value,values:(m=(d=f["x-action-settings"])==null?void 0:d.assignedValues)==null?void 0:m.values,key:f.name}}),collection:t["x-decorator-props"].collection}}),n}},block:{scope:{},components:{CustomFormBlockProvider:R}}};function Fe(){const{name:o,title:n}=e.useCollection_deprecated(),r=b.useFieldSchema(),{t}=j.useTranslation(),{dn:i}=e.useDesignable();return s.jsxs(e.GeneralSchemaDesigner,{title:n||o,children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsActionModalItem,{title:t("Filter settings",{ns:g}),schema:{name:"filter",type:"object",title:'{{t("Filter")}}',"x-component":"Filter","x-component-props":{useProps(){var c;return{options:e.useCollectionFilterOptions((c=r==null?void 0:r["x-decorator-props"])==null?void 0:c.collection)}},dynamicComponent:"FilterDynamicComponent"}},initialValues:r==null?void 0:r["x-decorator-props"],onSubmit:({filter:a})=>{r["x-decorator-props"].filter=a,i.emit("patch",{schema:{"x-decorator-props":r["x-decorator-props"]}}),i.refresh()}}),s.jsx(e.SchemaSettingsLinkageRules,{collectionName:o}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const ke={title:`{{t("Update record form", { ns: "${g}" })}}`,config:{useInitializer({allCollections:o}){const n=h.useMemo(()=>o.map(({key:a,displayName:c,collections:u})=>({key:a,name:a,label:c,type:"subMenu",children:u.map(l=>({name:J.camelCase(`updateRecordForm-child-${l.name}`),type:"item",title:l.title||l.tableName,schema:{collection:l.name,dataSource:a,title:`{{t("Update record", { ns: "${g}" })}}`,formType:"update","x-designer":"UpdateFormDesigner"},Component:W}))})),[o]),[r,t]=h.useState([]),i=e.useMenuSearch({data:n,openKeys:r});return{name:"updateRecordForm",key:"updateRecordForm",type:"subMenu",title:`{{t("Update record form", { ns: "${g}" })}}`,componentProps:{onOpenChange(a){t(a)}},children:i}},initializers:{},components:{FilterDynamicComponent:p.FilterDynamicComponent,UpdateFormDesigner:Fe},parseFormOptions(o){const n={};return D(o,t=>t["x-decorator"]==="FormBlockProvider"&&t["x-decorator-props"].formType==="update").forEach(t=>{var u,l;const[i]=Object.keys(t.properties),a=t.properties[i],c=((u=Object.entries(a.properties).find(([x,f])=>f["x-component"]==="ActionBar"))==null?void 0:u[0])||"actions";n[i]=k(y({},t["x-decorator-props"]),{type:"update",title:((l=t["x-component-props"])==null?void 0:l.title)||i,actions:D(a.properties[c],x=>x["x-component"]==="Action").map(x=>{var f,d;return{status:x["x-decorator-props"].value,values:(d=(f=x["x-action-settings"])==null?void 0:f.assignedValues)==null?void 0:d.values,key:x.name}})})}),n}},block:{scope:{},components:{}}},M=new T.Registry;M.register("customForm",re),M.register("createForm",Ce),M.register("updateForm",ke);function se(){const{workflow:o}=p.useFlowContext(),n=p.useTrigger();return n.useInitializers?n.useInitializers(o.config):null}const we={customForm:re.title,record:`{{t("Data record", { ns: "${g}" })}}`};function Ie(){var t,i;const o=b.useFieldSchema(),n=(i=we[(t=o["x-designer-props"])==null?void 0:t.type])!=null?i:'{{t("Block")}}',r=e.useCompile();return s.jsxs(e.GeneralSchemaDesigner,{title:r(n),children:[s.jsx(e.SchemaSettingsBlockTitleItem,{}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})}const ie=new e.CompatibleSchemaInitializer({name:"AddBlockButton",wrap:e.gridRowColWrap,title:'{{t("Add block")}}',items:[{type:"itemGroup",name:"dataBlocks",title:'{{t("Data blocks")}}',hideIfNoChildren:!0,useChildren(){const o=e.usePlugin(p),n=p.useNodeContext(),r=p.useAvailableUpstreams(n),t=[se()].filter(Boolean),i=r.map(c=>{var l;const u=o.instructions.get(c.type);return(l=u==null?void 0:u.useInitializers)==null?void 0:l.call(u,c)}).filter(Boolean);return[...t,...i.length?[{name:"nodes",type:"subMenu",title:`{{t("Node result", { ns: "${g}" })}}`,children:i}]:[]].filter(Boolean)}},{type:"itemGroup",name:"form",title:'{{t("Form")}}',useChildren(){const n=e.useDataSourceManager().getAllCollections();return Array.from(M.getValues()).map(r=>{const{useInitializer:t}=r.config;return t({allCollections:n})})}},{type:"itemGroup",name:"otherBlocks",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]}),Ae=new e.CompatibleSchemaInitializer({name:"workflowManual:popup:configureUserInterface:addBlock",wrap:e.gridRowColWrap,title:'{{t("Add block")}}',items:[{type:"itemGroup",name:"dataBlocks",title:'{{t("Data blocks")}}',hideIfNoChildren:!0,useChildren(){const o=e.usePlugin(p),n=p.useNodeContext(),r=p.useAvailableUpstreams(n),t=[se()].filter(Boolean),i=r.map(c=>{var l;const u=o.instructions.get(c.type);return(l=u==null?void 0:u.useInitializers)==null?void 0:l.call(u,c)}).filter(Boolean);return[...t,...i.length?[{name:"nodes",type:"subMenu",title:`{{t("Node result", { ns: "${g}" })}}`,children:i}]:[]].filter(Boolean)}},{type:"itemGroup",name:"form",title:'{{t("Form")}}',useChildren(){const n=e.useDataSourceManager().getAllCollections();return Array.from(M.getValues()).map(r=>{const{useInitializer:t}=r.config;return t({allCollections:n})})}},{type:"itemGroup",name:"otherBlocks",title:'{{t("Other blocks")}}',children:[{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"}]}]},ie);function Be(){var I,z,O;const o=h.useContext(e.SchemaComponentContext),{t:n}=j.useTranslation(),r=b.useFieldSchema(),t=p.useWorkflowVariableOptions(),[i,a]=h.useState(!1),[c,u]=h.useState((O=(z=(I=r==null?void 0:r["x-action-settings"])==null?void 0:I.assignedValues)==null?void 0:z.schema)!=null?O:{type:"void","x-component":"Grid","x-initializer":"assignFieldValuesForm:configureFields",properties:{}}),[l,x]=h.useState(null),{components:f}=e.useSchemaOptionsContext();h.useEffect(()=>{x(new b.Schema({properties:{grid:c}}))},[c]);const d=h.useMemo(()=>{var P,N;const B=(N=(P=r==null?void 0:r["x-action-settings"])==null?void 0:P.assignedValues)==null?void 0:N.values;return U.createForm({initialValues:T.lodash.cloneDeep(B),values:T.lodash.cloneDeep(B)})},[r]),m=e.useFormActiveFields(),v=n("Assign field values");function w(){a(!1)}function F(){r["x-action-settings"]||(r["x-action-settings"]={}),r["x-action-settings"].assignedValues||(r["x-action-settings"].assignedValues={}),r["x-action-settings"].assignedValues.schema=c,r["x-action-settings"].assignedValues.values=d.values,a(!1),setTimeout(()=>{var B;(B=o.refresh)==null||B.call(o)},300)}return s.jsxs(s.Fragment,{children:[s.jsx(e.SchemaSettingsItem,{title:v,onClick:()=>a(!0),children:v}),s.jsx(S.Modal,{width:"50%",title:v,open:i,onCancel:w,footer:s.jsxs(S.Space,{children:[s.jsx(S.Button,{onClick:w,children:n("Cancel")}),s.jsx(S.Button,{type:"primary",onClick:F,children:n("Submit")})]}),children:s.jsx(e.DefaultValueProvider,{isAllowToSetDefaultValue:()=>!1,children:s.jsx(e.VariableScopeProvider,{scope:t,children:s.jsx(e.FormActiveFieldsProvider,{name:"form",getActiveFieldsName:m==null?void 0:m.getActiveFieldsName,children:s.jsx(b.FormProvider,{form:d,children:s.jsxs(E.FormLayout,{layout:"vertical",children:[s.jsx(S.Alert,{message:A("Values preset in this form will override user submitted ones when continue or reject.")}),s.jsx("br",{}),i&&l&&s.jsx(e.SchemaComponentContext.Provider,{value:k(y({},o),{refresh(){u(T.lodash.get(l.toJSON(),"properties.grid"))}}),children:s.jsx(e.SchemaComponent,{schema:l,components:f})})]})})})})})})]})}function Te(o){return s.jsxs(e.GeneralSchemaDesigner,k(y({},o),{disableInitializer:!0,children:[s.jsx(e.Action.Designer.ButtonEditor,{}),s.jsx(Be,{}),s.jsx(e.SchemaSettingsDivider,{}),s.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"ActionBar"}})]}))}function ae(){const a=e.useSchemaInitializerItem(),{action:n,actionProps:r}=a,t=V(a,["action","actionProps"]),{insert:i}=e.useSchemaInitializer();return s.jsx(e.SchemaInitializerItem,k(y({},t),{onClick:()=>{i({type:"void",title:t.title,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:n},"x-component":"Action","x-component-props":k(y({},r),{useAction:"{{ useSubmit }}"}),"x-designer":"ManualActionDesigner","x-action-settings":{}})}}))}function L(){const o=e.useSchemaInitializerItem(),i=o,{action:n,actionProps:r}=i,t=V(i,["action","actionProps"]);return s.jsx(e.InitializerWithSwitch,k(y({},t),{item:o,schema:{type:"void",title:t.title,"x-decorator":"ManualActionStatusProvider","x-decorator-props":{value:n},"x-component":"Action","x-component-props":k(y({},r),{useAction:"{{ useSubmit }}"}),"x-designer":"Action.Designer","x-action":`${n}`},type:"x-action"}))}const ce=new e.CompatibleSchemaInitializer({name:"AddActionButton",title:'{{t("Configure actions")}}',items:[{name:"jobStatusResolved",title:`{{t("Continue the process", { ns: "${g}" })}}`,Component:ae,action:p.JOB_STATUS.RESOLVED,actionProps:{type:"primary"}},{name:"jobStatusRejected",title:`{{t("Terminate the process", { ns: "${g}" })}}`,Component:L,action:p.JOB_STATUS.REJECTED,actionProps:{danger:!0}},{name:"jobStatusPending",title:`{{t("Save temporarily", { ns: "${g}" })}}`,Component:L,action:p.JOB_STATUS.PENDING}]}),Me=new e.CompatibleSchemaInitializer({name:"workflowManual:form:configureActions",title:'{{t("Configure actions")}}',items:[{name:"jobStatusResolved",title:`{{t("Continue the process", { ns: "${g}" })}}`,Component:ae,action:p.JOB_STATUS.RESOLVED,actionProps:{type:"primary"}},{name:"jobStatusRejected",title:`{{t("Terminate the process", { ns: "${g}" })}}`,Component:L,action:p.JOB_STATUS.REJECTED,actionProps:{danger:!0}},{name:"jobStatusPending",title:`{{t("Save temporarily", { ns: "${g}" })}}`,Component:L,action:p.JOB_STATUS.PENDING}]},ce);function ze(){return{run(){}}}function Oe({value:o,onChange:n}){const r=e.usePlugin(p),t=h.useContext(e.SchemaComponentContext),i=p.useNodeContext(),a=p.useAvailableUpstreams(i),c=b.useForm(),{workflow:u}=p.useFlowContext(),l={};a.forEach(d=>{const m=r.instructions.get(d.type);Object.assign(l,m.components)});const x=h.useMemo(()=>new b.Schema({properties:{drawer:{type:"void",title:`{{t("User interface", { ns: "${g}" })}}`,"x-decorator":"Form","x-component":"Action.Drawer","x-component-props":{className:e.css`
|
|
2
2
|
.ant-drawer-body {
|
|
3
3
|
background: var(--nb-box-bg);
|
|
4
4
|
}
|
|
5
|
-
`},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers","x-initializer-props":{gridInitializer:"
|
|
5
|
+
`},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers","x-initializer-props":{gridInitializer:"workflowManual:popup:configureUserInterface:addBlock"},properties:o!=null?o:{tab1:{type:"void",title:`{{t("Manual", { ns: "${g}" })}}`,"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer",properties:{grid:{type:"void","x-component":"Grid","x-initializer":"workflowManual:popup:configureUserInterface:addBlock",properties:{}}}}}}}}}}),[]),f=h.useCallback(function(){const{tabs:m}=T.lodash.get(x.toJSON(),"properties.drawer.properties"),v=Array.from(M.getValues()).reduce((w,F)=>Object.assign(w,F.config.parseFormOptions(m)),{});c.setValuesIn("forms",v),n(m.properties)},[c,n,x]);return s.jsx(e.SchemaComponentContext.Provider,{value:k(y({},t),{designable:!u.executed,refresh:f}),children:s.jsx(e.SchemaComponent,{schema:x,components:k(y(y({},l),Array.from(M.getValues()).reduce((d,m)=>Object.assign(d,m.config.components),{})),{FormBlockProvider:Z,DetailsBlockProvider:X,ManualActionStatusProvider(d){return d.children},ActionBarProvider(d){return d.children},SimpleDesigner:Ie,ManualActionDesigner:Te}),scope:{useSubmit:ze,useDetailsBlockProps:e.useFormBlockContext}})})}function De(o){const{workflow:n}=p.useFlowContext(),[r,t]=h.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsx(S.Button,{type:"primary",onClick:()=>t(!0),disabled:!1,children:A(n.executed?"View user interface":"Configure user interface")}),s.jsx(e.ActionContextProvider,{value:{visible:r,setVisible:t,formValueChanged:!1},children:o.children})]})}function Pe({value:o,onChange:n}){const r=s.jsx("fieldset",{children:s.jsx(E.FormLayout,{layout:"vertical",children:s.jsx(e.FormItem,{label:A("Negotiation"),children:s.jsxs(S.Radio.Group,{value:o,onChange:n,children:[s.jsx(S.Radio,{value:1,children:s.jsxs(S.Tooltip,{title:A("Everyone should pass"),placement:"bottom",children:[s.jsx("span",{children:A("All pass")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})}),s.jsx(S.Radio,{value:-1,children:s.jsxs(S.Tooltip,{title:A("Anyone pass"),placement:"bottom",children:[s.jsx("span",{children:A("Any pass")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})})]})})})});return s.jsxs("fieldset",{className:e.css`
|
|
6
6
|
.ant-radio-group {
|
|
7
7
|
.anticon {
|
|
8
8
|
margin-left: 0.5em;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,children:[s.jsx(S.Form.Item,{children:s.jsxs(S.Radio.Group,{value:!!o,onChange:({target:{value:t}})=>{console.log(t),n(Number(t))},children:[s.jsx(S.Radio,{value:!0,children:s.jsxs(S.Tooltip,{title:w("Each user has own task"),placement:"bottom",children:[s.jsx("span",{children:w("Separately")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})}),s.jsx(S.Radio,{value:!1,children:s.jsxs(S.Tooltip,{title:w("Everyone shares one task"),placement:"bottom",children:[s.jsx("span",{children:w("Collaboratively")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})})]})}),o?r:null]})}function Me(o){return o.isForeignKey?o.target==="users":o.collectionName==="users"&&o.name==="id"}function ze({multiple:o=!1,value:n=[],onChange:r}){const t=d.useWorkflowVariableOptions({types:[Me]});return s.jsx(e.Variable.Input,{scope:t,value:n[0],onChange:i=>{r([i])},children:s.jsx(e.RemoteSelect,{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"},manual:!1,value:n[0],onChange:i=>{r(i!=null?[i]:[])}})})}class Pe extends d.Instruction{constructor(){super(...arguments);$(this,"title",`{{t("Manual", { ns: "${y}" })}}`);$(this,"type","manual");$(this,"group","manual");$(this,"description",`{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${y}" })}}`);$(this,"fieldset",{assignees:{type:"array",title:`{{t("Assignees", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"AssigneesSelect","x-component-props":{},required:!0,default:[]},mode:{type:"number",title:`{{t("Mode", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"ModeConfig",default:1,"x-reactions":{dependencies:["assignees"],fulfill:{state:{visible:"{{$deps[0].length > 1}}"}}}},schema:{type:"void",title:`{{t("User interface", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"SchemaConfigButton",properties:{schema:{type:"object","x-component":"SchemaConfig",default:null}}},forms:{type:"object",default:{}}});$(this,"components",{SchemaConfigButton:Oe,SchemaConfig:Te,ModeConfig:De,AssigneesSelect:ze})}useVariables({key:r,title:t,config:i},{types:a,fieldNames:c=d.defaultFieldNames}){var p;const u=e.useCompile(),{getCollectionFields:l}=e.useCollectionManager_deprecated(),x=Object.keys((p=i.forms)!=null?p:{});if(!x.length)return null;const f=x.map(m=>{var I;const v=i.forms[m],A=d.getCollectionFieldOptions({fields:(I=v.collection)==null?void 0:I.fields,collection:v.collection,types:a,compile:u,getCollectionFields:l}),F=u(v.title)||m;return A.length?{key:m,value:m,label:F,title:F,children:A}:null}).filter(Boolean);return f.length?{[c.value]:r,[c.label]:t,[c.children]:f}:null}useInitializers(r){var c;const{getCollection:t}=e.useCollectionManager_deprecated(),i=Object.keys((c=r.config.forms)!=null?c:{});if(!i.length||r.config.mode)return null;const a=i.map(u=>{var f,p;const l=r.config.forms[u],{fields:x=[]}=t(l.collection);return x.length?{name:(f=l.title)!=null?f:u,type:"item",title:(p=l.title)!=null?p:u,Component:d.CollectionBlockInitializer,collection:l.collection,dataSource:`{{$jobsMapByNodeKey.${r.key}.${u}}}`}:null}).filter(Boolean);return a.length?{name:`#${r.id}`,key:"forms",type:"subMenu",title:r.title,children:a}:null}isAvailable({engine:r,workflow:t,upstream:i,branchIndex:a}){return!r.isWorkflowSync(t)}}const Ve={title:`{{t("Task", { ns: "${y}" })}}`,name:"flow_nodes",fields:[{type:"bigInt",name:"id",interface:"m2o",uiSchema:{type:"number",title:"ID","x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes",params:{filter:{type:"manual"}}}}}},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}}]},je={title:`{{t("Workflow", { ns: "${y}" })}}`,name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}}]},Ne={title:`{{t("Workflow todos", { ns: "${y}" })}}`,name:"users_jobs",fields:[{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",interface:"m2o",uiSchema:{type:"number",title:'{{t("User")}}',"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"belongsTo",name:"node",target:"flow_nodes",foreignKey:"nodeId",interface:"m2o",isAssociation:!0,uiSchema:{type:"number",title:`{{t("Task", { ns: "${y}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes"}}}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"number",title:`{{t("Workflow", { ns: "${y}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"workflows"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:`{{t("Status", { ns: "${y}" })}}`,"x-component":"Select",enum:d.JobStatusOptions}},{name:"createdAt",type:"date",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},$e=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.title)!=null?t:`#${(r=o.value)==null?void 0:r.id}`},{displayName:"NodeColumn"}),_e=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.title)!=null?t:`#${(r=o.value)==null?void 0:r.id}`},{displayName:"WorkflowColumn"}),Ee=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.nickname)!=null?t:(r=o.value)==null?void 0:r.id},{displayName:"UserColumn"});function Ue(o){const n=e.useRecord(),r=w("Unprocessed");return n.execution.status&&!n.status?s.jsx(S.Tag,{children:r}):o.children}const Y=()=>s.jsx(e.SchemaComponent,{components:{NodeColumn:$e,WorkflowColumn:_e,UserColumn:Ee,UserJobStatusColumn:Ue},schema:{type:"void",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-designer":"Filter.Action.Designer","x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined",useProps:"{{ useFilterActionProps }}"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:refresh","x-component-props":{icon:"ReloadOutlined",useProps:"{{ useRefreshActionProps }}"},"x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-component-props":{rowKey:"id",useProps:"{{ useTableBlockProps }}"},properties:{actions:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:60},title:'{{t("Actions")}}',properties:{view:{type:"void","x-component":"Action.Link",title:'{{t("View")}}',properties:{drawer:{"x-component":"WorkflowTodo.Drawer"}}}}},node:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:`{{t("Task node", { ns: "${y}" })}}`,properties:{node:{"x-component":"NodeColumn","x-read-pretty":!0}}},workflow:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:'{{t("Workflow", { ns: "workflow" })}}',properties:{workflow:{"x-component":"WorkflowColumn","x-read-pretty":!0}}},status:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100},title:'{{t("Status", { ns: "workflow" })}}',properties:{status:{type:"number","x-decorator":"UserJobStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},user:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:140},title:`{{t("Assignee", { ns: "${y}" })}}`,properties:{user:{"x-component":"UserColumn","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:160},properties:{createdAt:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}}}}}}});function Ke(o){var x;const{data:n}=e.useCurrentUserContext(),{userJob:r}=d.useFlowContext(),{status:t,result:i,userId:a}=r,c=b.useFieldSchema(),{name:u}=c.parent.toJSON();let{children:l}=o;return t?i[u]||(l=null):((x=n==null?void 0:n.data)==null?void 0:x.id)!==a&&(l=null),l}const ne=h.createContext(null);ne.displayName="ManualActionStatusContext";function qe({value:o,children:n}){const{userJob:r,execution:t}=d.useFlowContext(),i=b.useField(),a=b.useFieldSchema();return h.useEffect(()=>{(t.status||r.status)&&(i.disabled=!0,i.visible=r.status===o&&r.result._===a.name)},[t,r,o,i,a.name]),s.jsx(ne.Provider,{value:o,children:n})}function Ge(){const o=e.useAPIClient(),{setVisible:n}=e.useActionContext(),{values:r,submit:t}=b.useForm(),i=b.useFieldSchema(),{service:a}=e.useTableBlockContext(),{userJob:c,execution:u}=d.useFlowContext(),{name:l}=i,{name:x}=i.parent.parent;return{run(){return _(this,null,function*(){u.status||c.status||(yield t(),yield o.resource("users_jobs").submit({filterByTk:c.id,values:{result:{[x]:r,_:l}}}),n(!1),a.refresh())})}}}function Je(o){var f;const n=e.usePlugin(d),r=e.useAPIClient(),{id:t}=e.useRecord(),[i,a]=h.useState(null),[c,u]=h.useState(null);h.useEffect(()=>{var p,m;t&&((m=(p=r.resource("users_jobs")).get)==null||m.call(p,{filterByTk:t,appends:["node","job","workflow","workflow.nodes","execution","execution.jobs"]}).then(({data:v})=>{var B;const P=(B=v==null?void 0:v.data)!=null?B:{},{node:A,workflow:N={}}=P,q=N,{nodes:F=[]}=q,I=V(q,["nodes"]),G=P,{execution:O}=G,D=V(G,["node","workflow","execution"]);d.linkNodes(F),u(A),a({userJob:D,workflow:I,nodes:F,execution:O})}))},[r,t]);const x=d.useAvailableUpstreams(i==null?void 0:i.nodes.find(p=>p.id===c.id)).reduce((p,{type:m})=>Object.assign(p,n.instructions.get(m).components),{});return c&&i?s.jsx(d.FlowContext.Provider,{value:i,children:s.jsx(e.SchemaComponent,{components:g(g({FormBlockProvider:X,DetailsBlockProvider:H,ActionBarProvider:Ke,ManualActionStatusProvider:qe},Array.from(z.getValues()).reduce((p,m)=>Object.assign(p,m.block.components),{})),x),scope:g({useSubmit:Ge,useFormBlockProps:Le,useDetailsBlockProps:Ye},Array.from(z.getValues()).reduce((p,m)=>Object.assign(p,m.block.scope),{})),schema:{type:"void",name:"tabs","x-component":"Tabs",properties:(f=c.config)==null?void 0:f.schema}})}):s.jsx(S.Spin,{})}function Le(){var c;const{userJob:o,execution:n}=d.useFlowContext(),r=e.useRecord(),{data:t}=e.useCurrentUserContext(),{form:i}=e.useFormBlockContext(),a=n.status||o.status?r?"readPretty":"disabled":((c=t==null?void 0:t.data)==null?void 0:c.id)!==o.userId?"disabled":"editable";return h.useEffect(()=>{i==null||i.setPattern(a)},[a,i]),{form:i}}function Ye(){const{form:o}=e.useFormBlockContext();return{form:o}}function Qe(){const o=e.useCompile(),{status:n,updatedAt:r}=e.useRecord(),t=d.JobStatusOptionsMap[n];return n?s.jsxs(S.Space,{children:[s.jsx("time",{className:e.css`
|
|
11
|
+
`,children:[s.jsx(S.Form.Item,{children:s.jsxs(S.Radio.Group,{value:!!o,onChange:({target:{value:t}})=>{console.log(t),n(Number(t))},children:[s.jsx(S.Radio,{value:!0,children:s.jsxs(S.Tooltip,{title:A("Each user has own task"),placement:"bottom",children:[s.jsx("span",{children:A("Separately")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})}),s.jsx(S.Radio,{value:!1,children:s.jsxs(S.Tooltip,{title:A("Everyone shares one task"),placement:"bottom",children:[s.jsx("span",{children:A("Collaboratively")}),s.jsx(K.QuestionCircleOutlined,{style:{color:"#999"}})]})})]})}),o?r:null]})}function Ve(o){return o.isForeignKey?o.target==="users":o.collectionName==="users"&&o.name==="id"}function je({multiple:o=!1,value:n=[],onChange:r}){const t=p.useWorkflowVariableOptions({types:[Ve]});return s.jsx(e.Variable.Input,{scope:t,value:n[0],onChange:i=>{r([i])},children:s.jsx(e.RemoteSelect,{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"},manual:!1,value:n[0],onChange:i=>{r(i!=null?[i]:[])}})})}class Ne extends p.Instruction{constructor(){super(...arguments);$(this,"title",`{{t("Manual", { ns: "${g}" })}}`);$(this,"type","manual");$(this,"group","manual");$(this,"description",`{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${g}" })}}`);$(this,"fieldset",{assignees:{type:"array",title:`{{t("Assignees", { ns: "${g}" })}}`,"x-decorator":"FormItem","x-component":"AssigneesSelect","x-component-props":{},required:!0,default:[]},mode:{type:"number",title:`{{t("Mode", { ns: "${g}" })}}`,"x-decorator":"FormItem","x-component":"ModeConfig",default:1,"x-reactions":{dependencies:["assignees"],fulfill:{state:{visible:"{{$deps[0].length > 1}}"}}}},schema:{type:"void",title:`{{t("User interface", { ns: "${g}" })}}`,"x-decorator":"FormItem","x-component":"SchemaConfigButton",properties:{schema:{type:"object","x-component":"SchemaConfig",default:null}}},forms:{type:"object",default:{}}});$(this,"components",{SchemaConfigButton:De,SchemaConfig:Oe,ModeConfig:Pe,AssigneesSelect:je})}useVariables({key:r,title:t,config:i},{types:a,fieldNames:c=p.defaultFieldNames}){var d;const u=e.useCompile(),{getCollectionFields:l}=e.useCollectionManager_deprecated(),x=Object.keys((d=i.forms)!=null?d:{});if(!x.length)return null;const f=x.map(m=>{var I;const v=i.forms[m],w=p.getCollectionFieldOptions({fields:(I=v.collection)==null?void 0:I.fields,collection:v.collection,types:a,compile:u,getCollectionFields:l}),F=u(v.title)||m;return w.length?{key:m,value:m,label:F,title:F,children:w}:null}).filter(Boolean);return f.length?{[c.value]:r,[c.label]:t,[c.children]:f}:null}useInitializers(r){var c;const{getCollection:t}=e.useCollectionManager_deprecated(),i=Object.keys((c=r.config.forms)!=null?c:{});if(!i.length||r.config.mode)return null;const a=i.map(u=>{var f,d;const l=r.config.forms[u],{fields:x=[]}=t(l.collection);return x.length?{name:(f=l.title)!=null?f:u,type:"item",title:(d=l.title)!=null?d:u,Component:p.CollectionBlockInitializer,collection:l.collection,dataSource:`{{$jobsMapByNodeKey.${r.key}.${u}}}`}:null}).filter(Boolean);return a.length?{name:`#${r.id}`,key:"forms",type:"subMenu",title:r.title,children:a}:null}isAvailable({engine:r,workflow:t,upstream:i,branchIndex:a}){return!r.isWorkflowSync(t)}}const $e={title:`{{t("Task", { ns: "${g}" })}}`,name:"flow_nodes",fields:[{type:"bigInt",name:"id",interface:"m2o",uiSchema:{type:"number",title:"ID","x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes",params:{filter:{type:"manual"}}}}}},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}}]},_e={title:`{{t("Workflow", { ns: "${g}" })}}`,name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}}]},Ee={title:`{{t("Workflow todos", { ns: "${g}" })}}`,name:"users_jobs",fields:[{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",interface:"m2o",uiSchema:{type:"number",title:'{{t("User")}}',"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"belongsTo",name:"node",target:"flow_nodes",foreignKey:"nodeId",interface:"m2o",isAssociation:!0,uiSchema:{type:"number",title:`{{t("Task", { ns: "${g}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes"}}}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"number",title:`{{t("Workflow", { ns: "${g}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"workflows"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:`{{t("Status", { ns: "${g}" })}}`,"x-component":"Select",enum:p.JobStatusOptions}},{name:"createdAt",type:"date",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},Ue=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.title)!=null?t:`#${(r=o.value)==null?void 0:r.id}`},{displayName:"NodeColumn"}),Ke=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.title)!=null?t:`#${(r=o.value)==null?void 0:r.id}`},{displayName:"WorkflowColumn"}),qe=b.observer(()=>{var n,r,t;const o=b.useField();return(t=(n=o==null?void 0:o.value)==null?void 0:n.nickname)!=null?t:(r=o.value)==null?void 0:r.id},{displayName:"UserColumn"});function Ge(o){const n=e.useRecord(),r=A("Unprocessed");return n.execution.status&&!n.status?s.jsx(S.Tag,{children:r}):o.children}const Q=()=>s.jsx(e.SchemaComponent,{components:{NodeColumn:Ue,WorkflowColumn:Ke,UserColumn:qe,UserJobStatusColumn:Ge},schema:{type:"void",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-designer":"Filter.Action.Designer","x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined",useProps:"{{ useFilterActionProps }}"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:refresh","x-component-props":{icon:"ReloadOutlined",useProps:"{{ useRefreshActionProps }}"},"x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-component-props":{rowKey:"id",useProps:"{{ useTableBlockProps }}"},properties:{actions:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:60},title:'{{t("Actions")}}',properties:{view:{type:"void","x-component":"Action.Link",title:'{{t("View")}}',properties:{drawer:{"x-component":"WorkflowTodo.Drawer"}}}}},node:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:`{{t("Task node", { ns: "${g}" })}}`,properties:{node:{"x-component":"NodeColumn","x-read-pretty":!0}}},workflow:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:'{{t("Workflow", { ns: "workflow" })}}',properties:{workflow:{"x-component":"WorkflowColumn","x-read-pretty":!0}}},status:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100},title:'{{t("Status", { ns: "workflow" })}}',properties:{status:{type:"number","x-decorator":"UserJobStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},user:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:140},title:`{{t("Assignee", { ns: "${g}" })}}`,properties:{user:{"x-component":"UserColumn","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:160},properties:{createdAt:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}}}}}}});function Je(o){var x;const{data:n}=e.useCurrentUserContext(),{userJob:r}=p.useFlowContext(),{status:t,result:i,userId:a}=r,c=b.useFieldSchema(),{name:u}=c.parent.toJSON();let{children:l}=o;return t?i[u]||(l=null):((x=n==null?void 0:n.data)==null?void 0:x.id)!==a&&(l=null),l}const le=h.createContext(null);le.displayName="ManualActionStatusContext";function Le({value:o,children:n}){const{userJob:r,execution:t}=p.useFlowContext(),i=b.useField(),a=b.useFieldSchema();return h.useEffect(()=>{(t.status||r.status)&&(i.disabled=!0,i.visible=r.status===o&&r.result._===a.name)},[t,r,o,i,a.name]),s.jsx(le.Provider,{value:o,children:n})}function Ye(){const o=e.useAPIClient(),{setVisible:n}=e.useActionContext(),{values:r,submit:t}=b.useForm(),i=b.useFieldSchema(),{service:a}=e.useTableBlockContext(),{userJob:c,execution:u}=p.useFlowContext(),{name:l}=i,{name:x}=i.parent.parent;return{run(){return _(this,null,function*(){u.status||c.status||(yield t(),yield o.resource("users_jobs").submit({filterByTk:c.id,values:{result:{[x]:r,_:l}}}),n(!1),a.refresh())})}}}function Qe(o){var f;const n=e.usePlugin(p),r=e.useAPIClient(),{id:t}=e.useRecord(),[i,a]=h.useState(null),[c,u]=h.useState(null);h.useEffect(()=>{var d,m;t&&((m=(d=r.resource("users_jobs")).get)==null||m.call(d,{filterByTk:t,appends:["node","job","workflow","workflow.nodes","execution","execution.jobs"]}).then(({data:v})=>{var B;const P=(B=v==null?void 0:v.data)!=null?B:{},{node:w,workflow:N={}}=P,q=N,{nodes:F=[]}=q,I=V(q,["nodes"]),G=P,{execution:z}=G,O=V(G,["node","workflow","execution"]);p.linkNodes(F),u(w),a({userJob:O,workflow:I,nodes:F,execution:z})}))},[r,t]);const x=p.useAvailableUpstreams(i==null?void 0:i.nodes.find(d=>d.id===c.id)).reduce((d,{type:m})=>Object.assign(d,n.instructions.get(m).components),{});return c&&i?s.jsx(p.FlowContext.Provider,{value:i,children:s.jsx(e.SchemaComponent,{components:y(y({FormBlockProvider:Z,DetailsBlockProvider:X,ActionBarProvider:Je,ManualActionStatusProvider:Le},Array.from(M.getValues()).reduce((d,m)=>Object.assign(d,m.block.components),{})),x),scope:y({useSubmit:Ye,useFormBlockProps:He,useDetailsBlockProps:Xe},Array.from(M.getValues()).reduce((d,m)=>Object.assign(d,m.block.scope),{})),schema:{type:"void",name:"tabs","x-component":"Tabs",properties:(f=c.config)==null?void 0:f.schema}})}):s.jsx(S.Spin,{})}function He(){var c;const{userJob:o,execution:n}=p.useFlowContext(),r=e.useRecord(),{data:t}=e.useCurrentUserContext(),{form:i}=e.useFormBlockContext(),a=n.status||o.status?r?"readPretty":"disabled":((c=t==null?void 0:t.data)==null?void 0:c.id)!==o.userId?"disabled":"editable";return h.useEffect(()=>{i==null||i.setPattern(a)},[a,i]),{form:i}}function Xe(){const{form:o}=e.useFormBlockContext();return{form:o}}function Ze(){const o=e.useCompile(),{status:n,updatedAt:r}=e.useRecord(),t=p.JobStatusOptionsMap[n];return n?s.jsxs(S.Space,{children:[s.jsx("time",{className:e.css`
|
|
12
12
|
margin-right: 0.5em;
|
|
13
|
-
`,children:
|
|
13
|
+
`,children:ue(r).format("YYYY-MM-DD HH:mm:ss")}),s.jsx(S.Tag,{icon:t.icon,color:t.color,children:o(t.label)})]}):null}function We(){var a;const o=h.useContext(e.SchemaComponentContext),{id:n,node:r,workflow:t,status:i}=e.useRecord();return s.jsx(e.SchemaComponentContext.Provider,{value:k(y({},o),{reset(){},designable:!1}),children:s.jsx(e.SchemaComponent,{components:{FooterStatus:Ze,FlowContextProvider:Qe},schema:{type:"void",name:`drawer-${n}-${i}`,"x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:`${t.title} - ${(a=r.title)!=null?a:`#${r.id}`}`,properties:{tabs:{type:"void","x-component":"FlowContextProvider"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{content:{type:"void","x-component":"FooterStatus"}}}}}})})}function Re({params:o={},children:n}){const r={collection:"users_jobs",resource:"users_jobs",action:"list",params:k(y({pageSize:20,sort:["-createdAt"]},o),{appends:["user","node","workflow","execution.status"],except:["node.config","workflow.config","workflow.options"]}),rowKey:"id",showIndex:!0,dragSort:!1};return s.jsx(e.ExtendCollectionsProvider,{collections:[$e,_e,Ee],children:s.jsx(e.TableBlockProvider,k(y({name:"workflow-todo"},r),{children:n}))})}Q.Drawer=We,Q.Decorator=Re;const eo=()=>{const o=e.useSchemaInitializerItem(),{insert:n}=e.useSchemaInitializer();return s.jsx(e.SchemaInitializerItem,k(y({icon:s.jsx(K.TableOutlined,{})},o),{onClick:()=>{n({type:"void","x-decorator":"WorkflowTodo.Decorator","x-decorator-props":{},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{todos:{type:"void","x-component":"WorkflowTodo"}}})}}))};class oo extends e.Plugin{afterAdd(){return _(this,null,function*(){})}load(){return _(this,null,function*(){this.addComponents(),this.app.pm.get("workflow").registerInstruction("manual",Ne),this.app.schemaInitializerManager.add(ie),this.app.schemaInitializerManager.add(Ae),this.app.schemaInitializerManager.add(ce),this.app.schemaInitializerManager.add(Me),this.app.schemaInitializerManager.add(ne),this.app.schemaInitializerManager.add(Se),this.app.schemaInitializerManager.get("page:addBlock").add("otherBlocks.workflowTodos",{title:`{{t("Workflow todos", { ns: "${g}" })}}`,Component:"WorkflowTodoBlockInitializer",icon:"CheckSquareOutlined"})})}addComponents(){this.app.addComponents({WorkflowTodo:Q,WorkflowTodoBlockInitializer:eo})}}C.default=oo,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISchema } from '@formily/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { CompatibleSchemaInitializer, SchemaInitializerItemType } from '@nocobase/client';
|
|
4
4
|
import { JOB_STATUS } from '@nocobase/plugin-workflow/client';
|
|
5
5
|
type ValueOf<T> = T[keyof T];
|
|
6
6
|
export type FormType = {
|
|
@@ -39,8 +39,16 @@ export type ManualFormType = {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
export declare const manualFormTypes: any;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
export declare const addBlockButton_deprecated: CompatibleSchemaInitializer;
|
|
46
|
+
export declare const addBlockButton: CompatibleSchemaInitializer;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
export declare const addActionButton_deprecated: CompatibleSchemaInitializer;
|
|
51
|
+
export declare const addActionButton: CompatibleSchemaInitializer;
|
|
44
52
|
export declare function SchemaConfig({ value, onChange }: {
|
|
45
53
|
value: any;
|
|
46
54
|
onChange: any;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CompatibleSchemaInitializer } from '@nocobase/client';
|
|
2
2
|
import { ManualFormType } from '../SchemaConfig';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
export declare const addCustomFormField_deprecated: CompatibleSchemaInitializer;
|
|
7
|
+
export declare const addCustomFormField: CompatibleSchemaInitializer;
|
|
4
8
|
declare const _default: ManualFormType;
|
|
5
9
|
export default _default;
|
package/dist/externalVersion.js
CHANGED
|
@@ -3,18 +3,18 @@ module.exports = {
|
|
|
3
3
|
"antd": "5.12.8",
|
|
4
4
|
"dayjs": "1.11.10",
|
|
5
5
|
"react": "18.2.0",
|
|
6
|
-
"@nocobase/client": "0.20.0-alpha.
|
|
7
|
-
"@nocobase/plugin-workflow": "0.20.0-alpha.
|
|
6
|
+
"@nocobase/client": "0.20.0-alpha.12",
|
|
7
|
+
"@nocobase/plugin-workflow": "0.20.0-alpha.12",
|
|
8
8
|
"@ant-design/icons": "5.2.6",
|
|
9
9
|
"react-i18next": "11.18.6",
|
|
10
|
-
"@nocobase/utils": "0.20.0-alpha.
|
|
11
|
-
"@nocobase/server": "0.20.0-alpha.
|
|
12
|
-
"@nocobase/actions": "0.20.0-alpha.
|
|
13
|
-
"@nocobase/resourcer": "0.20.0-alpha.
|
|
14
|
-
"@nocobase/plugin-workflow-test": "0.20.0-alpha.
|
|
15
|
-
"@nocobase/test": "0.20.0-alpha.
|
|
10
|
+
"@nocobase/utils": "0.20.0-alpha.12",
|
|
11
|
+
"@nocobase/server": "0.20.0-alpha.12",
|
|
12
|
+
"@nocobase/actions": "0.20.0-alpha.12",
|
|
13
|
+
"@nocobase/resourcer": "0.20.0-alpha.12",
|
|
14
|
+
"@nocobase/plugin-workflow-test": "0.20.0-alpha.12",
|
|
15
|
+
"@nocobase/test": "0.20.0-alpha.12",
|
|
16
16
|
"@formily/core": "2.3.0",
|
|
17
17
|
"@formily/antd-v5": "1.1.9",
|
|
18
|
-
"@nocobase/database": "0.20.0-alpha.
|
|
18
|
+
"@nocobase/database": "0.20.0-alpha.12",
|
|
19
19
|
"lodash": "4.17.21"
|
|
20
20
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:人工处理节点",
|
|
5
5
|
"description": "Could be used for workflows which some of decisions are made by users.",
|
|
6
6
|
"description.zh-CN": "用于人工控制部分决策的流程。",
|
|
7
|
-
"version": "0.20.0-alpha.
|
|
7
|
+
"version": "0.20.0-alpha.12",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow-manual",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@nocobase/test": "0.x",
|
|
31
31
|
"@nocobase/utils": "0.x"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "4d6655776b3f418dacd86370126e82ae25e1185a",
|
|
34
34
|
"keywords": [
|
|
35
35
|
"Workflow"
|
|
36
36
|
]
|