datastake-daf 0.6.750 → 0.6.751

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 (28) hide show
  1. package/dist/components/index.js +70 -70
  2. package/dist/pages/index.js +286 -211
  3. package/dist/utils/index.js +24 -0
  4. package/package.json +1 -1
  5. package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +2 -2
  6. package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Identification/hook.js +1 -1
  7. package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +6 -1
  8. package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/helper.js +3 -3
  9. package/src/@daf/pages/Locations/MineSite/index.jsx +1 -1
  10. package/src/@daf/pages/Summary/Minesite/components/MineDetailsSection/index.js +51 -0
  11. package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/config.js +31 -37
  12. package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/index.js +4 -16
  13. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/config.js +6 -6
  14. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/helper.js +13 -16
  15. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/index.js +3 -3
  16. package/src/@daf/pages/Summary/Minesite/index.jsx +15 -19
  17. package/src/@daf/pages/Summary/Operator/components/Governance/config.js +4 -4
  18. package/src/@daf/pages/Summary/Operator/components/Governance/helper.js +8 -11
  19. package/src/@daf/pages/Summary/Operator/components/Governance/index.js +9 -3
  20. package/src/@daf/pages/Summary/Operator/index.jsx +6 -4
  21. package/src/@daf/pages/Summary/components/InformationAvailability/components/Contributions/index.js +16 -5
  22. package/src/@daf/pages/Summary/components/InformationAvailability/components/InformationCompleteness/index.js +2 -3
  23. package/src/@daf/pages/Summary/components/InformationAvailability/index.js +7 -4
  24. package/src/@daf/pages/Summary/hook.js +3 -3
  25. package/src/constants/locales/en/translation.js +8 -0
  26. package/src/constants/locales/fr/translation.js +8 -0
  27. package/src/constants/locales/sp/translation.js +8 -0
  28. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useMemo } from 'react'
2
2
  import Widget from '../../../../../../core/components/Dashboard/Widget/index.jsx';
3
3
  import BarChart from '../../../../../../core/components/Charts/BarChart/index.jsx';
4
4
 
