datastake-daf 0.6.745 → 0.6.746
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 +71 -7
- package/dist/pages/index.css +1 -0
- package/dist/pages/index.js +3602 -12
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx +75 -54
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/style.js +44 -0
- package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +128 -0
- package/src/@daf/{pages/pages → core/components/TableScreen}/TablePageWithTabs/index.jsx +3 -3
- package/src/@daf/pages/Documents/index.jsx +1 -1
- package/src/@daf/pages/Events/Activities/index.jsx +1 -1
- package/src/@daf/pages/Events/Incidents/index.jsx +1 -1
- package/src/@daf/pages/Events/index.jsx +1 -1
- package/src/@daf/pages/Locations/MineSite/index.jsx +1 -1
- package/src/@daf/pages/Locations/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/Operators/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/Workers/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/index.jsx +1 -1
- package/src/@daf/pages/Summary/Activities/Restoration/config.js +36 -0
- package/src/@daf/pages/Summary/Activities/Restoration/helper.js +98 -0
- package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +178 -0
- package/src/@daf/pages/Summary/minesite/index.js +0 -0
- package/src/@daf/pages/Summary/operator/index.jsx +76 -0
- package/src/pages.js +6 -4
- package/src/@daf/pages/Events/Incidents2/columns.js +0 -176
- package/src/@daf/pages/Events/Incidents2/config.js +0 -170
- package/src/@daf/pages/Events/Incidents2/create.jsx +0 -104
- package/src/@daf/pages/Events/Incidents2/index.jsx +0 -156
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/SupplyChainMap/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/TradeRelationships/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/CustomSegment/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataChainOfCustody/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataCompilation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataConsilidation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/helper.js +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import { Tabs, Drawer } from 'antd'
|
|
3
|
-
import Header from '../../../
|
|
4
|
-
import BaseScreen from '
|
|
3
|
+
import Header from '../../../Header/index.jsx'
|
|
4
|
+
import BaseScreen from '../../BaseScreen/index.jsx'
|
|
5
5
|
import { CREATE_DRAWER_WIDTH } from '../../../../helpers/Forms.js'
|
|
6
|
-
import DrawerHeader from '../../../
|
|
6
|
+
import DrawerHeader from '../../../Header/DrawerHeader/index.jsx'
|
|
7
7
|
|
|
8
8
|
const TablePageWithTabs = ({
|
|
9
9
|
t= () => {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
5
|
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const getKeyIndicatorsRowConfig = ({ t, data = {} }) => [
|
|
4
|
+
|
|
5
|
+
{
|
|
6
|
+
label: t('Primary Data Collection'),
|
|
7
|
+
render: () => {
|
|
8
|
+
let displayValue = '-';
|
|
9
|
+
|
|
10
|
+
if (data?.origin?.[0]?.name === 'straatos') {
|
|
11
|
+
displayValue = data?.author?.name || '-';
|
|
12
|
+
} else if (data?.formCompleterType === 'localRelay') {
|
|
13
|
+
displayValue = 'Relay (Allcot Senegal)';
|
|
14
|
+
} else if (data?.formCompleterType === 'technicalPartner') {
|
|
15
|
+
displayValue = data?.technicalPartner?.name || '-';
|
|
16
|
+
} else {
|
|
17
|
+
displayValue = data?.author?.name || '-';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return <div className="flex">{displayValue}</div>;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: t('Implementation Partner'),
|
|
25
|
+
render: () => <div>{data?.technicalPartner?.name || '-'}</div>
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: t('Activity Participants'),
|
|
29
|
+
render: () => <div>{'0'}</div>
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: t('Hectares Planted'),
|
|
33
|
+
render: () => <div>{data?.hectaresPlanted || '0 ha'}</div>
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// REGION: Photo/Image Extraction
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Extract images from a photo document
|
|
7
|
+
* Handles both documents with pictures arrays and direct image objects
|
|
8
|
+
*/
|
|
9
|
+
export const extractFromPhotoDoc = (photoDoc, label, docIndex) => {
|
|
10
|
+
const photos = photoDoc?.pictures?.filter(p => p?.url) || (photoDoc?.url ? [photoDoc] : []);
|
|
11
|
+
|
|
12
|
+
return photos.map((photo, photoIndex) => ({
|
|
13
|
+
src: normalizeUrl(photo.url),
|
|
14
|
+
alt: photo.name || photo.alt || `${label} - Image ${docIndex + 1}-${photoIndex + 1}`
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Normalize URL by removing trailing colon if present
|
|
20
|
+
*/
|
|
21
|
+
const normalizeUrl = (url) => url?.endsWith(':') ? url.slice(0, -1) : url;
|
|
22
|
+
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// REGION: Gender Distribution
|
|
25
|
+
// ============================================================================
|
|
26
|
+
|
|
27
|
+
// Gender distribution colors for pie chart
|
|
28
|
+
const GENDER_COLORS = ['#016C6E', '#00AEB1']; // Male (dark teal), Female (light teal)
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get gender distribution data from activityData
|
|
32
|
+
* Maps genderDistributionMale and genderDistributionFemale to a structured object
|
|
33
|
+
*/
|
|
34
|
+
export const getGenderDistributionData = (activityData) => {
|
|
35
|
+
return {
|
|
36
|
+
Male: activityData?.genderDistributionMale || 0,
|
|
37
|
+
Female: activityData?.genderDistributionFemale || 0,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Check if gender distribution is empty
|
|
43
|
+
* Returns true if all values are 0 or falsy
|
|
44
|
+
*/
|
|
45
|
+
export const isGenderDistributionEmpty = (genderDistributionData) => {
|
|
46
|
+
return Object.values(genderDistributionData).every(val => !val || val === 0);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Calculate pie chart data from gender distribution
|
|
51
|
+
* Computes percentages and assigns colors based on gender distribution values
|
|
52
|
+
*/
|
|
53
|
+
export const calculateGenderPieData = (genderDistributionData) => {
|
|
54
|
+
const total = Object.values(genderDistributionData).reduce((all, val) => all + (val || 0), 0);
|
|
55
|
+
|
|
56
|
+
return Object.keys(genderDistributionData).map((key, index) => {
|
|
57
|
+
const color = GENDER_COLORS[index % GENDER_COLORS.length];
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
value: genderDistributionData[key] || 0,
|
|
61
|
+
percent: total > 0 ? (genderDistributionData[key] || 0) / total : 0,
|
|
62
|
+
color: color,
|
|
63
|
+
label: key,
|
|
64
|
+
key: key,
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get tooltip children for gender distribution pie chart
|
|
71
|
+
* Generates tooltip content showing gender label and value
|
|
72
|
+
*/
|
|
73
|
+
export const getGenderTooltipChildren = (item, isEmpty, genderDistributionData, t, renderTooltipJsx) => {
|
|
74
|
+
if (isEmpty) {
|
|
75
|
+
if (!Object.keys(genderDistributionData).length) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return renderTooltipJsx({
|
|
80
|
+
title: t("Gender"),
|
|
81
|
+
items: Object.keys(genderDistributionData).map((k) => ({
|
|
82
|
+
label: k,
|
|
83
|
+
value: 0,
|
|
84
|
+
})),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return renderTooltipJsx({
|
|
89
|
+
title: t("Gender"),
|
|
90
|
+
items: [
|
|
91
|
+
{
|
|
92
|
+
color: item.color,
|
|
93
|
+
label: t(item.label),
|
|
94
|
+
value: `${item.value || 0}`,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
});
|
|
98
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { useMemo, useCallback } from 'react';
|
|
2
|
+
import { DashboardLayout, Header, ImageCarousel, KeyIndicators, MineSiteMap, Widget, PieChart } from '../../../../../../src/index.js'
|
|
3
|
+
import { getKeyIndicatorsRowConfig } from './config';
|
|
4
|
+
import { extractFromPhotoDoc, getGenderDistributionData, isGenderDistributionEmpty, calculateGenderPieData, getGenderTooltipChildren } from './helper';
|
|
5
|
+
import { renderTooltipJsx } from '../../../../../../src/utils';
|
|
6
|
+
import { useResizeContext } from '../../../../../../src/context';
|
|
7
|
+
|
|
8
|
+
const RestorationActivitySummary = ({ activityData, supportText, onDownload, downloadDisabled, actionButtons, breadcrumbs, goBackTo, loading, t = () => { } }) => {
|
|
9
|
+
const { isCollapsed, isNestedSidebarCollapsed } = useResizeContext();
|
|
10
|
+
const keyIndicatorsConfig = useMemo(() => getKeyIndicatorsRowConfig({ t, data: activityData }), [t, activityData]);
|
|
11
|
+
const images = useMemo(() => {
|
|
12
|
+
|
|
13
|
+
const photoArrays = [
|
|
14
|
+
{ data: activityData?.groupPhotos, label: 'Group Photo' },
|
|
15
|
+
{ data: activityData?.photosStartActivity, label: 'Start of Activity' },
|
|
16
|
+
{ data: activityData?.photosDuringActivity, label: 'During Activity' },
|
|
17
|
+
{ data: activityData?.photosEndActivity, label: 'End of Activity' }
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
return photoArrays
|
|
21
|
+
.flatMap(({ data, label }) =>
|
|
22
|
+
Array.isArray(data)
|
|
23
|
+
? data.flatMap((photoDoc, index) => extractFromPhotoDoc(photoDoc, label, index))
|
|
24
|
+
: []
|
|
25
|
+
);
|
|
26
|
+
}, [activityData]);
|
|
27
|
+
const genderDistributionData = useMemo(() => getGenderDistributionData(activityData), [activityData]);
|
|
28
|
+
const isEmpty = useMemo(() => isGenderDistributionEmpty(genderDistributionData), [genderDistributionData]);
|
|
29
|
+
const pieData = useMemo(() => calculateGenderPieData(genderDistributionData), [genderDistributionData]);
|
|
30
|
+
|
|
31
|
+
const getTooltipChildren = useCallback(
|
|
32
|
+
(item) => getGenderTooltipChildren(item, isEmpty, genderDistributionData, t, renderTooltipJsx),
|
|
33
|
+
[t, isEmpty, genderDistributionData],
|
|
34
|
+
);
|
|
35
|
+
return (
|
|
36
|
+
<DashboardLayout
|
|
37
|
+
header={
|
|
38
|
+
<Header
|
|
39
|
+
title={'Restoration Activity Summary'}
|
|
40
|
+
supportText={supportText || ''}
|
|
41
|
+
onDownload={onDownload}
|
|
42
|
+
downloadDisabled={downloadDisabled}
|
|
43
|
+
actionButtons={actionButtons}
|
|
44
|
+
breadcrumbs={breadcrumbs}
|
|
45
|
+
goBackTo={goBackTo}
|
|
46
|
+
loading={loading}
|
|
47
|
+
/>
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
<section>
|
|
51
|
+
<KeyIndicators title={t("Key Information")} config={keyIndicatorsConfig} loading={loading} />
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
<section>
|
|
55
|
+
<Widget
|
|
56
|
+
title={t("Activity Location")}
|
|
57
|
+
className="no-px no-pb-body"
|
|
58
|
+
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
|
59
|
+
>
|
|
60
|
+
<div style={{ flex: 1, minHeight: 0 }}>
|
|
61
|
+
<MineSiteMap
|
|
62
|
+
loading={loading}
|
|
63
|
+
t={t}
|
|
64
|
+
isSatellite={true}
|
|
65
|
+
app={"straatos"}
|
|
66
|
+
showSider={false}
|
|
67
|
+
user={null}
|
|
68
|
+
data={[
|
|
69
|
+
{
|
|
70
|
+
_id: {},
|
|
71
|
+
id: "7f2aaed4-4b2e-406c-8e0a-6659c5c8367b",
|
|
72
|
+
color: "#6698E4",
|
|
73
|
+
parent: {
|
|
74
|
+
_id: {},
|
|
75
|
+
createdAt: "2024-06-13T14:51:55.296Z",
|
|
76
|
+
updatedAt: "2024-06-13T14:51:55.296Z",
|
|
77
|
+
id: "a5340bf1-2c7d-413f-a2a5-ccd7dc8f7a7c",
|
|
78
|
+
name: "New Mine",
|
|
79
|
+
authorId: "4e6066e9-00d8-423a-94ec-c7c9d3432fec",
|
|
80
|
+
collectId: "f8a2b6a9cc935ef3e5844427f49aade34e152eca",
|
|
81
|
+
country: "AL",
|
|
82
|
+
category: "mineSite",
|
|
83
|
+
datastakeId: "LOC-00000000141",
|
|
84
|
+
__v: 0,
|
|
85
|
+
},
|
|
86
|
+
administrativeLevel1: "6839cb26-5af4-44a3-b136-a0f0a0bcecc6",
|
|
87
|
+
administrativeLevel2: "f849835d-5640-4bee-ae98-9f1c810c1abe",
|
|
88
|
+
// "name": "New Mine",
|
|
89
|
+
country: "AL",
|
|
90
|
+
category: "mineSite",
|
|
91
|
+
authorId: "4e6066e9-00d8-423a-94ec-c7c9d3432fec",
|
|
92
|
+
gps: {
|
|
93
|
+
latitude: 7,
|
|
94
|
+
longitude: 1,
|
|
95
|
+
},
|
|
96
|
+
area: [
|
|
97
|
+
[6, 5],
|
|
98
|
+
[7, 1],
|
|
99
|
+
[9, 2],
|
|
100
|
+
],
|
|
101
|
+
associatedSubjects: [
|
|
102
|
+
{
|
|
103
|
+
entity: "Event",
|
|
104
|
+
_id: {},
|
|
105
|
+
nature: "",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
published: false,
|
|
109
|
+
version: 1,
|
|
110
|
+
createdAt: "2024-06-13T14:51:55.296Z",
|
|
111
|
+
updatedAt: "2024-06-13T14:51:55.296Z",
|
|
112
|
+
name: "Name",
|
|
113
|
+
type: "Loc Type",
|
|
114
|
+
__v: 0,
|
|
115
|
+
datastakeId: "LOC-00000000141",
|
|
116
|
+
},
|
|
117
|
+
]}
|
|
118
|
+
// tooltipAsText: true,
|
|
119
|
+
primaryLink={true}
|
|
120
|
+
renderTooltip={() => {
|
|
121
|
+
return [
|
|
122
|
+
{
|
|
123
|
+
label: "Name",
|
|
124
|
+
value: "Name",
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}}
|
|
128
|
+
center={[13, -15]}
|
|
129
|
+
mapConfig={{ maxZoom: 18 }}
|
|
130
|
+
type={'territory'}
|
|
131
|
+
link={true}
|
|
132
|
+
onClickLink={() => { }}
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
</Widget>
|
|
136
|
+
</section>
|
|
137
|
+
|
|
138
|
+
<section>
|
|
139
|
+
<div style={{ maxWidth: "70%", width: "calc(100% - 405px)" }}>
|
|
140
|
+
<ImageCarousel
|
|
141
|
+
loading={loading}
|
|
142
|
+
images={images}
|
|
143
|
+
title={t("straatos::activity-imagery")}
|
|
144
|
+
key={`${isCollapsed}-${isNestedSidebarCollapsed}`}
|
|
145
|
+
customArrows={true}
|
|
146
|
+
activeDotColor="#003435"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
<Widget
|
|
150
|
+
loading={loading}
|
|
151
|
+
title={<div>{t("Workers Distribution")}</div>}
|
|
152
|
+
className="with-border-header h-w-btn-header "
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
style={{
|
|
156
|
+
marginTop: "auto",
|
|
157
|
+
marginBottom: "auto",
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<PieChart
|
|
161
|
+
mouseXOffset={10}
|
|
162
|
+
mouseYOffset={10}
|
|
163
|
+
changeOpacityOnHover={false}
|
|
164
|
+
data={pieData}
|
|
165
|
+
doConstraints={false}
|
|
166
|
+
isPie
|
|
167
|
+
t={t}
|
|
168
|
+
isEmpty={isEmpty}
|
|
169
|
+
getTooltipChildren={getTooltipChildren}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
</Widget>
|
|
173
|
+
</section>
|
|
174
|
+
</DashboardLayout>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export default RestorationActivitySummary;
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from 'react'
|
|
2
|
+
import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
|
|
3
|
+
import DashboardLayout from '../../../core/components/Dashboard/DashboardLayout/index.jsx';
|
|
4
|
+
import Header from '../../../core/components/Header/index.jsx';
|
|
5
|
+
import Multiselect from '../../../core/components/Select/MultiSelect/index.jsx';
|
|
6
|
+
|
|
7
|
+
function OperatorSummary({
|
|
8
|
+
t = () => { },
|
|
9
|
+
goTo = () => { },
|
|
10
|
+
getRedirectLink = () => { },
|
|
11
|
+
theme = {},
|
|
12
|
+
user = {},
|
|
13
|
+
options = {},
|
|
14
|
+
partners,
|
|
15
|
+
selectedPartners,
|
|
16
|
+
setSelectedPartners,
|
|
17
|
+
informationSources,
|
|
18
|
+
hardcodedData,
|
|
19
|
+
breadCrumbs = [],
|
|
20
|
+
}) {
|
|
21
|
+
|
|
22
|
+
const sourceOptions = useMemo(() => {
|
|
23
|
+
if (!partners?.length) return [];
|
|
24
|
+
|
|
25
|
+
return partners?.map((partner) => {
|
|
26
|
+
const isOwnData = partner.id === user?.company?.id;
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
label: partner.nickName,
|
|
30
|
+
value: partner.id,
|
|
31
|
+
avatar: isOwnData ? <span>OWN</span> : <CustomIcon name={"Search02"} size={14} />,
|
|
32
|
+
background: isOwnData ? theme.colorPrimary7 : undefined,
|
|
33
|
+
color: isOwnData ? "white" : undefined,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}, [partners, user]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
window.theme = theme;
|
|
40
|
+
}, [theme])
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<DashboardLayout
|
|
45
|
+
header={
|
|
46
|
+
<Header
|
|
47
|
+
title={t('Operator Summary')}
|
|
48
|
+
addedHeader={
|
|
49
|
+
<div>
|
|
50
|
+
<Multiselect
|
|
51
|
+
options={[...sourceOptions]}
|
|
52
|
+
isAvatarGroup
|
|
53
|
+
selectionType="checkbox"
|
|
54
|
+
canUnselectLast={false}
|
|
55
|
+
key={partners?.length}
|
|
56
|
+
onChange={(selected) => {
|
|
57
|
+
setSelectedPartners((prev) => ({
|
|
58
|
+
...prev,
|
|
59
|
+
partners: selected,
|
|
60
|
+
loading: false,
|
|
61
|
+
}));
|
|
62
|
+
}}
|
|
63
|
+
dropDownWidth={200}
|
|
64
|
+
defaultSelected={partners?.map((p) => p.id) || []}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
breadcrumbs={breadCrumbs}
|
|
69
|
+
/>
|
|
70
|
+
}
|
|
71
|
+
>
|
|
72
|
+
</DashboardLayout>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default OperatorSummary;
|
package/src/pages.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Dashboards
|
|
2
|
-
export { default as SupplyChainDashboard } from './@daf/pages/
|
|
3
|
-
export { default as UserDashboard } from './@daf/pages/
|
|
2
|
+
export { default as SupplyChainDashboard } from './@daf/pages/Dashboards/SupplyChain/index.jsx';
|
|
3
|
+
export { default as UserDashboard } from './@daf/pages/Dashboards/UserDashboard/index.jsx';
|
|
4
4
|
export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
|
|
5
5
|
export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
|
|
6
6
|
export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
|
|
@@ -12,6 +12,8 @@ export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index
|
|
|
12
12
|
export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
|
|
13
13
|
export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
// Summary
|
|
17
|
+
export { default as OperatorSummary } from './@daf/pages/Summary/operator/index.jsx';
|
|
18
|
+
export { default as RestorationActivitySummary } from './@daf/pages/Summary/Activities/Restoration/index.jsx';
|
|
17
19
|
|