datastake-daf 0.6.768 → 0.6.770
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 +792 -580
- package/dist/layouts/index.js +495 -459
- package/dist/pages/index.js +2808 -738
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/dist/utils/index.js +481 -457
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/index.jsx +10 -0
- package/src/@daf/core/components/Charts/LineChart/index.jsx +14 -0
- package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/index.jsx +2 -0
- package/src/@daf/core/components/Dashboard/Widget/StatCard/StatCard.stories.js +226 -0
- package/src/@daf/core/components/Dashboard/Widget/StatCard/index.js +103 -0
- package/src/@daf/core/components/Dashboard/Widget/StatCard/style.js +83 -0
- package/src/@daf/core/components/Icon/configs/Down.js +8 -0
- package/src/@daf/core/components/Icon/configs/Up.js +8 -0
- package/src/@daf/core/components/Icon/configs/index.js +4 -0
- package/src/@daf/core/components/Icon/configs/partnerIcon.js +1 -1
- package/src/@daf/core/components/Sidenav/Menu.jsx +4 -4
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/AssociatedInformation/index.jsx +43 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/CommunityStats/helper.js +60 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/CommunityStats/index.jsx +36 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/GenderDistribution/helper.js +117 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/GenderDistribution/index.jsx +49 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/JobsTimeline/index.jsx +212 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/index.jsx +72 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/CyclePartners/helper.js +91 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/CyclePartners/index.jsx +50 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/helper.js +134 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/index.jsx +49 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/index.jsx +112 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/index.jsx +498 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/KeyInformation/index.jsx +49 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/PlantingLocations/index.jsx +120 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/config.js +5 -10
- package/src/@daf/pages/Summary/Activities/PlantingCycle/helper.js +218 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/index.jsx +22 -32
- package/src/@daf/pages/Summary/Activities/Restoration/components/ActivityImagery/index.jsx +29 -0
- package/src/@daf/pages/Summary/Activities/Restoration/components/ActivityLocation/index.jsx +94 -0
- package/src/@daf/pages/Summary/Activities/Restoration/components/WorkersDistribution/index.jsx +49 -0
- package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +16 -138
- package/src/index.js +1 -0
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
import { useMemo
|
|
2
|
-
import { DashboardLayout, Header,
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { DashboardLayout, Header, KeyIndicators, ActivityIndicators } from '../../../../../../src/index.js'
|
|
3
3
|
import { getKeyIndicatorsRowConfig } from './config';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import CustomIcon from '../../../../../../src/@daf/core/components/Icon/CustomIcon.jsx';
|
|
4
|
+
import { getActivityIndicatorsConfig } from './helper';
|
|
5
|
+
import ActivityLocation from './components/ActivityLocation/index.jsx';
|
|
6
|
+
import ActivityImagery from './components/ActivityImagery/index.jsx';
|
|
7
|
+
import WorkersDistribution from './components/WorkersDistribution/index.jsx';
|
|
9
8
|
|
|
10
9
|
const RestorationActivitySummary = ({ activityData, supportText, onDownload, downloadDisabled, actionButtons, breadcrumbs, goBackTo, loading, t = () => { } }) => {
|
|
11
|
-
const { isCollapsed, isNestedSidebarCollapsed } = useResizeContext();
|
|
12
10
|
const keyIndicatorsConfig = useMemo(() => getKeyIndicatorsRowConfig({ t, data: activityData }), [t, activityData]);
|
|
13
|
-
const images = useMemo(() => getActivityImages(activityData), [activityData]);
|
|
14
|
-
const genderDistributionData = useMemo(() => getGenderDistributionData(activityData), [activityData]);
|
|
15
|
-
const isEmpty = useMemo(() => isGenderDistributionEmpty(genderDistributionData), [genderDistributionData]);
|
|
16
|
-
const pieData = useMemo(() => calculateGenderPieData(genderDistributionData), [genderDistributionData]);
|
|
17
11
|
|
|
18
|
-
const getTooltipChildren = useCallback(
|
|
19
|
-
(item) => getGenderTooltipChildren(item, isEmpty, genderDistributionData, t, renderTooltipJsx),
|
|
20
|
-
[t, isEmpty, genderDistributionData],
|
|
21
|
-
);
|
|
22
|
-
|
|
23
12
|
// Activity Indicators Config - mapped from activityData
|
|
24
|
-
const activityIndicatorsConfig = useMemo(() =>
|
|
13
|
+
const activityIndicatorsConfig = useMemo(() =>
|
|
25
14
|
getActivityIndicatorsConfig(activityData, t),
|
|
26
15
|
[activityData, t]
|
|
27
16
|
);
|
|
28
17
|
|
|
29
|
-
// Map Data - transformed from activityData
|
|
30
|
-
const mapData = useMemo(() => getMapDataFromActivity(activityData, t), [activityData, t]);
|
|
31
|
-
|
|
32
18
|
return (
|
|
33
19
|
<DashboardLayout
|
|
34
20
|
header={
|
|
@@ -48,126 +34,18 @@ const RestorationActivitySummary = ({ activityData, supportText, onDownload, dow
|
|
|
48
34
|
<KeyIndicators title={t("Key Information")} config={keyIndicatorsConfig} loading={loading} />
|
|
49
35
|
</section>
|
|
50
36
|
|
|
51
|
-
<
|
|
52
|
-
<Widget
|
|
53
|
-
title={t("Activity Location")}
|
|
54
|
-
className="no-px h-w-btn-header no-pt-body no-p-body no-pb-body"
|
|
55
|
-
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
|
56
|
-
>
|
|
57
|
-
<div style={{ flex: 1, minHeight: 0 }}>
|
|
58
|
-
<MineSiteMap
|
|
59
|
-
loading={loading}
|
|
60
|
-
t={t}
|
|
61
|
-
isSatellite={true}
|
|
62
|
-
app={"straatos"}
|
|
63
|
-
type={'location-territory'}
|
|
64
|
-
showSider={false}
|
|
65
|
-
user={null}
|
|
66
|
-
data={mapData}
|
|
67
|
-
maxZoom={18}
|
|
68
|
-
primaryLink={true}
|
|
69
|
-
style={{ height: '100%', width: '100%' }}
|
|
70
|
-
renderTooltipForLocation={(data) => {
|
|
71
|
-
const coordinates = data.gps?.latitude && data.gps?.longitude
|
|
72
|
-
? convertDMS(data.gps.latitude, data.gps.longitude)
|
|
73
|
-
: null;
|
|
74
|
-
|
|
75
|
-
if (!coordinates) {
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const isActivityEnd = data.name === t("Activity End") || data.id?.includes('-departure');
|
|
80
|
-
const iconColor = isActivityEnd ? "#FF7A45" : "#016C6E";
|
|
81
|
-
|
|
82
|
-
return [
|
|
83
|
-
{
|
|
84
|
-
label: t("Coordinates"),
|
|
85
|
-
|
|
86
|
-
value: (
|
|
87
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'nowrap' }}>
|
|
88
|
-
{/* Latitude icon (vertical) */}
|
|
89
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
90
|
-
<CustomIcon
|
|
91
|
-
name="SpacingHeight"
|
|
92
|
-
width={14}
|
|
93
|
-
height={14}
|
|
94
|
-
color={iconColor}
|
|
95
|
-
/>
|
|
96
|
-
<span style={{ fontWeight: 600, marginLeft: '4px' }}>{coordinates[0]}</span>
|
|
97
|
-
</div>
|
|
98
|
-
{/* Longitude icon (horizontal) */}
|
|
99
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
100
|
-
<CustomIcon
|
|
101
|
-
name="SpacingWidth"
|
|
102
|
-
width={14}
|
|
103
|
-
height={14}
|
|
104
|
-
color={iconColor}
|
|
105
|
-
/>
|
|
106
|
-
<span style={{ fontWeight: 600, marginLeft: '4px' }}>{coordinates[1]}</span>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
),
|
|
110
|
-
},
|
|
111
|
-
];
|
|
112
|
-
}}
|
|
113
|
-
renderTooltipForTerritory={(data) => {
|
|
114
|
-
return [
|
|
115
|
-
{
|
|
116
|
-
label: t("Plot Name"),
|
|
117
|
-
value: data.plotName || data.name || "--",
|
|
118
|
-
},
|
|
119
|
-
];
|
|
120
|
-
}}
|
|
121
|
-
link={true}
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
</Widget>
|
|
125
|
-
</section>
|
|
37
|
+
<ActivityLocation activityData={activityData} loading={loading} t={t} />
|
|
126
38
|
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/>
|
|
134
|
-
</section>
|
|
39
|
+
<ActivityIndicators
|
|
40
|
+
config={activityIndicatorsConfig}
|
|
41
|
+
loading={loading}
|
|
42
|
+
title={t("Activity Indicators")}
|
|
43
|
+
className="small-content"
|
|
44
|
+
/>
|
|
135
45
|
|
|
136
46
|
<section>
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
loading={loading}
|
|
140
|
-
images={images}
|
|
141
|
-
title={t("straatos::activity-imagery")}
|
|
142
|
-
key={`${isCollapsed}-${isNestedSidebarCollapsed}`}
|
|
143
|
-
customArrows={true}
|
|
144
|
-
activeDotColor="#003435"
|
|
145
|
-
/>
|
|
146
|
-
</div>
|
|
147
|
-
<Widget
|
|
148
|
-
loading={loading}
|
|
149
|
-
title={<div>{t("Workers Distribution")}</div>}
|
|
150
|
-
className="with-border-header h-w-btn-header "
|
|
151
|
-
>
|
|
152
|
-
<div
|
|
153
|
-
style={{
|
|
154
|
-
marginTop: "auto",
|
|
155
|
-
marginBottom: "auto",
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
<PieChart
|
|
159
|
-
mouseXOffset={10}
|
|
160
|
-
mouseYOffset={10}
|
|
161
|
-
changeOpacityOnHover={false}
|
|
162
|
-
data={pieData}
|
|
163
|
-
doConstraints={false}
|
|
164
|
-
isPie
|
|
165
|
-
t={t}
|
|
166
|
-
isEmpty={isEmpty}
|
|
167
|
-
getTooltipChildren={getTooltipChildren}
|
|
168
|
-
/>
|
|
169
|
-
</div>
|
|
170
|
-
</Widget>
|
|
47
|
+
<ActivityImagery activityData={activityData} loading={loading} t={t} />
|
|
48
|
+
<WorkersDistribution activityData={activityData} loading={loading} t={t} />
|
|
171
49
|
</section>
|
|
172
50
|
</DashboardLayout>
|
|
173
51
|
)
|
package/src/index.js
CHANGED
|
@@ -77,6 +77,7 @@ export { default as ProjectWidget } from "./@daf/core/components/Dashboard/Widge
|
|
|
77
77
|
export { default as WidgetCard } from "./@daf/core/components/Dashboard/Widget/WidgetCard/index.js";
|
|
78
78
|
export { default as CarouselWidget } from "./@daf/core/components/Dashboard/Widget/CarouselWidget/index.jsx";
|
|
79
79
|
export { default as ImageCarousel } from "./@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx";
|
|
80
|
+
export { default as StatCard } from "./@daf/core/components/Dashboard/Widget/StatCard/index.js";
|
|
80
81
|
// export { default as WidgetCatalogue } from "./@daf/core/components/Dashboard/Widget/WidgetCatalogue/index.jsx";
|
|
81
82
|
|
|
82
83
|
// Forms
|