datastake-daf 0.6.100 → 0.6.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/components/index.css +1 -1
  2. package/dist/components/index.js +2722 -226
  3. package/package.json +1 -1
  4. package/rollup.config.js +41 -83
  5. package/src/@daf/core/components/Dashboard/Map/helper.js +434 -439
  6. package/src/@daf/core/components/Dashboard/Map/storyConfig1.js +230 -233
  7. package/src/@daf/core/components/EditForm/components/AjaxSubGroup/index.js +0 -2
  8. package/src/@daf/core/components/PdfForm/components/AjaxSubGroup.js +106 -0
  9. package/src/@daf/core/components/PdfForm/components/ajaxSubGroupHandler.js +12 -0
  10. package/src/@daf/core/components/PdfForm/components/dataLinkGroupHandler.js +24 -15
  11. package/src/@daf/core/components/PdfForm/components/dataLinkHandler.js +51 -17
  12. package/src/@daf/core/components/PdfForm/index.js +208 -22
  13. package/src/@daf/core/components/PdfForm/storyConfig.js +464 -163
  14. package/src/@daf/core/components/PdfForm/style.scss +145 -3
  15. package/src/@daf/core/components/PdfForm/utils/fieldData.js +82 -3
  16. package/src/@daf/core/components/PdfForm/utils/fieldRenderer.js +14 -6
  17. package/src/helpers/Map.js +6 -82
  18. package/src/styles/_index.scss +1 -1
  19. package/src/styles/datastake.scss +4454 -1
  20. package/.vscode/settings.json +0 -13
  21. package/dist/style/datastake/_index.css +0 -5
  22. package/dist/style/datastake/datastake.css +0 -5081
  23. package/dist/style/datastake/fonts/Outfit-Black.ttf +0 -0
  24. package/dist/style/datastake/fonts/Outfit-Bold.ttf +0 -0
  25. package/dist/style/datastake/fonts/Outfit-ExtraBold.ttf +0 -0
  26. package/dist/style/datastake/fonts/Outfit-ExtraLight.ttf +0 -0
  27. package/dist/style/datastake/fonts/Outfit-Light.ttf +0 -0
  28. package/dist/style/datastake/fonts/Outfit-Medium.ttf +0 -0
  29. package/dist/style/datastake/fonts/Outfit-Regular.ttf +0 -0
  30. package/dist/style/datastake/fonts/Outfit-SemiBold.ttf +0 -0
  31. package/dist/style/datastake/fonts/Outfit-Thin.ttf +0 -0
  32. package/dist/style/datastake/fonts/outfit.css +0 -62
  33. package/dist/style/datastake/fonts/sf-ui-display-black-58646a6b80d5a.woff +0 -0
  34. package/dist/style/datastake/fonts/sf-ui-display-bold-58646a511e3d9.woff +0 -0
  35. package/dist/style/datastake/fonts/sf-ui-display-heavy-586470160b9e5.woff +0 -0
  36. package/dist/style/datastake/fonts/sf-ui-display-light-58646b33e0551.woff +0 -0
  37. package/dist/style/datastake/fonts/sf-ui-display-medium-58646be638f96.woff +0 -0
  38. package/dist/style/datastake/fonts/sf-ui-display-semibold-58646eddcae92.woff +0 -0
  39. package/dist/style/datastake/fonts/sf-ui-display-thin-58646e9b26e8b.woff +0 -0
  40. package/dist/style/datastake/fonts/sf-ui-display-ultralight-58646b19bf205.woff +0 -0
  41. package/dist/style/datastake/fonts/sfDisplay.css +0 -59
  42. package/dist/style/datastake/leaflet.css +0 -671
  43. package/dist/style/datastake/leaflet.markercluster.css +0 -60
  44. package/dist/style/style.css +0 -1
  45. package/src/styles/datastake/_index.css +0 -5
  46. package/src/styles/datastake/datastake.css +0 -5081
  47. package/src/styles/datastake/fonts/Outfit-Black.ttf +0 -0
  48. package/src/styles/datastake/fonts/Outfit-Bold.ttf +0 -0
  49. package/src/styles/datastake/fonts/Outfit-ExtraBold.ttf +0 -0
  50. package/src/styles/datastake/fonts/Outfit-ExtraLight.ttf +0 -0
  51. package/src/styles/datastake/fonts/Outfit-Light.ttf +0 -0
  52. package/src/styles/datastake/fonts/Outfit-Medium.ttf +0 -0
  53. package/src/styles/datastake/fonts/Outfit-Regular.ttf +0 -0
  54. package/src/styles/datastake/fonts/Outfit-SemiBold.ttf +0 -0
  55. package/src/styles/datastake/fonts/Outfit-Thin.ttf +0 -0
  56. package/src/styles/datastake/fonts/outfit.css +0 -62
  57. package/src/styles/datastake/fonts/sf-ui-display-black-58646a6b80d5a.woff +0 -0
  58. package/src/styles/datastake/fonts/sf-ui-display-bold-58646a511e3d9.woff +0 -0
  59. package/src/styles/datastake/fonts/sf-ui-display-heavy-586470160b9e5.woff +0 -0
  60. package/src/styles/datastake/fonts/sf-ui-display-light-58646b33e0551.woff +0 -0
  61. package/src/styles/datastake/fonts/sf-ui-display-medium-58646be638f96.woff +0 -0
  62. package/src/styles/datastake/fonts/sf-ui-display-semibold-58646eddcae92.woff +0 -0
  63. package/src/styles/datastake/fonts/sf-ui-display-thin-58646e9b26e8b.woff +0 -0
  64. package/src/styles/datastake/fonts/sf-ui-display-ultralight-58646b19bf205.woff +0 -0
  65. package/src/styles/datastake/fonts/sfDisplay.css +0 -59
  66. package/src/styles/datastake/leaflet.css +0 -671
  67. package/src/styles/datastake/leaflet.markercluster.css +0 -60
