@nocobase/client 0.7.0-alpha.26 → 0.7.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/block-provider/hooks/index.js +10 -2
- package/esm/block-provider/hooks/index.js.map +1 -1
- package/esm/collection-manager/hooks/useCollection.d.ts +1 -0
- package/esm/collection-manager/types.d.ts +1 -0
- package/esm/collection-manager/types.js.map +1 -1
- package/esm/locale/en_US.d.ts +4 -0
- package/esm/locale/en_US.js +6 -1
- package/esm/locale/en_US.js.map +1 -1
- package/esm/locale/index.d.ts +29 -7
- package/esm/locale/zh_CN.d.ts +25 -7
- package/esm/locale/zh_CN.js +25 -7
- package/esm/locale/zh_CN.js.map +1 -1
- package/esm/schema-component/antd/action/Action.Designer.js +6 -6
- package/esm/schema-component/antd/action/Action.Designer.js.map +1 -1
- package/esm/schema-component/antd/action/Action.Drawer.js +60 -3
- package/esm/schema-component/antd/action/Action.Drawer.js.map +1 -1
- package/esm/schema-component/antd/action/Action.js +36 -19
- package/esm/schema-component/antd/action/Action.js.map +1 -1
- package/esm/schema-component/antd/action/context.d.ts +2 -0
- package/esm/schema-component/antd/action/context.js.map +1 -1
- package/esm/schema-component/antd/action/hooks.d.ts +2 -0
- package/esm/schema-component/antd/filter/Filter.Action.Designer.js +1 -1
- package/esm/schema-component/antd/filter/Filter.Action.Designer.js.map +1 -1
- package/esm/schema-component/antd/filter/FilterGroup.js +12 -9
- package/esm/schema-component/antd/filter/FilterGroup.js.map +1 -1
- package/esm/schema-component/antd/filter/FilterItem.js +1 -1
- package/esm/schema-component/antd/filter/FilterItem.js.map +1 -1
- package/esm/schema-component/antd/form-v2/Form.js +27 -3
- package/esm/schema-component/antd/form-v2/Form.js.map +1 -1
- package/esm/schema-component/antd/grid/Grid.d.ts +2 -0
- package/esm/schema-component/antd/grid/Grid.js +10 -3
- package/esm/schema-component/antd/grid/Grid.js.map +1 -1
- package/esm/schema-component/antd/menu/Menu.Designer.js +35 -23
- package/esm/schema-component/antd/menu/Menu.Designer.js.map +1 -1
- package/esm/schema-component/antd/menu/Menu.js +3 -3
- package/esm/schema-component/antd/menu/Menu.js.map +1 -1
- package/esm/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/esm/schema-component/antd/record-picker/ReadPrettyRecordPicker.js.map +1 -1
- package/esm/schema-component/antd/table/Table.Void.Designer.js +1 -1
- package/esm/schema-component/antd/table/Table.Void.Designer.js.map +1 -1
- package/esm/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/esm/schema-component/antd/table-v2/Table.Column.Designer.js.map +1 -1
- package/esm/schema-component/antd/table-v2/TableBlockDesigner.js +2 -2
- package/esm/schema-component/antd/table-v2/TableBlockDesigner.js.map +1 -1
- package/esm/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -1
- package/esm/schema-component/antd/table-v2/TableSelectorDesigner.js.map +1 -1
- package/esm/schema-component/antd/tabs/Tabs.Designer.js +13 -2
- package/esm/schema-component/antd/tabs/Tabs.Designer.js.map +1 -1
- package/esm/schema-component/common/dnd-context/index.js +2 -1
- package/esm/schema-component/common/dnd-context/index.js.map +1 -1
- package/esm/schema-initializer/buttons/BlockInitializers.js +1 -1
- package/esm/schema-initializer/buttons/BlockInitializers.js.map +1 -1
- package/esm/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -1
- package/esm/schema-initializer/buttons/CreateFormBlockInitializers.js.map +1 -1
- package/esm/schema-initializer/buttons/FormItemInitializers.js +3 -13
- package/esm/schema-initializer/buttons/FormItemInitializers.js.map +1 -1
- package/esm/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +3 -13
- package/esm/schema-initializer/buttons/ReadPrettyFormItemInitializers.js.map +1 -1
- package/esm/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
- package/esm/schema-initializer/buttons/RecordBlockInitializers.js.map +1 -1
- package/esm/schema-settings/GeneralSchemaDesigner.js +17 -6
- package/esm/schema-settings/GeneralSchemaDesigner.js.map +1 -1
- package/esm/schema-templates/schemas/uiSchemaTemplates.js +67 -10
- package/esm/schema-templates/schemas/uiSchemaTemplates.js.map +1 -1
- package/esm/workflow/WorkflowCanvas.js +2 -2
- package/esm/workflow/WorkflowCanvas.js.map +1 -1
- package/esm/workflow/WorkflowLink.js +1 -1
- package/esm/workflow/WorkflowLink.js.map +1 -1
- package/esm/workflow/calculators.js +7 -5
- package/esm/workflow/calculators.js.map +1 -1
- package/esm/workflow/nodes/condition.d.ts +1 -1
- package/esm/workflow/nodes/condition.js +16 -13
- package/esm/workflow/nodes/condition.js.map +1 -1
- package/esm/workflow/nodes/create.d.ts +1 -0
- package/esm/workflow/nodes/index.js +4 -4
- package/esm/workflow/nodes/index.js.map +1 -1
- package/esm/workflow/nodes/parallel.js +8 -5
- package/esm/workflow/nodes/parallel.js.map +1 -1
- package/esm/workflow/nodes/query.js +1 -1
- package/esm/workflow/nodes/query.js.map +1 -1
- package/esm/workflow/nodes/update.d.ts +2 -1
- package/esm/workflow/nodes/update.js +12 -1
- package/esm/workflow/nodes/update.js.map +1 -1
- package/esm/workflow/schemas/collection.d.ts +1 -0
- package/esm/workflow/schemas/collection.js +3 -2
- package/esm/workflow/schemas/collection.js.map +1 -1
- package/esm/workflow/schemas/workflows.js +3 -2
- package/esm/workflow/schemas/workflows.js.map +1 -1
- package/esm/workflow/style.d.ts +1 -0
- package/esm/workflow/style.js +5 -4
- package/esm/workflow/style.js.map +1 -1
- package/esm/workflow/triggers/{model.d.ts → collection.d.ts} +5 -4
- package/esm/workflow/triggers/{model.js → collection.js} +23 -31
- package/esm/workflow/triggers/collection.js.map +1 -0
- package/esm/workflow/triggers/index.js +11 -8
- package/esm/workflow/triggers/index.js.map +1 -1
- package/lib/block-provider/hooks/index.js +9 -1
- package/lib/block-provider/hooks/index.js.map +1 -1
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -0
- package/lib/collection-manager/types.d.ts +1 -0
- package/lib/collection-manager/types.js.map +1 -1
- package/lib/locale/en_US.d.ts +4 -0
- package/lib/locale/en_US.js +6 -1
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/index.d.ts +29 -7
- package/lib/locale/zh_CN.d.ts +25 -7
- package/lib/locale/zh_CN.js +25 -7
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +6 -6
- package/lib/schema-component/antd/action/Action.Designer.js.map +1 -1
- package/lib/schema-component/antd/action/Action.Drawer.js +59 -2
- package/lib/schema-component/antd/action/Action.Drawer.js.map +1 -1
- package/lib/schema-component/antd/action/Action.js +35 -18
- package/lib/schema-component/antd/action/Action.js.map +1 -1
- package/lib/schema-component/antd/action/context.d.ts +2 -0
- package/lib/schema-component/antd/action/context.js.map +1 -1
- package/lib/schema-component/antd/action/hooks.d.ts +2 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +1 -1
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js.map +1 -1
- package/lib/schema-component/antd/filter/FilterGroup.js +12 -9
- package/lib/schema-component/antd/filter/FilterGroup.js.map +1 -1
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/FilterItem.js.map +1 -1
- package/lib/schema-component/antd/form-v2/Form.js +29 -5
- package/lib/schema-component/antd/form-v2/Form.js.map +1 -1
- package/lib/schema-component/antd/grid/Grid.d.ts +2 -0
- package/lib/schema-component/antd/grid/Grid.js +13 -4
- package/lib/schema-component/antd/grid/Grid.js.map +1 -1
- package/lib/schema-component/antd/menu/Menu.Designer.js +35 -23
- package/lib/schema-component/antd/menu/Menu.Designer.js.map +1 -1
- package/lib/schema-component/antd/menu/Menu.js +2 -2
- package/lib/schema-component/antd/menu/Menu.js.map +1 -1
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js.map +1 -1
- package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -1
- package/lib/schema-component/antd/table/Table.Void.Designer.js.map +1 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js.map +1 -1
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -2
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js.map +1 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js.map +1 -1
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +13 -2
- package/lib/schema-component/antd/tabs/Tabs.Designer.js.map +1 -1
- package/lib/schema-component/common/dnd-context/index.js +2 -1
- package/lib/schema-component/common/dnd-context/index.js.map +1 -1
- package/lib/schema-initializer/buttons/BlockInitializers.js +1 -1
- package/lib/schema-initializer/buttons/BlockInitializers.js.map +1 -1
- package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js +2 -1
- package/lib/schema-initializer/buttons/CreateFormBlockInitializers.js.map +1 -1
- package/lib/schema-initializer/buttons/FormItemInitializers.js +3 -13
- package/lib/schema-initializer/buttons/FormItemInitializers.js.map +1 -1
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +3 -13
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js.map +1 -1
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js.map +1 -1
- package/lib/schema-settings/GeneralSchemaDesigner.js +15 -4
- package/lib/schema-settings/GeneralSchemaDesigner.js.map +1 -1
- package/lib/schema-templates/schemas/uiSchemaTemplates.js +67 -10
- package/lib/schema-templates/schemas/uiSchemaTemplates.js.map +1 -1
- package/lib/workflow/WorkflowCanvas.js +2 -2
- package/lib/workflow/WorkflowCanvas.js.map +1 -1
- package/lib/workflow/WorkflowLink.js +1 -1
- package/lib/workflow/WorkflowLink.js.map +1 -1
- package/lib/workflow/calculators.js +7 -5
- package/lib/workflow/calculators.js.map +1 -1
- package/lib/workflow/nodes/condition.d.ts +1 -1
- package/lib/workflow/nodes/condition.js +13 -10
- package/lib/workflow/nodes/condition.js.map +1 -1
- package/lib/workflow/nodes/create.d.ts +1 -0
- package/lib/workflow/nodes/index.js +3 -3
- package/lib/workflow/nodes/index.js.map +1 -1
- package/lib/workflow/nodes/parallel.js +8 -5
- package/lib/workflow/nodes/parallel.js.map +1 -1
- package/lib/workflow/nodes/query.js +1 -1
- package/lib/workflow/nodes/query.js.map +1 -1
- package/lib/workflow/nodes/update.d.ts +2 -1
- package/lib/workflow/nodes/update.js +12 -1
- package/lib/workflow/nodes/update.js.map +1 -1
- package/lib/workflow/schemas/collection.d.ts +1 -0
- package/lib/workflow/schemas/collection.js +3 -2
- package/lib/workflow/schemas/collection.js.map +1 -1
- package/lib/workflow/schemas/workflows.js +3 -2
- package/lib/workflow/schemas/workflows.js.map +1 -1
- package/lib/workflow/style.d.ts +1 -0
- package/lib/workflow/style.js +6 -5
- package/lib/workflow/style.js.map +1 -1
- package/lib/workflow/triggers/{model.d.ts → collection.d.ts} +5 -4
- package/lib/workflow/triggers/{model.js → collection.js} +22 -30
- package/lib/workflow/triggers/collection.js.map +1 -0
- package/lib/workflow/triggers/index.js +10 -7
- package/lib/workflow/triggers/index.js.map +1 -1
- package/package.json +3 -3
- package/src/block-provider/hooks/index.ts +10 -2
- package/src/collection-manager/types.ts +1 -0
- package/src/locale/en_US.ts +8 -1
- package/src/locale/zh_CN.ts +27 -7
- package/src/schema-component/antd/action/Action.Designer.tsx +2 -2
- package/src/schema-component/antd/action/Action.Drawer.tsx +20 -3
- package/src/schema-component/antd/action/Action.tsx +19 -5
- package/src/schema-component/antd/action/context.tsx +2 -0
- package/src/schema-component/antd/filter/Filter.Action.Designer.tsx +1 -1
- package/src/schema-component/antd/filter/FilterGroup.tsx +14 -9
- package/src/schema-component/antd/filter/FilterItem.tsx +1 -1
- package/src/schema-component/antd/form-v2/Form.tsx +29 -3
- package/src/schema-component/antd/grid/Grid.tsx +31 -20
- package/src/schema-component/antd/menu/Menu.Designer.tsx +36 -26
- package/src/schema-component/antd/menu/Menu.tsx +12 -2
- package/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx +3 -1
- package/src/schema-component/antd/table/Table.Void.Designer.tsx +1 -1
- package/src/schema-component/antd/table-v2/Table.Column.Designer.tsx +1 -1
- package/src/schema-component/antd/table-v2/TableBlockDesigner.tsx +2 -2
- package/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx +1 -1
- package/src/schema-component/antd/tabs/Tabs.Designer.tsx +1 -1
- package/src/schema-component/common/dnd-context/index.tsx +2 -1
- package/src/schema-initializer/buttons/BlockInitializers.tsx +1 -1
- package/src/schema-initializer/buttons/CreateFormBlockInitializers.tsx +4 -1
- package/src/schema-initializer/buttons/FormItemInitializers.tsx +5 -3
- package/src/schema-initializer/buttons/ReadPrettyFormItemInitializers.tsx +5 -3
- package/src/schema-initializer/buttons/RecordBlockInitializers.tsx +4 -1
- package/src/schema-settings/GeneralSchemaDesigner.tsx +20 -5
- package/src/schema-templates/schemas/uiSchemaTemplates.ts +23 -10
- package/src/workflow/WorkflowCanvas.tsx +2 -3
- package/src/workflow/WorkflowLink.tsx +1 -1
- package/src/workflow/calculators.tsx +10 -8
- package/src/workflow/nodes/condition.tsx +21 -38
- package/src/workflow/nodes/index.tsx +6 -4
- package/src/workflow/nodes/parallel.tsx +10 -7
- package/src/workflow/nodes/query.tsx +1 -1
- package/src/workflow/nodes/update.tsx +4 -1
- package/src/workflow/schemas/collection.ts +3 -3
- package/src/workflow/schemas/workflows.ts +3 -2
- package/src/workflow/style.tsx +4 -0
- package/src/workflow/triggers/{model.tsx → collection.tsx} +25 -25
- package/src/workflow/triggers/index.tsx +13 -6
- package/esm/workflow/triggers/model.js.map +0 -1
- package/lib/workflow/triggers/model.js.map +0 -1
|
@@ -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,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import { useCollectionDataSource } from '../..';
|
|
2
13
|
import { CollectionFieldset, VariableComponent } from '../calculators';
|
|
3
14
|
import { collection, filter, values } from '../schemas/collection';
|
|
@@ -13,7 +24,7 @@ export default {
|
|
|
13
24
|
title: '',
|
|
14
25
|
'x-decorator': 'FormItem',
|
|
15
26
|
properties: {
|
|
16
|
-
filter: filter,
|
|
27
|
+
filter: __assign(__assign({}, filter), { title: '{{t("Only update records matching conditions")}}' }),
|
|
17
28
|
values: values
|
|
18
29
|
}
|
|
19
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;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,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;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,MAAM,KACT,KAAK,EAAE,kDAAkD,GAC1D;gBACD,MAAM,QAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,yBAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,mBAAA;QACjB,kBAAkB,oBAAA;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"]}
|
|
@@ -16,14 +16,15 @@ export var collection = {
|
|
|
16
16
|
};
|
|
17
17
|
export var values = {
|
|
18
18
|
type: 'object',
|
|
19
|
-
title: '{{t("
|
|
19
|
+
title: '{{t("Fields values")}}',
|
|
20
20
|
name: 'config.params.values',
|
|
21
21
|
'x-decorator': 'FormItem',
|
|
22
22
|
'x-decorator-props': {
|
|
23
23
|
labelAlign: 'left',
|
|
24
24
|
className: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n "], ["\n flex-direction: column;\n "])))
|
|
25
25
|
},
|
|
26
|
-
'x-component': 'CollectionFieldset'
|
|
26
|
+
'x-component': 'CollectionFieldset',
|
|
27
|
+
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.")}}',
|
|
27
28
|
};
|
|
28
29
|
export var filter = {
|
|
29
30
|
type: 'object',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,MAAM,CAAC,IAAM,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;AAEF,MAAM,CAAC,IAAM,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,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,oBAAoB;IACnC,WAAW,EAAE,6IAA6I;CAC3J,CAAC;AAEF,MAAM,CAAC,IAAM,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,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,QAAQ;IACvB,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,MAAM,GAAK,OAAO,EAAE,OAAd,CAAe;YAC7B,IAAM,OAAO,GAAG,0BAA0B,CAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,SAAA;gBACP,SAAS,EAAE,GAAG,sIAAA,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 { 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"]}
|
|
@@ -72,6 +72,7 @@ var collection = {
|
|
|
72
72
|
],
|
|
73
73
|
'x-component': 'Radio.Group',
|
|
74
74
|
'x-decorator': 'FormItem',
|
|
75
|
+
default: false
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
],
|
|
@@ -241,7 +242,7 @@ export var workflowSchema = {
|
|
|
241
242
|
},
|
|
242
243
|
executions: {
|
|
243
244
|
type: 'void',
|
|
244
|
-
title: '{{t("
|
|
245
|
+
title: '{{t("Execution History")}}',
|
|
245
246
|
'x-component': 'Action.Link',
|
|
246
247
|
'x-component-props': {
|
|
247
248
|
type: 'primary',
|
|
@@ -249,7 +250,7 @@ export var workflowSchema = {
|
|
|
249
250
|
properties: {
|
|
250
251
|
drawer: {
|
|
251
252
|
type: 'void',
|
|
252
|
-
title: '{{t("
|
|
253
|
+
title: '{{t("Execution History")}}',
|
|
253
254
|
'x-component': 'Action.Drawer',
|
|
254
255
|
properties: executionSchema
|
|
255
256
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","s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","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,OA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wCACD,MAAM,EAAE;4CACN,IAAI,EAAE,MAAM;4CACZ,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,aAAa;4CAC5B,mBAAmB,EAAE;gDACnB,IAAI,EAAE,SAAS;6CAChB;4CACD,UAAU,EAAE;gDACV,KAAK,EAAE;oDACL,IAAI,EAAE,MAAM;oDACZ,aAAa,EAAE,cAAc;oDAC7B,aAAa,EAAE,MAAM;oDACrB,mBAAmB,EAAE;wDACnB,SAAS,EAAE,8BAA8B;qDAC1C;oDACD,KAAK,EAAE,iBAAiB;oDACxB,UAAU,EAAE;wDACV,KAAK,EAAE;4DACL,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,OAAO,EAAE;4DACP,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,MAAM,EAAE;4DACN,IAAI,EAAE,MAAM;4DACZ,aAAa,EAAE,qBAAqB;4DACpC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,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 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"]}
|
package/esm/workflow/style.d.ts
CHANGED
|
@@ -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;
|
package/esm/workflow/style.js
CHANGED
|
@@ -10,8 +10,9 @@ export var nodeBlockClass = css(templateObject_4 || (templateObject_4 = __makeTe
|
|
|
10
10
|
export var nodeClass = 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"])));
|
|
11
11
|
export var nodeCardClass = 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"])));
|
|
12
12
|
export var nodeHeaderClass = css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
13
|
-
export var
|
|
14
|
-
export var
|
|
15
|
-
export var
|
|
16
|
-
var
|
|
13
|
+
export var nodeMetaClass = css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-bottom: .5em;\n"], ["\n margin-bottom: .5em;\n"])));
|
|
14
|
+
export var nodeTitleClass = 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"])));
|
|
15
|
+
export var nodeSubtreeClass = 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"])));
|
|
16
|
+
export var addButtonClass = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n flex-shrink: 0;\n padding: 2em 0;\n"], ["\n flex-shrink: 0;\n padding: 2em 0;\n"])));
|
|
17
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
17
18
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/workflow/style.tsx"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,IAAM,iBAAiB,GAAG,GAAG,oSAAA,iOAanC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,2RAAA,wNAalC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,GAAG,g4BAAA,6zBAuD7B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,uMAAA,oIAOhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,GAAG,+JAAA,4FAK3B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,aAAa,GAAG,GAAG,kdAAA,+YAwB/B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,GAAG,8FAAA,2BAEjC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,8IAAA,2EAMhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/workflow/style.tsx"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,IAAM,iBAAiB,GAAG,GAAG,oSAAA,iOAanC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,2RAAA,wNAalC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,GAAG,g4BAAA,6zBAuD7B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,uMAAA,oIAOhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,GAAG,+JAAA,4FAK3B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,aAAa,GAAG,GAAG,kdAAA,+YAwB/B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,GAAG,8FAAA,2BAEjC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,aAAa,GAAG,GAAG,+FAAA,4BAE/B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,8IAAA,2EAMhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,sJAAA,iFAIlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,+GAAA,0CAGhC,IAAA,CAAC","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"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useCollectionDataSource } from '../../collection-manager';
|
|
3
|
-
declare function useCollectionFieldsDataSource(): (field: any) => void;
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
type: string;
|
|
@@ -26,6 +25,7 @@ declare const _default: {
|
|
|
26
25
|
label: string;
|
|
27
26
|
}[];
|
|
28
27
|
};
|
|
28
|
+
required: boolean;
|
|
29
29
|
};
|
|
30
30
|
'config.changed': {
|
|
31
31
|
type: string;
|
|
@@ -37,7 +37,6 @@ declare const _default: {
|
|
|
37
37
|
'x-component-props': {
|
|
38
38
|
mode: string;
|
|
39
39
|
};
|
|
40
|
-
'x-reactions': string[];
|
|
41
40
|
};
|
|
42
41
|
'config.condition': {
|
|
43
42
|
name: string;
|
|
@@ -60,7 +59,9 @@ declare const _default: {
|
|
|
60
59
|
};
|
|
61
60
|
scope: {
|
|
62
61
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
63
|
-
|
|
62
|
+
};
|
|
63
|
+
components: {
|
|
64
|
+
FieldsSelect: React.MemoExoticComponent<React.FunctionComponent<unknown>>;
|
|
64
65
|
};
|
|
65
66
|
getter({ type, options, onChange }: {
|
|
66
67
|
type: any;
|
|
@@ -11,38 +11,30 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Select } from 'antd';
|
|
14
|
-
import {
|
|
15
|
-
import { useForm } from '@formily/react';
|
|
14
|
+
import { observer, useForm } from '@formily/react';
|
|
16
15
|
import { useCollectionDataSource, useCollectionManager } from '../../collection-manager';
|
|
17
16
|
import { useCompile } from '../../schema-component';
|
|
18
17
|
import { useFlowContext } from '../WorkflowCanvas';
|
|
19
18
|
import { BaseTypeSet } from '../calculators';
|
|
20
19
|
import { collection, filter } from '../schemas/collection';
|
|
21
20
|
import { useTranslation } from 'react-i18next';
|
|
22
|
-
function
|
|
21
|
+
var FieldsSelect = observer(function (props) {
|
|
23
22
|
var _a;
|
|
24
23
|
var compile = useCompile();
|
|
25
24
|
var getCollectionFields = useCollectionManager().getCollectionFields;
|
|
26
25
|
var values = useForm().values;
|
|
27
26
|
var fields = getCollectionFields((_a = values === null || values === void 0 ? void 0 : values.config) === null || _a === void 0 ? void 0 : _a.collection);
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
field.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
label: compile((_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.title),
|
|
37
|
-
value: field.name
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
})(fields);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
27
|
+
return (_jsx(Select, __assign({}, props, { children: fields
|
|
28
|
+
.filter(function (field) { return (!field.hidden
|
|
29
|
+
&& (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)); })
|
|
30
|
+
.map(function (field) {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_jsx(Select.Option, __assign({ value: field.name }, { children: compile((_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.title) }), void 0));
|
|
33
|
+
}) }), void 0));
|
|
34
|
+
});
|
|
43
35
|
export default {
|
|
44
|
-
title: '{{t("
|
|
45
|
-
type: '
|
|
36
|
+
title: '{{t("Collection event")}}',
|
|
37
|
+
type: 'collection',
|
|
46
38
|
fieldset: {
|
|
47
39
|
'config.collection': collection,
|
|
48
40
|
'config.mode': {
|
|
@@ -58,27 +50,27 @@ export default {
|
|
|
58
50
|
{ value: 3, label: '{{t("After record added or updated")}}' },
|
|
59
51
|
{ value: 4, label: '{{t("After record deleted")}}' }
|
|
60
52
|
]
|
|
61
|
-
}
|
|
53
|
+
},
|
|
54
|
+
required: true
|
|
62
55
|
},
|
|
63
56
|
'config.changed': {
|
|
64
57
|
type: 'array',
|
|
65
58
|
name: 'changed',
|
|
66
59
|
title: '{{t("Changed fields")}}',
|
|
67
|
-
description: '{{t("
|
|
60
|
+
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.")}}',
|
|
68
61
|
'x-decorator': 'FormItem',
|
|
69
|
-
'x-component': '
|
|
62
|
+
'x-component': 'FieldsSelect',
|
|
70
63
|
'x-component-props': {
|
|
71
64
|
mode: 'multiple',
|
|
72
|
-
}
|
|
73
|
-
'x-reactions': [
|
|
74
|
-
'{{useCollectionFieldsDataSource()}}'
|
|
75
|
-
]
|
|
65
|
+
}
|
|
76
66
|
},
|
|
77
|
-
'config.condition': __assign(__assign({}, filter), { name: 'config.condition', title: '{{t("
|
|
67
|
+
'config.condition': __assign(__assign({}, filter), { name: 'config.condition', title: '{{t("Only triggers when match conditions")}}' })
|
|
78
68
|
},
|
|
79
69
|
scope: {
|
|
80
|
-
useCollectionDataSource: useCollectionDataSource
|
|
81
|
-
|
|
70
|
+
useCollectionDataSource: useCollectionDataSource
|
|
71
|
+
},
|
|
72
|
+
components: {
|
|
73
|
+
FieldsSelect: FieldsSelect
|
|
82
74
|
},
|
|
83
75
|
getter: function (_a) {
|
|
84
76
|
var _b, _c;
|
|
@@ -95,4 +87,4 @@ export default {
|
|
|
95
87
|
.map(function (field) { return (_jsx(Select.Option, __assign({ value: field.name }, { children: compile(field.uiSchema.title) }), field.name)); }) }), void 0));
|
|
96
88
|
}
|
|
97
89
|
};
|
|
98
|
-
//# sourceMappingURL=
|
|
90
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/triggers/collection.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,U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AAQ,CAAC,MAAM,CAAC,UAAU,EAAxC,CAAwC,CAAC,mCAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAExG,OAAO,CACL,KAAC,MAAM,aACL,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,EACxB,KAAK,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAC5C,QAAQ,EAAE,UAAC,IAAI;gBACb,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,wBAAO,OAAO,KAAE,IAAI,EAAE,UAAQ,IAAM,GAAE,EAAE,CAAC,CAAC;YACpE,CAAC,gBAEA,UAAU,CAAC,MAAM;iBACf,MAAM,CAAC,UAAA,KAAK,YAAI,OAAA,WAAW,CAAC,GAAG,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,CAAC,CAAA,EAAA,CAAC;iBACvD,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CACd,KAAC,MAAM,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';\nimport { observer, 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\nconst FieldsSelect = observer((props) => {\n const compile = useCompile();\n const { getCollectionFields } = useCollectionManager();\n const { values } = useForm();\n const fields = getCollectionFields(values?.config?.collection);\n\n return (\n <Select\n {...props}\n >\n {fields\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)\n ))\n .map(field => (\n <Select.Option value={field.name}>{compile(field.uiSchema?.title)}</Select.Option>\n ))}\n </Select>\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': 'FieldsSelect',\n 'x-component-props': {\n mode: 'multiple',\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 },\n components: {\n FieldsSelect\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"]}
|
|
@@ -50,8 +50,10 @@ import { useForm } from "@formily/react";
|
|
|
50
50
|
import { cx } from "@emotion/css";
|
|
51
51
|
import { Registry } from "@nocobase/utils";
|
|
52
52
|
import { SchemaComponent, useActionContext, useAPIClient, useCompile, useRecord, useResourceActionContext } from '../../';
|
|
53
|
-
import
|
|
54
|
-
import { nodeCardClass } from "../style";
|
|
53
|
+
import collection from './collection';
|
|
54
|
+
import { nodeCardClass, nodeMetaClass } from "../style";
|
|
55
|
+
import { useTranslation } from "react-i18next";
|
|
56
|
+
import { Tag } from "antd";
|
|
55
57
|
function useUpdateConfigAction() {
|
|
56
58
|
var form = useForm();
|
|
57
59
|
var api = useAPIClient();
|
|
@@ -84,24 +86,25 @@ function useUpdateConfigAction() {
|
|
|
84
86
|
;
|
|
85
87
|
;
|
|
86
88
|
export var triggers = new Registry();
|
|
87
|
-
triggers.register(
|
|
89
|
+
triggers.register(collection.type, collection);
|
|
88
90
|
export var TriggerConfig = function () {
|
|
91
|
+
var t = useTranslation().t;
|
|
89
92
|
var compile = useCompile();
|
|
90
93
|
var data = useResourceActionContext().data;
|
|
91
94
|
if (!data) {
|
|
92
95
|
return null;
|
|
93
96
|
}
|
|
94
97
|
var _a = data.data, type = _a.type, config = _a.config;
|
|
95
|
-
var _b = triggers.get(type), title = _b.title, fieldset = _b.fieldset, scope = _b.scope;
|
|
96
|
-
return (_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsx("h4", { children: compile(title) }, void 0), _jsx(SchemaComponent, { schema: {
|
|
98
|
+
var _b = triggers.get(type), title = _b.title, fieldset = _b.fieldset, scope = _b.scope, components = _b.components;
|
|
99
|
+
return (_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsx("div", __assign({ className: cx(nodeMetaClass) }, { children: _jsx(Tag, __assign({ color: "gold" }, { children: t('Trigger') }), void 0) }), void 0), _jsx("h4", { children: compile(title) }, void 0), _jsx(SchemaComponent, { schema: {
|
|
97
100
|
type: 'void',
|
|
98
|
-
title: '{{t("
|
|
101
|
+
title: '{{t("Configure")}}',
|
|
99
102
|
'x-component': 'Action.Link',
|
|
100
103
|
name: 'drawer',
|
|
101
104
|
properties: {
|
|
102
105
|
drawer: {
|
|
103
106
|
type: 'void',
|
|
104
|
-
title: '{{t("
|
|
107
|
+
title: '{{t("Configure")}}',
|
|
105
108
|
'x-component': 'Action.Drawer',
|
|
106
109
|
'x-decorator': 'Form',
|
|
107
110
|
'x-decorator-props': {
|
|
@@ -139,6 +142,6 @@ export var TriggerConfig = function () {
|
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
|
-
}, scope: scope }, void 0)] }), void 0));
|
|
145
|
+
}, scope: scope, components: components }, void 0)] }), void 0));
|
|
143
146
|
};
|
|
144
147
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAc,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AACtI,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EA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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,EACZ,UAAU,EAAE,UAAU,WACtB,aACE,CACP,CAAC;AACJ,CAAC,CAAA","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, components } = 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 components={components}\n />\n </div>\n );\n}\n"]}
|
|
@@ -105,6 +105,7 @@ var useCreateActionProps = function () {
|
|
|
105
105
|
var history = (0, react_router_dom_1.useHistory)();
|
|
106
106
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
107
107
|
var actionSchema = (0, react_1.useFieldSchema)();
|
|
108
|
+
var actionField = (0, react_1.useField)();
|
|
108
109
|
var _c = (0, collection_manager_1.useCollection)(), fields = _c.fields, getField = _c.getField;
|
|
109
110
|
var compile = (0, schema_component_1.useCompile)();
|
|
110
111
|
return {
|
|
@@ -166,11 +167,14 @@ var useCreateActionProps = function () {
|
|
|
166
167
|
for (key in form.values) {
|
|
167
168
|
_loop_1(key);
|
|
168
169
|
}
|
|
170
|
+
actionField.data = field.data || {};
|
|
171
|
+
actionField.data.loading = true;
|
|
169
172
|
return [4 /*yield*/, resource.create({
|
|
170
173
|
values: __assign(__assign({}, values), overwriteValues),
|
|
171
174
|
})];
|
|
172
175
|
case 3:
|
|
173
176
|
_f.sent();
|
|
177
|
+
actionField.data.loading = false;
|
|
174
178
|
(_d = (_c = __parent === null || __parent === void 0 ? void 0 : __parent.service) === null || _c === void 0 ? void 0 : _c.refresh) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
175
179
|
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
176
180
|
onSuccess = (_e = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) === null || _e === void 0 ? void 0 : _e.onSuccess;
|
|
@@ -215,6 +219,7 @@ var useUpdateActionProps = function () {
|
|
|
215
219
|
var history = (0, react_router_dom_1.useHistory)();
|
|
216
220
|
var _b = (0, collection_manager_1.useCollection)(), fields = _b.fields, getField = _b.getField;
|
|
217
221
|
var compile = (0, schema_component_1.useCompile)();
|
|
222
|
+
var actionField = (0, react_1.useField)();
|
|
218
223
|
return {
|
|
219
224
|
onClick: function () {
|
|
220
225
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -241,7 +246,7 @@ var useUpdateActionProps = function () {
|
|
|
241
246
|
values[key] = form.values[key];
|
|
242
247
|
return "continue";
|
|
243
248
|
}
|
|
244
|
-
if (!field.added.has(key)) {
|
|
249
|
+
if (field.added && !field.added.has(key)) {
|
|
245
250
|
return "continue";
|
|
246
251
|
}
|
|
247
252
|
var items = form.values[key];
|
|
@@ -281,12 +286,15 @@ var useUpdateActionProps = function () {
|
|
|
281
286
|
for (key in form.values) {
|
|
282
287
|
_loop_2(key);
|
|
283
288
|
}
|
|
289
|
+
actionField.data = field.data || {};
|
|
290
|
+
actionField.data.loading = true;
|
|
284
291
|
return [4 /*yield*/, resource.update({
|
|
285
292
|
filterByTk: filterByTk,
|
|
286
293
|
values: __assign(__assign({}, values), overwriteValues),
|
|
287
294
|
})];
|
|
288
295
|
case 3:
|
|
289
296
|
_j.sent();
|
|
297
|
+
actionField.data.loading = false;
|
|
290
298
|
(_d = (_c = __parent === null || __parent === void 0 ? void 0 : __parent.service) === null || _c === void 0 ? void 0 : _c.refresh) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
291
299
|
if (!(resource instanceof TableFieldProvider_1.TableFieldResource)) {
|
|
292
300
|
(_g = (_f = (_e = __parent === null || __parent === void 0 ? void 0 : __parent.__parent) === null || _e === void 0 ? void 0 : _e.service) === null || _f === void 0 ? void 0 : _f.refresh) === null || _g === void 0 ? void 0 : _g.call(_f);
|