datastake-daf 0.6.765 → 0.6.766
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/components/index.js +312 -143
- package/dist/layouts/index.js +0 -3
- package/dist/pages/index.js +206 -219
- package/dist/services/index.js +18 -0
- package/dist/utils/index.js +312 -4
- package/package.json +1 -2
- package/src/@daf/core/components/Charts/BarChart/index.jsx +4 -0
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +0 -7
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +0 -2
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +3 -4
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/KeyIndicatorsWidget/config.js +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/KeyIndicatorsWidget/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserActivity/helper.js +4 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserActivity/index.jsx +5 -0
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/index.jsx +34 -26
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/index.jsx +56 -52
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +52 -67
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +96 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +96 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +2 -1
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +116 -89
- package/src/@daf/core/components/Table/MoreTags/index.jsx +17 -5
- package/src/@daf/layouts/AuthLayout/components/Navbar/index.jsx +0 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Identification/hook.js +10 -10
- package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +6 -3
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/helper.js +1 -14
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/hook.js +12 -5
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/index.jsx +1 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/Triangulation/hook.js +1 -1
- package/src/@daf/pages/Data/Channels/columns.js +175 -0
- package/src/@daf/pages/Data/Channels/config.js +0 -0
- package/src/@daf/pages/Data/Channels/create.jsx +0 -0
- package/src/@daf/pages/Data/Channels/index.jsx +0 -0
- package/src/@daf/pages/Events/Activities/columns.js +1 -4
- package/src/@daf/pages/Events/helper.js +3 -2
- package/src/@daf/pages/Events/index.jsx +1 -1
- package/src/@daf/pages/Locations/MineSite/columns.js +6 -4
- package/src/@daf/pages/Stakeholders/Operators/columns.js +4 -2
- package/src/@daf/pages/Summary/Activities/PlantingCycle/index.jsx +1 -0
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/config.js +2 -2
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/helper.js +7 -7
- package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/index.js +3 -2
- package/src/@daf/pages/Summary/Minesite/index.jsx +3 -1
- package/src/@daf/pages/Summary/Operator/components/Governance/index.js +0 -1
- package/src/@daf/pages/Summary/Operator/components/KeyInformation/config.js +33 -21
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +13 -13
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/hook.js +8 -8
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +5 -2
- package/src/@daf/pages/Summary/Operator/index.jsx +3 -0
- package/src/@daf/pages/Summary/components/InformationAvailability/index.js +4 -3
- package/src/@daf/services/AdminService.js +14 -0
- package/src/constants/locales/en/translation.js +104 -2
- package/src/constants/locales/fr/translation.js +104 -1
- package/src/constants/locales/sp/translation.js +104 -1
- package/src/index.js +2 -0
- package/dist/style/datastake/mapbox-gl.css +0 -330
|
@@ -9,6 +9,9 @@ export default function MoreTags({
|
|
|
9
9
|
maxWidthCont = 120,
|
|
10
10
|
maxTextCont = 100,
|
|
11
11
|
diff = 30,
|
|
12
|
+
style = {},
|
|
13
|
+
tagColor,
|
|
14
|
+
limit,
|
|
12
15
|
}) {
|
|
13
16
|
const ref = useRef();
|
|
14
17
|
const [width, setWidth] = useState(0);
|
|
@@ -27,6 +30,12 @@ export default function MoreTags({
|
|
|
27
30
|
}, []);
|
|
28
31
|
|
|
29
32
|
const _calculate = () => {
|
|
33
|
+
// If limit prop is provided and valid, use it instead of calculating
|
|
34
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
35
|
+
setIndexToReturn(Math.min(limit - 1, values.length - 1));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
const tabs = ref.current.querySelectorAll(".check-tabs");
|
|
31
40
|
let filled = 0;
|
|
32
41
|
let indexToReturn;
|
|
@@ -60,7 +69,7 @@ export default function MoreTags({
|
|
|
60
69
|
|
|
61
70
|
useEffect(() => {
|
|
62
71
|
_calculate();
|
|
63
|
-
}, [width, values]);
|
|
72
|
+
}, [width, values, limit]);
|
|
64
73
|
|
|
65
74
|
return (
|
|
66
75
|
<div className="daf-more-tags">
|
|
@@ -76,8 +85,9 @@ export default function MoreTags({
|
|
|
76
85
|
overflow: "hidden",
|
|
77
86
|
textOverflow: "ellipsis",
|
|
78
87
|
whiteSpace: "nowrap",
|
|
88
|
+
...style,
|
|
79
89
|
}}
|
|
80
|
-
color={ac.color}
|
|
90
|
+
color={tagColor || ac.color}
|
|
81
91
|
>
|
|
82
92
|
<Tooltip title={typeof ac === "object" ? ac.label : ac}>
|
|
83
93
|
<span
|
|
@@ -86,6 +96,7 @@ export default function MoreTags({
|
|
|
86
96
|
overflow: "hidden",
|
|
87
97
|
textOverflow: "ellipsis",
|
|
88
98
|
whiteSpace: "nowrap",
|
|
99
|
+
...style,
|
|
89
100
|
}}
|
|
90
101
|
>
|
|
91
102
|
{typeof ac === "object" ? ac.label : ac}
|
|
@@ -100,7 +111,7 @@ export default function MoreTags({
|
|
|
100
111
|
.map((ac) => (typeof ac === "object" ? ac.label : ac))
|
|
101
112
|
.join(", ")}
|
|
102
113
|
>
|
|
103
|
-
<Tag>+{other.length}</Tag>
|
|
114
|
+
<Tag color={tagColor || 'default'} style={style}>+{other.length}</Tag>
|
|
104
115
|
</Tooltip>
|
|
105
116
|
) : null}
|
|
106
117
|
</div>
|
|
@@ -110,10 +121,10 @@ export default function MoreTags({
|
|
|
110
121
|
ac.renderTag("check-tabs")
|
|
111
122
|
) : (
|
|
112
123
|
<Tag
|
|
113
|
-
color={ac.color}
|
|
124
|
+
color={tagColor || ac.color}
|
|
114
125
|
key={`${ac}-${i}`}
|
|
115
126
|
className="check-tabs"
|
|
116
|
-
style={{ maxWidth: _maxWidthCont }}
|
|
127
|
+
style={{ maxWidth: _maxWidthCont, ...style }}
|
|
117
128
|
>
|
|
118
129
|
<Text
|
|
119
130
|
ellipsis={{ tooltip: typeof ac === "object" ? ac.label : ac }}
|
|
@@ -134,4 +145,5 @@ MoreTags.propTypes = {
|
|
|
134
145
|
maxWidthCont: PropTypes.number,
|
|
135
146
|
maxTextCont: PropTypes.number,
|
|
136
147
|
diff: PropTypes.number,
|
|
148
|
+
limit: PropTypes.number,
|
|
137
149
|
};
|
|
@@ -23,7 +23,6 @@ const AuthNavbar = ({
|
|
|
23
23
|
defaultValue = StorageManager.get('datastakeLng') || 'en',
|
|
24
24
|
onClose
|
|
25
25
|
}) => {
|
|
26
|
-
console.log({navbarDefaultValue: defaultValue})
|
|
27
26
|
return (
|
|
28
27
|
<Style className={formatClassname([typeof onClose === 'function' && 'bordered'])}>
|
|
29
28
|
<div className="d-navbar flex-c jus-c">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState, useMemo } from "react";
|
|
2
|
+
import { findOptions } from '../../../../../../../../helpers/StringHelper.js';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export function useIdentification({ data, theme = {}, options = {} }) {
|
|
@@ -58,16 +59,15 @@ export function useIdentification({ data, theme = {}, options = {} }) {
|
|
|
58
59
|
const values = graphData.filter((d) => d.date === title);
|
|
59
60
|
return {
|
|
60
61
|
title: "Products",
|
|
61
|
-
items: values.map((val) =>
|
|
62
|
-
|
|
63
|
-
options?.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})),
|
|
62
|
+
items: values.map((val) => {
|
|
63
|
+
return{
|
|
64
|
+
label: findOptions(val.typeOfProduct, options?.mineralOptions) || val.typeOfProduct,
|
|
65
|
+
color: colors[
|
|
66
|
+
allSeenProducts.indexOf(val.typeOfProduct) % colors.length
|
|
67
|
+
],
|
|
68
|
+
value: val.value.toLocaleString(),
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
return { title: "", items: [] };
|
|
@@ -35,6 +35,7 @@ function SupplyChainMap({selectedSources = {}, t = () => {}, goTo = () => {}, op
|
|
|
35
35
|
renderTooltip={(data) => {
|
|
36
36
|
const productsText = data?.products?.[0];
|
|
37
37
|
const minerals = options?.minerals || [];
|
|
38
|
+
const participants = data?.stakeholders?.map((stakeholder) => stakeholder.name);
|
|
38
39
|
return [
|
|
39
40
|
{
|
|
40
41
|
label: t("Products"),
|
|
@@ -46,14 +47,16 @@ function SupplyChainMap({selectedSources = {}, t = () => {}, goTo = () => {}, op
|
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
label: t("Participants"),
|
|
49
|
-
value:
|
|
50
|
+
value: participants?.length > 0 ? participants.join(', ') : "-",
|
|
50
51
|
},
|
|
51
52
|
];
|
|
52
53
|
}}
|
|
53
54
|
link
|
|
54
55
|
onClickLink={(data) => {
|
|
55
|
-
const locationTypes = ['
|
|
56
|
-
if
|
|
56
|
+
const locationTypes = ['village', 'town', 'area', 'territory'];
|
|
57
|
+
if(data?.type === 'mineSite') {
|
|
58
|
+
goTo(getRedirectLink(`/app/mine-summary/${data.datastakeId}`));
|
|
59
|
+
} else if (locationTypes.includes(data.type)) {
|
|
57
60
|
goTo(getRedirectLink(`/app/view/locations/${data.datastakeId}`));
|
|
58
61
|
} else {
|
|
59
62
|
goTo(getRedirectLink(`/app/view/stakeholders/${data.datastakeId}`));
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
export const mapData = ({ t, data = [], tabSelected }) => {
|
|
2
2
|
if (!data.length) {
|
|
3
|
-
return [
|
|
4
|
-
{ category: "", type: t("Stakeholders"), value: 0.5 },
|
|
5
|
-
{ category: "", type: t("Locations"), value: 0.5 },
|
|
6
|
-
{ category: "", type: t("Events"), value: 0.5 },
|
|
7
|
-
{ category: " ", type: "Stakeholders", value: 0.5 },
|
|
8
|
-
{ category: " ", type: "Locations", value: 0.5 },
|
|
9
|
-
{ category: " ", type: t("Events"), value: 0.5 },
|
|
10
|
-
{ category: " ", type: t("Stakeholders"), value: 0.5 },
|
|
11
|
-
{ category: " ", type: t("Locations"), value: 0.5 },
|
|
12
|
-
{ category: " ", type: t("Events"), value: 0.5 },
|
|
13
|
-
{ category: " ", type: t("Stakeholders"), value: 0.5 },
|
|
14
|
-
{ category: " ", type: t("Locations"), value: 0.5 },
|
|
15
|
-
{ category: " ", type: t("Events"), value: 0.5 },
|
|
16
|
-
];
|
|
3
|
+
return [];
|
|
17
4
|
}
|
|
18
5
|
|
|
19
6
|
const metricTypes = {
|
|
@@ -11,16 +11,23 @@ export const useContributionsGraph = ({
|
|
|
11
11
|
return mapData({ t, data, tabSelected });
|
|
12
12
|
}, [data, t]);
|
|
13
13
|
|
|
14
|
+
const isEmpty = useMemo(() => _data?.length === 0, [_data]);
|
|
15
|
+
|
|
14
16
|
const chartConfig = useMemo(() => {
|
|
15
17
|
return {
|
|
16
18
|
data: _data,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
xFieldKey: "value",
|
|
20
|
+
yFieldKey: "category",
|
|
19
21
|
seriesField: "type",
|
|
20
22
|
isGroup: true,
|
|
23
|
+
...(isEmpty && {
|
|
24
|
+
xAxisConfig: {
|
|
25
|
+
min: 0,
|
|
26
|
+
max: 10,
|
|
27
|
+
tickCount: 5,
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
21
30
|
renderTooltipContent: (title, items) => {
|
|
22
|
-
const isEmpty = !data.length;
|
|
23
|
-
|
|
24
31
|
const tooltipItems = items.map((item) => ({
|
|
25
32
|
label: item.name,
|
|
26
33
|
color: item.color,
|
|
@@ -40,7 +47,7 @@ export const useContributionsGraph = ({
|
|
|
40
47
|
],
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
}, [_data, t, theme]);
|
|
50
|
+
}, [_data, t, theme, isEmpty]);
|
|
44
51
|
|
|
45
52
|
return chartConfig;
|
|
46
53
|
}
|
|
@@ -59,7 +59,7 @@ export const useTriangulation = ({ widgetData, t = () => {}, section, theme = {}
|
|
|
59
59
|
return renderTooltipJsx({
|
|
60
60
|
title: t(
|
|
61
61
|
section === "data-compilation"
|
|
62
|
-
? "
|
|
62
|
+
? "Information Sharing"
|
|
63
63
|
: "Triangulation",
|
|
64
64
|
),
|
|
65
65
|
items: [
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Tag } from 'antd';
|
|
3
|
+
import { findOptions } from '../../../../helpers/StringHelper.js';
|
|
4
|
+
import { renderDateFormatted } from '../../../../helpers/Forms.js';
|
|
5
|
+
import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
|
|
6
|
+
import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
|
|
7
|
+
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
|
+
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const getLinkValue = (value, linkingObject) => {
|
|
12
|
+
if(linkingObject && linkingObject?.[value]) {
|
|
13
|
+
return linkingObject?.[value]?.name;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
19
|
+
{
|
|
20
|
+
dataIndex: 'datastakeId',
|
|
21
|
+
title: t('ID'),
|
|
22
|
+
ellipsis: true,
|
|
23
|
+
show: true,
|
|
24
|
+
render: (v, all) => {
|
|
25
|
+
if (all.empty) {
|
|
26
|
+
return <div className="daf-default-cell" />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
dataIndex: 'partner',
|
|
34
|
+
title: t('Partner'),
|
|
35
|
+
ellipsis: true,
|
|
36
|
+
show: true,
|
|
37
|
+
render: (v, all) => {
|
|
38
|
+
if (all.empty) {
|
|
39
|
+
return <div className="daf-default-cell" />
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
dataIndex: 'dataPoints',
|
|
47
|
+
title: t('Data Points'),
|
|
48
|
+
ellipsis: true,
|
|
49
|
+
show: true,
|
|
50
|
+
render: (v, all) => {
|
|
51
|
+
if (all.empty) {
|
|
52
|
+
return <div className="daf-default-cell" />
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const category = findOptions(v, data?.options?.locationCategories);
|
|
56
|
+
|
|
57
|
+
return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
dataIndex: 'country',
|
|
62
|
+
title: t('Country'),
|
|
63
|
+
ellipsis: true,
|
|
64
|
+
show: true,
|
|
65
|
+
render: (v, all) => {
|
|
66
|
+
if (all.empty) {
|
|
67
|
+
return <div className="daf-default-cell" />
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const country = findOptions(v, options?.countries);
|
|
71
|
+
|
|
72
|
+
return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
dataIndex: 'province',
|
|
77
|
+
title: t('Province'),
|
|
78
|
+
ellipsis: true,
|
|
79
|
+
show: true,
|
|
80
|
+
render: (v, all) => {
|
|
81
|
+
if (all.empty) {
|
|
82
|
+
return <div className="daf-default-cell" />
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const province = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
|
|
86
|
+
|
|
87
|
+
return province ? <Tooltip title={province}>{province}</Tooltip> : '-';
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
dataIndex: 'territory',
|
|
92
|
+
title: t('Territory'),
|
|
93
|
+
ellipsis: true,
|
|
94
|
+
show: true,
|
|
95
|
+
render: (v, all) => {
|
|
96
|
+
if (all.empty) {
|
|
97
|
+
return <div className="daf-default-cell" />
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const territory = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
|
|
101
|
+
|
|
102
|
+
return territory ? <Tooltip title={territory}>{territory}</Tooltip> : '-';
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: t("Sources"),
|
|
107
|
+
dataIndex: "sources",
|
|
108
|
+
key: "sources",
|
|
109
|
+
show: activeTab !== "own",
|
|
110
|
+
render: (val, all) => {
|
|
111
|
+
if (all.empty) {
|
|
112
|
+
return <div className="daf-default-cell" />;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const sources = sourceAvatarConfig(val, user, applications);
|
|
116
|
+
|
|
117
|
+
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: t("Last Update"),
|
|
122
|
+
dataIndex: "updatedAt",
|
|
123
|
+
key: "updatedAt",
|
|
124
|
+
width: 125,
|
|
125
|
+
render: (date, all) => {
|
|
126
|
+
if (all.empty) {
|
|
127
|
+
return <div className="daf-default-cell" />;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
131
|
+
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
132
|
+
},
|
|
133
|
+
ellipsis: true,
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
id: 'actions',
|
|
138
|
+
title: "",
|
|
139
|
+
width: 60,
|
|
140
|
+
render: (_, all) => {
|
|
141
|
+
if (all.empty) {
|
|
142
|
+
return <div className="daf-default-cell" />;
|
|
143
|
+
}
|
|
144
|
+
const onClick = () => {
|
|
145
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
146
|
+
if (activeTab === "shared") {
|
|
147
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
148
|
+
}
|
|
149
|
+
goTo(getRedirectLink(link));
|
|
150
|
+
};
|
|
151
|
+
const moreMenuItems = [
|
|
152
|
+
{
|
|
153
|
+
label: t("Details"),
|
|
154
|
+
value: "details",
|
|
155
|
+
onClick: onClick,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: t("Summary"),
|
|
159
|
+
value: "Summary",
|
|
160
|
+
onClick: () => {
|
|
161
|
+
let link = `/app/summary/${subject}/${all.datastakeId}`
|
|
162
|
+
if (activeTab === "shared") {
|
|
163
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
164
|
+
}
|
|
165
|
+
goTo(getRedirectLink(link));
|
|
166
|
+
},
|
|
167
|
+
// disabled: true,
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
return <div >
|
|
171
|
+
<MoreMenu items={moreMenuItems} />
|
|
172
|
+
</div>;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
].filter((column) => column.show !== false);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -106,10 +106,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const eventCategory = findOptions(v, data?.options?.eventCategoryOptions);
|
|
109
|
-
const categoryValue = getEventCategoryBySubject(eventCategory,
|
|
110
|
-
console.log({categoryValue})
|
|
111
|
-
console.log({eventCategory})
|
|
112
|
-
console.log({subject})
|
|
109
|
+
const categoryValue = getEventCategoryBySubject(eventCategory, "correctiveActions", true);
|
|
113
110
|
|
|
114
111
|
return categoryValue ? <Tooltip title={categoryValue}>{categoryValue}</Tooltip> : '-';
|
|
115
112
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export const getEventCategoryBySubject = (eventCategoryObject, subject) => {
|
|
1
|
+
export const getEventCategoryBySubject = (eventCategoryObject, subject, isSingular = false) => {
|
|
2
|
+
console.log({eventCategoryObject, subject})
|
|
2
3
|
if (!eventCategoryObject || typeof eventCategoryObject !== 'object') {
|
|
3
4
|
return null;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
|
-
const subjectSingular = subject.endsWith('ies')
|
|
7
|
+
const subjectSingular = isSingular ? subject : subject.endsWith('ies')
|
|
7
8
|
? subject.slice(0, -3) + 'y'
|
|
8
9
|
: subject.endsWith('s')
|
|
9
10
|
? subject.slice(0, -1)
|
|
@@ -7,6 +7,7 @@ import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
|
|
|
7
7
|
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
8
|
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
9
9
|
import MoreOptions from '../../../core/components/Table/MoreOptions/index.jsx';
|
|
10
|
+
import { renderStatusTag } from '../../../utils/tags.js';
|
|
10
11
|
|
|
11
12
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
12
13
|
{
|
|
@@ -89,8 +90,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
89
90
|
return <div className="daf-default-cell" />
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
const operators = all?.
|
|
93
|
-
return (operators && operators.length > 0) ? <MoreOptions data={operators || []}
|
|
93
|
+
const operators = all?.operator?.map((operator) => operator?.clientLocation?.name);
|
|
94
|
+
return (operators && operators.length > 0) ? <MoreOptions data={operators || []} toolTipPlacement={operators?.length < 2 ? "topLeft" : "top"} /> : '-';
|
|
94
95
|
},
|
|
95
96
|
},
|
|
96
97
|
{
|
|
@@ -117,8 +118,9 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
117
118
|
if (all.empty) {
|
|
118
119
|
return <div className="daf-default-cell" />
|
|
119
120
|
}
|
|
120
|
-
const
|
|
121
|
-
|
|
121
|
+
const _val = all?.published || all?.status === "submitted" ? "submitted" : v;
|
|
122
|
+
|
|
123
|
+
return renderStatusTag({ value: _val, t });
|
|
122
124
|
},
|
|
123
125
|
},
|
|
124
126
|
|
|
@@ -6,6 +6,7 @@ import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
|
|
|
6
6
|
import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
|
|
7
7
|
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
8
|
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
9
|
+
import { renderStatusTag } from '../../../utils/tags.js';
|
|
9
10
|
|
|
10
11
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
11
12
|
{
|
|
@@ -133,8 +134,9 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
133
134
|
if (all.empty) {
|
|
134
135
|
return <div className="daf-default-cell" />
|
|
135
136
|
}
|
|
136
|
-
const
|
|
137
|
-
|
|
137
|
+
const _val = all?.published || all?.status === "submitted" ? "submitted" : v;
|
|
138
|
+
|
|
139
|
+
return renderStatusTag({ value: _val, t });
|
|
138
140
|
},
|
|
139
141
|
},
|
|
140
142
|
|
|
@@ -12,10 +12,10 @@ export const IconNodesConfig = {
|
|
|
12
12
|
emptyName: "no-traders",
|
|
13
13
|
},
|
|
14
14
|
government: {
|
|
15
|
-
name: "
|
|
15
|
+
name: "Governance",
|
|
16
16
|
icon: "KYC",
|
|
17
17
|
order: 3,
|
|
18
|
-
emptyName: "no-
|
|
18
|
+
emptyName: "no-governance",
|
|
19
19
|
},
|
|
20
20
|
other: {
|
|
21
21
|
name: "Other",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { IconNodesConfig } from './config.js';
|
|
2
2
|
import { findOptions } from '../../../../../../helpers/StringHelper.js';
|
|
3
3
|
|
|
4
|
-
export const getStakeholderMappingData = ({data, locationData, id, options, t, goTo, selectedPartners, mainSubject}) => {
|
|
4
|
+
export const getStakeholderMappingData = ({data, locationData, id, options, t, goTo, selectedPartners, mainSubject, APP}) => {
|
|
5
5
|
const _data = data;
|
|
6
6
|
const mainSubjectData = _data?.[mainSubject];
|
|
7
7
|
|
|
8
8
|
return {
|
|
9
|
-
id: mainSubjectData?.datastakeId || "",
|
|
10
|
-
name: mainSubjectData?.name || "",
|
|
9
|
+
id: mainSubjectData?.datastakeId || locationData?.datastakeId || "",
|
|
10
|
+
name: mainSubjectData?.name || locationData?.name || "",
|
|
11
11
|
country: {
|
|
12
|
-
label: findOptions(mainSubjectData?.country, options?.countries) || "",
|
|
13
|
-
value: (mainSubjectData?.country || "").toLowerCase() || "",
|
|
12
|
+
label: findOptions((mainSubjectData?.country || locationData?.country), options?.countries) || "",
|
|
13
|
+
value: ((mainSubjectData?.country || locationData?.country) || "").toLowerCase() || "",
|
|
14
14
|
},
|
|
15
|
-
onClick: () => goTo(`/app/view
|
|
15
|
+
onClick: () => goTo(`/app/view/${APP === 'nashiriki' ? 'scl' : 'production-sites'}/${mainSubjectData?.datastakeId || locationData?.datastakeId}`),
|
|
16
16
|
totalSources: selectedPartners?.partners?.length || 0,
|
|
17
17
|
backgroundColor: "#FFD6E7",
|
|
18
18
|
iconColor: "#C41D7F",
|
|
@@ -43,7 +43,7 @@ export const getStakeholderMappingData = ({data, locationData, id, options, t, g
|
|
|
43
43
|
icon: "DashboardStakeholder",
|
|
44
44
|
onClick: () => {
|
|
45
45
|
if (child?.type === "operator") {
|
|
46
|
-
goTo(`/app
|
|
46
|
+
goTo(`/app/${APP === 'nashiriki' ? 'summary/operators' : 'operator-summary'}/${child.datastakeId}`);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -11,6 +11,7 @@ const StakeholderMapping = ({
|
|
|
11
11
|
goTo = () => {},
|
|
12
12
|
selectedPartners = {},
|
|
13
13
|
locationData = {},
|
|
14
|
+
APP,
|
|
14
15
|
}) => {
|
|
15
16
|
|
|
16
17
|
const defaultFilter = useMemo(() => {
|
|
@@ -25,7 +26,7 @@ const StakeholderMapping = ({
|
|
|
25
26
|
coreSubject: "location",
|
|
26
27
|
filterBySources: false,
|
|
27
28
|
metrics: {
|
|
28
|
-
operator: ['operator
|
|
29
|
+
operator: ['operator.locationClient'],
|
|
29
30
|
government: ['custom.stakeholderId', 'governance'],
|
|
30
31
|
trader: ['trade'],
|
|
31
32
|
other: ['civilSociety', 'international'],
|
|
@@ -37,7 +38,7 @@ const StakeholderMapping = ({
|
|
|
37
38
|
const { data, loading } = useWidgetFetch({config: defaultFilter});
|
|
38
39
|
|
|
39
40
|
const graphData = useMemo(() => {
|
|
40
|
-
return getStakeholderMappingData({data, locationData, id, options, t, goTo, selectedPartners, mainSubject: "mine"});
|
|
41
|
+
return getStakeholderMappingData({data, locationData, id, options, t, goTo, selectedPartners, mainSubject: "mine", APP});
|
|
41
42
|
}, [data, locationData, id, options, t, goTo, selectedPartners]);
|
|
42
43
|
|
|
43
44
|
return (
|
|
@@ -30,6 +30,7 @@ const MineSummary = ({
|
|
|
30
30
|
goBack = () => {},
|
|
31
31
|
onIdChange = () => {},
|
|
32
32
|
breadcrumbs = [],
|
|
33
|
+
APP,
|
|
33
34
|
}) => {
|
|
34
35
|
const {
|
|
35
36
|
selectedItem,
|
|
@@ -78,7 +79,7 @@ const MineSummary = ({
|
|
|
78
79
|
tooltip: t("Details"),
|
|
79
80
|
icon: "FileEdit",
|
|
80
81
|
onClick: () => {
|
|
81
|
-
goTo(getRedirectLink(`/app/view
|
|
82
|
+
goTo(getRedirectLink(`/app/view/${APP === 'nashiriki' ? 'scl' : 'production-sites'}/${params?.id ? params?.id : selectedItem}`));
|
|
82
83
|
},
|
|
83
84
|
},
|
|
84
85
|
{
|
|
@@ -142,6 +143,7 @@ const MineSummary = ({
|
|
|
142
143
|
t={t}
|
|
143
144
|
id={params?.id || selectedItem}
|
|
144
145
|
partners={partners}
|
|
146
|
+
APP={APP}
|
|
145
147
|
/>
|
|
146
148
|
</section>
|
|
147
149
|
<section>
|