@@ -5,241 +5,238 @@ import MoreTags from "../../Table/MoreTags";
5
5
  const isMineSite = true;
6
6
 
7
7
  export const storyConfig = {
8
- data: [
9
- {
10
- gps: {
11
- latitude: -1.545726158025555,
12
- longitude: 28.875630614904935,
13
- },
14
- name: "Rubaya",
15
- datastakeId: "LOC-00000000241",
16
- data: [
17
- {
18
- _id: "68af116e2cb57a4e3dd2e056",
19
- createdBy: "4274fdb4-2798-46ea-a0a6-b4af5d92566e",
20
- form: "event",
21
- id: "91c3176a-d312-4259-9ddf-9d286ff6df87",
22
- datastakeId: "EV-000000000150",
23
- name: "Eboulement",
24
- authorId: "7e17f076-09e7-4668-927c-11c12ccd1346",
25
- collectId: "d78271301d04f76dfe0f70ce3c9e114ffe4dc4e0",
26
- country: "CD",
27
- date: "2025-08-25",
28
- typeOfEvent: "incident",
29
- implementers: [],
30
- associatedSubjects: [],
31
- testimonialsSource: [],
32
- pictures: [],
33
- documents: [],
34
- channels: ["NAS-00000000105"],
35
- published: true,
36
- version: 1,
37
- identifiedPerpetrators: [],
38
- identifiedVictims: [],
39
- assistedVictims: [],
40
- mitigationMeasures: [],
41
- createdAt: "2025-08-27T00:00:00.000Z",
42
- updatedAt: "2025-08-27T14:12:21.395Z",
43
- __v: 0,
44
- percentageCompletion: 40,
45
- eventCategory: "conflict",
46
- incindentType: null,
47
- initiative: null,
48
- meta: null,
49
- namespace: "incident",
50
- primarySource: null,
51
- severity: "moderate",
52
- sources: ["7e17f076-09e7-4668-927c-11c12ccd1346"],
53
- type: "minor_incident",
54
- },
55
- {
56
- _id: "68af1fb6b52f86d82f57e945",
57
- createdBy: "b1e3f288-01a2-4cea-95d2-03f65dfede99",
58
- form: "event",
59
- id: "5bee0d0f-39da-4bd1-85a4-e66276c82303",
60
- datastakeId: "EV-000000000153",
61
- name: "Request of security equipment",
62
- authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
63
- collectId: "2142bd9f3306c9ec3c823f63bbbbb8fe3ebad7fa",
64
- country: "CD",
65
- date: "2025-08-11",
66
- typeOfEvent: "testimonials",
67
- implementers: [],
68
- typeOfTestimonials: "request",
69
- associatedSubjects: [],
70
- testimonialsSource: [],
71
- pictures: [],
72
- documents: [],
73
- channels: [],
74
- published: true,
75
- version: 1,
76
- identifiedPerpetrators: [],
77
- identifiedVictims: [],
78
- assistedVictims: [],
79
- mitigationMeasures: [],
80
- createdAt: "2025-08-27T00:00:00.000Z",
81
- updatedAt: "2025-08-27T15:10:00.619Z",
82
- __v: 0,
83
- percentageCompletion: 50,
84
- meta: null,
85
- namespace: "testimonials",
86
- sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
87
- type: "correctiveActions",
88
- },
89
- {
90
- _id: "68af5d45b52f86d82f580fc8",
91
- createdBy: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
92
- form: "event",
93
- id: "97348b4c-f7cf-4124-9b70-0f6891a40a15",
94
- datastakeId: "EV-000000000161",
95
- name: "76867485768",
96
- authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
97
- collectId: "33b9aea707761a7a735aee81ebd29d5656f049fa",
98
- country: "CD",
99
- date: "2025-08-11",
100
- typeOfEvent: "incident",
101
- implementers: [],
102
- associatedSubjects: [],
103
- testimonialsSource: [],
104
- pictures: [],
105
- documents: [],
106
- channels: [],
107
- published: false,
108
- version: 1,
109
- identifiedPerpetrators: [],
110
- identifiedVictims: [],
111
- assistedVictims: [],
112
- mitigationMeasures: [],
113
- createdAt: "2025-08-27T00:00:00.000Z",
114
- updatedAt: "2025-08-27T00:00:00.000Z",
115
- __v: 0,
116
- percentageCompletion: 40,
117
- eventCategory: null,
118
- initiative: null,
119
- meta: null,
120
- namespace: "incident",
121
- primarySource: null,
122
- severity: "major",
123
- sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
124
- type: "major_incident",
125
- },
126
- ],
127
- type: "Mine site",
128
- total: 5,
129
- sources: 2,
130
- },
131
- ],
132
- filtersConfig: [
133
- {
134
- label: "Location type",
135
- placeholder: "Select",
136
- key: "type",
137
- type: "select",
138
- value: "A",
139
- options: [{ label: "Typ A", value: "A" }],
140
- },
141
- {
142
- label: "Location type",
143
- placeholder: "Select",
144
- key: "type2",
145
- type: "select",
146
- value: undefined,
147
- options: [{ label: "Typ A", value: "A" }],
148
- },
149
- ],
150
- onFilterChange: (v) => {
151
- console.log(v);
152
- },
153
- // tooltipAsText: true,
154
- primaryLink: true,
155
- renderSider: () =>
156
- isMineSite ? (
157
- <div className="body-list">
158
- <div className="body-row">
159
- <span className="label">Territory</span>
160
- <span>Territory</span>
161
- </div>
8
+ data: [
9
+ {
10
+ gps: {
11
+ latitude: -1.545726158025555,
12
+ longitude: 28.875630614904935,
13
+ },
14
+ name: "Rubaya",
15
+ datastakeId: "LOC-00000000241",
16
+ data: [
17
+ {
18
+ _id: "68af116e2cb57a4e3dd2e056",
19
+ createdBy: "4274fdb4-2798-46ea-a0a6-b4af5d92566e",
20
+ form: "event",
21
+ id: "91c3176a-d312-4259-9ddf-9d286ff6df87",
22
+ datastakeId: "EV-000000000150",
23
+ name: "Eboulement",
24
+ authorId: "7e17f076-09e7-4668-927c-11c12ccd1346",
25
+ collectId: "d78271301d04f76dfe0f70ce3c9e114ffe4dc4e0",
26
+ country: "CD",
27
+ date: "2025-08-25",
28
+ typeOfEvent: "incident",
29
+ implementers: [],
30
+ associatedSubjects: [],
31
+ testimonialsSource: [],
32
+ pictures: [],
33
+ documents: [],
34
+ channels: ["NAS-00000000105"],
35
+ published: true,
36
+ version: 1,
37
+ identifiedPerpetrators: [],
38
+ identifiedVictims: [],
39
+ assistedVictims: [],
40
+ mitigationMeasures: [],
41
+ createdAt: "2025-08-27T00:00:00.000Z",
42
+ updatedAt: "2025-08-27T14:12:21.395Z",
43
+ __v: 0,
44
+ percentageCompletion: 40,
45
+ eventCategory: "conflict",
46
+ incindentType: null,
47
+ initiative: null,
48
+ meta: null,
49
+ namespace: "incident",
50
+ primarySource: null,
51
+ severity: "moderate",
52
+ sources: ["7e17f076-09e7-4668-927c-11c12ccd1346"],
53
+ type: "minor_incident",
54
+ },
55
+ {
56
+ _id: "68af1fb6b52f86d82f57e945",
57
+ createdBy: "b1e3f288-01a2-4cea-95d2-03f65dfede99",
58
+ form: "event",
59
+ id: "5bee0d0f-39da-4bd1-85a4-e66276c82303",
60
+ datastakeId: "EV-000000000153",
61
+ name: "Request of security equipment",
62
+ authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
63
+ collectId: "2142bd9f3306c9ec3c823f63bbbbb8fe3ebad7fa",
64
+ country: "CD",
65
+ date: "2025-08-11",
66
+ typeOfEvent: "testimonials",
67
+ implementers: [],
68
+ typeOfTestimonials: "request",
69
+ associatedSubjects: [],
70
+ testimonialsSource: [],
71
+ pictures: [],
72
+ documents: [],
73
+ channels: [],
74
+ published: true,
75
+ version: 1,
76
+ identifiedPerpetrators: [],
77
+ identifiedVictims: [],
78
+ assistedVictims: [],
79
+ mitigationMeasures: [],
80
+ createdAt: "2025-08-27T00:00:00.000Z",
81
+ updatedAt: "2025-08-27T15:10:00.619Z",
82
+ __v: 0,
83
+ percentageCompletion: 50,
84
+ meta: null,
85
+ namespace: "testimonials",
86
+ sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
87
+ type: "correctiveActions",
88
+ },
89
+ {
90
+ _id: "68af5d45b52f86d82f580fc8",
91
+ createdBy: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
92
+ form: "event",
93
+ id: "97348b4c-f7cf-4124-9b70-0f6891a40a15",
94
+ datastakeId: "EV-000000000161",
95
+ name: "76867485768",
96
+ authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
97
+ collectId: "33b9aea707761a7a735aee81ebd29d5656f049fa",
98
+ country: "CD",
99
+ date: "2025-08-11",
100
+ typeOfEvent: "incident",
101
+ implementers: [],
102
+ associatedSubjects: [],
103
+ testimonialsSource: [],
104
+ pictures: [],
105
+ documents: [],
106
+ channels: [],
107
+ published: false,
108
+ version: 1,
109
+ identifiedPerpetrators: [],
110
+ identifiedVictims: [],
111
+ assistedVictims: [],
112
+ mitigationMeasures: [],
113
+ createdAt: "2025-08-27T00:00:00.000Z",
114
+ updatedAt: "2025-08-27T00:00:00.000Z",
115
+ __v: 0,
116
+ percentageCompletion: 40,
117
+ eventCategory: null,
118
+ initiative: null,
119
+ meta: null,
120
+ namespace: "incident",
121
+ primarySource: null,
122
+ severity: "major",
123
+ sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
124
+ type: "major_incident",
125
+ },
126
+ ],
127
+ type: "Mine site",
128
+ total: 5,
129
+ sources: 2,
130
+ },
131
+ ],
132
+ filtersConfig: [
133
+ {
134
+ label: "Location type",
135
+ placeholder: "Select",
136
+ key: "type",
137
+ type: "select",
138
+ value: "A",
139
+ options: [{ label: "Typ A", value: "A" }],
140
+ },
141
+ {
142
+ label: "Location type",
143
+ placeholder: "Select",
144
+ key: "type2",
145
+ type: "select",
146
+ value: undefined,
147
+ options: [{ label: "Typ A", value: "A" }],
148
+ },
149
+ ],
150
+ onFilterChange: (v) => {
151
+ console.log(v);
152
+ },
153
+ // tooltipAsText: true,
154
+ primaryLink: true,
155
+ renderSider: () =>
156
+ isMineSite ? (
157
+ <div className="body-list">
158
+ <div className="body-row">
159
+ <span className="label">Territory</span>
160
+ <span>Territory</span>
161
+ </div>
162
162
 
163
- <div className="body-row">
164
- <span className="label">Territory</span>
165
- <span>Territory</span>
166
- </div>
163
+ <div className="body-row">
164
+ <span className="label">Territory</span>
165
+ <span>Territory</span>
166
+ </div>
167
167
 
168
- <div className="body-row">
169
- <span className="label">Territory</span>
170
- <span>Territory</span>
171
- </div>
172
- </div>
173
- ) : (
174
- <div className="daf-table-wrapper extra-small">
175
- <DAFTable
176
- loading={false}
177
- scroll={{ y: 300 }}
178
- className="no-padding no-margin"
179
- data={[
180
- { worker: "Redis RIra", activity: "1234", key: 0 },
181
- { empty: true, key: 1 },
182
- { empty: true, key: 2 },
183
- { empty: true, key: 3 },
184
- { empty: true, key: 4 },
185
- { empty: true, key: 5 },
186
- { empty: true, key: 6 },
187
- { empty: true, key: 7 },
188
- { empty: true, key: 8 },
189
- ]}
190
- pagination={false}
191
- columns={[
192
- {
193
- title: "Worker",
194
- dataIndex: "worker",
195
- key: "worker",
196
- ellipsis: true,
197
- width: 90,
198
- },
199
- {
200
- title: "Activity",
201
- dataIndex: "activity",
202
- key: "activity",
203
- width: 90,
204
- render: (_, all) => {
205
- if (all.empty) {
206
- return <div className="daf-default-cell md" />;
207
- }
168
+ <div className="body-row">
169
+ <span className="label">Territory</span>
170
+ <span>Territory</span>
171
+ </div>
172
+ </div>
173
+ ) : (
174
+ <div className="daf-table-wrapper extra-small">
175
+ <DAFTable
176
+ loading={false}
177
+ scroll={{ y: 300 }}
178
+ className="no-padding no-margin"
179
+ data={[
180
+ { worker: "Redis RIra", activity: "1234", key: 0 },
181
+ { empty: true, key: 1 },
182
+ { empty: true, key: 2 },
183
+ { empty: true, key: 3 },
184
+ { empty: true, key: 4 },
185
+ { empty: true, key: 5 },
186
+ { empty: true, key: 6 },
187
+ { empty: true, key: 7 },
188
+ { empty: true, key: 8 },
189
+ ]}
190
+ pagination={false}
191
+ columns={[
192
+ {
193
+ title: "Worker",
194
+ dataIndex: "worker",
195
+ key: "worker",
196
+ ellipsis: true,
197
+ width: 90,
198
+ },
199
+ {
200
+ title: "Activity",
201
+ dataIndex: "activity",
202
+ key: "activity",
203
+ width: 90,
204
+ render: (_, all) => {
205
+ if (all.empty) {
206
+ return <div className="daf-default-cell md" />;
207
+ }
208
208
 
209
- return (
210
- <MoreTags
211
- values={[{ label: "DDdadsdas" }]}
212
- maxTextCont={40}
213
- />
214
- );
215
- },
216
- },
217
- {
218
- title: "",
219
- dataIndex: "action",
220
- key: "action",
221
- width: 34,
222
- render: (_, all) => {
223
- if (all.empty) {
224
- return <div className="daf-default-cell md" />;
225
- }
209
+ return (
210
+ <MoreTags values={[{ label: "DDdadsdas" }]} maxTextCont={40} />
211
+ );
212
+ },
213
+ },
214
+ {
215
+ title: "",
216
+ dataIndex: "action",
217
+ key: "action",
218
+ width: 34,
219
+ render: (_, all) => {
220
+ if (all.empty) {
221
+ return <div className="daf-default-cell md" />;
222
+ }
226
223
 
227
- return <CustomIcon name="LinkNewTab" width={12} height={12} />;
228
- },
229
- },
230
- ]}
231
- rowKey="key"
232
- />
233
- </div>
234
- ),
235
- renderTooltip: (data) => {
236
- return [
237
- { label: "Workers", value: data?.administrativeLevel1 },
238
- { label: "Opinion", value: "RROFTE GERRDECI " },
239
- ];
240
- },
241
- link: true,
242
- onClickLink: (data) => {
243
- console.log(data);
244
- },
224
+ return <CustomIcon name="LinkNewTab" width={12} height={12} />;
225
+ },
226
+ },
227
+ ]}
228
+ rowKey="key"
229
+ />
230
+ </div>
231
+ ),
232
+ renderTooltip: (data) => {
233
+ return [
234
+ { label: "Workers", value: data?.administrativeLevel1 },
235
+ { label: "Opinion", value: "RROFTE GERRDECI " },
236
+ ];
237
+ },
238
+ link: true,
239
+ onClickLink: (data) => {
240
+ console.log(data);
241
+ },
245
242
  };