@@ -6,7 +6,18 @@ const Contributions = ({
6
6
  data = {},
7
7
  loading = false,
8
8
  t = () => {},
9
+ partners = [],
9
10
  }) => {
11
+ const dataPoints = data?.datapointsByAuthor || {};
12
+ const _data = useMemo(() => {
13
+ return Object.keys(dataPoints).map((key) => {
14
+ return {
15
+ name: partners?.find((partner) => partner.id === key)?.name,
16
+ datapoints: dataPoints[key],
17
+ }
18
+ })
19
+ }, [dataPoints, partners]);
20
+
10
21
  return (
11
22
  <Widget
12
23
  title={t("Contributions")}
@@ -14,16 +25,16 @@ const Contributions = ({
14
25
  loading={loading}
15
26
  >
16
27
  <BarChart
17
- data={data?.stakeholders || []}
18
- xFieldKey="completedDatapoints"
19
- yFieldKey="author"
28
+ data={_data || []}
29
+ xFieldKey="datapoints"
30
+ yFieldKey="name"
20
31
  renderTooltipContent={(title, item) => {
21
32
  return {
22
33
  title: title,
23
34
  items: [
24
35
  {
25
36
  label: t("Datapoints"),
26
- value: item?.[0]?.data?.completedDatapoints || 0,
37
+ value: item?.[0]?.data?.datapoints || 0,
27
38
  },
28
39
  ],
29
40
  };
@@ -7,11 +7,10 @@ const InformationCompleteness = ({
7
7
  loading = false,
8
8
  t = () => {},
9
9
  }) => {
10
-
11
10
  const graphData = useMemo(() => {
12
11
  const keys = {
13
- ownDataCompletion: data?.ownDataCompletion || 0,
14
- consolidatedCompletion: data?.consolidatedCompletion || 0,
12
+ ownDataCompletion: typeof data?.percentage === "object" ? data?.percentage?.percentage : data?.percentage || 0,
13
+ consolidatedCompletion: data?.consolidatedPercentage || 0,
15
14
  };
16
15
 
17
16
  const _data = Object.keys(keys).map((key) => {
@@ -8,15 +8,18 @@ const InformationAvailability = ({
8
8
  selectedPartners = {},
9
9
  t = () => {},
10
10
  id,
11
+ subject,
12
+ partners
11
13
  }) => {
12
14
  const defaultFetchConfig = useMemo(
13
15
  () => ({
14
- basepath: "analytics",
15
- url: "/widgets/completeness",
16
+ basepath: subject === "stakeholder" ? "stakeholder" : "location",
17
+ url: `/completion/${id}`,
16
18
  defaultData: [],
17
19
  stop: selectedPartners?.loading,
18
20
  filters: {
19
- datastakeId: id,
21
+ // datastakeId: id,
22
+ scope: subject === "stakeholder" ? "operatorInfo" : "locationInfo",
20
23
  sources: selectedPartners?.partners || [],
21
24
  },
22
25
  }),
@@ -33,7 +36,7 @@ const InformationAvailability = ({
33
36
  >
34
37
  <div className="flex flex-row flex-col-mobile gap-6">
35
38
  <InformationCompleteness data={data} loading={loading} t={t} />
36
- <Contributions data={data} loading={loading} t={t} />
39
+ <Contributions data={data} loading={loading} t={t} partners={partners} />
37
40
  </div>
38
41
  </Widget>
39
42
  )
@@ -129,11 +129,11 @@ export const useSummary = ({
129
129
  }, [params?.id, hasSelect, getOne, getMultiple, _partners, isPdf, id, filters]);
130
130
 
131
131
  useEffect(() => {
132
- if (selectedItem && _partners !== undefined) {
132
+ if ((selectedItem || params?.id) && _partners !== undefined) {
133
133
  const fetchSingleItem = async () => {
134
134
  setLoading(true);
135
135
  try {
136
- const { data } = await service.getOne(selectedItem, { sources: _partners });
136
+ const { data } = await service.getOne(selectedItem || params?.id, { sources: _partners });
137
137
  setSingleItemData(data);
138
138
  } catch (error) {
139
139
  console.log(error);
@@ -143,7 +143,7 @@ export const useSummary = ({
143
143
  };
144
144
  fetchSingleItem();
145
145
  }
146
- }, [selectedItem, service, _partners]);
146
+ }, [selectedItem, service, _partners, params?.id]);
147
147
 
148
148
  useEffect(() => {
149
149
  _setPartners(selectedPartners?.partners);
@@ -1,4 +1,12 @@
1
1
  const en = {
2
+ "no-board-members": "No board members identified",
3
+ "no-management": "No management identified",
4
+ "no-beneficiaries": "No beneficiaries identified",
5
+ "no-stakeholders": "No stakeholders identified",
6
+ "no-operators": "No operators identified",
7
+ "no-traders": "No traders identified",
8
+ "no-government": "No government identified",
9
+ "no-other": "No other identified",
2
10
  "No planning required": "No planning required",
3
11
  "No evaluation required": "No evaluation required",
4
12
  "No improvement required": "No improvement required",
@@ -1,4 +1,12 @@
1
1
  const fr = {
2
+ "no-board-members": "Aucun membre du conseil d'administration identifié",
3
+ "no-management": "Aucun management identifié",
4
+ "no-beneficiaries": "Aucun bénéficiaire identifié",
5
+ "no-stakeholders": "Aucun stakeholder identifié",
6
+ "no-operators": "Aucun opérateur identifié",
7
+ "no-traders": "Aucun négociant identifié",
8
+ "no-government": "Aucun gouvernement identifié",
9
+ "no-other": "Aucun autre identifié",
2
10
  "No planning required": "Pas de planification requise",
3
11
  "No evaluation required": "Pas d'évaluation requise",
4
12
  "No improvement required": "Pas d'amélioration requise",
@@ -1,4 +1,12 @@
1
1
  const sp = {
2
+ "no-board-members": "No hay miembros del consejo identificados",
3
+ "no-management": "No hay gerencia identificados",
4
+ "no-beneficiaries": "No hay beneficiarios identificados",
5
+ "no-stakeholders": "No hay partes interesadas identificadas",
6
+ "no-operators": "No hay operadores identificados",
7
+ "no-traders": "No hay comerciantes identificados",
8
+ "no-government": "No hay gobierno identificado",
9
+ "no-other": "No hay otros identificados",
2
10
  "No planning required": "No se requiere planeación",
3
11
  "No evaluation required": "No se requiere evaluación",
4
12
  "No improvement required": "No se requiere mejora",
@@ -1,330 +0,0 @@
1
- /* Isolated Mapbox GL CSS - Scoped to prevent Leaflet conflicts */
2
-
3
- /* Mapbox GL Core Styles - Scoped with .mapbox-gl-scope */
4
- .mapbox-gl-scope .mapboxgl-map {
5
- font: 12px/20px Helvetica Neue, Arial, Helvetica, sans-serif;
6
- overflow: hidden;
7
- position: relative;
8
- -webkit-tap-highlight-color: rgb(0 0 0/0);
9
- }
10
-
11
- .mapbox-gl-scope .mapboxgl-canvas {
12
- left: 0;
13
- position: absolute;
14
- top: 0;
15
- }
16
-
17
- .mapbox-gl-scope .mapboxgl-map:-webkit-full-screen {
18
- height: 100%;
19
- width: 100%;
20
- }
21
-
22
- .mapbox-gl-scope .mapboxgl-canary {
23
- background-color: salmon;
24
- }
25
-
26
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive,
27
- .mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
28
- cursor: grab;
29
- -webkit-user-select: none;
30
- user-select: none;
31
- }
32
-
33
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer {
34
- cursor: pointer;
35
- }
36
-
37
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive:active,
38
- .mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {
39
- cursor: grabbing;
40
- }
41
-
42
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,
43
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {
44
- touch-action: pan-x pan-y;
45
- }
46
-
47
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan,
48
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {
49
- touch-action: pinch-zoom;
50
- }
51
-
52
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
53
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
54
- touch-action: none;
55
- }
56
-
57
- /* Control positioning */
58
- .mapbox-gl-scope .mapboxgl-ctrl-bottom,
59
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left,
60
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right,
61
- .mapbox-gl-scope .mapboxgl-ctrl-left,
62
- .mapbox-gl-scope .mapboxgl-ctrl-right,
63
- .mapbox-gl-scope .mapboxgl-ctrl-top,
64
- .mapbox-gl-scope .mapboxgl-ctrl-top-left,
65
- .mapbox-gl-scope .mapboxgl-ctrl-top-right {
66
- pointer-events: none;
67
- position: absolute;
68
- z-index: 2;
69
- }
70
-
71
- .mapbox-gl-scope .mapboxgl-ctrl-top-left {
72
- left: 0;
73
- top: 0;
74
- }
75
-
76
- .mapbox-gl-scope .mapboxgl-ctrl-top {
77
- left: 50%;
78
- top: 0;
79
- transform: translateX(-50%);
80
- }
81
-
82
- .mapbox-gl-scope .mapboxgl-ctrl-top-right {
83
- right: 0;
84
- top: 0;
85
- }
86
-
87
- .mapbox-gl-scope .mapboxgl-ctrl-right {
88
- right: 0;
89
- top: 50%;
90
- transform: translateY(-50%);
91
- }
92
-
93
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right {
94
- bottom: 0;
95
- right: 0;
96
- }
97
-
98
- .mapbox-gl-scope .mapboxgl-ctrl-bottom {
99
- bottom: 0;
100
- left: 50%;
101
- transform: translateX(-50%);
102
- }
103
-
104
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left {
105
- bottom: 0;
106
- left: 0;
107
- }
108
-
109
- .mapbox-gl-scope .mapboxgl-ctrl-left {
110
- left: 0;
111
- top: 50%;
112
- transform: translateY(-50%);
113
- }
114
-
115
- .mapbox-gl-scope .mapboxgl-ctrl {
116
- clear: both;
117
- pointer-events: auto;
118
- transform: translate(0);
119
- }
120
-
121
- .mapbox-gl-scope .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
122
- float: left;
123
- margin: 10px 0 0 10px;
124
- }
125
-
126
- .mapbox-gl-scope .mapboxgl-ctrl-top .mapboxgl-ctrl {
127
- float: left;
128
- margin: 10px 0;
129
- }
130
-
131
- .mapbox-gl-scope .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
132
- float: right;
133
- margin: 10px 10px 0 0;
134
- }
135
-
136
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,
137
- .mapbox-gl-scope .mapboxgl-ctrl-right .mapboxgl-ctrl {
138
- float: right;
139
- margin: 0 10px 10px 0;
140
- }
141
-
142
- .mapbox-gl-scope .mapboxgl-ctrl-bottom .mapboxgl-ctrl {
143
- float: left;
144
- margin: 10px 0;
145
- }
146
-
147
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,
148
- .mapbox-gl-scope .mapboxgl-ctrl-left .mapboxgl-ctrl {
149
- float: left;
150
- margin: 0 0 10px 10px;
151
- }
152
-
153
- /* Control group styling */
154
- .mapbox-gl-scope .mapboxgl-ctrl-group {
155
- background: #fff;
156
- border-radius: 4px;
157
- }
158
-
159
- .mapbox-gl-scope .mapboxgl-ctrl-group:not(:empty) {
160
- box-shadow: 0 0 0 2px #0000001a;
161
- }
162
-
163
- .mapbox-gl-scope .mapboxgl-ctrl-group button {
164
- background-color: initial;
165
- border: 0;
166
- box-sizing: border-box;
167
- cursor: pointer;
168
- display: block;
169
- height: 29px;
170
- outline: none;
171
- overflow: hidden;
172
- padding: 0;
173
- width: 29px;
174
- }
175
-
176
- .mapbox-gl-scope .mapboxgl-ctrl-group button+button {
177
- border-top: 1px solid #ddd;
178
- }
179
-
180
- .mapbox-gl-scope .mapboxgl-ctrl button .mapboxgl-ctrl-icon {
181
- background-position: 50%;
182
- background-repeat: no-repeat;
183
- display: block;
184
- height: 100%;
185
- width: 100%;
186
- }
187
-
188
- .mapbox-gl-scope .mapboxgl-ctrl-attrib-button:focus,
189
- .mapbox-gl-scope .mapboxgl-ctrl-group button:focus {
190
- box-shadow: 0 0 2px 2px #0096ff;
191
- }
192
-
193
- .mapbox-gl-scope .mapboxgl-ctrl button:disabled {
194
- cursor: not-allowed;
195
- }
196
-
197
- .mapbox-gl-scope .mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon {
198
- opacity: .25;
199
- }
200
-
201
- .mapbox-gl-scope .mapboxgl-ctrl-group button:first-child {
202
- border-radius: 4px 4px 0 0;
203
- }
204
-
205
- .mapbox-gl-scope .mapboxgl-ctrl-group button:last-child {
206
- border-radius: 0 0 4px 4px;
207
- }
208
-
209
- .mapbox-gl-scope .mapboxgl-ctrl-group button:only-child {
210
- border-radius: inherit;
211
- }
212
-
213
- .mapbox-gl-scope .mapboxgl-ctrl button:not(:disabled):hover {
214
- background-color: #0000000d;
215
- }
216
-
217
- /* Marker styles */
218
- .mapbox-gl-scope .mapboxgl-marker {
219
- position: absolute;
220
- z-index: 1;
221
- }
222
-
223
- .mapbox-gl-scope .mapboxgl-marker svg {
224
- display: block;
225
- }
226
-
227
- /* Popup styles */
228
- .mapbox-gl-scope .mapboxgl-popup {
229
- position: absolute;
230
- text-align: center;
231
- margin-bottom: 20px;
232
- }
233
-
234
- .mapbox-gl-scope .mapboxgl-popup-content-wrapper {
235
- padding: 1px;
236
- text-align: left;
237
- border-radius: 12px;
238
- }
239
-
240
- .mapbox-gl-scope .mapboxgl-popup-content {
241
- margin: 13px 24px 13px 20px;
242
- line-height: 1.3;
243
- font-size: 13px;
244
- min-height: 1px;
245
- }
246
-
247
- .mapbox-gl-scope .mapboxgl-popup-content p {
248
- margin: 17px 0;
249
- }
250
-
251
- .mapbox-gl-scope .mapboxgl-popup-tip-container {
252
- width: 40px;
253
- height: 20px;
254
- position: absolute;
255
- left: 50%;
256
- margin-top: -1px;
257
- margin-left: -20px;
258
- overflow: hidden;
259
- pointer-events: none;
260
- }
261
-
262
- .mapbox-gl-scope .mapboxgl-popup-tip {
263
- width: 17px;
264
- height: 17px;
265
- padding: 1px;
266
- margin: -10px auto 0;
267
- pointer-events: auto;
268
- -webkit-transform: rotate(45deg);
269
- -moz-transform: rotate(45deg);
270
- -ms-transform: rotate(45deg);
271
- transform: rotate(45deg);
272
- }
273
-
274
- .mapbox-gl-scope .mapboxgl-popup-content-wrapper,
275
- .mapbox-gl-scope .mapboxgl-popup-tip {
276
- background: white;
277
- color: #333;
278
- box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
279
- }
280
-
281
- .mapbox-gl-scope .mapboxgl-popup-close-button {
282
- position: absolute;
283
- top: 0;
284
- right: 0;
285
- border: none;
286
- text-align: center;
287
- width: 24px;
288
- height: 24px;
289
- font: 16px/24px Tahoma, Verdana, sans-serif;
290
- color: #757575;
291
- text-decoration: none;
292
- background: transparent;
293
- }
294
-
295
- .mapbox-gl-scope .mapboxgl-popup-close-button:hover,
296
- .mapbox-gl-scope .mapboxgl-popup-close-button:focus {
297
- color: #585858;
298
- }
299
-
300
- /* Attribution */
301
- .mapbox-gl-scope .mapboxgl-ctrl-attribution {
302
- background: #fff;
303
- background: rgba(255, 255, 255, 0.8);
304
- margin: 0;
305
- }
306
-
307
- .mapbox-gl-scope .mapboxgl-ctrl-attribution,
308
- .mapbox-gl-scope .mapboxgl-ctrl-scale-line {
309
- padding: 0 5px;
310
- color: #333;
311
- line-height: 1.4;
312
- }
313
-
314
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a {
315
- text-decoration: none;
316
- }
317
-
318
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a:hover,
319
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a:focus {
320
- text-decoration: underline;
321
- }
322
-
323
- /* Hide attribution by default */
324
- .mapbox-gl-scope .mapboxgl-ctrl-attribution {
325
- display: none !important;
326
- }
327
-
328
- .mapbox-gl-scope .mapboxgl-ctrl-logo {
329
- display: none !important;
330
- }