@gisce/react-ooui 1.4.11 → 1.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-ooui.es.js +2006 -2003
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +8 -8
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/widgets/base/many2one/Many2oneSuffix.tsx +24 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Many2oneSuffix.d.ts","sourceRoot":"","sources":["Many2oneSuffix.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Many2oneSuffix.d.ts","sourceRoot":"","sources":["Many2oneSuffix.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAwB/D,aAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,KAAK,6BA8L1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/plots": "^1.0.9",
|
|
35
35
|
"@gisce/fiber-diagram": "^1.1.0-rc.3",
|
|
36
|
-
"@gisce/ooui": "^0.22.
|
|
36
|
+
"@gisce/ooui": "^0.22.3",
|
|
37
37
|
"@gisce/react-formiga-components": "^1.0.9-rc.21",
|
|
38
38
|
"@gisce/react-formiga-table": "^0.8.5",
|
|
39
39
|
"@monaco-editor/react": "^4.4.5",
|
|
@@ -20,6 +20,7 @@ import ConnectionProvider from "@/ConnectionProvider";
|
|
|
20
20
|
import { processValues } from "@/helpers/formHelper";
|
|
21
21
|
import showErrorDialog from "@/ui/ActionErrorDialog";
|
|
22
22
|
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
23
|
+
import { parseContextFields, parseDomainFields } from "@gisce/ooui";
|
|
23
24
|
|
|
24
25
|
type Props = {
|
|
25
26
|
id: number;
|
|
@@ -60,18 +61,29 @@ export const Many2oneSuffix = (props: Props) => {
|
|
|
60
61
|
context,
|
|
61
62
|
}) as FormView;
|
|
62
63
|
setFormView(formView);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
let fields: string[] = [];
|
|
65
|
+
const { toolbar } = formView;
|
|
66
|
+
toolbar.action?.filter((item: any) => item.hasOwnProperty('context')).map((item: any) => fields.push(...parseContextFields(item.context)));
|
|
67
|
+
toolbar.action?.filter((item: any) => item.hasOwnProperty('domain')).map((item: any) => fields.push(...parseDomainFields(item.domain)));
|
|
68
|
+
toolbar.relate?.filter((item: any) => item.hasOwnProperty('context')).map((item: any) => fields.push(...parseContextFields(item.context)));
|
|
69
|
+
toolbar.relate?.filter((item: any) => item.hasOwnProperty('domain')).map((item: any) => fields.push(...parseDomainFields(item.domain)));
|
|
70
|
+
toolbar.print?.filter((item: any) => item.hasOwnProperty('context')).map((item: any) => fields.push(...parseContextFields(item.context)));
|
|
71
|
+
fields = fields.filter((i) => Object.keys(formView.fields).indexOf(i) > -1)
|
|
72
|
+
|
|
73
|
+
let values = {}
|
|
74
|
+
|
|
75
|
+
if (fields.length > 0) {
|
|
76
|
+
values = (
|
|
77
|
+
await ConnectionProvider.getHandler().readObjects({
|
|
78
|
+
model,
|
|
79
|
+
ids: [id],
|
|
80
|
+
fieldsToRetrieve: fields,
|
|
81
|
+
context,
|
|
82
|
+
})
|
|
83
|
+
)[0];
|
|
84
|
+
}
|
|
85
|
+
values = { ...processValues(values, fields), active_id: id };
|
|
86
|
+
setTargetValues(values);
|
|
75
87
|
|
|
76
88
|
setIsLoading(false);
|
|
77
89
|
} catch (err) {
|