@@ -30,8 +30,6 @@ export default function AjaxSubGroup({
30
30
  const { t } = useEditContext();
31
31
  const isAjaxModal = useMemo(() => !!form?.meta?.namespace, [form]);
32
32
 
33
- console.log({form, options, k, excludedKeys, values, i, formTitles, data});
34
-
35
33
  const formScope = useMemo(() => {
36
34
  const val = form.meta.formScope;
37
35
  let toReturn = val;
@@ -0,0 +1,106 @@
1
+ import React, { useMemo } from 'react';
2
+ import useAjaxModal from '../utils/useAjaxModal';
3
+ import { handleDataLinkWithTableKeys } from './dataLinkHandler';
4
+
5
+ const AjaxSubGroup = ({
6
+ config,
7
+ value,
8
+ allData,
9
+ level,
10
+ t,
11
+ rootForm,
12
+ user,
13
+ getApiBaseUrl = () => {},
14
+ getAppHeader = () => {},
15
+ app,
16
+ TreeNodeComponent
17
+ }) => {
18
+ const isAjaxModal = useMemo(() => !!config?.meta?.namespace, [config]);
19
+
20
+ const ajaxModalValues = useAjaxModal({
21
+ name: config?.label || 'ajaxSubGroup',
22
+ user,
23
+ namespace: config?.meta?.namespace,
24
+ skipFetch: config?.meta?.skipFetch,
25
+ isAjaxModal,
26
+ formScope: config?.meta?.formScope || 'modal',
27
+ APP: app,
28
+ apiBaseUrl: getApiBaseUrl(),
29
+ _getAppHeader: getAppHeader,
30
+ });
31
+
32
+ const ajaxForm = ajaxModalValues?.form;
33
+
34
+ console.log({ajaxForm});
35
+
36
+ if (ajaxModalValues.isFetching) {
37
+ return (
38
+ <div className="ajax-subgroup-loading" style={{ padding: '20px', textAlign: 'center' }}>
39
+ <span>Loading form configuration...</span>
40
+ </div>
41
+ );
42
+ }
43
+
44
+ const formInputs = Object.values(ajaxForm || {})[0] || {};
45
+ console.log({formInputs})
46
+
47
+ const sortedRecords = value.sort((a, b) => {
48
+ const yearA = parseInt(a.meta?.year || '0');
49
+ const yearB = parseInt(b.meta?.year || '0');
50
+ return yearB - yearA;
51
+ });
52
+
53
+ const children = [];
54
+
55
+ sortedRecords.forEach((record, recordIndex) => {
56
+ const year = record.meta?.year || 'Unknown Year';
57
+
58
+ const fieldKeys = Object.keys(formInputs)
59
+ .filter((inputKey) => {
60
+ const metadataKeys = ['id', 'label', 'position', 'subTitle'];
61
+ if (metadataKeys.includes(inputKey)) {
62
+ return false;
63
+ }
64
+
65
+ const excludedKeys = config?.meta?.excludedKeysView || [];
66
+ return !excludedKeys.includes(inputKey);
67
+ })
68
+ .sort((a, b) => {
69
+ const positionA = formInputs[a]?.position || 0;
70
+ const positionB = formInputs[b]?.position || 0;
71
+ return positionA - positionB;
72
+ });
73
+
74
+ const yearInputs = {};
75
+ fieldKeys.forEach(inputKey => {
76
+ yearInputs[inputKey] = formInputs[inputKey];
77
+ });
78
+
79
+ children.push(
80
+ <TreeNodeComponent
81
+ key={`year-${year}`}
82
+ nodeKey={`year-${year}`}
83
+ config={{
84
+ label: year,
85
+ type: 'header',
86
+ inputs: yearInputs,
87
+ meta: { code: record.datastakeId || '' }
88
+ }}
89
+ value={record}
90
+ level={level + 1}
91
+ isLast={recordIndex === sortedRecords.length - 1}
92
+ t={t}
93
+ rootForm={rootForm}
94
+ allData={record}
95
+ user={user}
96
+ getApiBaseUrl={getApiBaseUrl}
97
+ getAppHeader={getAppHeader}
98
+ app={app}
99
+ />
100
+ );
101
+ });
102
+
103
+ return children;
104
+ };
105
+
106
+ export default AjaxSubGroup;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import AjaxSubGroup from './AjaxSubGroup';
3
+
4
+ export const handleAjaxSubGroupChildren = (props) => {
5
+ if (props.config?.type !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
6
+ return null;
7
+ }
8
+
9
+ return [
10
+ <AjaxSubGroup key="ajax-subgroup" {...props} />
11
+ ];
12
+ };