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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/client/{142.d84a976875799df4.js → 142.fb4936d78fc80007.js} +1 -1
  2. package/dist/client/{159.3d5abee06b818db3.js → 159.cc9a0f2d92cab2c1.js} +1 -1
  3. package/dist/client/{382.80ebd002a9971b65.js → 382.d37fba14a6b91b0b.js} +1 -1
  4. package/dist/client/{394.d7eacf666590a6ae.js → 394.a37310b78419ad7a.js} +1 -1
  5. package/dist/client/{438.c4de8f085e490158.js → 438.6c6409d821d8c353.js} +1 -1
  6. package/dist/client/509.0504f44820a39d45.js +10 -0
  7. package/dist/client/{54.c452a382e9b3953d.js → 54.d3d5d9f2f2115201.js} +1 -1
  8. package/dist/client/618.1aa6c21d0f2840cb.js +10 -0
  9. package/dist/client/635.42814cddec653cdd.js +10 -0
  10. package/dist/client/67.ea0c78153b4842ef.js +10 -0
  11. package/dist/client/719.cd8ca7c9f00584be.js +10 -0
  12. package/dist/client/739.49407722fca8d236.js +10 -0
  13. package/dist/client/782.e0f0d84dd5cfac2a.js +10 -0
  14. package/dist/client/{828.77de843c49fb307a.js → 828.78ff0c90212276c0.js} +1 -1
  15. package/dist/client/{87.d2c2b5b1cae08bfc.js → 87.083467b89aaf3e53.js} +1 -1
  16. package/dist/client/{938.77649c32dae1c225.js → 938.26493fc09ba1ccbc.js} +1 -1
  17. package/dist/client/964.5ab736effd480a42.js +10 -0
  18. package/dist/client/972.600a190e71978122.js +10 -0
  19. package/dist/client/index.js +1 -1
  20. package/dist/client/variable.d.ts +3 -9
  21. package/dist/client-v2/142.fe4f9b7869876ff1.js +10 -0
  22. package/dist/client-v2/{276.43297f402f31970e.js → 276.8ca10542a0424df3.js} +1 -1
  23. package/dist/client-v2/387.eae325172ba209e5.js +10 -0
  24. package/dist/client-v2/{513.ab2bdd96ad9ece4d.js → 513.19fe2e75d7cb18f8.js} +1 -1
  25. package/dist/client-v2/635.d14f99a9520d336b.js +10 -0
  26. package/dist/client-v2/677.d3294a45cd038c72.js +10 -0
  27. package/dist/client-v2/{739.906e94bbe6d52a3d.js → 739.5b60845103064f8d.js} +1 -1
  28. package/dist/client-v2/canvas/BranchContext.d.ts +11 -2
  29. package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +1 -0
  30. package/dist/client-v2/canvas/contexts.d.ts +2 -0
  31. package/dist/client-v2/components/FilterDynamicComponent.d.ts +6 -1
  32. package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +8 -1
  33. package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +0 -21
  34. package/dist/client-v2/index.d.ts +1 -3
  35. package/dist/client-v2/index.js +1 -1
  36. package/dist/client-v2/nodes/components/filter.d.ts +2 -1
  37. package/dist/client-v2/utils/contextSingleton.d.ts +9 -0
  38. package/dist/common/defaultWorkflowFilter.d.ts +21 -0
  39. package/dist/common/defaultWorkflowFilter.js +38 -0
  40. package/dist/externalVersion.js +13 -13
  41. package/dist/locale/en-US.json +6 -0
  42. package/dist/locale/zh-CN.json +6 -0
  43. package/dist/locale/zh-TW.json +6 -0
  44. package/dist/node_modules/cron-parser/package.json +1 -1
  45. package/dist/node_modules/joi/package.json +1 -1
  46. package/dist/node_modules/lru-cache/package.json +1 -1
  47. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  48. package/dist/server/Dispatcher.js +20 -22
  49. package/package.json +3 -2
  50. package/dist/client/509.2f72dd97808f12d1.js +0 -10
  51. package/dist/client/618.a97bc812678ab2a7.js +0 -10
  52. package/dist/client/635.3f165e9ed7e940b2.js +0 -10
  53. package/dist/client/67.4117e04bd42f9d42.js +0 -10
  54. package/dist/client/719.5801e3f1cf81b97b.js +0 -10
  55. package/dist/client/739.955f18b3dc31ae3a.js +0 -10
  56. package/dist/client/782.332fd345a98b82c2.js +0 -10
  57. package/dist/client/964.cb1ecff7a46687b7.js +0 -10
  58. package/dist/client/972.4da2796f3f2df874.js +0 -10
  59. package/dist/client-v2/142.3d386748090ff6d3.js +0 -10
  60. package/dist/client-v2/224.44a5e1227bee33fb.js +0 -10
  61. package/dist/client-v2/387.ab3eac2eb447f36f.js +0 -10
  62. package/dist/client-v2/635.37de4abe241b30e8.js +0 -10
  63. package/dist/client-v2/canvas/WorkflowVariableSelect.d.ts +0 -29
