@nocobase/client 0.7.0-alpha.26 → 0.7.0-alpha.27

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 (200) hide show
  1. package/esm/block-provider/hooks/index.js +10 -2
  2. package/esm/block-provider/hooks/index.js.map +1 -1
  3. package/esm/collection-manager/hooks/useCollection.d.ts +1 -0
  4. package/esm/collection-manager/types.d.ts +1 -0
  5. package/esm/collection-manager/types.js.map +1 -1
  6. package/esm/locale/en_US.d.ts +2 -0
  7. package/esm/locale/en_US.js +4 -1
  8. package/esm/locale/en_US.js.map +1 -1
  9. package/esm/locale/index.d.ts +24 -7
  10. package/esm/locale/zh_CN.d.ts +22 -7
  11. package/esm/locale/zh_CN.js +22 -7
  12. package/esm/locale/zh_CN.js.map +1 -1
  13. package/esm/schema-component/antd/action/Action.Designer.js +6 -6
  14. package/esm/schema-component/antd/action/Action.Designer.js.map +1 -1
  15. package/esm/schema-component/antd/action/Action.js +24 -17
  16. package/esm/schema-component/antd/action/Action.js.map +1 -1
  17. package/esm/schema-component/antd/filter/Filter.Action.Designer.js +1 -1
  18. package/esm/schema-component/antd/filter/Filter.Action.Designer.js.map +1 -1
  19. package/esm/schema-component/antd/grid/Grid.d.ts +2 -0
  20. package/esm/schema-component/antd/grid/Grid.js +10 -3
  21. package/esm/schema-component/antd/grid/Grid.js.map +1 -1
  22. package/esm/schema-component/antd/menu/Menu.Designer.js +35 -23
  23. package/esm/schema-component/antd/menu/Menu.Designer.js.map +1 -1
  24. package/esm/schema-component/antd/menu/Menu.js +3 -3
  25. package/esm/schema-component/antd/menu/Menu.js.map +1 -1
  26. package/esm/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  27. package/esm/schema-component/antd/record-picker/ReadPrettyRecordPicker.js.map +1 -1
  28. package/esm/schema-component/antd/table/Table.Void.Designer.js +1 -1
  29. package/esm/schema-component/antd/table/Table.Void.Designer.js.map +1 -1
  30. package/esm/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  31. package/esm/schema-component/antd/table-v2/Table.Column.Designer.js.map +1 -1
  32. package/esm/schema-component/antd/table-v2/TableBlockDesigner.js +2 -2
  33. package/esm/schema-component/antd/table-v2/TableBlockDesigner.js.map +1 -1
  34. package/esm/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -1
  35. package/esm/schema-component/antd/table-v2/TableSelectorDesigner.js.map +1 -1
  36. package/esm/schema-component/antd/tabs/Tabs.Designer.js +13 -2
  37. package/esm/schema-component/antd/tabs/Tabs.Designer.js.map +1 -1
  38. package/esm/schema-initializer/buttons/BlockInitializers.js +1 -1
  39. package/esm/schema-initializer/buttons/BlockInitializers.js.map +1 -1
  40. package/esm/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -1
  41. package/esm/schema-initializer/buttons/CreateFormBlockInitializers.js.map +1 -1
  42. package/esm/schema-initializer/buttons/FormItemInitializers.js +3 -13
  43. package/esm/schema-initializer/buttons/FormItemInitializers.js.map +1 -1
  44. package/esm/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +3 -13
  45. package/esm/schema-initializer/buttons/ReadPrettyFormItemInitializers.js.map +1 -1
  46. package/esm/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  47. package/esm/schema-initializer/buttons/RecordBlockInitializers.js.map +1 -1
  48. package/esm/schema-settings/GeneralSchemaDesigner.js +17 -6
  49. package/esm/schema-settings/GeneralSchemaDesigner.js.map +1 -1
  50. package/esm/schema-templates/schemas/uiSchemaTemplates.js +67 -10
  51. package/esm/schema-templates/schemas/uiSchemaTemplates.js.map +1 -1
  52. package/esm/workflow/WorkflowLink.js +1 -1
  53. package/esm/workflow/WorkflowLink.js.map +1 -1
  54. package/esm/workflow/calculators.js +7 -5
  55. package/esm/workflow/calculators.js.map +1 -1
  56. package/esm/workflow/nodes/condition.d.ts +1 -1
  57. package/esm/workflow/nodes/condition.js +16 -13
  58. package/esm/workflow/nodes/condition.js.map +1 -1
  59. package/esm/workflow/nodes/create.d.ts +1 -0
  60. package/esm/workflow/nodes/index.js +4 -4
  61. package/esm/workflow/nodes/index.js.map +1 -1
  62. package/esm/workflow/nodes/parallel.js +8 -5
  63. package/esm/workflow/nodes/parallel.js.map +1 -1
  64. package/esm/workflow/nodes/query.js +1 -1
  65. package/esm/workflow/nodes/query.js.map +1 -1
  66. package/esm/workflow/nodes/update.d.ts +2 -1
  67. package/esm/workflow/nodes/update.js +12 -1
  68. package/esm/workflow/nodes/update.js.map +1 -1
  69. package/esm/workflow/schemas/collection.d.ts +1 -0
  70. package/esm/workflow/schemas/collection.js +3 -2
  71. package/esm/workflow/schemas/collection.js.map +1 -1
  72. package/esm/workflow/schemas/workflows.js +3 -2
  73. package/esm/workflow/schemas/workflows.js.map +1 -1
  74. package/esm/workflow/style.d.ts +1 -0
  75. package/esm/workflow/style.js +5 -4
  76. package/esm/workflow/style.js.map +1 -1
  77. package/esm/workflow/triggers/{model.d.ts → collection.d.ts} +1 -0
  78. package/esm/workflow/triggers/{model.js → collection.js} +7 -6
  79. package/esm/workflow/triggers/collection.js.map +1 -0
  80. package/esm/workflow/triggers/index.js +9 -6
  81. package/esm/workflow/triggers/index.js.map +1 -1
  82. package/lib/block-provider/hooks/index.js +9 -1
  83. package/lib/block-provider/hooks/index.js.map +1 -1
  84. package/lib/collection-manager/hooks/useCollection.d.ts +1 -0
  85. package/lib/collection-manager/types.d.ts +1 -0
  86. package/lib/collection-manager/types.js.map +1 -1
  87. package/lib/locale/en_US.d.ts +2 -0
  88. package/lib/locale/en_US.js +4 -1
  89. package/lib/locale/en_US.js.map +1 -1
  90. package/lib/locale/index.d.ts +24 -7
  91. package/lib/locale/zh_CN.d.ts +22 -7
  92. package/lib/locale/zh_CN.js +22 -7
  93. package/lib/locale/zh_CN.js.map +1 -1
  94. package/lib/schema-component/antd/action/Action.Designer.js +6 -6
  95. package/lib/schema-component/antd/action/Action.Designer.js.map +1 -1
  96. package/lib/schema-component/antd/action/Action.js +24 -17
  97. package/lib/schema-component/antd/action/Action.js.map +1 -1
  98. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +1 -1
  99. package/lib/schema-component/antd/filter/Filter.Action.Designer.js.map +1 -1
  100. package/lib/schema-component/antd/grid/Grid.d.ts +2 -0
  101. package/lib/schema-component/antd/grid/Grid.js +13 -4
  102. package/lib/schema-component/antd/grid/Grid.js.map +1 -1
  103. package/lib/schema-component/antd/menu/Menu.Designer.js +35 -23
  104. package/lib/schema-component/antd/menu/Menu.Designer.js.map +1 -1
  105. package/lib/schema-component/antd/menu/Menu.js +2 -2
  106. package/lib/schema-component/antd/menu/Menu.js.map +1 -1
  107. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  108. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js.map +1 -1
  109. package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -1
  110. package/lib/schema-component/antd/table/Table.Void.Designer.js.map +1 -1
  111. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  112. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js.map +1 -1
  113. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -2
  114. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js.map +1 -1
  115. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -1
  116. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js.map +1 -1
  117. package/lib/schema-component/antd/tabs/Tabs.Designer.js +13 -2
  118. package/lib/schema-component/antd/tabs/Tabs.Designer.js.map +1 -1
  119. package/lib/schema-initializer/buttons/BlockInitializers.js +1 -1
  120. package/lib/schema-initializer/buttons/BlockInitializers.js.map +1 -1
  121. package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -1
  122. package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js.map +1 -1
  123. package/lib/schema-initializer/buttons/FormItemInitializers.js +3 -13
  124. package/lib/schema-initializer/buttons/FormItemInitializers.js.map +1 -1
  125. package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +3 -13
  126. package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js.map +1 -1
  127. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  128. package/lib/schema-initializer/buttons/RecordBlockInitializers.js.map +1 -1
  129. package/lib/schema-settings/GeneralSchemaDesigner.js +15 -4
  130. package/lib/schema-settings/GeneralSchemaDesigner.js.map +1 -1
  131. package/lib/schema-templates/schemas/uiSchemaTemplates.js +67 -10
  132. package/lib/schema-templates/schemas/uiSchemaTemplates.js.map +1 -1
  133. package/lib/workflow/WorkflowLink.js +1 -1
  134. package/lib/workflow/WorkflowLink.js.map +1 -1
  135. package/lib/workflow/calculators.js +7 -5
  136. package/lib/workflow/calculators.js.map +1 -1
  137. package/lib/workflow/nodes/condition.d.ts +1 -1
  138. package/lib/workflow/nodes/condition.js +13 -10
  139. package/lib/workflow/nodes/condition.js.map +1 -1
  140. package/lib/workflow/nodes/create.d.ts +1 -0
  141. package/lib/workflow/nodes/index.js +3 -3
  142. package/lib/workflow/nodes/index.js.map +1 -1
  143. package/lib/workflow/nodes/parallel.js +8 -5
  144. package/lib/workflow/nodes/parallel.js.map +1 -1
  145. package/lib/workflow/nodes/query.js +1 -1
  146. package/lib/workflow/nodes/query.js.map +1 -1
  147. package/lib/workflow/nodes/update.d.ts +2 -1
  148. package/lib/workflow/nodes/update.js +12 -1
  149. package/lib/workflow/nodes/update.js.map +1 -1
  150. package/lib/workflow/schemas/collection.d.ts +1 -0
  151. package/lib/workflow/schemas/collection.js +3 -2
  152. package/lib/workflow/schemas/collection.js.map +1 -1
  153. package/lib/workflow/schemas/workflows.js +3 -2
  154. package/lib/workflow/schemas/workflows.js.map +1 -1
  155. package/lib/workflow/style.d.ts +1 -0
  156. package/lib/workflow/style.js +6 -5
  157. package/lib/workflow/style.js.map +1 -1
  158. package/lib/workflow/triggers/{model.d.ts → collection.d.ts} +1 -0
  159. package/lib/workflow/triggers/{model.js → collection.js} +7 -6
  160. package/lib/workflow/triggers/collection.js.map +1 -0
  161. package/lib/workflow/triggers/index.js +8 -5
  162. package/lib/workflow/triggers/index.js.map +1 -1
  163. package/package.json +3 -3
  164. package/src/block-provider/hooks/index.ts +10 -2
  165. package/src/collection-manager/types.ts +1 -0
  166. package/src/locale/en_US.ts +5 -1
  167. package/src/locale/zh_CN.ts +24 -7
  168. package/src/schema-component/antd/action/Action.Designer.tsx +2 -2
  169. package/src/schema-component/antd/action/Action.tsx +4 -2
  170. package/src/schema-component/antd/filter/Filter.Action.Designer.tsx +1 -1
  171. package/src/schema-component/antd/grid/Grid.tsx +31 -20
  172. package/src/schema-component/antd/menu/Menu.Designer.tsx +36 -26
  173. package/src/schema-component/antd/menu/Menu.tsx +12 -2
  174. package/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx +3 -1
  175. package/src/schema-component/antd/table/Table.Void.Designer.tsx +1 -1
  176. package/src/schema-component/antd/table-v2/Table.Column.Designer.tsx +1 -1
  177. package/src/schema-component/antd/table-v2/TableBlockDesigner.tsx +2 -2
  178. package/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx +1 -1
  179. package/src/schema-component/antd/tabs/Tabs.Designer.tsx +1 -1
  180. package/src/schema-initializer/buttons/BlockInitializers.tsx +1 -1
  181. package/src/schema-initializer/buttons/CreateFormBlockInitializers.tsx +4 -1
  182. package/src/schema-initializer/buttons/FormItemInitializers.tsx +5 -3
  183. package/src/schema-initializer/buttons/ReadPrettyFormItemInitializers.tsx +5 -3
  184. package/src/schema-initializer/buttons/RecordBlockInitializers.tsx +4 -1
  185. package/src/schema-settings/GeneralSchemaDesigner.tsx +20 -5
  186. package/src/schema-templates/schemas/uiSchemaTemplates.ts +23 -10
  187. package/src/workflow/WorkflowLink.tsx +1 -1
  188. package/src/workflow/calculators.tsx +10 -8
  189. package/src/workflow/nodes/condition.tsx +21 -38
  190. package/src/workflow/nodes/index.tsx +6 -4
  191. package/src/workflow/nodes/parallel.tsx +10 -7
  192. package/src/workflow/nodes/query.tsx +1 -1
  193. package/src/workflow/nodes/update.tsx +4 -1
  194. package/src/workflow/schemas/collection.ts +3 -2
  195. package/src/workflow/schemas/workflows.ts +3 -2
  196. package/src/workflow/style.tsx +4 -0
  197. package/src/workflow/triggers/{model.tsx → collection.tsx} +6 -5
  198. package/src/workflow/triggers/index.tsx +11 -5
  199. package/esm/workflow/triggers/model.js.map +0 -1
  200. package/lib/workflow/triggers/model.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/workflow/nodes/query.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,6BAA8B;AAE9B,2BAAkF;AAElF,oDAAmD;AACnD,8CAAgE;AAChE,oDAA2D;AAC3D,+CAA+C;AAE/C,kBAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,uBAAU;QAC/B,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,iBAAiB;YACvB,aAAa,EAAE,UAAU;YACzB,aAAa,EAAE,UAAU;YACzB,mBAAmB,EAAE;gBACnB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,qBAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,6BAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,iCAAA;KAClB;IACD,MAAM,YAAC,EAA2B;;YAAzB,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA;QACtB,IAAA,CAAC,GAAK,IAAA,8BAAc,GAAE,EAArB,CAAsB;QAC/B,IAAM,O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port { useCollectionDataSource, useCollectionManager, useCompile } from '../..';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet, VariableComponent } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\nimport { useTranslation } from 'react-i18next';\n\nexport default {\n title: '{{t(\"Query record\")}}',\n type: 'query',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.multiple': {\n type: 'boolean',\n title: '多条数据',\n name: 'config.multiple',\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-component-props': {\n disabled: true\n }\n },\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent\n },\n getter({ type, options, onChange }) {\n const { t } = useTranslation();\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { nodes } = useFlowContext();\n const { config } = nodes.find(n => n.id == options.nodeId);\n const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };\n\n return (\n <Select value={options.path} placeholder={t('Fields')} onChange={path => {\n onChange({ type, options: { ...options, path } });\n }}>\n {collection.fields\n .filter(field => BaseTypeSet.has(field.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/workflow/nodes/query.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,6BAA8B;AAE9B,2BAAkF;AAElF,oDAAmD;AACnD,8CAAgE;AAChE,oDAA2D;AAC3D,+CAA+C;AAE/C,kBAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,uBAAU;QAC/B,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,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Q,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,wBAAO,OAAO,KAAE,IAAI,MAAA,GAAE,EAAE,CAAC,CAAC;YACpD,CAAC,gBACE,UAAU,CAAC,MAAM;iBACf,MAAM,CAAC,UAAA,KAAK,YAAI,OAAA,yBAAW,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAA,EAAA,CAAC;iBACtD,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CACd,uBAAC,aAAM,CAAC,MAAM,aAAkB,KAAK,EAAE,KAAK,CAAC,IAAI,gBAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAA7D,KAAK,CAAC,IAAI,CAAoE,CACnG,EAFe,CAEf,CAAC,YACK,CACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import React from 'react';\nimport { Select } from 'antd';\n\nimport { useCollectionDataSource, useCollectionManager, useCompile } from '../..';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet, VariableComponent } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\nimport { useTranslation } from 'react-i18next';\n\nexport default {\n title: '{{t(\"Query record\")}}',\n type: 'query',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.multiple': {\n type: 'boolean',\n title: '{{t(\"Multiple records\")}}',\n name: 'config.multiple',\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-component-props': {\n disabled: true\n }\n },\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent\n },\n getter({ type, options, onChange }) {\n const { t } = useTranslation();\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { nodes } = useFlowContext();\n const { config } = nodes.find(n => n.id == options.nodeId);\n const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };\n\n return (\n <Select value={options.path} placeholder={t('Fields')} onChange={path => {\n onChange({ type, options: { ...options, path } });\n }}>\n {collection.fields\n .filter(field => BaseTypeSet.has(field.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
@@ -22,8 +22,8 @@ declare const _default: {
22
22
  'x-decorator': string;
23
23
  properties: {
24
24
  filter: {
25
- type: string;
26
25
  title: string;
26
+ type: string;
27
27
  name: string;
28
28
  'x-decorator': string;
29
29
  'x-decorator-props': {
@@ -49,6 +49,7 @@ declare const _default: {
49
49
  className: string;
50
50
  };
51
51
  'x-component': string;
52
+ description: string;
52
53
  };
53
54
  };
54
55
  };
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  var __1 = require("../..");
4
15
  var calculators_1 = require("../calculators");
@@ -15,7 +26,7 @@ exports.default = {
15
26
  title: '',
16
27
  'x-decorator': 'FormItem',
17
28
  properties: {
18
- filter: collection_1.filter,
29
+ filter: __assign(__assign({}, collection_1.filter), { title: '{{t("Only update records matching conditions")}}' }),
19
30
  values: collection_1.values
20
31
  }
21
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":";;AAAA,2BAAgD;AAChD,8CAAuE;AACvE,oDAAmE;AAEnE,kBAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,uBAAU;QAC/B,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,qBAAA;gBACN,MAAM,qBAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,6BAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,iCAAA;QACjB,kBAAkB,kCAAA;KACnB;CACF,CAAC","sourcesContent":["import { useCollectionDataSource } from '../..';\nimport { CollectionFieldset, VariableComponent } from '../calculators';\nimport { collection, filter, values } from '../schemas/collection';\n\nexport default {\n title: '{{t(\"Update record\")}}',\n type: 'update',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter,\n values\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent,\n CollectionFieldset\n }\n};\n"]}
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2BAAgD;AAChD,8CAAuE;AACvE,oDAAmE;AAEnE,kBAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,uBAAU;QAC/B,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,wBACD,mBAAM,KACT,KAAK,EAAE,kDAAkD,GAC1D;gBACD,MAAM,qBAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,6BAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,iCAAA;QACjB,kBAAkB,kCAAA;KACnB;CACF,CAAC","sourcesContent":["import { useCollectionDataSource } from '../..';\nimport { CollectionFieldset, VariableComponent } from '../calculators';\nimport { collection, filter, values } from '../schemas/collection';\n\nexport default {\n title: '{{t(\"Update record\")}}',\n type: 'update',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter: {\n ...filter,\n title: '{{t(\"Only update records matching conditions\")}}',\n },\n values\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent,\n CollectionFieldset\n }\n};\n"]}
@@ -17,6 +17,7 @@ export declare const values: {
17
17
  className: string;
18
18
  };
19
19
  'x-component': string;
20
+ description: string;
20
21
  };
21
22
  export declare const filter: {
22
23
  type: string;
@@ -19,14 +19,15 @@ exports.collection = {
19
19
  };
20
20
  exports.values = {
21
21
  type: 'object',
22
- title: '{{t("Form values")}}',
22
+ title: '{{t("Fields values")}}',
23
23
  name: 'config.params.values',
24
24
  'x-decorator': 'FormItem',
25
25
  'x-decorator-props': {
26
26
  labelAlign: 'left',
27
27
  className: (0, css_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n "], ["\n flex-direction: column;\n "])))
28
28
  },
29
- 'x-component': 'CollectionFieldset'
29
+ 'x-component': 'CollectionFieldset',
30
+ description: '{{t("Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.")}}',
30
31
  };
31
32
  exports.filter = {
32
33
  type: 'object',
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;;;;AAAA,oCAAmC;AACnC,wCAAyC;AAEzC,sEAAmF;AAEtE,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,CAAC,+BAA+B,CAAC;IAChD,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,QAAQ;CACxB,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,MAAE,SAAG,2GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,oBAAoB;CACpC,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,MAAE,SAAG,2GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,QAAQ;IACvB,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,MAAM,GAAK,IAAA,eAAO,GAAE,OAAd,CAAe;YAC7B,IAAM,OAAO,GAAG,IAAA,yCAA0B,EAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,SAAA;gBACP,SAAS,MAAE,SAAG,uIAAA,mEAGb,IAAA;aACF,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,mBAAmB;KACtC;CACF,CAAC","sourcesContent":["import { css } from \"@emotion/css\";\nimport { useForm } from \"@formily/react\";\nimport { useCollectionManager } from \"../../collection-manager\";\nimport { useCollectionFilterOptions } from \"../../collection-manager/action-hooks\";\n\nexport const collection = {\n type: 'string',\n title: '{{t(\"Collection\")}}',\n name: 'config.collection',\n required: true,\n 'x-reactions': ['{{useCollectionDataSource()}}'],\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n};\n\nexport const values = {\n type: 'object',\n title: '{{t(\"Form values\")}}',\n name: 'config.params.values',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'CollectionFieldset'\n};\n\nexport const filter = {\n type: 'object',\n title: '{{t(\"Filter\")}}',\n name: 'config.params.filter',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'Filter',\n 'x-component-props': {\n useProps() {\n const { values } = useForm();\n const options = useCollectionFilterOptions(values.config?.collection);\n return {\n options,\n className: css`\n position: relative;\n width: 100%;\n `\n };\n },\n dynamicComponent: 'VariableComponent'\n }\n};\n"]}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;;;;AAAA,oCAAmC;AACnC,wCAAyC;AAEzC,sEAAmF;AAEtE,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,CAAC,+BAA+B,CAAC;IAChD,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,QAAQ;CACxB,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,MAAE,SAAG,2GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,oBAAoB;IACnC,WAAW,EAAE,6IAA6I;CAC3J,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,MAAE,SAAG,2GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,QAAQ;IACvB,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,MAAM,GAAK,IAAA,eAAO,GAAE,OAAd,CAAe;YAC7B,IAAM,OAAO,GAAG,IAAA,yCAA0B,EAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,SAAA;gBACP,SAAS,MAAE,SAAG,uIAAA,mEAGb,IAAA;aACF,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,mBAAmB;KACtC;CACF,CAAC","sourcesContent":["import { css } from \"@emotion/css\";\nimport { useForm } from \"@formily/react\";\nimport { useCollectionManager } from \"../../collection-manager\";\nimport { useCollectionFilterOptions } from \"../../collection-manager/action-hooks\";\n\nexport const collection = {\n type: 'string',\n title: '{{t(\"Collection\")}}',\n name: 'config.collection',\n required: true,\n 'x-reactions': ['{{useCollectionDataSource()}}'],\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n};\n\nexport const values = {\n type: 'object',\n title: '{{t(\"Fields values\")}}',\n name: 'config.params.values',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'CollectionFieldset',\n description: '{{t(\"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.\")}}',\n};\n\nexport const filter = {\n type: 'object',\n title: '{{t(\"Filter\")}}',\n name: 'config.params.filter',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'Filter',\n 'x-component-props': {\n useProps() {\n const { values } = useForm();\n const options = useCollectionFilterOptions(values.config?.collection);\n return {\n options,\n className: css`\n position: relative;\n width: 100%;\n `\n };\n },\n dynamicComponent: 'VariableComponent'\n }\n};\n"]}
@@ -75,6 +75,7 @@ var collection = {
75
75
  ],
76
76
  'x-component': 'Radio.Group',
77
77
  'x-decorator': 'FormItem',
78
+ default: false
78
79
  }
79
80
  }
80
81
  ],
@@ -244,7 +245,7 @@ exports.workflowSchema = {
244
245
  },
245
246
  executions: {
246
247
  type: 'void',
247
- title: '{{t("Executions")}}',
248
+ title: '{{t("Execution History")}}',
248
249
  'x-component': 'Action.Link',
249
250
  'x-component-props': {
250
251
  type: 'primary',
@@ -252,7 +253,7 @@ exports.workflowSchema = {
252
253
  properties: {
253
254
  drawer: {
254
255
  type: 'void',
255
- title: '{{t("Executions")}}',
256
+ title: '{{t("Execution History")}}',
256
257
  'x-component': 'Action.Drawer',
257
258
  properties: executions_1.executionSchema
258
259
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/schemas/workflows.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AACA,wCAAuC;AACvC,2CAA+C;AAE/C,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,EAAkB;wBAAlB,KAAA,aAAkB,EAAjB,KAAK,QAAA,EA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EACD,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,YAAY;wCACZ,kBAAkB;wCAClB,gCAAgC;wCAChC,kCAAkC;wCAClC,2BAA2B;wCAC3B,iBAAiB;wCACjB,yCAAyC;wCACzC,iEAAiE;wCACjE,SAAS;wCACT,0DAA0D;wCAC1D,OAAO;wCACP,KAAK;qCACN;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { triggers } from '../triggers';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Name\")}}',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '{{t(\"Trigger type\")}}',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: Array.from(triggers.getEntities()).map(([value, { title }]) => ({\n value,\n label: title,\n })),\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'description',\n interface: 'textarea',\n uiSchema: {\n title: '{{t(\"Description\")}}',\n type: 'string',\n 'x-component': 'Input.TextArea',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '{{t(\"Status\")}}',\n type: 'string',\n enum: [\n { label: '{{t(\"Enabled\")}}', value: true },\n { label: '{{t(\"Disabled\")}}', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '{{t(\"Delete\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete record')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '{{t(\"Add new\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '{{t(\"Add new\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n 'x-component': 'WorkflowLink'\n },\n executions: {\n type: 'void',\n title: '{{t(\"Executions\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Executions\")}}',\n 'x-component': 'Action.Drawer',\n properties: executionSchema\n }\n }\n },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '{{ t(\"Edit\") }}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/schemas/workflows.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AACA,wCAAuC;AACvC,2CAA+C;AAE/C,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,EAAkB;wBAAlB,KAAA,aAAkB,EAAjB,KAAK,QAAA,EAAI,KAAK,cAAA;oBAAQ,OAAA,CAAC;wBACpE,KAAK,OAAA;wBACL,KAAK,EAAE,KAAK;qBACb,CAAC;gBAHmE,CAGnE,CAAC;gBACH,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,I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0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,YAAY;wCACZ,kBAAkB;wCAClB,gCAAgC;wCAChC,kCAAkC;wCAClC,2BAA2B;wCAC3B,iBAAiB;wCACjB,yCAAyC;wCACzC,iEAAiE;wCACjE,SAAS;wCACT,0DAA0D;wCAC1D,OAAO;wCACP,KAAK;qCACN;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { triggers } from '../triggers';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Name\")}}',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '{{t(\"Trigger type\")}}',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: Array.from(triggers.getEntities()).map(([value, { title }]) => ({\n value,\n label: title,\n })),\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'description',\n interface: 'textarea',\n uiSchema: {\n title: '{{t(\"Description\")}}',\n type: 'string',\n 'x-component': 'Input.TextArea',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '{{t(\"Status\")}}',\n type: 'string',\n enum: [\n { label: '{{t(\"Enabled\")}}', value: true },\n { label: '{{t(\"Disabled\")}}', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n default: false\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '{{t(\"Delete\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete record')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '{{t(\"Add new\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '{{t(\"Add new\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n 'x-component': 'WorkflowLink'\n },\n executions: {\n type: 'void',\n title: '{{t(\"Execution History\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Execution History\")}}',\n 'x-component': 'Action.Drawer',\n properties: executionSchema\n }\n }\n },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '{{ t(\"Edit\") }}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
@@ -5,6 +5,7 @@ export declare const nodeBlockClass: string;
5
5
  export declare const nodeClass: string;
6
6
  export declare const nodeCardClass: string;
7
7
  export declare const nodeHeaderClass: string;
8
+ export declare const nodeMetaClass: string;
8
9
  export declare const nodeTitleClass: string;
9
10
  export declare const nodeSubtreeClass: string;
10
11
  export declare const addButtonClass: string;
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  return cooked;
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.addButtonClass = exports.nodeSubtreeClass = exports.nodeTitleClass = exports.nodeHeaderClass = exports.nodeCardClass = exports.nodeClass = exports.nodeBlockClass = exports.branchClass = exports.branchBlockClass = exports.workflowPageClass = void 0;
7
+ exports.addButtonClass = exports.nodeSubtreeClass = exports.nodeTitleClass = exports.nodeMetaClass = exports.nodeHeaderClass = exports.nodeCardClass = exports.nodeClass = exports.nodeBlockClass = exports.branchClass = exports.branchBlockClass = exports.workflowPageClass = void 0;
8
8
  var css_1 = require("@emotion/css");
9
9
  exports.workflowPageClass = (0, css_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n overflow: auto;\n\n .workflow-canvas{\n width: min-content;\n min-width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n }\n"], ["\n height: 100%;\n width: 100%;\n overflow: auto;\n\n .workflow-canvas{\n width: min-content;\n min-width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n }\n"])));
10
10
  exports.branchBlockClass = (0, css_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n position: relative;\n\n :before{\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - .5px);\n width: 1px;\n background-color: #f0f2f5;\n }\n"], ["\n display: flex;\n position: relative;\n\n :before{\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - .5px);\n width: 1px;\n background-color: #f0f2f5;\n }\n"])));
@@ -13,8 +13,9 @@ exports.nodeBlockClass = (0, css_1.css)(templateObject_4 || (templateObject_4 =
13
13
  exports.nodeClass = (0, css_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"], ["\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"])));
14
14
  exports.nodeCardClass = (0, css_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 20em;\n background: #fff;\n padding: 1em;\n box-shadow: 0 .25em .5em rgba(0, 0, 0, .1);\n\n .workflow-node-remove-button{\n position: absolute;\n right: -.5em;\n top: -.5em;\n color: #999;\n opacity: 0;\n transition: opacity .3s ease;\n\n &:hover {\n color: red;\n }\n }\n\n &:hover{\n .workflow-node-remove-button{\n opacity: 1;\n }\n }\n"], ["\n width: 20em;\n background: #fff;\n padding: 1em;\n box-shadow: 0 .25em .5em rgba(0, 0, 0, .1);\n\n .workflow-node-remove-button{\n position: absolute;\n right: -.5em;\n top: -.5em;\n color: #999;\n opacity: 0;\n transition: opacity .3s ease;\n\n &:hover {\n color: red;\n }\n }\n\n &:hover{\n .workflow-node-remove-button{\n opacity: 1;\n }\n }\n"])));
15
15
  exports.nodeHeaderClass = (0, css_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
16
- exports.nodeTitleClass = (0, css_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n"], ["\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n"])));
17
- exports.nodeSubtreeClass = (0, css_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n"], ["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n"])));
18
- exports.addButtonClass = (0, css_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n flex-shrink: 0;\n padding: 2em 0;\n"], ["\n flex-shrink: 0;\n padding: 2em 0;\n"])));
19
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
16
+ exports.nodeMetaClass = (0, css_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-bottom: .5em;\n"], ["\n margin-bottom: .5em;\n"])));
17
+ exports.nodeTitleClass = (0, css_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n"], ["\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n"])));
18
+ exports.nodeSubtreeClass = (0, css_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n"], ["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n"])));
19
+ exports.addButtonClass = (0, css_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n flex-shrink: 0;\n padding: 2em 0;\n"], ["\n flex-shrink: 0;\n padding: 2em 0;\n"])));
20
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
20
21
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/workflow/style.tsx"],"names":[],"mappings":";;;;;;;AAAA,oCAAmC;AAEtB,QAAA,iBAAiB,OAAG,SAAG,qSAAA,iOAanC,KAAC;AAEW,QAAA,gBAAgB,OAAG,SAAG,4RAAA,wNAalC,KAAC;AAEW,QAAA,WAAW,OAAG,SAAG,i4BAAA,6zBAuD7B,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,wMAAA,oIAOhC,KAAC;AAEW,QAAA,SAAS,OAAG,SAAG,gKAAA,4FAK3B,KAAC;AAEW,QAAA,aAAa,OAAG,SAAG,mdAAA,+YAwB/B,KAAC;AAEW,QAAA,eAAe,OAAG,SAAG,+FAAA,2BAEjC,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,+IAAA,2EAMhC,KAAC;AAEW,QAAA,gBAAgB,OAAG,SAAG,qJAAA,iFAIlC,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,gHAAA,0CAGhC,KAAC","sourcesContent":["import { css } from '@emotion/css';\n\nexport const workflowPageClass = css`\n height: 100%;\n width: 100%;\n overflow: auto;\n\n .workflow-canvas{\n width: min-content;\n min-width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n }\n`;\n\nexport const branchBlockClass = css`\n display: flex;\n position: relative;\n\n :before{\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - .5px);\n width: 1px;\n background-color: #f0f2f5;\n }\n`;\n\nexport const branchClass = css`\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n padding: 0 2em;\n\n .workflow-node-list{\n flex-grow: 1;\n min-width: 20em;\n }\n\n .workflow-branch-lines{\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: #ddd;\n }\n\n :before,:after{\n content: \"\";\n position: absolute;\n height: 1px;\n background-color: #ddd;\n }\n\n :before{\n top: 0;\n }\n\n :after{\n bottom: 0;\n }\n\n :not(:first-child):not(:last-child){\n :before,:after{\n left: 0;\n width: 100%;\n }\n }\n\n :last-child:not(:first-child){\n :before,:after{\n right: 50%;\n width: 50%;\n }\n }\n\n :first-child:not(:last-child){\n :before,:after{\n left: 50%;\n width: 50%;\n }\n }\n`;\n\nexport const nodeBlockClass = css`\n flex-grow: 1;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n`;\n\nexport const nodeClass = css`\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const nodeCardClass = css`\n width: 20em;\n background: #fff;\n padding: 1em;\n box-shadow: 0 .25em .5em rgba(0, 0, 0, .1);\n\n .workflow-node-remove-button{\n position: absolute;\n right: -.5em;\n top: -.5em;\n color: #999;\n opacity: 0;\n transition: opacity .3s ease;\n\n &:hover {\n color: red;\n }\n }\n\n &:hover{\n .workflow-node-remove-button{\n opacity: 1;\n }\n }\n`;\n\nexport const nodeHeaderClass = css`\n position: relative;\n`;\n\nexport const nodeTitleClass = css`\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n`;\n\nexport const nodeSubtreeClass = css`\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n`;\n\nexport const addButtonClass = css`\n flex-shrink: 0;\n padding: 2em 0;\n`;\n"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/workflow/style.tsx"],"names":[],"mappings":";;;;;;;AAAA,oCAAmC;AAEtB,QAAA,iBAAiB,OAAG,SAAG,qSAAA,iOAanC,KAAC;AAEW,QAAA,gBAAgB,OAAG,SAAG,4RAAA,wNAalC,KAAC;AAEW,QAAA,WAAW,OAAG,SAAG,i4BAAA,6zBAuD7B,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,wMAAA,oIAOhC,KAAC;AAEW,QAAA,SAAS,OAAG,SAAG,gKAAA,4FAK3B,KAAC;AAEW,QAAA,aAAa,OAAG,SAAG,mdAAA,+YAwB/B,KAAC;AAEW,QAAA,eAAe,OAAG,SAAG,+FAAA,2BAEjC,KAAC;AAEW,QAAA,aAAa,OAAG,SAAG,gGAAA,4BAE/B,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,+IAAA,2EAMhC,KAAC;AAEW,QAAA,gBAAgB,OAAG,SAAG,uJAAA,iFAIlC,KAAC;AAEW,QAAA,cAAc,OAAG,SAAG,gHAAA,0CAGhC,KAAC","sourcesContent":["import { css } from '@emotion/css';\n\nexport const workflowPageClass = css`\n height: 100%;\n width: 100%;\n overflow: auto;\n\n .workflow-canvas{\n width: min-content;\n min-width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n }\n`;\n\nexport const branchBlockClass = css`\n display: flex;\n position: relative;\n\n :before{\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - .5px);\n width: 1px;\n background-color: #f0f2f5;\n }\n`;\n\nexport const branchClass = css`\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n padding: 0 2em;\n\n .workflow-node-list{\n flex-grow: 1;\n min-width: 20em;\n }\n\n .workflow-branch-lines{\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: #ddd;\n }\n\n :before,:after{\n content: \"\";\n position: absolute;\n height: 1px;\n background-color: #ddd;\n }\n\n :before{\n top: 0;\n }\n\n :after{\n bottom: 0;\n }\n\n :not(:first-child):not(:last-child){\n :before,:after{\n left: 0;\n width: 100%;\n }\n }\n\n :last-child:not(:first-child){\n :before,:after{\n right: 50%;\n width: 50%;\n }\n }\n\n :first-child:not(:last-child){\n :before,:after{\n left: 50%;\n width: 50%;\n }\n }\n`;\n\nexport const nodeBlockClass = css`\n flex-grow: 1;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n`;\n\nexport const nodeClass = css`\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const nodeCardClass = css`\n width: 20em;\n background: #fff;\n padding: 1em;\n box-shadow: 0 .25em .5em rgba(0, 0, 0, .1);\n\n .workflow-node-remove-button{\n position: absolute;\n right: -.5em;\n top: -.5em;\n color: #999;\n opacity: 0;\n transition: opacity .3s ease;\n\n &:hover {\n color: red;\n }\n }\n\n &:hover{\n .workflow-node-remove-button{\n opacity: 1;\n }\n }\n`;\n\nexport const nodeHeaderClass = css`\n position: relative;\n`;\n\nexport const nodeMetaClass = css`\n margin-bottom: .5em;\n`;\n\nexport const nodeTitleClass = css`\n font-weight: normal;\n\n .workflow-node-id{\n color: #999;\n }\n`;\n\nexport const nodeSubtreeClass = css`\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n`;\n\nexport const addButtonClass = css`\n flex-shrink: 0;\n padding: 2em 0;\n`;\n"]}
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  label: string;
27
27
  }[];
28
28
  };
29
+ required: boolean;
29
30
  };
30
31
  'config.changed': {
31
32
  type: string;
@@ -43,8 +43,8 @@ function useCollectionFieldsDataSource() {
43
43
  };
44
44
  }
45
45
  exports.default = {
46
- title: '{{t("Model event")}}',
47
- type: 'model',
46
+ title: '{{t("Collection event")}}',
47
+ type: 'collection',
48
48
  fieldset: {
49
49
  'config.collection': collection_1.collection,
50
50
  'config.mode': {
@@ -60,13 +60,14 @@ exports.default = {
60
60
  { value: 3, label: '{{t("After record added or updated")}}' },
61
61
  { value: 4, label: '{{t("After record deleted")}}' }
62
62
  ]
63
- }
63
+ },
64
+ required: true
64
65
  },
65
66
  'config.changed': {
66
67
  type: 'array',
67
68
  name: 'changed',
68
69
  title: '{{t("Changed fields")}}',
69
- description: '{{t("Select the fields which changed will trigger the event only")}}',
70
+ description: '{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.")}}',
70
71
  'x-decorator': 'FormItem',
71
72
  'x-component': 'Select',
72
73
  'x-component-props': {
@@ -76,7 +77,7 @@ exports.default = {
76
77
  '{{useCollectionFieldsDataSource()}}'
77
78
  ]
78
79
  },
79
- 'config.condition': __assign(__assign({}, collection_1.filter), { name: 'config.condition', title: '{{t("Match condition")}}' })
80
+ 'config.condition': __assign(__assign({}, collection_1.filter), { name: 'config.condition', title: '{{t("Only triggers when match conditions")}}' })
80
81
  },
81
82
  scope: {
82
83
  useCollectionDataSource: collection_manager_1.useCollectionDataSource,
@@ -97,4 +98,4 @@ exports.default = {
97
98
  .map(function (field) { return ((0, jsx_runtime_1.jsx)(antd_1.Select.Option, __assign({ value: field.name }, { children: compile(field.uiSchema.title) }), field.name)); }) }), void 0));
98
99
  }
99
100
  };
100
- //# sourceMappingURL=model.js.map
101
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/triggers/collection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,6BAA8B;AAC9B,8CAA2C;AAC3C,wCAAyC;AAEzC,+DAAyF;AACzF,2DAAoD;AAEpD,oDAAmD;AACnD,8CAA6C;AAC7C,oDAA2D;AAC3D,+CAA+C;AAE/C,SAAS,6BAA6B;;IACpC,IAAM,OAAO,GAAG,IAAA,6BAAU,GAAE,CAAC;IACrB,IAAA,mBAAmB,GAAK,IAAA,yCAAoB,GAAE,oBAA3B,CAA4B;IAC/C,IAAA,MAAM,GAAK,IAAA,eAAO,GAAE,OAAd,CAAe;IAC7B,IAAM,MAAM,GAAG,mBAAmB,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,UAAU,CAAC,CAAC;IAE/D,OAAO,UAAC,KAAU;QAChB,iBAAM,CAAC,KAAK,CAAC,UAAC,IAAS;YACrB,KAAK,CAAC,UAAU,GAAG,IAAI;iBACpB,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,CACf,CAAC,KAAK,CAAC,MAAM;mBACV,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAC9D,EAHgB,CAGhB,CAAC;iBACD,GAAG,CAAC,UAAA,KAAK;;gBAAI,OAAA,CAAC;oBACb,KAAK,EAAE,OAAO,CAAC,MAAA,KAAK,CAAC,QAAQ,0CAAE,KAAK,CAAC;oBACrC,KAAK,EA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 'react';\nimport { Select } from 'antd';\nimport { action } from '@formily/reactive';\nimport { useForm } from '@formily/react';\n\nimport { useCollectionDataSource, useCollectionManager } from '../../collection-manager';\nimport { useCompile } from '../../schema-component';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\nimport { useTranslation } from 'react-i18next';\n\nfunction useCollectionFieldsDataSource() {\n const compile = useCompile();\n const { getCollectionFields } = useCollectionManager();\n const { values } = useForm();\n const fields = getCollectionFields(values?.config?.collection);\n\n return (field: any) => {\n action.bound((data: any) => {\n field.dataSource = data\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)\n ))\n .map(field => ({\n label: compile(field.uiSchema?.title),\n value: field.name\n }));\n })(fields);\n };\n}\n\nexport default {\n title: '{{t(\"Collection event\")}}',\n type: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.mode': {\n type: 'number',\n title: '{{t(\"Trigger on\")}}',\n name: 'config.mode',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n options: [\n { value: 1, label: '{{t(\"After record added\")}}' },\n { value: 2, label: '{{t(\"After record updated\")}}' },\n { value: 3, label: '{{t(\"After record added or updated\")}}' },\n { value: 4, label: '{{t(\"After record deleted\")}}' }\n ]\n },\n required: true\n },\n 'config.changed': {\n type: 'array',\n name: 'changed',\n title: '{{t(\"Changed fields\")}}',\n description: '{{t(\"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.\")}}',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n mode: 'multiple',\n },\n 'x-reactions': [\n '{{useCollectionFieldsDataSource()}}'\n ]\n },\n 'config.condition': {\n ...filter,\n name: 'config.condition',\n title: '{{t(\"Only triggers when match conditions\")}}'\n }\n },\n scope: {\n useCollectionDataSource,\n useCollectionFieldsDataSource\n },\n getter({ type, options, onChange }) {\n const { t } = useTranslation();\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { workflow } = useFlowContext();\n const collection = collections.find(item => item.name === workflow.config.collection) ?? { fields: [] };\n\n return (\n <Select\n placeholder={t('Fields')}\n value={options?.path?.replace(/^data\\./, '')}\n onChange={(path) => {\n onChange({ type, options: { ...options, path: `data.${path}` } });\n }}\n >\n {collection.fields\n .filter(field => BaseTypeSet.has(field?.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
@@ -56,8 +56,10 @@ var react_1 = require("@formily/react");
56
56
  var css_1 = require("@emotion/css");
57
57
  var utils_1 = require("@nocobase/utils");
58
58
  var __1 = require("../../");
59
- var model_1 = __importDefault(require("./model"));
59
+ var collection_1 = __importDefault(require("./collection"));
60
60
  var style_1 = require("../style");
61
+ var react_i18next_1 = require("react-i18next");
62
+ var antd_1 = require("antd");
61
63
  function useUpdateConfigAction() {
62
64
  var form = (0, react_1.useForm)();
63
65
  var api = (0, __1.useAPIClient)();
@@ -90,8 +92,9 @@ function useUpdateConfigAction() {
90
92
  ;
91
93
  ;
92
94
  exports.triggers = new utils_1.Registry();
93
- exports.triggers.register(model_1.default.type, model_1.default);
95
+ exports.triggers.register(collection_1.default.type, collection_1.default);
94
96
  var TriggerConfig = function () {
97
+ var t = (0, react_i18next_1.useTranslation)().t;
95
98
  var compile = (0, __1.useCompile)();
96
99
  var data = (0, __1.useResourceActionContext)().data;
97
100
  if (!data) {
@@ -99,15 +102,15 @@ var TriggerConfig = function () {
99
102
  }
100
103
  var _a = data.data, type = _a.type, config = _a.config;
101
104
  var _b = exports.triggers.get(type), title = _b.title, fieldset = _b.fieldset, scope = _b.scope;
102
- return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, css_1.cx)(style_1.nodeCardClass) }, { children: [(0, jsx_runtime_1.jsx)("h4", { children: compile(title) }, void 0), (0, jsx_runtime_1.jsx)(__1.SchemaComponent, { schema: {
105
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, css_1.cx)(style_1.nodeCardClass) }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: (0, css_1.cx)(style_1.nodeMetaClass) }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, __assign({ color: "gold" }, { children: t('Trigger') }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("h4", { children: compile(title) }, void 0), (0, jsx_runtime_1.jsx)(__1.SchemaComponent, { schema: {
103
106
  type: 'void',
104
- title: '{{t("Trigger configuration")}}',
107
+ title: '{{t("Configure")}}',
105
108
  'x-component': 'Action.Link',
106
109
  name: 'drawer',
107
110
  properties: {
108
111
  drawer: {
109
112
  type: 'void',
110
- title: '{{t("Trigger configuration")}}',
113
+ title: '{{t("Configure")}}',
111
114
  'x-component': 'Action.Drawer',
112
115
  'x-decorator': 'Form',
113
116
  'x-decorator-props': {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAkD;AAClD,oCAAkC;AAClC,yCAA2C;AAE3C,4BAAsI;AACtI,kDAA4B;AAC5B,kCAAyC;AAGzC,SAAS,qBAAqB;IAC5B,IAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;IACvB,IAAM,GAAG,GAAG,IAAA,gBAAY,GAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,IAAA,aAAS,GAAE,CAAC;IAC3B,IAAM,GAAG,GAAG,IAAA,oBAAgB,GAAE,CAAC;IACvB,IAAA,OAAO,GAAK,IAAA,4BAAwB,GAAE,QAA/B,CAAgC;IAC/C,OAAO;QACC,GAAG;;;;gCACP,qBAAM,IAAI,CAAC,MAAM,EAAE,EAAA;;4BAAnB,SAAmB,CAAC;4BACpB,qBAAM,GAAG,CAAC,QAA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,mBAAmB,EAAE;gCACnB,YAAY,EAAE,EAAE,MAAM,QAAA,EAAE;6BACzB;4BACD,UAAU,EAAE;gCACV,MAAM,EAAE;oCACN,IAAI,EAAE,MAAM;oCACZ,IAAI,EAAE,QAAQ;oCACd,aAAa,EAAE,UAAU;oCACzB,mBAAmB,EAAE,EAAE;oCACvB,UAAU,EAAE,QAAQ;iCACrB;gCACD,OAAO,EAAE;oCACP,IAAI,EAAE,MAAM;oCACZ,aAAa,EAAE,sBAAsB;oCACrC,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,SAAS,EAAE,0BAA0B;6CACtC;yCACF;wCACD,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,IAAI,EAAE,SAAS;gDACf,SAAS,EAAE,qBAAqB;6CACjC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF,EACD,KAAK,EAAE,KAAK,WACZ,aACE,CACP,CAAC;AACJ,CAAC,CAAA;AA/DY,QAAA,aAAa,iBA+DzB","sourcesContent":["import React from \"react\";\nimport { ISchema, useForm } from \"@formily/react\";\nimport { cx } from \"@emotion/css\";\nimport { Registry } from \"@nocobase/utils\";\n\nimport { SchemaComponent, useActionContext, useAPIClient, useCompile, useRecord, useRequest, useResourceActionContext } from '../../';\nimport model from './model';\nimport { nodeCardClass } from \"../style\";\n\n\nfunction useUpdateConfigAction() {\n const form = useForm();\n const api = useAPIClient();\n const record = useRecord();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n return {\n async run() {\n await form.submit();\n await api.resource('workflows', record.id).update({\n filterByTk: record.id,\n values: form.values\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nexport interface Trigger {\n title: string;\n type: string;\n // group: string;\n options?: { label: string; value: any; key: string }[];\n fieldset: { [key: string]: ISchema };\n view?: ISchema;\n scope?: { [key: string]: any };\n components?: { [key: string]: any };\n render?(props): React.ReactElement;\n getter?(node: any): React.ReactElement;\n};\n\nexport const triggers = new Registry<Trigger>();\n\ntriggers.register(model.type, model);\n\nexport const TriggerConfig = () => {\n const compile = useCompile();\n const { data } = useResourceActionContext();\n if (!data) {\n return null;\n }\n const { type, config } = data.data;\n const { title, fieldset, scope } = triggers.get(type);\n return (\n <div className={cx(nodeCardClass)}>\n <h4>{compile(title)}</h4>\n <SchemaComponent\n schema={{\n type: 'void',\n title: '{{t(\"Trigger configuration\")}}',\n 'x-component': 'Action.Link',\n name: 'drawer',\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Trigger configuration\")}}',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n initialValue: { config }\n },\n properties: {\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: fieldset\n },\n actions: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: useUpdateConfigAction\n }\n }\n }\n }\n }\n }\n }\n }}\n scope={scope}\n />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAkD;AAClD,oCAAkC;AAClC,yCAA2C;AAE3C,4BAAsI;AACtI,4DAAsC;AACtC,kCAAwD;AACxD,+CAA+C;AAC/C,6BAA2B;AAG3B,SAAS,qBAAqB;IAC5B,IAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;IACvB,IAAM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CAAC,CAAA;AAnEY,QAAA,aAAa,iBAmEzB","sourcesContent":["import React from \"react\";\nimport { ISchema, useForm } from \"@formily/react\";\nimport { cx } from \"@emotion/css\";\nimport { Registry } from \"@nocobase/utils\";\n\nimport { SchemaComponent, useActionContext, useAPIClient, useCompile, useRecord, useRequest, useResourceActionContext } from '../../';\nimport collection from './collection';\nimport { nodeCardClass, nodeMetaClass } from \"../style\";\nimport { useTranslation } from \"react-i18next\";\nimport { Tag } from \"antd\";\n\n\nfunction useUpdateConfigAction() {\n const form = useForm();\n const api = useAPIClient();\n const record = useRecord();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n return {\n async run() {\n await form.submit();\n await api.resource('workflows', record.id).update({\n filterByTk: record.id,\n values: form.values\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nexport interface Trigger {\n title: string;\n type: string;\n // group: string;\n options?: { label: string; value: any; key: string }[];\n fieldset: { [key: string]: ISchema };\n view?: ISchema;\n scope?: { [key: string]: any };\n components?: { [key: string]: any };\n render?(props): React.ReactElement;\n getter?(node: any): React.ReactElement;\n};\n\nexport const triggers = new Registry<Trigger>();\n\ntriggers.register(collection.type, collection);\n\nexport const TriggerConfig = () => {\n const { t } = useTranslation();\n const compile = useCompile();\n const { data } = useResourceActionContext();\n if (!data) {\n return null;\n }\n const { type, config } = data.data;\n const { title, fieldset, scope } = triggers.get(type);\n return (\n <div className={cx(nodeCardClass)}>\n <div className={cx(nodeMetaClass)}>\n <Tag color=\"gold\">{t('Trigger')}</Tag>\n </div>\n <h4>{compile(title)}</h4>\n <SchemaComponent\n schema={{\n type: 'void',\n title: '{{t(\"Configure\")}}',\n 'x-component': 'Action.Link',\n name: 'drawer',\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Configure\")}}',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n initialValue: { config }\n },\n properties: {\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: fieldset\n },\n actions: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: useUpdateConfigAction\n }\n }\n }\n }\n }\n }\n }\n }}\n scope={scope}\n />\n </div>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/client",
3
- "version": "0.7.0-alpha.26",
3
+ "version": "0.7.0-alpha.27",
4
4
  "license": "Apache-2.0",
5
5
  "licenses": [
6
6
  {
@@ -29,7 +29,7 @@
29
29
  "@formily/antd": "^2.0.15",
30
30
  "@formily/core": "^2.0.15",
31
31
  "@formily/react": "^2.0.15",
32
- "@nocobase/utils": "0.7.0-alpha.26",
32
+ "@nocobase/utils": "0.7.0-alpha.27",
33
33
  "ahooks": "^3.0.5",
34
34
  "antd": "~4.19.5",
35
35
  "axios": "^0.24.0",
@@ -66,5 +66,5 @@
66
66
  "@types/marked": "^4.0.1",
67
67
  "axios-mock-adapter": "^1.20.0"
68
68
  },
69
- "gitHead": "515d95276700ffafe7d2785a93fc510d36da462b"
69
+ "gitHead": "ebfe11ff09bf50b4b2322cbbad65b4ea936fdb71"
70
70
  }
@@ -1,4 +1,4 @@
1
- import { useFieldSchema, useForm } from '@formily/react';
1
+ import { useField, useFieldSchema, useForm } from '@formily/react';
2
2
  import { Modal } from 'antd';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useHistory } from 'react-router-dom';
@@ -59,6 +59,7 @@ export const useCreateActionProps = () => {
59
59
  const history = useHistory();
60
60
  const { t } = useTranslation();
61
61
  const actionSchema = useFieldSchema();
62
+ const actionField = useField();
62
63
  const { fields, getField } = useCollection();
63
64
  const compile = useCompile();
64
65
  return {
@@ -100,12 +101,15 @@ export const useCreateActionProps = () => {
100
101
  values[key] = form.values[key];
101
102
  }
102
103
  }
104
+ actionField.data = field.data || {};
105
+ actionField.data.loading = true;
103
106
  await resource.create({
104
107
  values: {
105
108
  ...values,
106
109
  ...overwriteValues,
107
110
  },
108
111
  });
112
+ actionField.data.loading = false;
109
113
  __parent?.service?.refresh?.();
110
114
  setVisible?.(false);
111
115
  const onSuccess = actionSchema?.['x-action-settings']?.onSuccess;
@@ -138,6 +142,7 @@ export const useUpdateActionProps = () => {
138
142
  const history = useHistory();
139
143
  const { fields, getField } = useCollection();
140
144
  const compile = useCompile();
145
+ const actionField = useField();
141
146
  return {
142
147
  async onClick() {
143
148
  const skipValidator = actionSchema?.['x-action-settings']?.skipValidator;
@@ -154,7 +159,7 @@ export const useUpdateActionProps = () => {
154
159
  values[key] = form.values[key];
155
160
  continue;
156
161
  }
157
- if (!field.added.has(key)) {
162
+ if (field.added && !field.added.has(key)) {
158
163
  continue;
159
164
  }
160
165
  const items = form.values[key];
@@ -184,6 +189,8 @@ export const useUpdateActionProps = () => {
184
189
  values[key] = form.values[key];
185
190
  }
186
191
  }
192
+ actionField.data = field.data || {};
193
+ actionField.data.loading = true;
187
194
  await resource.update({
188
195
  filterByTk,
189
196
  values: {
@@ -191,6 +198,7 @@ export const useUpdateActionProps = () => {
191
198
  ...overwriteValues,
192
199
  },
193
200
  });
201
+ actionField.data.loading = false;
194
202
  __parent?.service?.refresh?.();
195
203
  if (!(resource instanceof TableFieldResource)) {
196
204
  __parent?.__parent?.service?.refresh?.();
@@ -19,6 +19,7 @@ export interface CollectionOptions {
19
19
  title?: string;
20
20
  filterTargetKey?: string;
21
21
  targetKey?: string;
22
+ sortable?: any;
22
23
  fields?: FieldOptions[];
23
24
  }
24
25
 
@@ -280,5 +280,9 @@ export default {
280
280
  "Add card": "Add card",
281
281
  "edit title": "Edit Title",
282
282
  "Turn the page": "Turn the page",
283
- "Others": "Others"
283
+ "Others": "Others",
284
+
285
+ // workflows
286
+ 'Execution History': 'History',
287
+ 'Parallel branch': 'Branch',
284
288
  }