@nocobase/flow-engine 2.0.0-alpha.49 → 2.0.0-alpha.50
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/lib/acl/Acl.d.ts +2 -1
- package/lib/acl/Acl.js +19 -23
- package/lib/flowEngine.js +20 -8
- package/lib/locale/de-DE.json +63 -0
- package/lib/locale/en-US.json +48 -48
- package/lib/locale/es-ES.json +63 -0
- package/lib/locale/fr-FR.json +63 -0
- package/lib/locale/hu-HU.json +63 -0
- package/lib/locale/id-ID.json +63 -0
- package/lib/locale/index.d.ts +94 -94
- package/lib/locale/it-IT.json +63 -0
- package/lib/locale/ja-JP.json +63 -0
- package/lib/locale/ko-KR.json +63 -0
- package/lib/locale/nl-NL.json +63 -0
- package/lib/locale/pt-BR.json +63 -0
- package/lib/locale/ru-RU.json +63 -0
- package/lib/locale/tr-TR.json +63 -0
- package/lib/locale/uk-UA.json +63 -0
- package/lib/locale/vi-VN.json +63 -0
- package/lib/locale/zh-CN.json +48 -48
- package/lib/locale/zh-TW.json +63 -0
- package/lib/models/flowModel.d.ts +2 -2
- package/lib/resources/multiRecordResource.js +1 -17
- package/lib/resources/singleRecordResource.js +1 -17
- package/lib/types.d.ts +8 -0
- package/lib/utils/serverContextParams.d.ts +3 -0
- package/lib/utils/serverContextParams.js +2 -0
- package/lib/utils/variablesParams.js +2 -1
- package/lib/views/createViewMeta.d.ts +1 -0
- package/lib/views/createViewMeta.js +39 -18
- package/package.json +4 -4
- package/src/__tests__/createViewMeta.popup.test.ts +8 -1
- package/src/acl/Acl.tsx +19 -24
- package/src/flowEngine.ts +24 -7
- package/src/locale/de-DE.json +63 -0
- package/src/locale/en-US.json +48 -48
- package/src/locale/es-ES.json +63 -0
- package/src/locale/fr-FR.json +63 -0
- package/src/locale/hu-HU.json +63 -0
- package/src/locale/id-ID.json +63 -0
- package/src/locale/it-IT.json +63 -0
- package/src/locale/ja-JP.json +63 -0
- package/src/locale/ko-KR.json +63 -0
- package/src/locale/nl-NL.json +63 -0
- package/src/locale/pt-BR.json +63 -0
- package/src/locale/ru-RU.json +63 -0
- package/src/locale/tr-TR.json +63 -0
- package/src/locale/uk-UA.json +63 -0
- package/src/locale/vi-VN.json +63 -0
- package/src/locale/zh-CN.json +48 -48
- package/src/locale/zh-TW.json +63 -0
- package/src/models/__tests__/flowEngine.resolveUse.test.ts +58 -0
- package/src/models/flowModel.tsx +2 -4
- package/src/resources/multiRecordResource.ts +1 -20
- package/src/resources/singleRecordResource.ts +1 -17
- package/src/types.ts +12 -0
- package/src/utils/__tests__/variablesParams.test.ts +33 -0
- package/src/utils/serverContextParams.ts +5 -0
- package/src/utils/variablesParams.ts +2 -1
- package/src/views/createViewMeta.ts +27 -5
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
package/src/locale/zh-CN.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"Configuration": "配置",
|
|
6
|
-
"Step configuration": "步骤配置",
|
|
7
|
-
"This step has no configurable parameters": "此步骤没有可配置的参数",
|
|
8
|
-
"Failed to import Formily components": "导入 Formily 组件失败",
|
|
9
|
-
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "抽屉 API 不可用,请确保在 FlowEngineGlobalsContextProvider 中使用",
|
|
10
|
-
"Configuration saved": "配置已保存",
|
|
11
|
-
"Error saving configuration": "保存配置时出错",
|
|
12
|
-
"Error saving configuration, please check console": "保存配置时出错,请检查控制台",
|
|
13
|
-
"Failed to import FormDialog": "导入 FormDialog 失败",
|
|
14
|
-
"OK": "确定",
|
|
2
|
+
"Add": "添加",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "确定要删除此项吗?此操作不可撤销。",
|
|
4
|
+
"Array index out of bounds": "数组索引 {{index}} 超出 '{{subKey}}' 的边界",
|
|
15
5
|
"Cancel": "取消",
|
|
16
|
-
"
|
|
17
|
-
"Error submitting form": "提交表单时出错",
|
|
6
|
+
"Common actions": "通用操作",
|
|
18
7
|
"Complete configuration": "完成配置",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"UID
|
|
8
|
+
"Configuration": "配置",
|
|
9
|
+
"Configuration popup cancelled or error": "配置弹窗已取消或出错",
|
|
10
|
+
"Configuration saved": "配置已保存",
|
|
11
|
+
"Confirm delete": "确认删除",
|
|
12
|
+
"Copy UID": "复制 UID",
|
|
13
|
+
"Copy error info": "复制错误信息",
|
|
24
14
|
"Copy failed": "复制失败",
|
|
25
|
-
"Copy failed, please copy [{{uid}}] manually.": "复制失败,请手动复制 [{{uid}}]。",
|
|
26
15
|
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "HTTP 环境下复制失败。非 HTTPS 页面不支持剪贴板 API,请手动复制 [{{uid}}]。",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "复制失败,请手动复制 [{{uid}}]。",
|
|
17
|
+
"Copy popup UID": "复制弹窗 UID",
|
|
18
|
+
"Data blocks": "数据区块",
|
|
19
|
+
"Delete": "删除",
|
|
30
20
|
"Delete failed": "删除失败",
|
|
21
|
+
"Delete operation failed": "删除操作失败",
|
|
31
22
|
"Delete operation failed, please check the console for details.": "删除操作失败,请检查控制台获取详细信息。",
|
|
32
|
-
"
|
|
23
|
+
"Download logs": "下载日志",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "抽屉 API 不可用,请确保在 FlowEngineGlobalsContextProvider 中使用",
|
|
25
|
+
"Error saving configuration": "保存配置时出错",
|
|
26
|
+
"Error saving configuration, please check console": "保存配置时出错,请检查控制台",
|
|
27
|
+
"Error submitting form": "提交表单时出错",
|
|
28
|
+
"Expected array for subModel": "期望 '{{subKey}}' 为数组,实际为 {{type}}",
|
|
29
|
+
"Expected object for subModel": "期望 '{{subKey}}' 为对象,实际为数组",
|
|
30
|
+
"Failed to add sub model": "添加子模型失败",
|
|
31
|
+
"Failed to destroy model after creation error": "创建错误后销毁模型失败",
|
|
33
32
|
"Failed to get action {{action}}": "获取 action '{{action}}' 失败",
|
|
34
33
|
"Failed to get configurable flows for model {{model}}": "获取模型 '{{model}}' 的可配置 flows 失败",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"here": "这里",
|
|
39
|
-
"Render failed": "渲染失败",
|
|
34
|
+
"Failed to import FormDialog": "导入 FormDialog 失败",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "导入 FormDialog 或 FormStep 失败",
|
|
36
|
+
"Failed to import Formily components": "导入 Formily 组件失败",
|
|
40
37
|
"Feedback": "反馈",
|
|
41
|
-
"Download logs": "下载日志",
|
|
42
|
-
"Copy error info": "复制错误信息",
|
|
43
|
-
"Try again": "重试",
|
|
44
|
-
"Data blocks": "数据区块",
|
|
45
38
|
"Filter blocks": "筛选区块",
|
|
46
|
-
"
|
|
39
|
+
"Flow with key {{flowKey}} not found": "未找到key为 {{flowKey}} 的流程",
|
|
40
|
+
"Form validation failed": "表单验证失败",
|
|
47
41
|
"Invalid input parameters": "输入参数无效",
|
|
42
|
+
"Invalid model provided": "提供的模型无效",
|
|
48
43
|
"Invalid subModelKey format": "无效的 subModelKey 格式: {{subModelKey}}",
|
|
49
|
-
"Submodel not found": "未找到 Submodel '{{subKey}}'",
|
|
50
|
-
"Expected array for subModel": "期望 '{{subKey}}' 为数组,实际为 {{type}}",
|
|
51
|
-
"Array index out of bounds": "数组索引 {{index}} 超出 '{{subKey}}' 的边界",
|
|
52
|
-
"Expected object for subModel": "期望 '{{subKey}}' 为对象,实际为数组",
|
|
53
|
-
"No createModelOptions found for item": "未找到该项的 createModelOptions",
|
|
54
|
-
"createModelOptions must specify use property": "createModelOptions 必须指定 \"use\" 属性",
|
|
55
|
-
"Failed to add sub model": "添加子模型失败",
|
|
56
|
-
"Failed to destroy model after creation error": "创建错误后销毁模型失败",
|
|
57
|
-
"Add": "添加",
|
|
58
|
-
"Name": "名称",
|
|
59
44
|
"Model with ID {{uid}} not found": "未找到 ID 为 {{uid}} 的模型",
|
|
60
|
-
"
|
|
45
|
+
"Name": "名称",
|
|
46
|
+
"Next step": "下一步",
|
|
47
|
+
"No createModelOptions found for item": "未找到该项的 createModelOptions",
|
|
48
|
+
"OK": "确定",
|
|
49
|
+
"Other blocks": "其他区块",
|
|
50
|
+
"Previous step": "上一步",
|
|
51
|
+
"Render failed": "渲染失败",
|
|
52
|
+
"Step configuration": "步骤配置",
|
|
53
|
+
"Step parameter configuration": "步骤参数配置",
|
|
54
|
+
"Step with key {{stepKey}} not found": "未找到key为 {{stepKey}} 的步骤",
|
|
55
|
+
"Submodel not found": "未找到 Submodel '{{subKey}}'",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "这可能是 NocoBase 内部错误。请在以下地址提交问题",
|
|
57
|
+
"This step has no configurable parameters": "此步骤没有可配置的参数",
|
|
61
58
|
"This variable is not available": "此变量不可用",
|
|
62
|
-
"
|
|
63
|
-
|
|
59
|
+
"Try again": "重试",
|
|
60
|
+
"UID copied to clipboard": "UID 已复制到剪贴板",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions 必须指定 \"use\" 属性",
|
|
62
|
+
"here": "这里"
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
|
@@ -109,4 +109,62 @@ describe('FlowEngine.createModel resolveUse hook', () => {
|
|
|
109
109
|
expect(model).toBeInstanceOf(DynamicTarget);
|
|
110
110
|
expect(serialized.use).toBe('DynamicEntry');
|
|
111
111
|
});
|
|
112
|
+
|
|
113
|
+
test('should receive parent model in resolveUse for sub-model decision', () => {
|
|
114
|
+
class ChildA extends FlowModel {}
|
|
115
|
+
class ChildB extends FlowModel {}
|
|
116
|
+
class Parent extends FlowModel {}
|
|
117
|
+
class ChildEntry extends FlowModel {
|
|
118
|
+
static resolveUse(options, _engine, parent?: FlowModel) {
|
|
119
|
+
return parent?.props?.variant === 'B' ? 'ChildB' : 'ChildA';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
engine.registerModels({ Parent, ChildEntry, ChildA, ChildB });
|
|
124
|
+
|
|
125
|
+
const parentA = engine.createModel({ use: 'Parent', uid: 'p-a', flowEngine: engine, props: { variant: 'A' } });
|
|
126
|
+
const childA = engine.createModel({
|
|
127
|
+
use: 'ChildEntry',
|
|
128
|
+
uid: 'c-a',
|
|
129
|
+
flowEngine: engine,
|
|
130
|
+
parentId: parentA.uid,
|
|
131
|
+
subKey: 'child',
|
|
132
|
+
});
|
|
133
|
+
expect(childA).toBeInstanceOf(ChildA);
|
|
134
|
+
|
|
135
|
+
const parentB = engine.createModel({ use: 'Parent', uid: 'p-b', flowEngine: engine, props: { variant: 'B' } });
|
|
136
|
+
const childB = engine.createModel({
|
|
137
|
+
use: 'ChildEntry',
|
|
138
|
+
uid: 'c-b',
|
|
139
|
+
flowEngine: engine,
|
|
140
|
+
parentId: parentB.uid,
|
|
141
|
+
subKey: 'child',
|
|
142
|
+
});
|
|
143
|
+
expect(childB).toBeInstanceOf(ChildB);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test('should stop resolveUse chain when stop flag is true', () => {
|
|
147
|
+
const leafSpy = vi.fn();
|
|
148
|
+
|
|
149
|
+
class Leaf extends FlowModel {
|
|
150
|
+
static resolveUse = leafSpy;
|
|
151
|
+
}
|
|
152
|
+
class Mid extends FlowModel {
|
|
153
|
+
static resolveUse() {
|
|
154
|
+
return 'Leaf';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
class Entry extends FlowModel {
|
|
158
|
+
static resolveUse() {
|
|
159
|
+
return { use: 'Mid', stop: true };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
engine.registerModels({ Entry, Mid, Leaf });
|
|
164
|
+
|
|
165
|
+
const model = engine.createModel({ use: 'Entry', uid: 'stop-flag', flowEngine: engine });
|
|
166
|
+
|
|
167
|
+
expect(model).toBeInstanceOf(Mid);
|
|
168
|
+
expect(leafSpy).not.toHaveBeenCalled();
|
|
169
|
+
});
|
|
112
170
|
});
|
package/src/models/flowModel.tsx
CHANGED
|
@@ -31,6 +31,7 @@ import type {
|
|
|
31
31
|
ParamObject,
|
|
32
32
|
ParentFlowModel,
|
|
33
33
|
PersistOptions,
|
|
34
|
+
ResolveUseResult,
|
|
34
35
|
RegisteredModelClassName,
|
|
35
36
|
StepDefinition,
|
|
36
37
|
StepParams,
|
|
@@ -323,10 +324,7 @@ export class FlowModel<Structure extends DefaultStructure = DefaultStructure> {
|
|
|
323
324
|
* 动态解析实际要实例化的模型类;可在子类中覆盖。
|
|
324
325
|
* 返回注册名或构造器,支持在 FlowEngine 中继续沿链解析。
|
|
325
326
|
*/
|
|
326
|
-
static resolveUse?(
|
|
327
|
-
options: CreateModelOptions,
|
|
328
|
-
engine: FlowEngine,
|
|
329
|
-
): RegisteredModelClassName | ModelConstructor | void;
|
|
327
|
+
static resolveUse?(options: CreateModelOptions, engine: FlowEngine, parent?: FlowModel): ResolveUseResult | void;
|
|
330
328
|
|
|
331
329
|
/**
|
|
332
330
|
* 注册仅当前 FlowModel 类及其子类可用的 Action。
|
|
@@ -133,26 +133,7 @@ export class MultiRecordResource<TDataItem = any> extends BaseRecordResource<TDa
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
async update(filterByTk: string | number, data: Partial<TDataItem>, options?: AxiosRequestConfig): Promise<void> {
|
|
136
|
-
const
|
|
137
|
-
const filterTargetKey = collection?.filterTargetKey;
|
|
138
|
-
const tkData = collection?.getFilterByTK(this.context.record);
|
|
139
|
-
let result = data;
|
|
140
|
-
|
|
141
|
-
// 安全处理 filterTargetKey & tkData
|
|
142
|
-
if (collection && filterTargetKey) {
|
|
143
|
-
if (Array.isArray(filterTargetKey)) {
|
|
144
|
-
result = {
|
|
145
|
-
...data,
|
|
146
|
-
...(tkData || {}),
|
|
147
|
-
};
|
|
148
|
-
} else {
|
|
149
|
-
result = {
|
|
150
|
-
...data,
|
|
151
|
-
[filterTargetKey]: tkData,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
136
|
+
const result = data;
|
|
156
137
|
const config = this.mergeRequestConfig(
|
|
157
138
|
{
|
|
158
139
|
params: {
|
|
@@ -33,28 +33,12 @@ export class SingleRecordResource<TData = any> extends BaseRecordResource<TData>
|
|
|
33
33
|
async save(data: TData, options?: AxiosRequestConfig & { refresh?: boolean }): Promise<void> {
|
|
34
34
|
const config = this.mergeRequestConfig(this.saveActionOptions, _.omit(options, ['refresh']));
|
|
35
35
|
let actionName = 'create';
|
|
36
|
-
|
|
36
|
+
const result = data;
|
|
37
37
|
// 如果有 filterByTk,则表示是更新操作
|
|
38
38
|
if (!this.isNewRecord) {
|
|
39
39
|
config.params = config.params || {};
|
|
40
40
|
config.params.filterByTk = this.getFilterByTk();
|
|
41
41
|
actionName = 'update';
|
|
42
|
-
const collection = this.context.collection;
|
|
43
|
-
const filterTargetKey = collection?.filterTargetKey;
|
|
44
|
-
const tkData = collection?.getFilterByTK(this.context.record);
|
|
45
|
-
if (collection && filterTargetKey) {
|
|
46
|
-
if (Array.isArray(filterTargetKey)) {
|
|
47
|
-
result = {
|
|
48
|
-
...data,
|
|
49
|
-
...(tkData || {}),
|
|
50
|
-
};
|
|
51
|
-
} else {
|
|
52
|
-
result = {
|
|
53
|
-
...data,
|
|
54
|
-
[filterTargetKey]: tkData,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
42
|
}
|
|
59
43
|
const res = await this.runAction(actionName, {
|
|
60
44
|
...config,
|
package/src/types.ts
CHANGED
|
@@ -311,6 +311,18 @@ export type ParamObject = {
|
|
|
311
311
|
*/
|
|
312
312
|
export type RegisteredModelClassName = string;
|
|
313
313
|
|
|
314
|
+
/**
|
|
315
|
+
* resolveUse 返回类型:可返回目标 use,或 { use, stop } 包含中断标志。
|
|
316
|
+
*/
|
|
317
|
+
export type ResolveUseResult =
|
|
318
|
+
| RegisteredModelClassName
|
|
319
|
+
| ModelConstructor
|
|
320
|
+
| {
|
|
321
|
+
use: RegisteredModelClassName | ModelConstructor;
|
|
322
|
+
/** 标记是否终止后续 resolveUse 链;默认 false(继续解析) */
|
|
323
|
+
stop?: boolean;
|
|
324
|
+
};
|
|
325
|
+
|
|
314
326
|
/**
|
|
315
327
|
* Options for creating a model instance
|
|
316
328
|
*/
|
|
@@ -75,6 +75,39 @@ describe('variablesParams helpers', () => {
|
|
|
75
75
|
expect(res).not.toHaveProperty('user');
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
it('collectContextParamsForTemplate keeps associationName/sourceId from RecordRef', async () => {
|
|
79
|
+
const ctx: any = {
|
|
80
|
+
getPropertyOptions: (k: string) => ({
|
|
81
|
+
meta:
|
|
82
|
+
k === 'popup'
|
|
83
|
+
? async () => ({
|
|
84
|
+
type: 'object',
|
|
85
|
+
title: 'Popup',
|
|
86
|
+
buildVariablesParams: () => ({
|
|
87
|
+
record: {
|
|
88
|
+
collection: 'posts',
|
|
89
|
+
dataSourceKey: 'main',
|
|
90
|
+
filterByTk: 1,
|
|
91
|
+
associationName: 'users.posts',
|
|
92
|
+
sourceId: 9,
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
})
|
|
96
|
+
: undefined,
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const tpl = { value: '{{ ctx.popup.record.id }}' } as any;
|
|
101
|
+
const res = await collectContextParamsForTemplate(ctx, tpl);
|
|
102
|
+
expect(res?.['popup.record']).toMatchObject({
|
|
103
|
+
collection: 'posts',
|
|
104
|
+
dataSourceKey: 'main',
|
|
105
|
+
filterByTk: 1,
|
|
106
|
+
associationName: 'users.posts',
|
|
107
|
+
sourceId: 9,
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
78
111
|
it('createRecordResolveOnServerWithLocal: no local record => always use server', () => {
|
|
79
112
|
const resolver = createRecordResolveOnServerWithLocal(
|
|
80
113
|
() => ({ name: 'posts', dataSourceKey: 'main' }) as any,
|
|
@@ -14,6 +14,7 @@ export type RecordRef = {
|
|
|
14
14
|
id?: any; // primary key value
|
|
15
15
|
filterByTk?: any; // alias for id
|
|
16
16
|
dataSourceKey?: string;
|
|
17
|
+
associationName?: string;
|
|
17
18
|
sourceId?: any;
|
|
18
19
|
fields?: string[];
|
|
19
20
|
appends?: string[];
|
|
@@ -28,6 +29,8 @@ export type NormalizedRecordParams = {
|
|
|
28
29
|
collection: string;
|
|
29
30
|
filterByTk: any;
|
|
30
31
|
dataSourceKey?: string;
|
|
32
|
+
associationName?: string;
|
|
33
|
+
sourceId?: any;
|
|
31
34
|
fields?: string[];
|
|
32
35
|
appends?: string[];
|
|
33
36
|
};
|
|
@@ -64,6 +67,8 @@ function normalizeOne(ctx: FlowContext, ref?: RecordRef): NormalizedRecordParams
|
|
|
64
67
|
collection,
|
|
65
68
|
filterByTk,
|
|
66
69
|
dataSourceKey,
|
|
70
|
+
associationName: ref.associationName,
|
|
71
|
+
sourceId: ref.sourceId,
|
|
67
72
|
fields: ref.fields,
|
|
68
73
|
appends: ref.appends,
|
|
69
74
|
});
|
|
@@ -43,9 +43,10 @@ export function inferViewRecordRef(ctx: FlowContext): RecordRef | undefined {
|
|
|
43
43
|
const collection = inputArgs?.collectionName || (view as any)?.record?.collection;
|
|
44
44
|
const dataSourceKey = inputArgs?.dataSourceKey || (view as any)?.record?.dataSourceKey || 'main';
|
|
45
45
|
const filterByTk = inputArgs?.filterByTk || (view as any)?.record?.filterByTk;
|
|
46
|
+
const associationName = inputArgs?.associationName;
|
|
46
47
|
const sourceId = inputArgs?.sourceId;
|
|
47
48
|
if (!collection || typeof filterByTk === 'undefined' || filterByTk === null) return undefined;
|
|
48
|
-
return { collection, dataSourceKey, filterByTk, sourceId };
|
|
49
|
+
return { collection, dataSourceKey, filterByTk, sourceId, associationName };
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// 统一视图场景中“视图记录”的本地复用逻辑:
|