@@ -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_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["387"],{2034:function(e,t,n){n.d(t,{i:function(){return O}});var r=n(9155),l=n.n(r),o=n(2059),a=n(7375),i=n(5477),c=n(7694),u=n(5980),s=n(9651),d=n(2235),f=n(3052),m=n(9488),p=n(4759),v=n(2625),g=n(3485),y=n(2404);function b(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 w(e){var t,n,r,i=e.triggerTitle,c=(0,m.kj)(),s=null!=(n=(0,d.$K)())?n:{},f=s.execution,p=s.workflow,v=function(e){if(Array.isArray(e))return e}(t=l().useState(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(l.push(t.value),2!==l.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return l}}(t)||function(e){if(e){if("string"==typeof e)return b(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=v[0],w=v[1],E=(0,u.A)().styles;return f?l().createElement(l().Fragment,null,l().createElement(o.Tooltip,{title:c("View result")},l().createElement(o.Button,{type:"primary",shape:"circle",size:"small",icon:l().createElement(a.InfoOutlined,null),className:E.nodeJobButtonClass,onClick:function(e){e.stopPropagation(),w(!0)},onMouseDown:function(e){return e.stopPropagation()}})),l().createElement(o.Modal,{open:g,onCancel:function(){return w(!1)},width:980,footer:null,title:l().createElement("div",{className:E.nodeTitleClass},l().createElement(o.Tag,null,i),l().createElement("strong",null,null==p?void 0:p.title)),destroyOnClose:!0,modalRender:function(e){return l().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},l().createElement("div",{style:{marginBottom:16}},l().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Triggered at"),":"),l().createElement("div",null,(0,y.fU)(null==f?void 0:f.createdAt))),l().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Trigger variables"),":"),l().createElement(o.Input.TextArea,{value:JSON.stringify(null!=(r=null==f?void 0:f.context)?r:null,null,2),disabled:!0,autoSize:{minRows:4,maxRows:20},className:E.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}))):null}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,l,o,a){try{var i=e[o](a),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,l)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var o=e.apply(t,n);function a(e){h(o,r,l,a,i,"next",e)}function i(e){h(o,r,l,a,i,"throw",e)}a(void 0)})}}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var o=[],a=!0,i=!1;try{for(l=l.call(e);!(a=(n=l.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(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 E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){var n,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function S(e){var t=e.trigger,n=e.t,r=o.theme.useToken().token;return t.description?l().createElement("div",{style:{marginBottom:r.marginLG,padding:r.padding,backgroundColor:r.colorFillAlter}},l().createElement(o.Typography.Paragraph,null,l().createElement(o.Typography.Text,null,n("Trigger type")),l().createElement(o.Typography.Text,null,": "),l().createElement(o.Tag,{icon:l().createElement(a.ThunderboltOutlined,null)},n(t.title))),l().createElement(o.Typography.Paragraph,{type:"secondary"},n(t.description))):null}function A(e){var t,n=e.trigger,a=e.workflow,i=e.onSubmitted,u=(0,c.useFlowContext)(),s=(0,m.kj)(),f=o.App.useApp().message,p=!!(null==a||null==(t=a.versionStats)?void 0:t.executed),y=T(o.Form.useForm(),1)[0],b=T((0,r.useState)(!1),2),w=b[0],E=b[1],h=(0,r.useMemo)(function(){return(null==n?void 0:n.FieldsetLoader)?(0,r.lazy)(n.FieldsetLoader):null},[n]),A=(0,r.useMemo)(function(){var e;return{config:null!=(e=a.config)?e:{}}},[a.config]);(0,r.useEffect)(function(){y.setFieldsValue(A)},[y,A]);var x=(0,v.useMemoizedFn)(function(){return C(function(){var e,t,n;return k(this,function(r){switch(r.label){case 0:return[4,y.validateFields()];case 1:e=r.sent(),E(!0),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,u.api.resource("workflows").update({filterByTk:a.id,values:{config:null!=(t=e.config)?t:{}}})];case 3:return r.sent(),null==i||i(),[3,6];case 4:throw n=r.sent(),f.error(s("Failed to save trigger")),console.error(n),n;case 5:return E(!1),[7];case 6:return[2]}})})()});return l().createElement(d.AA.Provider,{value:a},l().createElement(g.DrawerFormLayout,{title:s("Trigger"),onSubmit:x,submitting:w,submitText:s("Submit"),cancelText:s("Cancel"),footer:p?l().createElement("span",null):void 0},l().createElement(o.Form,{form:y,layout:"vertical",disabled:p},n?l().createElement(S,{trigger:n,t:s}):null,h?l().createElement(r.Suspense,{fallback:l().createElement(o.Skeleton,{active:!0,paragraph:{rows:4}})},l().createElement(h,null)):l().createElement(o.Typography.Paragraph,{type:"secondary"},n?s("This trigger's configuration has not been migrated to the new canvas yet."):s("This trigger type is not available in the new canvas yet.")))))}function x(){var e,t,n=(0,c.useFlowContext)(),i=(0,m.kj)(),s=(0,u.A)(),f=s.styles,g=s.cx,y=null!=(e=(0,d.$K)())?e:{},b=y.workflow,E=y.refresh,h=!!(0,d.S8)(),S=n.app.pm.get(p.q),x=(null==b?void 0:b.type)?S.getTriggerOptions(b.type):void 0,N=x?i(x.title):null!=(t=null==b?void 0:b.type)?t:i("Unknown trigger"),R=T((0,r.useState)(""),2),O=R[0],_=R[1];(0,r.useEffect)(function(){var e,t;_(null!=(e=null!=(t=null==b?void 0:b.triggerTitle)?t:null==b?void 0:b.title)?e:N)},[N,null==b?void 0:b.title,null==b?void 0:b.triggerTitle]);var I=(0,v.useMemoizedFn)(function(e){return C(function(){var t;return k(this,function(r){switch(r.label){case 0:if(!(null==b?void 0:b.id)||(_(t=e||N),t===b.triggerTitle))return[2];return[4,n.api.resource("workflows").update({filterByTk:b.id,values:{triggerTitle:t}})];case 1:return r.sent(),null==E||E(),[2]}})})()}),F=(0,v.useMemoizedFn)(function(){if(null==b?void 0:b.id){var e;(e={ctx:n,trigger:x,workflow:b,refresh:E}).ctx.viewer.drawer({width:"50%",closable:!0,content:function(){return l().createElement(A,{trigger:e.trigger,workflow:e.workflow,onSubmitted:e.refresh})}})}});if(!b)return null;var j=i("Trigger");return l().createElement("div",{className:f.nodeClass,role:"button","aria-label":"".concat(j,"-").concat(O),onClick:function(e){if(e.currentTarget.contains(e.target)){var t,n,r;n=t=e.target,(null!=(r=HTMLElement)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)&&t.closest("textarea, input, button, a, .ant-dropdown, .workflow-node-actions, .ant-modal")||F()}}},l().createElement("div",{className:g(f.nodeCardClass,{invalid:!x})},l().createElement("div",{className:f.nodeHeaderClass},l().createElement("div",{className:g(f.nodeMetaClass,"workflow-node-meta")},l().createElement(o.Tooltip,{title:(null==x?void 0:x.description)?i(x.description):void 0},l().createElement(o.Tag,{color:x?"gold":"error",icon:l().createElement(a.ThunderboltOutlined,null)},l().createElement("span",{className:"type"},N)))),l().createElement("div",{className:"workflow-node-actions"},l().createElement(w,{triggerTitle:N}))),l().createElement("div",{className:"workflow-node-title"},l().createElement(o.Input.TextArea,{value:O,onChange:function(e){return _(e.target.value)},onBlur:function(e){return C(function(){return k(this,function(t){switch(t.label){case 0:return[4,I(e.target.value)];case 1:return t.sent(),[2]}})})()},autoSize:!0,disabled:h,"aria-label":i("Trigger title")}))))}function N(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(){var e,t=(0,u.A)().styles,n=(0,m.kj)(),r=(0,c.useFlowEngine)(),i=(0,f.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var d=r.context.app.pm.get(p.q),v=null==d?void 0:d.getInstruction(s.type),g=v?n(v.title):s.type;return l().createElement("div",{className:t.clipboardPreviewClass},l().createElement("div",{className:"workflow-clipboard-header"},l().createElement("span",null,n("Copied node")),l().createElement(o.Button,{type:"text",size:"small",icon:l().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),l().createElement("div",{className:"workflow-clipboard-card"},l().createElement("div",{className:"workflow-clipboard-type"},g),l().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function O(e){var t,n,a=e.entry,c=(0,u.A)(),f=c.styles,p=c.cx,v=(0,m.kj)(),g=(0,d.S8)();(null!=(n=(0,d.$K)())?n:{}).workflow;var y=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(100))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(l.push(t.value),2!==l.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return l}}(t)||function(e){if(e){if("string"==typeof e)return N(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=y[1];return l().createElement("div",{className:p(f.workflowPageClass,(0,i.css)({height:"100%"}))},l().createElement("div",{className:"workflow-canvas-wrapper"},l().createElement("div",{className:"workflow-canvas",style:{zoom:b/100}},l().createElement("div",{className:p(f.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},l().createElement("div",{className:f.branchClass},g?l().createElement(o.Alert,{type:"warning",showIcon:!0,message:v("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,l().createElement(x,null),l().createElement("div",{className:p(f.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},l().createElement(s.l,{entry:a})),l().createElement("div",{className:f.terminalClass},v("End"))))),l().createElement(R,null),l().createElement("div",{className:"workflow-canvas-zoomer"},l().createElement(o.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:b,onChange:w}))))}},8761:function(e,t,n){n.d(t,{K:function(){return r}});function r(e){var t=new Map;e.forEach(function(e){return t.set(e.id,e)});var n=!0,r=!1,l=void 0;try{for(var o,a=t.values()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var i=o.value;i.upstreamId&&(i.upstream=t.get(i.upstreamId)),i.downstreamId&&(i.downstream=t.get(i.downstreamId))}}catch(e){r=!0,l=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw l}}}},7001:function(e,t,n){n.d(t,{TD:function(){return a}});var r=n(2625),l=n(8401);function o(){return"u">typeof window&&"string"==typeof window.__nocobase_modern_client_prefix__&&window.__nocobase_modern_client_prefix__.trim().length>0}function a(){var e=(0,r.useMemoizedFn)(function(e){return o()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return o()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:o(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return o},QQ:function(){return c},hi:function(){return a},m2:function(){return i}});var r=n(358);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:o.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:o.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:o.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:o.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:o.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:o.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:o.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:o.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:o.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=a.reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{}),c=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{})}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["635"],{5329:function(e,n,t){t.d(n,{F:function(){return u}});var o=t(9155),l=t.n(o),r=t(2059),a=t(7806),i=t(9488);function c(e){var n=e.value,t=e.onChange,r=e.disabled,i=e.onCollectionChanged,c=(0,o.useRef)();return l().createElement(a.XJ,{value:n,disabled:r,onChange:function(e){var o,l=null!=(o=c.current)?o:n;null==t||t(e),l&&l!==e&&(null==i||i(l,e)),c.current=e}})}function u(e){var n=e.disabled,t=e.onCollectionChanged,o=(0,i.kj)();return l().createElement(r.Form.Item,{name:["config","collection"],label:o("Collection"),rules:[{required:!0}]},l().createElement(c,{disabled:n,onCollectionChanged:t}))}},6855:function(e,n,t){t.d(n,{F:function(){return s}});var o=t(9155),l=t.n(o),r=t(2059),a=t(7768),i=t(1801),c=t(9488);function u(e,n,t,o,l,r,a){try{var i=e[r](a),c=i.value}catch(e){t(e);return}i.done?n(c):Promise.resolve(c).then(o,l)}function s(e){var n=e.collection,t=e.label,o=e.name,s=e.required,d=(0,c.kj)();return l().createElement(r.Form.Item,{name:void 0===o?["config","params","filter"]:o,label:null!=t?t:d("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===s||s?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,o,l,r={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(t=1,o&&(l=2&u[0]?o.return:u[0]?o.throw||((l=o.return)&&l.call(o),0):o.next)&&!(l=l.call(o,u[1])).done)return l;switch(o=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!(l=(l=r.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){r=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){r.label=u[1];break}if(6===u[0]&&r.label<l[1]){r.label=l[1],l=u;break}if(l&&r.label<l[2]){r.label=l[2],r.ops.push(u);break}l[2]&&r.ops.pop(),r.trys.pop();continue}u=n.call(e,r)}catch(e){u=[6,e],o=0}finally{t=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(d("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(o,l){var r=t.apply(e,n);function a(e){u(r,o,l,a,i,"next",e)}function i(e){u(r,o,l,a,i,"throw",e)}a(void 0)})})()}}]:void 0},l().createElement(i.N$,{collection:n}))}},8950:function(e,n,t){t.d(n,{UpdateFieldset:function(){return m},UpdatePresetFieldset:function(){return p}});var o=t(9155),l=t.n(o),r=t(2059),a=t(2235),i=t(7806),c=t(9785),u=t(9488),s=t(5329),d=t(6855);function f(){var e,n=(0,u.kj)(),t=r.Form.useFormInstance(),a=r.Form.useWatch(["config","collection"]),s=[{label:(e=(0,u.kj)())("Update in a batch"),value:!1,tooltip:e("Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.")},{label:e("Update one by one"),value:!0,tooltip:e("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.")}];return((0,o.useEffect)(function(){a&&(t.setFieldValue(["config","usingAssignFormSchema"],void 0),t.setFieldValue(["config","assignFormSchema"],void 0),void 0===t.getFieldValue(["config","params","individualHooks"])&&t.setFieldValue(["config","params","individualHooks"],!1))},[a,t]),a)?l().createElement(l().Fragment,null,l().createElement(r.Form.Item,{name:["config","params","individualHooks"],label:n("Update mode")},l().createElement(c.$,{options:s})),l().createElement(d.F,{collection:a,label:n("Only update records matching conditions")}),l().createElement(r.Form.Item,{name:["config","params","values"],label:n("Fields values")},l().createElement(i.XH,{collection:a}))):null}function m(){var e,n=(0,a.TA)(),t=r.Form.useFormInstance();return l().createElement(l().Fragment,null,l().createElement(s.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{}),t.setFieldValue(["config","params","values"],{}),t.setFieldValue(["config","usingAssignFormSchema"],void 0),t.setFieldValue(["config","assignFormSchema"],void 0)}}),l().createElement(f,null))}function p(){return l().createElement(s.F,null)}}}]);
@@ -1,29 +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
- import React from 'react';
10
- import { type UseWorkflowVariableOptions } from './useWorkflowVariableOptions';
11
- import { type WorkflowVariableTagProps } from './WorkflowVariableTag';
12
- export type WorkflowVariableSelectProps = {
13
- value?: string | null;
14
- onChange?: (value: string | null) => void;
15
- disabled?: boolean;
16
- placeholder?: string;
17
- className?: string;
18
- style?: React.CSSProperties;
19
- status?: WorkflowVariableTagProps['status'];
20
- variableOptions?: UseWorkflowVariableOptions;
21
- };
22
- /**
23
- * Pure workflow variable selector: the left side is read-only and only shows
24
- * the selected variable tag (with clear) or an empty placeholder input. Users
25
- * must select from the workflow variable cascader and cannot type freeform
26
- * content after choosing a variable.
27
- */
28
- export declare function WorkflowVariableSelect(props: WorkflowVariableSelectProps): React.JSX.Element;
29
- export default WorkflowVariableSelect;