datastake-daf 0.6.831 → 0.6.833
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 +726 -582
- package/dist/hooks/index.js +8 -0
- package/dist/pages/index.js +1850 -176
- package/dist/services/index.js +8 -0
- package/dist/utils/index.js +4 -3
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Documents.jsx +4 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Events.jsx +4 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +4 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +4 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/helper.js +19 -29
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/index.jsx +16 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/helper.js +15 -20
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/index.jsx +13 -4
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +114 -29
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +16 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/helper.js +29 -29
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +16 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +1 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/config.js +106 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/index.js +47 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/helper.js +3 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/index.js +218 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/hook.js +32 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +73 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/hook.js +86 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/index.js +102 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/config.js +34 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/index.js +107 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/config.js +5 -0
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/index.js +77 -0
- package/src/@daf/core/components/Screens/ConflictManagement/index.js +136 -0
- package/src/@daf/core/components/UI/SingleTruncatedLine/index.jsx +25 -0
- package/src/@daf/pages/Edit/index.jsx +7 -1
- package/src/@daf/pages/Events/Activities/columns.js +1 -1
- package/src/@daf/pages/Events/Testimonials/columns.js +1 -1
- package/src/@daf/pages/Events/columns.js +2 -3
- package/src/@daf/pages/Locations/columns.js +1 -1
- package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/config.js +4 -35
- package/src/@daf/services/DashboardService.js +9 -0
- package/src/constants/locales/en/translation.js +1 -0
- package/src/helpers/dataFetch.js +3 -3
- package/src/index.js +1 -0
- package/src/pages.js +4 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React, { useMemo, useCallback } from 'react'
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { renderTooltipJsx } from '../../../../../../../../utils/tooltip.js';
|
|
4
|
+
import Widget from '../../../../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
5
|
+
import Chart from '../../../../../../../../core/components/Charts/PieChart/chart.jsx';
|
|
6
|
+
import {useWidgetFetch} from '../../../../../../../../hooks/useWidgetFetch.js';
|
|
7
|
+
import { getColors } from './config.js';
|
|
8
|
+
import useTerritorialDistribution from './config.js';
|
|
9
|
+
|
|
10
|
+
function TerritorialDistribution({ selectedPartners = {}, loading: parentLoading = false, t = (s) => s, theme = {}, category = "conflict", selectedRange ,goTo = () => {}, getRedirectLink = () => {}}) {
|
|
11
|
+
const { filters, filtersConfig } = useTerritorialDistribution({ t });
|
|
12
|
+
const colors = getColors(theme);
|
|
13
|
+
|
|
14
|
+
const defaultFetchConfig = useMemo(
|
|
15
|
+
() => ({
|
|
16
|
+
url: "/territorial-distribution",
|
|
17
|
+
filters: {
|
|
18
|
+
...filters,
|
|
19
|
+
category,
|
|
20
|
+
period: selectedRange,
|
|
21
|
+
sources: selectedPartners?.partners || [],
|
|
22
|
+
},
|
|
23
|
+
defaultData: [],
|
|
24
|
+
stop: selectedPartners?.loading,
|
|
25
|
+
}),
|
|
26
|
+
[filters, category, selectedRange, selectedPartners],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const { data, loading } = useWidgetFetch({ config: defaultFetchConfig });
|
|
30
|
+
|
|
31
|
+
const pieData = useMemo(() => {
|
|
32
|
+
if (!data || Array.isArray(data)) return [];
|
|
33
|
+
const all = Object.keys(data);
|
|
34
|
+
const totalEvents = all.reduce((acc, key) => acc + (data[key]?.events?.length || 0), 0);
|
|
35
|
+
|
|
36
|
+
return all
|
|
37
|
+
.sort((a, b) => (data[b]?.events?.length || 0) - (data[a]?.events?.length || 0))
|
|
38
|
+
.map((key, index) => {
|
|
39
|
+
const item = data[key];
|
|
40
|
+
return {
|
|
41
|
+
value: item?.events?.length,
|
|
42
|
+
label: item?.locationData?.name,
|
|
43
|
+
locationData: item?.locationData,
|
|
44
|
+
color: colors[index % colors.length],
|
|
45
|
+
percent: totalEvents ? (item?.events?.length / totalEvents) : 0,
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}, [data, colors]);
|
|
49
|
+
|
|
50
|
+
const isEmpty = !pieData.length;
|
|
51
|
+
|
|
52
|
+
const getTooltipChildren = useCallback((items) => {
|
|
53
|
+
const item = items[0];
|
|
54
|
+
|
|
55
|
+
return renderTooltipJsx({
|
|
56
|
+
title: item?.label || t("Undetermined"),
|
|
57
|
+
link: true,
|
|
58
|
+
onClickLink: () => {
|
|
59
|
+
if (item?.label) {
|
|
60
|
+
goTo(
|
|
61
|
+
`/app/incident?administrativeLevel1=${item?.locationData?.administrativeLevel1}&administrativeLevel2=${item?.locationData?.administrativeLevel2}&country=${item?.locationData?.country}`,
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
goTo("/app/incident");
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
items: [
|
|
68
|
+
{
|
|
69
|
+
label: t("Number of incidents"),
|
|
70
|
+
value: item?.value,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
});
|
|
74
|
+
}, [t, goTo]);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Widget
|
|
78
|
+
loading={loading || parentLoading}
|
|
79
|
+
title={t("Territorial Distribution")}
|
|
80
|
+
className="with-border-header"
|
|
81
|
+
filtersConfig={filtersConfig}
|
|
82
|
+
>
|
|
83
|
+
<Chart
|
|
84
|
+
mouseXOffset={10}
|
|
85
|
+
mouseYOffset={10}
|
|
86
|
+
changeOpacityOnHover={false}
|
|
87
|
+
data={pieData}
|
|
88
|
+
doConstraints={false}
|
|
89
|
+
isPie
|
|
90
|
+
t={t}
|
|
91
|
+
isEmpty={isEmpty}
|
|
92
|
+
getTooltipChildren={getTooltipChildren}
|
|
93
|
+
/>
|
|
94
|
+
</Widget>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
TerritorialDistribution.propTypes = {
|
|
99
|
+
selectedPartners: PropTypes.object,
|
|
100
|
+
loading: PropTypes.bool,
|
|
101
|
+
t: PropTypes.func,
|
|
102
|
+
theme: PropTypes.object,
|
|
103
|
+
category: PropTypes.string,
|
|
104
|
+
selectedRange: PropTypes.string,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default TerritorialDistribution;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Select } from "antd";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import Widget from "../../../../Dashboard/Widget/index.jsx";
|
|
4
|
+
import IncidentsTime from "./components/IncidentsTime/index.js";
|
|
5
|
+
import TerritorialDistribution from "./components/TerritorialDistribution/index.js";
|
|
6
|
+
import ProblemSolver from "./components/ProblemSolver/index.js";
|
|
7
|
+
import { filterOptions } from "./config.js";
|
|
8
|
+
|
|
9
|
+
export default function RisksWidget({
|
|
10
|
+
title = "Analytics",
|
|
11
|
+
selectedPartners = {},
|
|
12
|
+
t = (s) => s,
|
|
13
|
+
goTo = () => {},
|
|
14
|
+
getRedirectLink = (s) => s,
|
|
15
|
+
theme = {},
|
|
16
|
+
APP,
|
|
17
|
+
options = {},
|
|
18
|
+
category = "conflict",
|
|
19
|
+
user = {},
|
|
20
|
+
}) {
|
|
21
|
+
const [range, setRange] = useState(filterOptions[0].value);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Widget
|
|
25
|
+
title={t(title)}
|
|
26
|
+
className="with-border-header month-select-header"
|
|
27
|
+
addedHeader={
|
|
28
|
+
<>
|
|
29
|
+
<div className="flex-1" />
|
|
30
|
+
<div>
|
|
31
|
+
<Select
|
|
32
|
+
value={range}
|
|
33
|
+
className="custom-select white month-select"
|
|
34
|
+
onChange={(val) => setRange(val)}
|
|
35
|
+
>
|
|
36
|
+
{filterOptions.map((o) => (
|
|
37
|
+
<Select.Option value={o.value} key={o.value}>
|
|
38
|
+
{t(o.label)}
|
|
39
|
+
</Select.Option>
|
|
40
|
+
))}
|
|
41
|
+
</Select>
|
|
42
|
+
</div>
|
|
43
|
+
</>
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
<div className="flex flex-row flex-col-mobile gap-6">
|
|
47
|
+
<IncidentsTime
|
|
48
|
+
selectedRange={range}
|
|
49
|
+
selectedPartners={selectedPartners}
|
|
50
|
+
t={t}
|
|
51
|
+
theme={theme}
|
|
52
|
+
goTo={goTo}
|
|
53
|
+
getRedirectLink={getRedirectLink}
|
|
54
|
+
options={options}
|
|
55
|
+
user={user}
|
|
56
|
+
/>
|
|
57
|
+
<TerritorialDistribution
|
|
58
|
+
category={category}
|
|
59
|
+
selectedRange={range}
|
|
60
|
+
selectedPartners={selectedPartners}
|
|
61
|
+
t={t}
|
|
62
|
+
theme={theme}
|
|
63
|
+
goTo={goTo}
|
|
64
|
+
getRedirectLink={getRedirectLink}
|
|
65
|
+
/>
|
|
66
|
+
<ProblemSolver
|
|
67
|
+
selectedRange={range}
|
|
68
|
+
selectedPartners={selectedPartners}
|
|
69
|
+
t={t}
|
|
70
|
+
theme={theme}
|
|
71
|
+
goTo={goTo}
|
|
72
|
+
getRedirectLink={getRedirectLink}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</Widget>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from "react";
|
|
2
|
+
import Header from "../../Header/index.jsx";
|
|
3
|
+
import KeyIndicators from "./components/KeyIndicators/index.js";
|
|
4
|
+
import Multiselect from "../../Select/MultiSelect/index.jsx";
|
|
5
|
+
import MineSites from "./components/MineSite/index.js";
|
|
6
|
+
import RisksWidget from "./components/RisksWidget/index.js";
|
|
7
|
+
import { useSources } from "../../../../hooks/useSources.js";
|
|
8
|
+
import { renderBreadCrumbs } from "../../../../../helpers/breadCrumbs.js";
|
|
9
|
+
import CustomIcon from "../../Icon/CustomIcon.jsx";
|
|
10
|
+
|
|
11
|
+
export default function ConflictManagement({
|
|
12
|
+
t=()=>{},
|
|
13
|
+
user = {},
|
|
14
|
+
APP,
|
|
15
|
+
goTo = () => {},
|
|
16
|
+
getRedirectLink = (s) => s,
|
|
17
|
+
theme = {},
|
|
18
|
+
options = {}
|
|
19
|
+
}) {
|
|
20
|
+
const { partners, selectedPartners, setSelectedPartners, informationSources } =
|
|
21
|
+
useSources({ user, t });
|
|
22
|
+
|
|
23
|
+
// const { pushPath } = useHistory();
|
|
24
|
+
|
|
25
|
+
// useEffect(() => {
|
|
26
|
+
// pushPath(`/app/conflict-management`);
|
|
27
|
+
// }, []);
|
|
28
|
+
|
|
29
|
+
const breadCrumbs = useMemo(() => {
|
|
30
|
+
return renderBreadCrumbs({ t, view: "conflict-management", mod: APP, goTo });
|
|
31
|
+
}, [t, APP, goTo]);
|
|
32
|
+
|
|
33
|
+
const sourceOptions = useMemo(() => {
|
|
34
|
+
return partners.map((partner) => {
|
|
35
|
+
const isOwnData = partner.id === user?.company?.id;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
label: partner.nickName,
|
|
39
|
+
value: partner.id,
|
|
40
|
+
avatar: isOwnData ? <span>OWN</span> : <CustomIcon name={"Search02"} width={14} height={14} />,
|
|
41
|
+
background: isOwnData ? theme.colorPrimary7 : undefined,
|
|
42
|
+
color: isOwnData ? "white" : undefined,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}, [partners, user, theme]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="daf-analysis">
|
|
49
|
+
<Header
|
|
50
|
+
title={t("conflict-management")}
|
|
51
|
+
breadcrumbs={breadCrumbs}
|
|
52
|
+
supportText={
|
|
53
|
+
<>
|
|
54
|
+
{t("Supported by")}{" "}
|
|
55
|
+
<a
|
|
56
|
+
href="https://www.eeas.europa.eu/delegations/dr-congo-kinshasa_en?s=94"
|
|
57
|
+
target="_blank"
|
|
58
|
+
rel="noreferrer"
|
|
59
|
+
>
|
|
60
|
+
{t("European Union")}
|
|
61
|
+
</a>
|
|
62
|
+
</>
|
|
63
|
+
}
|
|
64
|
+
addedHeader={
|
|
65
|
+
<div>
|
|
66
|
+
<div className="flex-1" />
|
|
67
|
+
<Multiselect
|
|
68
|
+
options={[...sourceOptions]}
|
|
69
|
+
isAvatarGroup
|
|
70
|
+
canUnselectLast={false}
|
|
71
|
+
key={partners?.length}
|
|
72
|
+
onChange={(selected) => {
|
|
73
|
+
setSelectedPartners((prev) => ({
|
|
74
|
+
...prev,
|
|
75
|
+
partners: selected,
|
|
76
|
+
loading: false,
|
|
77
|
+
}));
|
|
78
|
+
}}
|
|
79
|
+
dropDownWidth={200}
|
|
80
|
+
selectionType="checkbox"
|
|
81
|
+
defaultSelected={partners.map((p) => p.id) || []}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
}
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<div className="content">
|
|
88
|
+
<div className="view-content">
|
|
89
|
+
<div className="daf-analysis-layout">
|
|
90
|
+
<div className="sections-cont w-pt">
|
|
91
|
+
<section>
|
|
92
|
+
<KeyIndicators
|
|
93
|
+
selectedPartners={selectedPartners}
|
|
94
|
+
partners={
|
|
95
|
+
informationSources > 0
|
|
96
|
+
? informationSources
|
|
97
|
+
: selectedPartners?.partners?.length > 0
|
|
98
|
+
? selectedPartners?.partners?.length
|
|
99
|
+
: 0
|
|
100
|
+
}
|
|
101
|
+
t={t}
|
|
102
|
+
goTo={goTo}
|
|
103
|
+
getRedirectLink={getRedirectLink}
|
|
104
|
+
theme={theme}
|
|
105
|
+
/>
|
|
106
|
+
</section>
|
|
107
|
+
<section>
|
|
108
|
+
<MineSites
|
|
109
|
+
selectedPartners={selectedPartners}
|
|
110
|
+
t={t}
|
|
111
|
+
goTo={goTo}
|
|
112
|
+
getRedirectLink={getRedirectLink}
|
|
113
|
+
theme={theme}
|
|
114
|
+
APP={APP}
|
|
115
|
+
options={options}
|
|
116
|
+
/>
|
|
117
|
+
</section>
|
|
118
|
+
<section>
|
|
119
|
+
<RisksWidget
|
|
120
|
+
selectedPartners={selectedPartners}
|
|
121
|
+
t={t}
|
|
122
|
+
goTo={goTo}
|
|
123
|
+
getRedirectLink={getRedirectLink}
|
|
124
|
+
theme={theme}
|
|
125
|
+
APP={APP}
|
|
126
|
+
options={options}
|
|
127
|
+
/>
|
|
128
|
+
</section>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
3
|
+
|
|
4
|
+
const SingleTruncatedLine = ({data = []}) => {
|
|
5
|
+
const displayText = data?.join(", ");
|
|
6
|
+
const tooltipText = data?.join("\n");
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Tooltip title={<div style={{ whiteSpace: "pre-line" }}>{tooltipText}</div>}>
|
|
10
|
+
<div
|
|
11
|
+
style={{
|
|
12
|
+
fontWeight: "normal",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
textOverflow: "ellipsis",
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
maxWidth: "100%"
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
{displayText}
|
|
20
|
+
</div>
|
|
21
|
+
</Tooltip>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default SingleTruncatedLine
|
|
@@ -137,6 +137,12 @@ const Edit = ({
|
|
|
137
137
|
namespaceOverrides,
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (data?.id && !canEdit) {
|
|
142
|
+
goTo(getViewLink());
|
|
143
|
+
}
|
|
144
|
+
}, [canEdit, goTo, getViewLink, namespace, data?.id]);
|
|
145
|
+
|
|
140
146
|
const action = useMemo(() => actionMap?.[namespaceConfig?.action], [namespaceConfig?.action, actionMap]);
|
|
141
147
|
|
|
142
148
|
const namespaceGet = {
|
|
@@ -237,7 +243,7 @@ const Edit = ({
|
|
|
237
243
|
{
|
|
238
244
|
tooltip: t("Save"),
|
|
239
245
|
onClick: () => onSubmitData(true),
|
|
240
|
-
disabled: !isChanged,
|
|
246
|
+
disabled: !isChanged || !canEdit,
|
|
241
247
|
type: "primary",
|
|
242
248
|
icon: "Save",
|
|
243
249
|
},
|
|
@@ -109,7 +109,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
109
109
|
if (all.empty) {
|
|
110
110
|
return <div className="daf-default-cell" />
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
const eventCategory = findOptions(v, data?.options?.eventCategoryOptions || data?.options?.categoryOptions);
|
|
114
114
|
const categoryValue = getEventCategoryBySubject(eventCategory, "correctiveActions", true);
|
|
115
115
|
|
|
@@ -50,7 +50,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
50
50
|
return <div className="daf-default-cell" />;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const type = findOptions(title,
|
|
53
|
+
const type = findOptions(title, options?.testimonialsType);
|
|
54
54
|
|
|
55
55
|
return type ? <Tooltip title={type}>{type}</Tooltip> : '-';
|
|
56
56
|
},
|
|
@@ -51,9 +51,8 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
51
51
|
return <div className="daf-default-cell" />
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const type = findOptions(v,
|
|
55
|
-
|
|
56
|
-
return type ? <Tooltip title={type}>{type}</Tooltip> : '-';
|
|
54
|
+
const type = findOptions(v, options?.eventType || options?.eventsType);
|
|
55
|
+
return <Tooltip title={type}>{type}</Tooltip>;
|
|
57
56
|
},
|
|
58
57
|
},
|
|
59
58
|
{
|
|
@@ -43,7 +43,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
43
43
|
return <div className="daf-default-cell" />
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const locationCategories = [...(
|
|
46
|
+
const locationCategories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || [])]
|
|
47
47
|
|
|
48
48
|
const category = findOptions(v, locationCategories);
|
|
49
49
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Tag, Tooltip } from "antd";
|
|
3
3
|
import { getTagColor } from "../../../../../utils/productTag.js";
|
|
4
|
+
import SingleTruncatedLine from "../../../../../core/components/UI/SingleTruncatedLine/index.jsx";
|
|
4
5
|
|
|
5
6
|
export function getKeyIndicatorsConfig({ t, data }) {
|
|
6
7
|
return [
|
|
@@ -11,20 +12,8 @@ export function getKeyIndicatorsConfig({ t, data }) {
|
|
|
11
12
|
if (validExtractionPoints?.length === 0 || !validExtractionPoints) {
|
|
12
13
|
return "-";
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{validExtractionPoints?.map((method, index) => {
|
|
17
|
-
return (
|
|
18
|
-
<React.Fragment key={method}>
|
|
19
|
-
<Tooltip title={method}>
|
|
20
|
-
<span style={{ fontWeight: "normal"}}>{method}</span>
|
|
21
|
-
</Tooltip>
|
|
22
|
-
{index < validExtractionPoints.length - 1 && ", "}
|
|
23
|
-
</React.Fragment>
|
|
24
|
-
);
|
|
25
|
-
})}
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
15
|
+
|
|
16
|
+
return <SingleTruncatedLine data={validExtractionPoints} />;
|
|
28
17
|
},
|
|
29
18
|
},
|
|
30
19
|
{
|
|
@@ -35,27 +24,7 @@ export function getKeyIndicatorsConfig({ t, data }) {
|
|
|
35
24
|
return "-";
|
|
36
25
|
}
|
|
37
26
|
|
|
38
|
-
return
|
|
39
|
-
<div>
|
|
40
|
-
{validProducts?.map((product, index) => {
|
|
41
|
-
return (
|
|
42
|
-
<React.Fragment key={product}>
|
|
43
|
-
<Tooltip title={product}>
|
|
44
|
-
<span
|
|
45
|
-
style={{
|
|
46
|
-
fontWeight: "normal",
|
|
47
|
-
color: getTagColor(product)
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
{product}
|
|
51
|
-
</span>
|
|
52
|
-
</Tooltip>
|
|
53
|
-
{index < validProducts.length - 1 && ", "}
|
|
54
|
-
</React.Fragment>
|
|
55
|
-
);
|
|
56
|
-
})}
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
27
|
+
return <SingleTruncatedLine data={validProducts} />
|
|
59
28
|
},
|
|
60
29
|
},
|
|
61
30
|
{
|
|
@@ -24,6 +24,15 @@ class DashboardService extends BaseService {
|
|
|
24
24
|
isUserManager: true,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
// getWidgetConflictManagement({ url, params = {}, filters = {} }) {
|
|
29
|
+
// return this.apiGet({
|
|
30
|
+
// url: `/dashboard/conflict-management${url}`,
|
|
31
|
+
// params: { ...params, ...filters },
|
|
32
|
+
// isApp: true,
|
|
33
|
+
// });
|
|
34
|
+
// }
|
|
35
|
+
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
export default createLazyService(DashboardService);
|
package/src/helpers/dataFetch.js
CHANGED
|
@@ -11,9 +11,9 @@ export const formatDataForTable = (data, options) => {
|
|
|
11
11
|
|
|
12
12
|
return { ...rest, children };
|
|
13
13
|
}),
|
|
14
|
-
meta: dataObj
|
|
14
|
+
meta: dataObj?.meta,
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
totalItems:
|
|
16
|
+
options: options || {},
|
|
17
|
+
totalItems: dataObj?.meta?.total || dataObj?.data?.length || 0,
|
|
18
18
|
}
|
|
19
19
|
}
|
package/src/index.js
CHANGED
|
@@ -201,6 +201,7 @@ export { default as SDGIcons } from "./@daf/core/components/UI/SDGIcon/index.jsx
|
|
|
201
201
|
export { default as CountryFlag } from "./@daf/core/components/UI/CountryFlag/index.jsx"
|
|
202
202
|
export { default as KeyIndicatorNavigateLabel } from "./@daf/core/components/UI/KeyIndicatorNavigateLabel/index.jsx";
|
|
203
203
|
export { default as MissingTagButton } from "./@daf/core/components/UI/MissingTagButton/index.jsx";
|
|
204
|
+
export { default as SingleTruncatedLine } from "./@daf/core/components/UI/SingleTruncatedLine/index.jsx";
|
|
204
205
|
|
|
205
206
|
//Settings
|
|
206
207
|
export { default as Settings } from "./@daf/core/components/Screens/Settings/index.js";
|
package/src/pages.js
CHANGED
|
@@ -20,4 +20,7 @@ export { default as UsersTable } from './@daf/core/components/Screens/Users/inde
|
|
|
20
20
|
export { default as View } from './@daf/pages/View/index.jsx';
|
|
21
21
|
|
|
22
22
|
// Edit
|
|
23
|
-
export { default as Edit } from './@daf/pages/Edit/index.jsx';
|
|
23
|
+
export { default as Edit } from './@daf/pages/Edit/index.jsx';
|
|
24
|
+
|
|
25
|
+
// Conflict Management
|
|
26
|
+
export { default as ConflictManagement } from './@daf/core/components/Screens/ConflictManagement/index.js';
|