datastake-daf 0.6.749 → 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.
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/dist/components/index.js +93 -92
- package/dist/layouts/index.js +7 -10
- package/dist/pages/index.js +286 -211
- package/dist/utils/index.js +24 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Sidenav/Menu.jsx +9 -8
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +2 -2
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Identification/hook.js +1 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +6 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/helper.js +3 -3
- package/src/@daf/pages/Locations/MineSite/index.jsx +1 -1
- package/src/@daf/pages/Summary/Minesite/components/MineDetailsSection/index.js +51 -0
- package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/config.js +31 -37
- package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/index.js +4 -16
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/config.js +6 -6
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/helper.js +13 -16
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/index.js +3 -3
- package/src/@daf/pages/Summary/Minesite/index.jsx +15 -19
- package/src/@daf/pages/Summary/Operator/components/Governance/config.js +4 -4
- package/src/@daf/pages/Summary/Operator/components/Governance/helper.js +8 -11
- package/src/@daf/pages/Summary/Operator/components/Governance/index.js +9 -3
- package/src/@daf/pages/Summary/Operator/index.jsx +6 -4
- package/src/@daf/pages/Summary/components/InformationAvailability/components/Contributions/index.js +16 -5
- package/src/@daf/pages/Summary/components/InformationAvailability/components/InformationCompleteness/index.js +2 -3
- package/src/@daf/pages/Summary/components/InformationAvailability/index.js +7 -4
- package/src/@daf/pages/Summary/hook.js +3 -3
- package/src/constants/locales/en/translation.js +8 -0
- package/src/constants/locales/fr/translation.js +8 -0
- package/src/constants/locales/sp/translation.js +8 -0
|
@@ -66,7 +66,7 @@ const OperatorSummary = ({
|
|
|
66
66
|
<DashboardLayout
|
|
67
67
|
header={
|
|
68
68
|
<Header
|
|
69
|
-
title={t(
|
|
69
|
+
title={hasSelect ? t("Operator Review") : (singleItemData?.name || "") + " " + t("Summary")}
|
|
70
70
|
className="with-border-header h-w-btn-header no-px-body"
|
|
71
71
|
goBackTo={!hasSelect && goBack}
|
|
72
72
|
addedHeaderFirst
|
|
@@ -130,7 +130,7 @@ const OperatorSummary = ({
|
|
|
130
130
|
selectedPartners={selectedPartners}
|
|
131
131
|
t={t}
|
|
132
132
|
id={params?.id || selectedItem}
|
|
133
|
-
data={
|
|
133
|
+
data={singleItemData}
|
|
134
134
|
loading={loading}
|
|
135
135
|
/>
|
|
136
136
|
<section>
|
|
@@ -138,6 +138,8 @@ const OperatorSummary = ({
|
|
|
138
138
|
selectedPartners={selectedPartners}
|
|
139
139
|
t={t}
|
|
140
140
|
id={params?.id || selectedItem}
|
|
141
|
+
subject="stakeholder"
|
|
142
|
+
partners={partners}
|
|
141
143
|
/>
|
|
142
144
|
</section>
|
|
143
145
|
<section>
|
|
@@ -148,7 +150,7 @@ const OperatorSummary = ({
|
|
|
148
150
|
options={options}
|
|
149
151
|
goTo={goTo}
|
|
150
152
|
getRedirectLink={getRedirectLink}
|
|
151
|
-
operatorData={
|
|
153
|
+
operatorData={singleItemData}
|
|
152
154
|
/>
|
|
153
155
|
</section>
|
|
154
156
|
<section>
|
|
@@ -159,7 +161,7 @@ const OperatorSummary = ({
|
|
|
159
161
|
options={options}
|
|
160
162
|
goTo={goTo}
|
|
161
163
|
getRedirectLink={getRedirectLink}
|
|
162
|
-
operatorData={
|
|
164
|
+
operatorData={singleItemData}
|
|
163
165
|
/>
|
|
164
166
|
</section>
|
|
165
167
|
|
package/src/@daf/pages/Summary/components/InformationAvailability/components/Contributions/index.js
CHANGED
|
@@ -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={
|
|
18
|
-
xFieldKey="
|
|
19
|
-
yFieldKey="
|
|
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?.
|
|
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?.
|
|
14
|
-
consolidatedCompletion: data?.
|
|
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: "
|
|
15
|
-
url:
|
|
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",
|