@gisce/react-ooui 1.4.10-rc.0 → 1.4.11-rc.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Many2oneSuffix.d.ts","sourceRoot":"","sources":["Many2oneSuffix.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/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,6BAmL1C,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,6BAiM1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.4.10-rc.0",
3
+ "version": "1.4.11-rc.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -33,9 +33,9 @@
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.2",
36
+ "@gisce/ooui": "^0.22.3-rc.0",
37
37
  "@gisce/react-formiga-components": "^1.0.9-rc.21",
38
- "@gisce/react-formiga-table": "^0.8.5-rc.0",
38
+ "@gisce/react-formiga-table": "^0.8.5",
39
39
  "@monaco-editor/react": "^4.4.5",
40
40
  "@tabler/icons-react": "^2.11.0",
41
41
  "antd": "^5.5.2",
@@ -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,30 @@ export const Many2oneSuffix = (props: Props) => {
60
61
  context,
61
62
  }) as FormView;
62
63
  setFormView(formView);
63
- const { fields, arch } = formView;
64
-
65
- const values = (
66
- await ConnectionProvider.getHandler().readObjects({
67
- model,
68
- ids: [id],
69
- fields,
70
- context,
71
- })
72
- )[0];
73
-
74
- setTargetValues({ ...processValues(values, fields), active_id: id });
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);
87
+ console.log('Values', targetValues, values);
75
88
 
76
89
  setIsLoading(false);
77
90
  } catch (err) {
@@ -149,6 +162,8 @@ export const Many2oneSuffix = (props: Props) => {
149
162
  return;
150
163
  }
151
164
 
165
+ console.log(targetValues);
166
+
152
167
  openRelate({
153
168
  relateData: relateItemClicked,
154
169
  values: targetValues,