datastake-daf 0.6.733 → 0.6.734
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/hooks/index.js +1 -1
- package/dist/pages/index.js +66 -40
- package/package.json +1 -1
- package/src/@daf/core/components/DynamicForm/storyConfig.js +192 -264
- package/src/@daf/hooks/useWidgetFetch.js +1 -1
- package/src/@daf/pages/dashboards/AllInformation/Locations/columns.js +15 -9
- package/src/@daf/pages/dashboards/AllInformation/Locations/create.jsx +1 -0
- package/src/@daf/pages/dashboards/AllInformation/Locations/index.jsx +6 -5
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/create.jsx +2 -0
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/index.jsx +2 -2
- package/src/@daf/pages/dashboards/SupplyChain/components/ChartsContainer/components/Identification/index.js +2 -0
- package/src/@daf/pages/dashboards/SupplyChain/components/TradeRelationships/index.js +1 -1
- package/src/@daf/pages/dashboards/UserDashboard/components/MineSites/index.jsx +3 -0
- package/src/@daf/pages/dashboards/helper.js +6 -5
package/dist/hooks/index.js
CHANGED
package/dist/pages/index.js
CHANGED
|
@@ -6788,7 +6788,7 @@ const useWidgetFetch = ({
|
|
|
6788
6788
|
};
|
|
6789
6789
|
React.useEffect(() => {
|
|
6790
6790
|
fetchData();
|
|
6791
|
-
}, []);
|
|
6791
|
+
}, [config]);
|
|
6792
6792
|
return {
|
|
6793
6793
|
data,
|
|
6794
6794
|
loading,
|
|
@@ -11990,30 +11990,32 @@ const mapIcon = category => {
|
|
|
11990
11990
|
};
|
|
11991
11991
|
const leftBackground = theme.colorPrimary3;
|
|
11992
11992
|
const rightBackground = theme.colorPrimary6;
|
|
11993
|
-
const mapDataForChainOfCustody = (data = {}, options =
|
|
11993
|
+
const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
|
|
11994
11994
|
const mapChildren = (items, type, parentId, isDirect = true) => {
|
|
11995
|
-
return (items ?? []).map(item =>
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
11995
|
+
return (items ?? []).map(item => {
|
|
11996
|
+
return {
|
|
11997
|
+
id: item.id,
|
|
11998
|
+
number: 0,
|
|
11999
|
+
name: item.name,
|
|
12000
|
+
sources: parentId ? [parentId] : [],
|
|
12001
|
+
subTitle: findOptions(item?.category, options?.categoriesOptions),
|
|
12002
|
+
leftIcon: type === "client" ? rightIcon : leftIcon,
|
|
12003
|
+
leftBackground: type === "client" ? rightBackground : leftBackground,
|
|
12004
|
+
topIcon: mapIcon(item.category),
|
|
12005
|
+
children: mapChildren(item.sources ?? item.clients ?? [], type, item.id, false),
|
|
12006
|
+
onClick: () => {
|
|
12007
|
+
if (isDirect && parentId === data.id) {
|
|
12008
|
+
goTo(`/app/partners?datastakeId=${item.id}`);
|
|
12009
|
+
}
|
|
12008
12010
|
}
|
|
12009
|
-
}
|
|
12010
|
-
})
|
|
12011
|
+
};
|
|
12012
|
+
});
|
|
12011
12013
|
};
|
|
12012
12014
|
return {
|
|
12013
12015
|
id: data.id,
|
|
12014
12016
|
number: 0,
|
|
12015
12017
|
name: data.name,
|
|
12016
|
-
subTitle: findOptions(data
|
|
12018
|
+
subTitle: findOptions(data?.category, options?.categoriesOptions),
|
|
12017
12019
|
leftIcon: middleIcon,
|
|
12018
12020
|
leftBackground: theme.colorPrimary10,
|
|
12019
12021
|
topIcon: mapIcon(data.category),
|
|
@@ -12044,7 +12046,7 @@ function TradeRelationships({
|
|
|
12044
12046
|
} = useWidgetFetch({
|
|
12045
12047
|
config: fetchConfig
|
|
12046
12048
|
});
|
|
12047
|
-
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options
|
|
12049
|
+
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options, goTo);
|
|
12048
12050
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
12049
12051
|
loading: loading,
|
|
12050
12052
|
title: t("Trade Relationships"),
|
|
@@ -12430,6 +12432,9 @@ function Identification({
|
|
|
12430
12432
|
label: t("Monthly"),
|
|
12431
12433
|
value: "monthly"
|
|
12432
12434
|
}], [t]);
|
|
12435
|
+
console.log({
|
|
12436
|
+
identificationData: data
|
|
12437
|
+
});
|
|
12433
12438
|
const chartConfig = useIdentification({
|
|
12434
12439
|
data,
|
|
12435
12440
|
theme,
|
|
@@ -13713,6 +13718,12 @@ function MineSites({
|
|
|
13713
13718
|
defaultData: [],
|
|
13714
13719
|
stop: selectedPartners?.loading
|
|
13715
13720
|
}), [activeTab, selectedPartners]);
|
|
13721
|
+
console.log({
|
|
13722
|
+
activeTab
|
|
13723
|
+
});
|
|
13724
|
+
console.log({
|
|
13725
|
+
dataFetchConfig
|
|
13726
|
+
});
|
|
13716
13727
|
const {
|
|
13717
13728
|
data,
|
|
13718
13729
|
loading,
|
|
@@ -29924,7 +29935,8 @@ const StakeholdersCreate$1 = ({
|
|
|
29924
29935
|
};
|
|
29925
29936
|
const newPayload = {
|
|
29926
29937
|
...defaultData,
|
|
29927
|
-
...payloadData
|
|
29938
|
+
...payloadData,
|
|
29939
|
+
form: 'stakeholder'
|
|
29928
29940
|
};
|
|
29929
29941
|
const callback = (type, m, data) => {
|
|
29930
29942
|
if (setSelectedFormNext) {
|
|
@@ -29984,7 +29996,7 @@ const StakeholdersTable = ({
|
|
|
29984
29996
|
activeTab,
|
|
29985
29997
|
getRedirectLink,
|
|
29986
29998
|
theme,
|
|
29987
|
-
subject: '
|
|
29999
|
+
subject: 'stakeholders'
|
|
29988
30000
|
}), [t, goTo, user, options, activeTab, getRedirectLink, theme]);
|
|
29989
30001
|
const breadCrumbs = [];
|
|
29990
30002
|
const {
|
|
@@ -30059,7 +30071,7 @@ const StakeholdersTable = ({
|
|
|
30059
30071
|
onSubmitted: (type, m, data) => {
|
|
30060
30072
|
if (data.datastakeId) {
|
|
30061
30073
|
displayMessage(type, t("affirmations::subject-created-successfully") || m);
|
|
30062
|
-
goTo(`/app/
|
|
30074
|
+
goTo(`/app/stakeholders`);
|
|
30063
30075
|
}
|
|
30064
30076
|
},
|
|
30065
30077
|
onCancel: onDrawerClose,
|
|
@@ -30075,6 +30087,12 @@ const StakeholdersTable = ({
|
|
|
30075
30087
|
});
|
|
30076
30088
|
};
|
|
30077
30089
|
|
|
30090
|
+
const getLinkValue = (value, linkingObject) => {
|
|
30091
|
+
if (linkingObject && linkingObject?.[value]) {
|
|
30092
|
+
return linkingObject?.[value]?.name;
|
|
30093
|
+
}
|
|
30094
|
+
return null;
|
|
30095
|
+
};
|
|
30078
30096
|
const getColumns = ({
|
|
30079
30097
|
t,
|
|
30080
30098
|
goTo,
|
|
@@ -30084,8 +30102,7 @@ const getColumns = ({
|
|
|
30084
30102
|
getRedirectLink,
|
|
30085
30103
|
theme,
|
|
30086
30104
|
subject,
|
|
30087
|
-
data
|
|
30088
|
-
dataOptions
|
|
30105
|
+
data
|
|
30089
30106
|
}) => [{
|
|
30090
30107
|
dataIndex: 'datastakeId',
|
|
30091
30108
|
title: t('ID'),
|
|
@@ -30129,7 +30146,7 @@ const getColumns = ({
|
|
|
30129
30146
|
className: "daf-default-cell"
|
|
30130
30147
|
});
|
|
30131
30148
|
}
|
|
30132
|
-
const category = findOptions(v,
|
|
30149
|
+
const category = findOptions(v, data?.options?.locationCategories);
|
|
30133
30150
|
return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
30134
30151
|
title: category,
|
|
30135
30152
|
children: category
|
|
@@ -30163,8 +30180,11 @@ const getColumns = ({
|
|
|
30163
30180
|
className: "daf-default-cell"
|
|
30164
30181
|
});
|
|
30165
30182
|
}
|
|
30166
|
-
|
|
30167
|
-
return
|
|
30183
|
+
const region = getLinkValue(v, all?.linking?.SCL);
|
|
30184
|
+
return region ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
30185
|
+
title: region,
|
|
30186
|
+
children: region
|
|
30187
|
+
}) : '-';
|
|
30168
30188
|
}
|
|
30169
30189
|
}, {
|
|
30170
30190
|
dataIndex: 'administrativeLevel2',
|
|
@@ -30177,8 +30197,11 @@ const getColumns = ({
|
|
|
30177
30197
|
className: "daf-default-cell"
|
|
30178
30198
|
});
|
|
30179
30199
|
}
|
|
30180
|
-
|
|
30181
|
-
return
|
|
30200
|
+
const district = getLinkValue(v, all?.linking?.SCL);
|
|
30201
|
+
return district ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
30202
|
+
title: district,
|
|
30203
|
+
children: district
|
|
30204
|
+
}) : '-';
|
|
30182
30205
|
}
|
|
30183
30206
|
}, {
|
|
30184
30207
|
title: t("Last Update"),
|
|
@@ -30209,9 +30232,10 @@ const getColumns = ({
|
|
|
30209
30232
|
className: "daf-default-cell"
|
|
30210
30233
|
});
|
|
30211
30234
|
}
|
|
30212
|
-
|
|
30213
|
-
|
|
30214
|
-
|
|
30235
|
+
console.log({
|
|
30236
|
+
val,
|
|
30237
|
+
all
|
|
30238
|
+
});
|
|
30215
30239
|
return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
|
|
30216
30240
|
items: val
|
|
30217
30241
|
});
|
|
@@ -30356,7 +30380,8 @@ const StakeholdersCreate = ({
|
|
|
30356
30380
|
};
|
|
30357
30381
|
const newPayload = {
|
|
30358
30382
|
...defaultData,
|
|
30359
|
-
...payloadData
|
|
30383
|
+
...payloadData,
|
|
30384
|
+
form: 'location'
|
|
30360
30385
|
};
|
|
30361
30386
|
const callback = (type, m, data) => {
|
|
30362
30387
|
if (setSelectedFormNext) {
|
|
@@ -30404,8 +30429,7 @@ const LocationsTable = ({
|
|
|
30404
30429
|
changeAjaxOptions = () => {},
|
|
30405
30430
|
formData = {},
|
|
30406
30431
|
formValue = {},
|
|
30407
|
-
form = {}
|
|
30408
|
-
dataOptions = {}
|
|
30432
|
+
form = {}
|
|
30409
30433
|
}) => {
|
|
30410
30434
|
const [selectOptions, setSelectOptions] = React.useState();
|
|
30411
30435
|
const [activeTab, setActiveTab] = React.useState();
|
|
@@ -30417,10 +30441,9 @@ const LocationsTable = ({
|
|
|
30417
30441
|
activeTab,
|
|
30418
30442
|
getRedirectLink,
|
|
30419
30443
|
theme,
|
|
30420
|
-
subject: '
|
|
30421
|
-
data
|
|
30422
|
-
|
|
30423
|
-
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, dataOptions]);
|
|
30444
|
+
subject: 'locations',
|
|
30445
|
+
data
|
|
30446
|
+
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
|
|
30424
30447
|
const breadCrumbs = [];
|
|
30425
30448
|
const {
|
|
30426
30449
|
paginationQuery,
|
|
@@ -30441,6 +30464,9 @@ const LocationsTable = ({
|
|
|
30441
30464
|
tab: activeTab
|
|
30442
30465
|
}, 'locations');
|
|
30443
30466
|
}, [paginationQuery, otherParams, searchParams, activeTab]);
|
|
30467
|
+
console.log({
|
|
30468
|
+
data
|
|
30469
|
+
});
|
|
30444
30470
|
const selectFiltersConfig = React.useMemo(() => {
|
|
30445
30471
|
return getFiltersConfig({
|
|
30446
30472
|
t
|
|
@@ -30495,7 +30521,7 @@ const LocationsTable = ({
|
|
|
30495
30521
|
if (data.datastakeId) {
|
|
30496
30522
|
displayMessage(type, t("affirmations::subject-created-successfully") || m);
|
|
30497
30523
|
// goTo(`/app/edit/stakeholders/${data.datastakeId}`);
|
|
30498
|
-
|
|
30524
|
+
goTo('/app/locations');
|
|
30499
30525
|
}
|
|
30500
30526
|
},
|
|
30501
30527
|
onCancel: onDrawerClose,
|
package/package.json
CHANGED
|
@@ -9,22 +9,35 @@ export const storyData = {
|
|
|
9
9
|
getApiBaseUrl,
|
|
10
10
|
getAppHeader,
|
|
11
11
|
form: {
|
|
12
|
-
form:
|
|
13
|
-
{
|
|
12
|
+
form: {
|
|
14
13
|
"id": "identification",
|
|
15
14
|
"position": 1,
|
|
15
|
+
"meta": {
|
|
16
|
+
"meta": {
|
|
17
|
+
"hidden": true
|
|
18
|
+
},
|
|
19
|
+
"kobo": {
|
|
20
|
+
"sectionName": {
|
|
21
|
+
"English (en)": "Identification",
|
|
22
|
+
"French (fr)": "Identification",
|
|
23
|
+
"sp": "Identificación"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
16
27
|
"date": {
|
|
17
|
-
"_id": "
|
|
18
|
-
"id": "
|
|
28
|
+
"_id": "6903e169de03f5cd64f66f38",
|
|
29
|
+
"id": "3ce07178-d73c-41c3-a0f6-c90d299c6055",
|
|
19
30
|
"dataId": "date",
|
|
20
31
|
"section": "identification",
|
|
21
32
|
"type": "date",
|
|
22
33
|
"meta": {
|
|
23
|
-
"
|
|
34
|
+
"comment": false,
|
|
24
35
|
"notApplicable": false,
|
|
25
36
|
"notAvailable": false,
|
|
26
|
-
"
|
|
27
|
-
|
|
37
|
+
"disableEdit": {
|
|
38
|
+
"create": false,
|
|
39
|
+
"edit": true
|
|
40
|
+
},
|
|
28
41
|
"mandatory": true
|
|
29
42
|
},
|
|
30
43
|
"position": 2,
|
|
@@ -35,142 +48,110 @@ export const storyData = {
|
|
|
35
48
|
}
|
|
36
49
|
],
|
|
37
50
|
"scope": [
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
51
|
+
"event",
|
|
52
|
+
"trainingEvent",
|
|
53
|
+
"monitoringEvent",
|
|
54
|
+
"createEventModal",
|
|
55
|
+
"createMonitoringModal",
|
|
56
|
+
"createPlantingCycleModal",
|
|
57
|
+
"createRestorationModal",
|
|
58
|
+
"createEngagementModal",
|
|
59
|
+
"createOperationModal",
|
|
60
|
+
"createActivityModal",
|
|
61
|
+
"operationsActivity",
|
|
62
|
+
"engagementActivity",
|
|
63
|
+
"monitoringActivity",
|
|
64
|
+
"restorationActivity",
|
|
65
|
+
"activity",
|
|
66
|
+
"restorationActivityStart",
|
|
67
|
+
"restorationActivityEnd",
|
|
68
|
+
"monitoringActivity",
|
|
69
|
+
"engagementActivity",
|
|
70
|
+
"operationsActivity",
|
|
71
|
+
"straatos"
|
|
48
72
|
],
|
|
49
73
|
"label": "Date",
|
|
50
|
-
"createdAt": "2025-10-
|
|
51
|
-
"updatedAt": "2025-10-
|
|
74
|
+
"createdAt": "2025-10-30T22:06:34.850Z",
|
|
75
|
+
"updatedAt": "2025-10-30T22:06:34.850Z",
|
|
52
76
|
"__v": 0
|
|
53
77
|
},
|
|
54
|
-
"
|
|
55
|
-
"_id": "
|
|
56
|
-
"id": "
|
|
57
|
-
"dataId": "
|
|
78
|
+
"name": {
|
|
79
|
+
"_id": "6903e169de03f5cd64f66f52",
|
|
80
|
+
"id": "af308827-f01f-442f-bc68-0b68e25d1895",
|
|
81
|
+
"dataId": "name",
|
|
58
82
|
"section": "identification",
|
|
59
|
-
"type": "
|
|
83
|
+
"type": "text",
|
|
60
84
|
"meta": {
|
|
61
85
|
"comment": false,
|
|
62
86
|
"notApplicable": false,
|
|
63
87
|
"notAvailable": false,
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"mandatory":
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"createNew": true,
|
|
74
|
-
"collection": "documents",
|
|
75
|
-
"formNamespace": "DOCUMENTS",
|
|
76
|
-
"keys": [
|
|
77
|
-
"title"
|
|
78
|
-
],
|
|
79
|
-
"pickKeys": []
|
|
80
|
-
},
|
|
81
|
-
"rules": [
|
|
82
|
-
{
|
|
83
|
-
"message": "errors::field is required",
|
|
84
|
-
"required": true
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"accept": ".doc,.docx,.pdf,.xls,.xlsx",
|
|
88
|
-
"type": "any"
|
|
88
|
+
"defaultValue": "Training related to operations",
|
|
89
|
+
"group": "identification",
|
|
90
|
+
"mandatory": false,
|
|
91
|
+
"kobo": {
|
|
92
|
+
"fieldName": {
|
|
93
|
+
"English (en)": "Title",
|
|
94
|
+
"French (fr)": "Titre",
|
|
95
|
+
"sp": "Título"
|
|
96
|
+
}
|
|
89
97
|
},
|
|
90
|
-
{
|
|
91
|
-
"
|
|
92
|
-
"
|
|
98
|
+
"disableEdit": {
|
|
99
|
+
"create": false,
|
|
100
|
+
"edit": true
|
|
93
101
|
}
|
|
94
|
-
],
|
|
95
|
-
"scope": [
|
|
96
|
-
"global",
|
|
97
|
-
"registrationFormDocuments",
|
|
98
|
-
"evaluationDocumentation",
|
|
99
|
-
"documents",
|
|
100
|
-
"evidenceAmoundGoldProduced",
|
|
101
|
-
"investmentNote",
|
|
102
|
-
"financialAnalysis",
|
|
103
|
-
"createDocument",
|
|
104
|
-
"projectDocument"
|
|
105
|
-
],
|
|
106
|
-
"label": "Upload file",
|
|
107
|
-
"tableLabel": "Content",
|
|
108
|
-
"createdAt": "2025-10-09T08:55:03.354Z",
|
|
109
|
-
"updatedAt": "2025-10-09T08:55:03.354Z",
|
|
110
|
-
"__v": 0
|
|
111
|
-
},
|
|
112
|
-
"links": {
|
|
113
|
-
"_id": "68e77861e8ffe2dc9621c98a",
|
|
114
|
-
"id": "5788f425-56cd-4d32-aec8-c540f3fa2e5d",
|
|
115
|
-
"dataId": "links",
|
|
116
|
-
"section": "identification",
|
|
117
|
-
"type": "link",
|
|
118
|
-
"meta": {
|
|
119
|
-
"comment": false,
|
|
120
|
-
"notApplicable": false,
|
|
121
|
-
"notAvailable": false,
|
|
122
|
-
"group": "documentation",
|
|
123
|
-
"versioning": true,
|
|
124
|
-
"mandatory": true
|
|
125
|
-
},
|
|
126
|
-
"showIf": "type is link",
|
|
127
|
-
"position": 4,
|
|
128
|
-
"dataLink": {
|
|
129
|
-
"entity": "Documents",
|
|
130
|
-
"createUserVersion": false,
|
|
131
|
-
"createNew": true,
|
|
132
|
-
"collection": "documents",
|
|
133
|
-
"formNamespace": "DOCUMENTS",
|
|
134
|
-
"keys": [
|
|
135
|
-
"title"
|
|
136
|
-
],
|
|
137
|
-
"pickKeys": []
|
|
138
102
|
},
|
|
103
|
+
"position": 3,
|
|
139
104
|
"rules": [
|
|
140
105
|
{
|
|
141
|
-
"
|
|
142
|
-
"
|
|
106
|
+
"required": true,
|
|
107
|
+
"message": "errors::field is required"
|
|
143
108
|
}
|
|
144
109
|
],
|
|
145
110
|
"scope": [
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
111
|
+
"event",
|
|
112
|
+
"straatos",
|
|
113
|
+
"trainingEvent",
|
|
114
|
+
"monitoringEvent",
|
|
115
|
+
"createEventModal",
|
|
116
|
+
"createActivityModal",
|
|
117
|
+
"createOperationModal",
|
|
118
|
+
"createMonitoringModal",
|
|
119
|
+
"createRestorationModal",
|
|
120
|
+
"createPlantingCycleModal",
|
|
121
|
+
"createEngagementModal",
|
|
122
|
+
"engagementActivity",
|
|
123
|
+
"operationsActivity",
|
|
124
|
+
"restorationActivity",
|
|
125
|
+
"monitoringActivity",
|
|
126
|
+
"operationsActivity",
|
|
127
|
+
"engagementActivity",
|
|
128
|
+
"monitoringActivity",
|
|
129
|
+
"restorationActivity",
|
|
130
|
+
"restorationActivityStart",
|
|
131
|
+
"activity"
|
|
154
132
|
],
|
|
155
|
-
"label": "
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"updatedAt": "2025-10-09T08:55:03.357Z",
|
|
133
|
+
"label": "Activity title",
|
|
134
|
+
"createdAt": "2025-10-30T22:06:34.865Z",
|
|
135
|
+
"updatedAt": "2025-10-30T22:06:34.865Z",
|
|
159
136
|
"__v": 0
|
|
160
137
|
},
|
|
161
|
-
"
|
|
162
|
-
"_id": "
|
|
163
|
-
"id": "
|
|
164
|
-
"dataId": "
|
|
138
|
+
"subCategory": {
|
|
139
|
+
"_id": "6903e169de03f5cd64f66f72",
|
|
140
|
+
"id": "85f91af5-dfe2-403b-812d-182425fba422",
|
|
141
|
+
"dataId": "subCategory",
|
|
165
142
|
"section": "identification",
|
|
166
|
-
"type": "
|
|
143
|
+
"type": "select",
|
|
167
144
|
"meta": {
|
|
168
145
|
"group": "identification",
|
|
146
|
+
"comment": false,
|
|
169
147
|
"notApplicable": false,
|
|
170
|
-
"notAvailable":
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
|
|
148
|
+
"notAvailable": true,
|
|
149
|
+
"disableEdit": {
|
|
150
|
+
"create": false,
|
|
151
|
+
"edit": true
|
|
152
|
+
},
|
|
153
|
+
"mandatory": true,
|
|
154
|
+
"conditionalOptions": "$$_options.activity.operationType"
|
|
174
155
|
},
|
|
175
156
|
"position": 1,
|
|
176
157
|
"rules": [
|
|
@@ -180,90 +161,93 @@ export const storyData = {
|
|
|
180
161
|
}
|
|
181
162
|
],
|
|
182
163
|
"scope": [
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"
|
|
164
|
+
"event",
|
|
165
|
+
"createEventModal",
|
|
166
|
+
"createOperationModal",
|
|
167
|
+
"createEngagementModal",
|
|
168
|
+
"createMonitoringModal",
|
|
169
|
+
"createRestorationModal",
|
|
170
|
+
"createPlantingCycleModal",
|
|
171
|
+
"activity",
|
|
172
|
+
"operationsActivity",
|
|
173
|
+
"createActivityModal",
|
|
174
|
+
"engagementActivity",
|
|
175
|
+
"monitoringActivity",
|
|
176
|
+
"restorationActivity",
|
|
177
|
+
"trainingEvent",
|
|
178
|
+
"straatos"
|
|
194
179
|
],
|
|
195
|
-
"label": "
|
|
196
|
-
"
|
|
197
|
-
"updatedAt": "2025-10-09T08:55:00.689Z",
|
|
198
|
-
"__v": 0
|
|
199
|
-
},
|
|
200
|
-
"pictures": {
|
|
201
|
-
"_id": "68e77861e8ffe2dc9621c98e",
|
|
202
|
-
"id": "2c0ffe9e-ddab-4e1c-93da-a6e681a93158",
|
|
203
|
-
"dataId": "pictures",
|
|
204
|
-
"section": "identification",
|
|
205
|
-
"type": "imageUpload",
|
|
206
|
-
"meta": {
|
|
207
|
-
"group": "identification",
|
|
208
|
-
"notApplicable": true,
|
|
209
|
-
"notAvailable": true,
|
|
210
|
-
"comment": true,
|
|
211
|
-
"versioning": true,
|
|
212
|
-
"mandatory": true
|
|
213
|
-
},
|
|
214
|
-
"showIf": "type is pictures",
|
|
215
|
-
"position": 4,
|
|
216
|
-
"dataLink": {
|
|
217
|
-
"entity": "Documents",
|
|
218
|
-
"createUserVersion": false,
|
|
219
|
-
"createNew": true,
|
|
220
|
-
"collection": "documents",
|
|
221
|
-
"formNamespace": "DOCUMENTS",
|
|
222
|
-
"keys": [
|
|
223
|
-
"title"
|
|
224
|
-
],
|
|
225
|
-
"pickKeys": []
|
|
226
|
-
},
|
|
227
|
-
"rules": [
|
|
180
|
+
"label": "Type of activity",
|
|
181
|
+
"options": [
|
|
228
182
|
{
|
|
229
|
-
"
|
|
230
|
-
"
|
|
183
|
+
"label": "Training",
|
|
184
|
+
"value": "training"
|
|
231
185
|
},
|
|
232
186
|
{
|
|
233
|
-
"
|
|
234
|
-
"
|
|
187
|
+
"label": "Other",
|
|
188
|
+
"value": "other"
|
|
235
189
|
},
|
|
236
190
|
{
|
|
237
|
-
"
|
|
238
|
-
"
|
|
191
|
+
"label": "Commercial intervention",
|
|
192
|
+
"value": "commercial_intervention"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"label": "Operational training",
|
|
196
|
+
"value": "operational_training"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"label": "Equipment provision",
|
|
200
|
+
"value": "equipment_provision"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "Financial intervention",
|
|
204
|
+
"value": "financial_intervention"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"label": "Infrastructure",
|
|
208
|
+
"value": "infrastructure"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"label": "Investigation & research",
|
|
212
|
+
"value": "investigation_research"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"label": "Legalisation",
|
|
216
|
+
"value": "legalisation"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"label": "Policy & enforcement",
|
|
220
|
+
"value": "policy_enforcement"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"label": "Technical intervention",
|
|
224
|
+
"value": "technical_intervention"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"label": "Site visit",
|
|
228
|
+
"value": "site_visit"
|
|
239
229
|
}
|
|
240
230
|
],
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
"modal",
|
|
244
|
-
"registrationFormDocuments",
|
|
245
|
-
"pictures",
|
|
246
|
-
"documents",
|
|
247
|
-
"evaluationDocumentation",
|
|
248
|
-
"evidenceAmoundGoldProduced",
|
|
249
|
-
"investmentNote",
|
|
250
|
-
"financialAnalysis",
|
|
251
|
-
"createDocument"
|
|
252
|
-
],
|
|
253
|
-
"label": "Upload file",
|
|
254
|
-
"tableLabel": "Content",
|
|
255
|
-
"createdAt": "2025-10-09T08:55:03.424Z",
|
|
256
|
-
"updatedAt": "2025-10-09T08:55:03.424Z",
|
|
231
|
+
"createdAt": "2025-10-30T22:06:36.634Z",
|
|
232
|
+
"updatedAt": "2025-10-30T22:06:36.634Z",
|
|
257
233
|
"__v": 0
|
|
258
234
|
},
|
|
259
|
-
"
|
|
260
|
-
"_id": "
|
|
261
|
-
"id": "
|
|
262
|
-
"dataId": "
|
|
235
|
+
"typeOfEvent": {
|
|
236
|
+
"_id": "6903e169de03f5cd64f66f74",
|
|
237
|
+
"id": "f44a3e74-e68a-40a0-a7f5-62189bc068a2",
|
|
238
|
+
"dataId": "typeOfEvent",
|
|
263
239
|
"section": "identification",
|
|
264
240
|
"type": "select",
|
|
265
241
|
"meta": {
|
|
266
|
-
"
|
|
242
|
+
"group": "identification",
|
|
243
|
+
"comment": false,
|
|
244
|
+
"notApplicable": false,
|
|
245
|
+
"notAvailable": true,
|
|
246
|
+
"defaultValue": "operation",
|
|
247
|
+
"disableEdit": {
|
|
248
|
+
"edit": true,
|
|
249
|
+
"create": true
|
|
250
|
+
},
|
|
267
251
|
"mandatory": true
|
|
268
252
|
},
|
|
269
253
|
"position": 0,
|
|
@@ -274,93 +258,37 @@ export const storyData = {
|
|
|
274
258
|
}
|
|
275
259
|
],
|
|
276
260
|
"scope": [
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"pictures",
|
|
283
|
-
"evidenceAmoundGoldProduced",
|
|
284
|
-
"investmentNote",
|
|
285
|
-
"financialAnalysis",
|
|
286
|
-
"createDocument"
|
|
261
|
+
"createOperationModal",
|
|
262
|
+
"createEngagementModal",
|
|
263
|
+
"createMonitoringModal",
|
|
264
|
+
"createRestorationModal",
|
|
265
|
+
"createActivityModal"
|
|
287
266
|
],
|
|
288
|
-
"label": "
|
|
267
|
+
"label": "Category",
|
|
289
268
|
"options": [
|
|
290
269
|
{
|
|
291
|
-
"label": "
|
|
292
|
-
"value": "
|
|
270
|
+
"label": "Operation",
|
|
271
|
+
"value": "operation"
|
|
293
272
|
},
|
|
294
273
|
{
|
|
295
|
-
"label": "
|
|
296
|
-
"value": "
|
|
274
|
+
"label": "Restoration",
|
|
275
|
+
"value": "restoration"
|
|
297
276
|
},
|
|
298
277
|
{
|
|
299
|
-
"label": "
|
|
300
|
-
"value": "
|
|
278
|
+
"label": "Monitoring",
|
|
279
|
+
"value": "monitoring"
|
|
301
280
|
},
|
|
302
281
|
{
|
|
303
|
-
"label": "
|
|
304
|
-
"value": "
|
|
305
|
-
}
|
|
306
|
-
],
|
|
307
|
-
"createdAt": "2025-10-09T08:55:04.175Z",
|
|
308
|
-
"updatedAt": "2025-10-09T08:55:04.175Z",
|
|
309
|
-
"__v": 0
|
|
310
|
-
},
|
|
311
|
-
"videos": {
|
|
312
|
-
"_id": "68e77861e8ffe2dc9621c996",
|
|
313
|
-
"id": "acd697ae-4d0a-4c86-abfd-028e980c9dfe",
|
|
314
|
-
"dataId": "videos",
|
|
315
|
-
"section": "identification",
|
|
316
|
-
"type": "videoUpload",
|
|
317
|
-
"meta": {
|
|
318
|
-
"comment": false,
|
|
319
|
-
"notApplicable": false,
|
|
320
|
-
"notAvailable": false,
|
|
321
|
-
"group": "documentation",
|
|
322
|
-
"versioning": true,
|
|
323
|
-
"mandatory": true
|
|
324
|
-
},
|
|
325
|
-
"showIf": "type is video",
|
|
326
|
-
"position": 4,
|
|
327
|
-
"dataLink": {
|
|
328
|
-
"entity": "Documents",
|
|
329
|
-
"createUserVersion": false,
|
|
330
|
-
"createNew": true,
|
|
331
|
-
"collection": "documents",
|
|
332
|
-
"formNamespace": "DOCUMENTS",
|
|
333
|
-
"keys": [
|
|
334
|
-
"title"
|
|
335
|
-
],
|
|
336
|
-
"pickKeys": []
|
|
337
|
-
},
|
|
338
|
-
"rules": [
|
|
339
|
-
{
|
|
340
|
-
"message": "errors::field is required",
|
|
341
|
-
"required": true
|
|
282
|
+
"label": "Engagement",
|
|
283
|
+
"value": "engagement"
|
|
342
284
|
}
|
|
343
285
|
],
|
|
344
|
-
"
|
|
345
|
-
|
|
346
|
-
"modal",
|
|
347
|
-
"registrationFormDocuments",
|
|
348
|
-
"documents",
|
|
349
|
-
"evaluationDocumentation",
|
|
350
|
-
"evidenceAmoundGoldProduced",
|
|
351
|
-
"createDocument",
|
|
352
|
-
"investmentNote",
|
|
353
|
-
"financialAnalysis"
|
|
354
|
-
],
|
|
355
|
-
"label": "Upload file",
|
|
356
|
-
"tableLabel": "Content",
|
|
357
|
-
"createdAt": "2025-10-09T08:55:03.362Z",
|
|
358
|
-
"updatedAt": "2025-10-09T08:55:03.362Z",
|
|
286
|
+
"createdAt": "2025-10-30T22:06:36.144Z",
|
|
287
|
+
"updatedAt": "2025-10-30T22:06:36.144Z",
|
|
359
288
|
"__v": 0
|
|
360
289
|
},
|
|
361
|
-
"label": "Identification"
|
|
362
|
-
|
|
363
|
-
},
|
|
290
|
+
"label": "Identification"
|
|
291
|
+
}
|
|
364
292
|
},
|
|
365
293
|
data: {
|
|
366
294
|
date: "2025-08-11T15:54:02.839Z",
|
|
@@ -5,7 +5,14 @@ import { renderDateFormatted } from '../../../../../helpers/Forms.js';
|
|
|
5
5
|
import CustomIcon from '../../../../core/components/Icon/CustomIcon.jsx';
|
|
6
6
|
import AvatarGroup from '../../../../core/components/AvatarGroup/index.jsx';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const getLinkValue = (value, linkingObject) => {
|
|
9
|
+
if(linkingObject && linkingObject?.[value]) {
|
|
10
|
+
return linkingObject?.[value]?.name;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data}) => [
|
|
9
16
|
{
|
|
10
17
|
dataIndex: 'datastakeId',
|
|
11
18
|
title: t('ID'),
|
|
@@ -42,7 +49,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
42
49
|
return <div className="daf-default-cell" />
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
const category = findOptions(v,
|
|
52
|
+
const category = findOptions(v, data?.options?.locationCategories);
|
|
46
53
|
|
|
47
54
|
return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
|
|
48
55
|
},
|
|
@@ -72,9 +79,9 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
72
79
|
return <div className="daf-default-cell" />
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
const
|
|
82
|
+
const region = getLinkValue(v, all?.linking?.SCL);
|
|
76
83
|
|
|
77
|
-
return
|
|
84
|
+
return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
|
|
78
85
|
},
|
|
79
86
|
},
|
|
80
87
|
{
|
|
@@ -87,9 +94,9 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
87
94
|
return <div className="daf-default-cell" />
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
const
|
|
97
|
+
const district = getLinkValue(v, all?.linking?.SCL);
|
|
91
98
|
|
|
92
|
-
return
|
|
99
|
+
return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
|
|
93
100
|
},
|
|
94
101
|
},
|
|
95
102
|
{
|
|
@@ -116,9 +123,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
116
123
|
if (all.empty) {
|
|
117
124
|
return <div className="daf-default-cell" />;
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
126
|
+
|
|
127
|
+
console.log({val, all})
|
|
122
128
|
|
|
123
129
|
return <AvatarGroup items={val}></AvatarGroup>;
|
|
124
130
|
},
|
|
@@ -32,10 +32,10 @@ const LocationsTable = ({
|
|
|
32
32
|
formData = {},
|
|
33
33
|
formValue = {},
|
|
34
34
|
form = {},
|
|
35
|
-
dataOptions = {},
|
|
36
35
|
}) => {
|
|
37
36
|
const [selectOptions, setSelectOptions] = useState();
|
|
38
37
|
const [activeTab, setActiveTab] = useState();
|
|
38
|
+
|
|
39
39
|
const columns = useMemo(() => getColumns({
|
|
40
40
|
t,
|
|
41
41
|
goTo,
|
|
@@ -44,10 +44,9 @@ const LocationsTable = ({
|
|
|
44
44
|
activeTab,
|
|
45
45
|
getRedirectLink,
|
|
46
46
|
theme,
|
|
47
|
-
subject: '
|
|
47
|
+
subject: 'locations',
|
|
48
48
|
data,
|
|
49
|
-
|
|
50
|
-
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, dataOptions]);
|
|
49
|
+
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
|
|
51
50
|
|
|
52
51
|
const breadCrumbs = [];
|
|
53
52
|
|
|
@@ -62,6 +61,8 @@ const LocationsTable = ({
|
|
|
62
61
|
}, 'locations')
|
|
63
62
|
}, [paginationQuery, otherParams, searchParams, activeTab]);
|
|
64
63
|
|
|
64
|
+
console.log({data})
|
|
65
|
+
|
|
65
66
|
const selectFiltersConfig = useMemo(() => {
|
|
66
67
|
return getFiltersConfig({t});
|
|
67
68
|
}, [t]);
|
|
@@ -121,7 +122,7 @@ const LocationsTable = ({
|
|
|
121
122
|
t("affirmations::subject-created-successfully") || m,
|
|
122
123
|
);
|
|
123
124
|
// goTo(`/app/edit/stakeholders/${data.datastakeId}`);
|
|
124
|
-
|
|
125
|
+
goTo('/app/locations')
|
|
125
126
|
}
|
|
126
127
|
}}
|
|
127
128
|
onCancel={onDrawerClose}
|
|
@@ -43,7 +43,7 @@ const StakeholdersTable = ({
|
|
|
43
43
|
activeTab,
|
|
44
44
|
getRedirectLink,
|
|
45
45
|
theme,
|
|
46
|
-
subject: '
|
|
46
|
+
subject: 'stakeholders'
|
|
47
47
|
}), [t, goTo, user, options, activeTab, getRedirectLink, theme]);
|
|
48
48
|
|
|
49
49
|
const breadCrumbs = [];
|
|
@@ -117,7 +117,7 @@ const StakeholdersTable = ({
|
|
|
117
117
|
type,
|
|
118
118
|
t("affirmations::subject-created-successfully") || m,
|
|
119
119
|
);
|
|
120
|
-
goTo(`/app/
|
|
120
|
+
goTo(`/app/stakeholders`);
|
|
121
121
|
}
|
|
122
122
|
}}
|
|
123
123
|
onCancel={onDrawerClose}
|
|
@@ -24,7 +24,7 @@ function TradeRelationships({goTo, t = () => {}, options = {}, hardcodedData = [
|
|
|
24
24
|
|
|
25
25
|
const { data, loading } = useWidgetFetch({config: fetchConfig});
|
|
26
26
|
|
|
27
|
-
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options
|
|
27
|
+
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options, goTo);
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<Widget
|
|
@@ -64,6 +64,9 @@ function MineSites({
|
|
|
64
64
|
[activeTab, selectedPartners],
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
+
console.log({activeTab})
|
|
68
|
+
console.log({dataFetchConfig})
|
|
69
|
+
|
|
67
70
|
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
68
71
|
|
|
69
72
|
const tabs = useMemo(() => getTabs(t), [t]);
|
|
@@ -45,14 +45,15 @@ const mapIcon = (category) => {
|
|
|
45
45
|
const leftBackground = theme.colorPrimary3;
|
|
46
46
|
const rightBackground = theme.colorPrimary6;
|
|
47
47
|
|
|
48
|
-
export const mapDataForChainOfCustody = (data = {}, options =
|
|
48
|
+
export const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
|
|
49
49
|
const mapChildren = (items, type, parentId, isDirect = true) => {
|
|
50
|
-
return (items ?? []).map((item) =>
|
|
50
|
+
return (items ?? []).map((item) => {
|
|
51
|
+
return {
|
|
51
52
|
id: item.id,
|
|
52
53
|
number: 0,
|
|
53
54
|
name: item.name,
|
|
54
55
|
sources: parentId ? [parentId] : [],
|
|
55
|
-
subTitle: findOptions(item
|
|
56
|
+
subTitle: findOptions(item?.category, options?.categoriesOptions),
|
|
56
57
|
leftIcon: type === "client" ? rightIcon : leftIcon,
|
|
57
58
|
leftBackground: type === "client" ? rightBackground : leftBackground,
|
|
58
59
|
topIcon: mapIcon(item.category),
|
|
@@ -62,14 +63,14 @@ export const mapDataForChainOfCustody = (data = {}, options = [], goTo = () => {
|
|
|
62
63
|
goTo(`/app/partners?datastakeId=${item.id}`);
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
|
-
})
|
|
66
|
+
}});
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
return {
|
|
69
70
|
id: data.id,
|
|
70
71
|
number: 0,
|
|
71
72
|
name: data.name,
|
|
72
|
-
subTitle: findOptions(data
|
|
73
|
+
subTitle: findOptions(data?.category, options?.categoriesOptions),
|
|
73
74
|
leftIcon: middleIcon,
|
|
74
75
|
leftBackground: theme.colorPrimary10,
|
|
75
76
|
topIcon: mapIcon(data.category),
|