datastake-daf 0.6.783 → 0.6.785
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 +78 -70
- package/dist/hooks/index.js +3 -1
- package/dist/pages/index.js +1082 -270
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/dist/utils/index.js +67 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/BarChart/index.jsx +1 -1
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/utils.js +2 -2
- package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -0
- package/src/@daf/core/components/Select/MultiSelect/index.jsx +4 -2
- package/src/@daf/core/components/Select/MultiSelect/style.js +15 -0
- package/src/@daf/hooks/useGetQueryParams.js +3 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/hook.js +6 -7
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/index.jsx +1 -1
- package/src/@daf/pages/Documents/config.js +5 -5
- package/src/@daf/pages/Events/Activities/columns.js +5 -0
- package/src/@daf/pages/Events/Activities/config.js +21 -17
- package/src/@daf/pages/Events/Incidents/columns.js +5 -0
- package/src/@daf/pages/Events/Incidents/config.js +14 -11
- package/src/@daf/pages/Events/columns.js +6 -0
- package/src/@daf/pages/Events/config.js +0 -16
- package/src/@daf/pages/Locations/MineSite/columns.js +5 -1
- package/src/@daf/pages/Locations/MineSite/config.js +21 -24
- package/src/@daf/pages/Partners/columns.js +3 -1
- package/src/@daf/pages/Partners/config.js +13 -9
- package/src/@daf/pages/Partners/create.jsx +5 -2
- package/src/@daf/pages/Partners/edit.jsx +4 -2
- package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -0
- package/src/@daf/pages/Stakeholders/Operators/config.js +8 -8
- package/src/@daf/pages/Stakeholders/Workers/columns.js +19 -13
- package/src/@daf/pages/Stakeholders/Workers/config.js +8 -23
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/KeyInformation/index.jsx +48 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/PlantedSpecies.jsx +73 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/SeedlingsHeight.jsx +44 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/Stats.jsx +86 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/VegetationHealth.jsx +73 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/index.jsx +92 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MonitoringScopeAndFindings/index.jsx +348 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/config.js +35 -0
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/index.jsx +30 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/CommunityStats/helper.js +1 -1
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/index.jsx +1 -1
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/index.jsx +1 -1
- package/src/@daf/pages/Summary/Activities/PlantingCycle/helper.js +0 -56
- package/src/@daf/pages/Summary/Minesite/index.jsx +6 -4
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +2 -0
- package/src/@daf/pages/Summary/Operator/index.jsx +6 -3
- package/src/@daf/pages/TablePage/index.jsx +8 -2
- package/src/@daf/pages/Template/components/LinkingTemplate/config.js +14 -1
- package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +4 -2
- package/src/@daf/pages/Template/index.jsx +1 -10
- package/src/@daf/pages/View/hooks/usePrepareForm.js +4 -4
- package/src/@daf/pages/View/index.jsx +2 -1
- package/src/@daf/utils/numbers.js +57 -0
- package/src/constants/locales/en/translation.js +3 -0
- package/src/constants/locales/fr/translation.js +3 -0
- package/src/constants/locales/sp/translation.js +3 -0
- package/src/pages.js +1 -0
- package/src/utils.js +1 -1
package/dist/pages/index.js
CHANGED
|
@@ -6192,6 +6192,17 @@ DAFHeader.propTypes = {
|
|
|
6192
6192
|
filtersConfig: PropTypes__default["default"].any
|
|
6193
6193
|
};
|
|
6194
6194
|
|
|
6195
|
+
const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
6196
|
+
&.ant-select-single {
|
|
6197
|
+
.ant-select-selector {
|
|
6198
|
+
padding-inline-end: 24px !important;
|
|
6199
|
+
padding: 0 !important;
|
|
6200
|
+
max-width: 56px !important;
|
|
6201
|
+
width: 56px !important;
|
|
6202
|
+
}
|
|
6203
|
+
}
|
|
6204
|
+
`;
|
|
6205
|
+
|
|
6195
6206
|
const {
|
|
6196
6207
|
useToken: useToken$8
|
|
6197
6208
|
} = antd.theme;
|
|
@@ -6330,7 +6341,7 @@ function Multiselect({
|
|
|
6330
6341
|
});
|
|
6331
6342
|
}
|
|
6332
6343
|
};
|
|
6333
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
6344
|
+
return /*#__PURE__*/jsxRuntime.jsx(MultiSelectStyled, {
|
|
6334
6345
|
mode: isSingle ? undefined : "multiple",
|
|
6335
6346
|
value: selectValue,
|
|
6336
6347
|
onChange: onSelectChange,
|
|
@@ -6387,7 +6398,8 @@ function Multiselect({
|
|
|
6387
6398
|
border: `1px solid ${token.baseGray40}`,
|
|
6388
6399
|
display: "flex",
|
|
6389
6400
|
alignItems: "center",
|
|
6390
|
-
justifyContent: "center"
|
|
6401
|
+
justifyContent: "center",
|
|
6402
|
+
padding: 0
|
|
6391
6403
|
},
|
|
6392
6404
|
children: option?.avatar || getFirstChar(option?.label)
|
|
6393
6405
|
}, value);
|
|
@@ -8348,11 +8360,11 @@ function getStakeholderPosition({
|
|
|
8348
8360
|
angleDeg
|
|
8349
8361
|
};
|
|
8350
8362
|
}
|
|
8351
|
-
function applyAnimationDirect(el, isShortLink) {
|
|
8363
|
+
function applyAnimationDirect(el, isShortLink, lineFlow = "downstream") {
|
|
8352
8364
|
if (!(el instanceof SVGElement) || isShortLink) return;
|
|
8353
8365
|
el.style.strokeDasharray = "10, 10";
|
|
8354
8366
|
el.style.strokeDashoffset = "0";
|
|
8355
|
-
el.style.animation =
|
|
8367
|
+
el.style.animation = `dash-flow 1.2s linear infinite ${lineFlow === "upstream" && "reverse"}`;
|
|
8356
8368
|
el.classList.add('animated-polyline');
|
|
8357
8369
|
}
|
|
8358
8370
|
function removeAnimationFromElement(element) {
|
|
@@ -14306,7 +14318,7 @@ function BarChart({
|
|
|
14306
14318
|
return Array.from(new Array(11), (v, i) => i * 10);
|
|
14307
14319
|
}
|
|
14308
14320
|
} : {}),
|
|
14309
|
-
...xAxisConfig,
|
|
14321
|
+
...(Object.keys(xAxisConfig).length > 0 ? xAxisConfig : {}),
|
|
14310
14322
|
label: {
|
|
14311
14323
|
formatter: isPercentage ? v => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, s => `${s},`) + " %" : formattedXAxis,
|
|
14312
14324
|
...xAxisConfig?.label
|
|
@@ -14436,6 +14448,10 @@ const useContributionsGraph = ({
|
|
|
14436
14448
|
});
|
|
14437
14449
|
}, [data, t]);
|
|
14438
14450
|
const isEmpty = React.useMemo(() => _data?.length === 0, [_data]);
|
|
14451
|
+
console.log({
|
|
14452
|
+
_data,
|
|
14453
|
+
isEmpty
|
|
14454
|
+
});
|
|
14439
14455
|
const chartConfig = React.useMemo(() => {
|
|
14440
14456
|
return {
|
|
14441
14457
|
data: _data,
|
|
@@ -14443,13 +14459,11 @@ const useContributionsGraph = ({
|
|
|
14443
14459
|
yFieldKey: "category",
|
|
14444
14460
|
seriesField: "type",
|
|
14445
14461
|
isGroup: true,
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
}
|
|
14452
|
-
}),
|
|
14462
|
+
xAxisConfig: isEmpty ? {
|
|
14463
|
+
min: 0,
|
|
14464
|
+
max: 10,
|
|
14465
|
+
tickCount: 5
|
|
14466
|
+
} : {},
|
|
14453
14467
|
renderTooltipContent: (title, items) => {
|
|
14454
14468
|
const tooltipItems = items.map(item => ({
|
|
14455
14469
|
label: item.name,
|
|
@@ -14505,10 +14519,11 @@ function ContributionsGraph({
|
|
|
14505
14519
|
loading: loading,
|
|
14506
14520
|
title: t("Contributions"),
|
|
14507
14521
|
className: "with-border-header h-w-btn-header no-px-body",
|
|
14508
|
-
children: /*#__PURE__*/
|
|
14522
|
+
children: /*#__PURE__*/React.createElement(BarChart, {
|
|
14509
14523
|
...chartConfig,
|
|
14510
14524
|
height: "400px",
|
|
14511
|
-
t: t
|
|
14525
|
+
t: t,
|
|
14526
|
+
key: data?.length
|
|
14512
14527
|
})
|
|
14513
14528
|
});
|
|
14514
14529
|
}
|
|
@@ -15296,6 +15311,8 @@ const getColumns$d = ({
|
|
|
15296
15311
|
title: t('ID'),
|
|
15297
15312
|
ellipsis: true,
|
|
15298
15313
|
show: true,
|
|
15314
|
+
key: "datastakeId",
|
|
15315
|
+
sorter: () => 0 + 0,
|
|
15299
15316
|
render: (v, all) => {
|
|
15300
15317
|
if (all.empty) {
|
|
15301
15318
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -15312,6 +15329,8 @@ const getColumns$d = ({
|
|
|
15312
15329
|
title: t('Name'),
|
|
15313
15330
|
ellipsis: true,
|
|
15314
15331
|
show: true,
|
|
15332
|
+
key: "name",
|
|
15333
|
+
sorter: () => 0 + 0,
|
|
15315
15334
|
render: (v, all) => {
|
|
15316
15335
|
if (all.empty) {
|
|
15317
15336
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -15345,6 +15364,8 @@ const getColumns$d = ({
|
|
|
15345
15364
|
title: t('Legal Form'),
|
|
15346
15365
|
ellipsis: true,
|
|
15347
15366
|
show: true,
|
|
15367
|
+
key: "subCategory",
|
|
15368
|
+
sorter: () => 0 + 0,
|
|
15348
15369
|
render: (v, all) => {
|
|
15349
15370
|
if (all.empty) {
|
|
15350
15371
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -16346,6 +16367,7 @@ const BaseScreen = ({
|
|
|
16346
16367
|
showFilters: showFilters,
|
|
16347
16368
|
defaultFilters: defaultFilters,
|
|
16348
16369
|
onChange: onTableChange,
|
|
16370
|
+
t: t,
|
|
16349
16371
|
...rest
|
|
16350
16372
|
}), /*#__PURE__*/jsxRuntime.jsx(Pagination, {
|
|
16351
16373
|
t: t,
|
|
@@ -30163,7 +30185,9 @@ const useGetQueryParams = ({
|
|
|
30163
30185
|
},
|
|
30164
30186
|
otherParams: {
|
|
30165
30187
|
...rest
|
|
30166
|
-
}
|
|
30188
|
+
},
|
|
30189
|
+
sortBy,
|
|
30190
|
+
sortDir
|
|
30167
30191
|
};
|
|
30168
30192
|
}, [queryParams]);
|
|
30169
30193
|
return params;
|
|
@@ -30411,7 +30435,7 @@ const getFiltersConfig$9 = ({
|
|
|
30411
30435
|
country: {
|
|
30412
30436
|
type: 'select',
|
|
30413
30437
|
label: 'Country',
|
|
30414
|
-
placeholder:
|
|
30438
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
30415
30439
|
style: {
|
|
30416
30440
|
flex: 1
|
|
30417
30441
|
},
|
|
@@ -30444,7 +30468,7 @@ const getFiltersConfig$9 = ({
|
|
|
30444
30468
|
}
|
|
30445
30469
|
return t('Province');
|
|
30446
30470
|
},
|
|
30447
|
-
placeholder:
|
|
30471
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
30448
30472
|
filters: data => ({
|
|
30449
30473
|
country: data.country,
|
|
30450
30474
|
level: 'level_1'
|
|
@@ -30488,7 +30512,7 @@ const getFiltersConfig$9 = ({
|
|
|
30488
30512
|
return t('Province');
|
|
30489
30513
|
},
|
|
30490
30514
|
show: data => !(data.country && data.administrativeLevel1),
|
|
30491
|
-
placeholder:
|
|
30515
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
30492
30516
|
filters: data => ({
|
|
30493
30517
|
country: data.country,
|
|
30494
30518
|
level: 'level_2',
|
|
@@ -30511,7 +30535,7 @@ const getFiltersConfig$9 = ({
|
|
|
30511
30535
|
subCategory: {
|
|
30512
30536
|
type: 'select',
|
|
30513
30537
|
label: 'Sub Category',
|
|
30514
|
-
placeholder:
|
|
30538
|
+
placeholder: () => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
|
|
30515
30539
|
style: {
|
|
30516
30540
|
flex: 1
|
|
30517
30541
|
},
|
|
@@ -30547,7 +30571,7 @@ const getFiltersConfig$9 = ({
|
|
|
30547
30571
|
positionInTheMineralSupplyChain: {
|
|
30548
30572
|
type: 'select',
|
|
30549
30573
|
label: 'Position',
|
|
30550
|
-
placeholder:
|
|
30574
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
30551
30575
|
style: {
|
|
30552
30576
|
flex: 1
|
|
30553
30577
|
},
|
|
@@ -30560,7 +30584,7 @@ const getFiltersConfig$9 = ({
|
|
|
30560
30584
|
status: {
|
|
30561
30585
|
type: "select",
|
|
30562
30586
|
label: "Status",
|
|
30563
|
-
placeholder:
|
|
30587
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
30564
30588
|
style: {
|
|
30565
30589
|
flex: 1
|
|
30566
30590
|
},
|
|
@@ -30592,10 +30616,10 @@ const getFilterOptions$9 = (options, t) => {
|
|
|
30592
30616
|
subCategory: subCategoriesOptions,
|
|
30593
30617
|
status: [{
|
|
30594
30618
|
value: "submitted",
|
|
30595
|
-
label: "Submitted"
|
|
30619
|
+
label: t("Submitted")
|
|
30596
30620
|
}, {
|
|
30597
30621
|
value: "private",
|
|
30598
|
-
label: "Private"
|
|
30622
|
+
label: t("Private")
|
|
30599
30623
|
}]
|
|
30600
30624
|
};
|
|
30601
30625
|
return _default;
|
|
@@ -30618,7 +30642,7 @@ const getFiltersConfig$8 = ({
|
|
|
30618
30642
|
country: {
|
|
30619
30643
|
type: 'select',
|
|
30620
30644
|
label: 'Country',
|
|
30621
|
-
placeholder:
|
|
30645
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
30622
30646
|
style: {
|
|
30623
30647
|
flex: 1
|
|
30624
30648
|
},
|
|
@@ -30651,7 +30675,7 @@ const getFiltersConfig$8 = ({
|
|
|
30651
30675
|
}
|
|
30652
30676
|
return t('Province');
|
|
30653
30677
|
},
|
|
30654
|
-
placeholder:
|
|
30678
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
30655
30679
|
filters: data => ({
|
|
30656
30680
|
country: data.country,
|
|
30657
30681
|
level: 'level_1'
|
|
@@ -30695,7 +30719,7 @@ const getFiltersConfig$8 = ({
|
|
|
30695
30719
|
return t('Province');
|
|
30696
30720
|
},
|
|
30697
30721
|
show: data => !(data.country && data.administrativeLevel1),
|
|
30698
|
-
placeholder:
|
|
30722
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
30699
30723
|
filters: data => ({
|
|
30700
30724
|
country: data.country,
|
|
30701
30725
|
level: 'level_2',
|
|
@@ -30718,7 +30742,7 @@ const getFiltersConfig$8 = ({
|
|
|
30718
30742
|
activity: {
|
|
30719
30743
|
type: 'select',
|
|
30720
30744
|
label: 'Activity',
|
|
30721
|
-
placeholder:
|
|
30745
|
+
placeholder: () => `${t('Filter by')} ${t('Activity').toLowerCase()}`,
|
|
30722
30746
|
style: {
|
|
30723
30747
|
flex: 1
|
|
30724
30748
|
},
|
|
@@ -30726,35 +30750,12 @@ const getFiltersConfig$8 = ({
|
|
|
30726
30750
|
flex: 1
|
|
30727
30751
|
},
|
|
30728
30752
|
getLabel: option => option.label,
|
|
30729
|
-
getValue: option => option.value
|
|
30730
|
-
filterOptions: val => {
|
|
30731
|
-
if (val) {
|
|
30732
|
-
const {
|
|
30733
|
-
option,
|
|
30734
|
-
filters
|
|
30735
|
-
} = val;
|
|
30736
|
-
if (filters && option) {
|
|
30737
|
-
const {
|
|
30738
|
-
filters: optionFilters
|
|
30739
|
-
} = option;
|
|
30740
|
-
if (Array.isArray(optionFilters) && optionFilters.length) {
|
|
30741
|
-
const {
|
|
30742
|
-
value,
|
|
30743
|
-
condition
|
|
30744
|
-
} = optionFilters[0];
|
|
30745
|
-
if (condition === 'includes') {
|
|
30746
|
-
return value.includes('corporation');
|
|
30747
|
-
}
|
|
30748
|
-
}
|
|
30749
|
-
}
|
|
30750
|
-
}
|
|
30751
|
-
return true;
|
|
30752
|
-
}
|
|
30753
|
+
getValue: option => option.value
|
|
30753
30754
|
},
|
|
30754
30755
|
positionInTheMineralSupplyChain: {
|
|
30755
30756
|
type: 'select',
|
|
30756
30757
|
label: 'Position',
|
|
30757
|
-
placeholder:
|
|
30758
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
30758
30759
|
style: {
|
|
30759
30760
|
flex: 1
|
|
30760
30761
|
},
|
|
@@ -30767,7 +30768,7 @@ const getFiltersConfig$8 = ({
|
|
|
30767
30768
|
status: {
|
|
30768
30769
|
type: "select",
|
|
30769
30770
|
label: "Status",
|
|
30770
|
-
placeholder:
|
|
30771
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
30771
30772
|
style: {
|
|
30772
30773
|
flex: 1
|
|
30773
30774
|
},
|
|
@@ -30796,10 +30797,10 @@ const getFilterOptions$8 = (options, t) => {
|
|
|
30796
30797
|
const _default = {
|
|
30797
30798
|
status: [{
|
|
30798
30799
|
value: "submitted",
|
|
30799
|
-
label: "Submitted"
|
|
30800
|
+
label: t("Submitted")
|
|
30800
30801
|
}, {
|
|
30801
30802
|
value: "private",
|
|
30802
|
-
label: "Private"
|
|
30803
|
+
label: t("Private")
|
|
30803
30804
|
}],
|
|
30804
30805
|
category: stakeholderCategoryOptions || categoryOptions,
|
|
30805
30806
|
country: countries,
|
|
@@ -30833,25 +30834,31 @@ const getColumns$b = ({
|
|
|
30833
30834
|
subject,
|
|
30834
30835
|
data,
|
|
30835
30836
|
applications
|
|
30836
|
-
}) => [
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
|
|
30840
|
-
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
|
|
30844
|
-
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30837
|
+
}) => [{
|
|
30838
|
+
dataIndex: 'datastakeId',
|
|
30839
|
+
title: t('Title'),
|
|
30840
|
+
ellipsis: true,
|
|
30841
|
+
show: true,
|
|
30842
|
+
key: "datastakeId",
|
|
30843
|
+
sorter: () => 0 + 0,
|
|
30844
|
+
render: (v, all) => {
|
|
30845
|
+
if (all.empty) {
|
|
30846
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
30847
|
+
className: "daf-default-cell"
|
|
30848
|
+
});
|
|
30849
|
+
}
|
|
30850
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
30851
|
+
title: v,
|
|
30852
|
+
children: v
|
|
30853
|
+
});
|
|
30854
|
+
}
|
|
30855
|
+
}, {
|
|
30851
30856
|
dataIndex: 'name',
|
|
30852
30857
|
title: t('Name'),
|
|
30853
30858
|
ellipsis: true,
|
|
30854
30859
|
show: true,
|
|
30860
|
+
key: "name",
|
|
30861
|
+
sorter: () => 0 + 0,
|
|
30855
30862
|
render: (v, all) => {
|
|
30856
30863
|
if (all.empty) {
|
|
30857
30864
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -30865,9 +30872,11 @@ const getColumns$b = ({
|
|
|
30865
30872
|
}
|
|
30866
30873
|
}, {
|
|
30867
30874
|
dataIndex: 'mineSite',
|
|
30868
|
-
title: t('
|
|
30875
|
+
title: t('Site'),
|
|
30869
30876
|
ellipsis: true,
|
|
30870
30877
|
show: true,
|
|
30878
|
+
key: "mineSite",
|
|
30879
|
+
sorter: () => 0 + 0,
|
|
30871
30880
|
render: (v, all) => {
|
|
30872
30881
|
if (all.empty) {
|
|
30873
30882
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31112,30 +31121,7 @@ const getFiltersConfig$7 = ({
|
|
|
31112
31121
|
flex: 1
|
|
31113
31122
|
},
|
|
31114
31123
|
getLabel: option => option.label,
|
|
31115
|
-
getValue: option => option.value
|
|
31116
|
-
filterOptions: val => {
|
|
31117
|
-
if (val) {
|
|
31118
|
-
const {
|
|
31119
|
-
option,
|
|
31120
|
-
filters
|
|
31121
|
-
} = val;
|
|
31122
|
-
if (filters && option) {
|
|
31123
|
-
const {
|
|
31124
|
-
filters: optionFilters
|
|
31125
|
-
} = option;
|
|
31126
|
-
if (Array.isArray(optionFilters) && optionFilters.length) {
|
|
31127
|
-
const {
|
|
31128
|
-
value,
|
|
31129
|
-
condition
|
|
31130
|
-
} = optionFilters[0];
|
|
31131
|
-
if (condition === 'includes') {
|
|
31132
|
-
return value.includes('corporation');
|
|
31133
|
-
}
|
|
31134
|
-
}
|
|
31135
|
-
}
|
|
31136
|
-
}
|
|
31137
|
-
return true;
|
|
31138
|
-
}
|
|
31124
|
+
getValue: option => option.value
|
|
31139
31125
|
},
|
|
31140
31126
|
category: {
|
|
31141
31127
|
type: 'select',
|
|
@@ -31340,6 +31326,8 @@ const getColumns$a = ({
|
|
|
31340
31326
|
title: t('ID'),
|
|
31341
31327
|
ellipsis: true,
|
|
31342
31328
|
show: true,
|
|
31329
|
+
key: "datastakeId",
|
|
31330
|
+
sorter: () => 0 + 0,
|
|
31343
31331
|
render: (v, all) => {
|
|
31344
31332
|
if (all.empty) {
|
|
31345
31333
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31356,6 +31344,8 @@ const getColumns$a = ({
|
|
|
31356
31344
|
title: t('Title'),
|
|
31357
31345
|
ellipsis: true,
|
|
31358
31346
|
show: true,
|
|
31347
|
+
key: "name",
|
|
31348
|
+
sorter: () => 0 + 0,
|
|
31359
31349
|
render: (v, all) => {
|
|
31360
31350
|
if (all.empty) {
|
|
31361
31351
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31372,6 +31362,8 @@ const getColumns$a = ({
|
|
|
31372
31362
|
title: t('Type'),
|
|
31373
31363
|
ellipsis: true,
|
|
31374
31364
|
show: true,
|
|
31365
|
+
key: "typeOfEvent",
|
|
31366
|
+
sorter: () => 0 + 0,
|
|
31375
31367
|
render: (v, all) => {
|
|
31376
31368
|
if (all.empty) {
|
|
31377
31369
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31559,12 +31551,13 @@ const getFiltersConfig$6 = ({
|
|
|
31559
31551
|
label: "Timeframe",
|
|
31560
31552
|
style: {
|
|
31561
31553
|
flex: 1
|
|
31562
|
-
}
|
|
31554
|
+
},
|
|
31555
|
+
t: t
|
|
31563
31556
|
},
|
|
31564
31557
|
country: {
|
|
31565
31558
|
type: 'select',
|
|
31566
31559
|
label: 'Country',
|
|
31567
|
-
placeholder:
|
|
31560
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
31568
31561
|
style: {
|
|
31569
31562
|
flex: 1
|
|
31570
31563
|
},
|
|
@@ -31597,7 +31590,7 @@ const getFiltersConfig$6 = ({
|
|
|
31597
31590
|
}
|
|
31598
31591
|
return t('Province');
|
|
31599
31592
|
},
|
|
31600
|
-
placeholder:
|
|
31593
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
31601
31594
|
filters: data => ({
|
|
31602
31595
|
country: data.country,
|
|
31603
31596
|
level: 'level_1'
|
|
@@ -31641,7 +31634,7 @@ const getFiltersConfig$6 = ({
|
|
|
31641
31634
|
return t('Province');
|
|
31642
31635
|
},
|
|
31643
31636
|
show: data => !(data.country && data.administrativeLevel1),
|
|
31644
|
-
placeholder:
|
|
31637
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
31645
31638
|
filters: data => ({
|
|
31646
31639
|
country: data.country,
|
|
31647
31640
|
level: 'level_2',
|
|
@@ -31664,7 +31657,7 @@ const getFiltersConfig$6 = ({
|
|
|
31664
31657
|
category: {
|
|
31665
31658
|
type: 'select',
|
|
31666
31659
|
label: 'Category',
|
|
31667
|
-
placeholder:
|
|
31660
|
+
placeholder: () => `${t('Filter by')} ${t('Category').toLowerCase()}`,
|
|
31668
31661
|
style: {
|
|
31669
31662
|
flex: 1
|
|
31670
31663
|
},
|
|
@@ -31700,7 +31693,7 @@ const getFiltersConfig$6 = ({
|
|
|
31700
31693
|
positionInTheMineralSupplyChain: {
|
|
31701
31694
|
type: 'select',
|
|
31702
31695
|
label: 'Position',
|
|
31703
|
-
placeholder:
|
|
31696
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
31704
31697
|
style: {
|
|
31705
31698
|
flex: 1
|
|
31706
31699
|
},
|
|
@@ -31713,7 +31706,7 @@ const getFiltersConfig$6 = ({
|
|
|
31713
31706
|
status: {
|
|
31714
31707
|
type: "select",
|
|
31715
31708
|
label: "Status",
|
|
31716
|
-
placeholder:
|
|
31709
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
31717
31710
|
style: {
|
|
31718
31711
|
flex: 1
|
|
31719
31712
|
},
|
|
@@ -31738,18 +31731,23 @@ const getFilterOptions$6 = (options, t) => {
|
|
|
31738
31731
|
administrativeLevel1,
|
|
31739
31732
|
administrativeLevel2,
|
|
31740
31733
|
positionInMineralSupplyChainOptions,
|
|
31741
|
-
subCategoriesOptions
|
|
31734
|
+
subCategoriesOptions,
|
|
31735
|
+
eventCategoryOptions = []
|
|
31742
31736
|
} = options || {};
|
|
31737
|
+
const _categoryOptions = eventCategoryOptions?.map(item => ({
|
|
31738
|
+
value: item.value,
|
|
31739
|
+
label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label
|
|
31740
|
+
}));
|
|
31743
31741
|
const _default = {
|
|
31744
31742
|
timeframe: timeframe,
|
|
31745
31743
|
status: [{
|
|
31746
31744
|
value: "submitted",
|
|
31747
|
-
label: "Submitted"
|
|
31745
|
+
label: t("Submitted")
|
|
31748
31746
|
}, {
|
|
31749
31747
|
value: "private",
|
|
31750
|
-
label: "Private"
|
|
31748
|
+
label: t("Private")
|
|
31751
31749
|
}],
|
|
31752
|
-
category:
|
|
31750
|
+
category: _categoryOptions,
|
|
31753
31751
|
country: countries,
|
|
31754
31752
|
subCategory: subCategoriesOptions,
|
|
31755
31753
|
// category: category,
|
|
@@ -31795,6 +31793,8 @@ const getColumns$9 = ({
|
|
|
31795
31793
|
title: t('ID'),
|
|
31796
31794
|
ellipsis: true,
|
|
31797
31795
|
show: true,
|
|
31796
|
+
key: "datastakeId",
|
|
31797
|
+
sorter: () => 0 + 0,
|
|
31798
31798
|
render: (v, all) => {
|
|
31799
31799
|
if (all.empty) {
|
|
31800
31800
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31811,6 +31811,8 @@ const getColumns$9 = ({
|
|
|
31811
31811
|
title: t('Title'),
|
|
31812
31812
|
ellipsis: true,
|
|
31813
31813
|
show: true,
|
|
31814
|
+
key: "name",
|
|
31815
|
+
sorter: () => 0 + 0,
|
|
31814
31816
|
render: (v, all) => {
|
|
31815
31817
|
if (all.empty) {
|
|
31816
31818
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31826,6 +31828,7 @@ const getColumns$9 = ({
|
|
|
31826
31828
|
title: t("Date"),
|
|
31827
31829
|
dataIndex: "date",
|
|
31828
31830
|
key: "date",
|
|
31831
|
+
sorter: () => 0 + 0,
|
|
31829
31832
|
render: (date, all) => {
|
|
31830
31833
|
if (all.empty) {
|
|
31831
31834
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32172,18 +32175,23 @@ const getFilterOptions$5 = (options, t) => {
|
|
|
32172
32175
|
administrativeLevel1,
|
|
32173
32176
|
administrativeLevel2,
|
|
32174
32177
|
positionInMineralSupplyChainOptions,
|
|
32175
|
-
subCategoriesOptions
|
|
32178
|
+
subCategoriesOptions,
|
|
32179
|
+
eventCategoryOptions = []
|
|
32176
32180
|
} = options || {};
|
|
32181
|
+
const _categoryOptions = eventCategoryOptions?.map(item => ({
|
|
32182
|
+
value: item.value,
|
|
32183
|
+
label: typeof item.label === 'object' ? Object.values(item.label)[0] : item.label
|
|
32184
|
+
}));
|
|
32177
32185
|
const _default = {
|
|
32178
32186
|
timeframe: timeframe,
|
|
32179
32187
|
status: [{
|
|
32180
32188
|
value: "submitted",
|
|
32181
|
-
label: "Submitted"
|
|
32189
|
+
label: t("Submitted")
|
|
32182
32190
|
}, {
|
|
32183
32191
|
value: "private",
|
|
32184
|
-
label: "Private"
|
|
32192
|
+
label: t("Private")
|
|
32185
32193
|
}],
|
|
32186
|
-
category:
|
|
32194
|
+
category: _categoryOptions,
|
|
32187
32195
|
country: countries,
|
|
32188
32196
|
subCategory: subCategoriesOptions,
|
|
32189
32197
|
// category: category,
|
|
@@ -32220,6 +32228,8 @@ const getColumns$8 = ({
|
|
|
32220
32228
|
title: t('ID'),
|
|
32221
32229
|
ellipsis: true,
|
|
32222
32230
|
show: true,
|
|
32231
|
+
key: "datastakeId",
|
|
32232
|
+
sorter: () => 0 + 0,
|
|
32223
32233
|
render: (v, all) => {
|
|
32224
32234
|
if (all.empty) {
|
|
32225
32235
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32236,6 +32246,8 @@ const getColumns$8 = ({
|
|
|
32236
32246
|
title: t('Title'),
|
|
32237
32247
|
ellipsis: true,
|
|
32238
32248
|
show: true,
|
|
32249
|
+
key: "name",
|
|
32250
|
+
sorter: () => 0 + 0,
|
|
32239
32251
|
render: (v, all) => {
|
|
32240
32252
|
if (all.empty) {
|
|
32241
32253
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32251,6 +32263,7 @@ const getColumns$8 = ({
|
|
|
32251
32263
|
title: t("Date"),
|
|
32252
32264
|
dataIndex: "date",
|
|
32253
32265
|
key: "date",
|
|
32266
|
+
sorter: () => 0 + 0,
|
|
32254
32267
|
render: (date, all) => {
|
|
32255
32268
|
if (all.empty) {
|
|
32256
32269
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32638,7 +32651,7 @@ const getFiltersConfig$3 = ({
|
|
|
32638
32651
|
country: {
|
|
32639
32652
|
type: 'select',
|
|
32640
32653
|
label: 'Country',
|
|
32641
|
-
placeholder:
|
|
32654
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
32642
32655
|
style: {
|
|
32643
32656
|
flex: 1
|
|
32644
32657
|
},
|
|
@@ -32671,7 +32684,7 @@ const getFiltersConfig$3 = ({
|
|
|
32671
32684
|
}
|
|
32672
32685
|
return t('Province');
|
|
32673
32686
|
},
|
|
32674
|
-
placeholder:
|
|
32687
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
32675
32688
|
filters: data => ({
|
|
32676
32689
|
country: data.country,
|
|
32677
32690
|
level: 'level_1'
|
|
@@ -32715,7 +32728,7 @@ const getFiltersConfig$3 = ({
|
|
|
32715
32728
|
return t('Province');
|
|
32716
32729
|
},
|
|
32717
32730
|
show: data => !(data.country && data.administrativeLevel1),
|
|
32718
|
-
placeholder:
|
|
32731
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
32719
32732
|
filters: data => ({
|
|
32720
32733
|
country: data.country,
|
|
32721
32734
|
level: 'level_2',
|
|
@@ -32738,7 +32751,7 @@ const getFiltersConfig$3 = ({
|
|
|
32738
32751
|
product: {
|
|
32739
32752
|
type: 'select',
|
|
32740
32753
|
label: 'Product',
|
|
32741
|
-
placeholder:
|
|
32754
|
+
placeholder: () => `${t('Filter by')} ${t('Product').toLowerCase()}`,
|
|
32742
32755
|
style: {
|
|
32743
32756
|
flex: 1
|
|
32744
32757
|
},
|
|
@@ -32746,35 +32759,25 @@ const getFiltersConfig$3 = ({
|
|
|
32746
32759
|
flex: 1
|
|
32747
32760
|
},
|
|
32748
32761
|
getLabel: option => option.label,
|
|
32749
|
-
getValue: option => option.value
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
|
|
32761
|
-
|
|
32762
|
-
|
|
32763
|
-
condition
|
|
32764
|
-
} = optionFilters[0];
|
|
32765
|
-
if (condition === 'includes') {
|
|
32766
|
-
return value.includes('corporation');
|
|
32767
|
-
}
|
|
32768
|
-
}
|
|
32769
|
-
}
|
|
32770
|
-
}
|
|
32771
|
-
return true;
|
|
32772
|
-
}
|
|
32762
|
+
getValue: option => option.value
|
|
32763
|
+
},
|
|
32764
|
+
type: {
|
|
32765
|
+
type: 'select',
|
|
32766
|
+
label: 'Type',
|
|
32767
|
+
placeholder: () => `${t('Filter by')} ${t('Type').toLowerCase()}`,
|
|
32768
|
+
style: {
|
|
32769
|
+
flex: 1
|
|
32770
|
+
},
|
|
32771
|
+
labelStyle: {
|
|
32772
|
+
flex: 1
|
|
32773
|
+
},
|
|
32774
|
+
getLabel: option => option.label,
|
|
32775
|
+
getValue: option => option.value
|
|
32773
32776
|
},
|
|
32774
32777
|
positionInTheMineralSupplyChain: {
|
|
32775
32778
|
type: 'select',
|
|
32776
32779
|
label: 'Position',
|
|
32777
|
-
placeholder:
|
|
32780
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
32778
32781
|
style: {
|
|
32779
32782
|
flex: 1
|
|
32780
32783
|
},
|
|
@@ -32787,7 +32790,7 @@ const getFiltersConfig$3 = ({
|
|
|
32787
32790
|
status: {
|
|
32788
32791
|
type: "select",
|
|
32789
32792
|
label: "Status",
|
|
32790
|
-
placeholder:
|
|
32793
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
32791
32794
|
style: {
|
|
32792
32795
|
flex: 1
|
|
32793
32796
|
},
|
|
@@ -32810,21 +32813,24 @@ const getFilterOptions$3 = (options, t) => {
|
|
|
32810
32813
|
stakeholderCategoryOptions,
|
|
32811
32814
|
stakeholderSubCategoriesOptions,
|
|
32812
32815
|
administrativeLevel1,
|
|
32813
|
-
administrativeLevel2
|
|
32816
|
+
administrativeLevel2,
|
|
32817
|
+
mineralOptions,
|
|
32818
|
+
locationCategories = []
|
|
32814
32819
|
} = options || {};
|
|
32815
32820
|
const _default = {
|
|
32816
32821
|
category: stakeholderCategoryOptions || categoryOptions,
|
|
32817
32822
|
country: countries,
|
|
32818
|
-
product:
|
|
32823
|
+
product: mineralOptions,
|
|
32824
|
+
type: locationCategories,
|
|
32819
32825
|
administrativeLevel1,
|
|
32820
32826
|
administrativeLevel2,
|
|
32821
32827
|
subCategory: subCategoriesOptions,
|
|
32822
32828
|
status: [{
|
|
32823
32829
|
value: "submitted",
|
|
32824
|
-
label: "Submitted"
|
|
32830
|
+
label: t("Submitted")
|
|
32825
32831
|
}, {
|
|
32826
32832
|
value: "private",
|
|
32827
|
-
label: "Private"
|
|
32833
|
+
label: t("Private")
|
|
32828
32834
|
}]
|
|
32829
32835
|
};
|
|
32830
32836
|
return _default;
|
|
@@ -32892,6 +32898,8 @@ const getColumns$6 = ({
|
|
|
32892
32898
|
title: t('ID'),
|
|
32893
32899
|
ellipsis: true,
|
|
32894
32900
|
show: true,
|
|
32901
|
+
key: "datastakeId",
|
|
32902
|
+
sorter: () => 0 + 0,
|
|
32895
32903
|
render: (v, all) => {
|
|
32896
32904
|
if (all.empty) {
|
|
32897
32905
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32908,6 +32916,8 @@ const getColumns$6 = ({
|
|
|
32908
32916
|
title: t('Name'),
|
|
32909
32917
|
ellipsis: true,
|
|
32910
32918
|
show: true,
|
|
32919
|
+
key: "name",
|
|
32920
|
+
sorter: () => 0 + 0,
|
|
32911
32921
|
render: (v, all) => {
|
|
32912
32922
|
if (all.empty) {
|
|
32913
32923
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -32955,7 +32965,7 @@ const getColumns$6 = ({
|
|
|
32955
32965
|
}
|
|
32956
32966
|
}, {
|
|
32957
32967
|
dataIndex: 'category',
|
|
32958
|
-
title: t('
|
|
32968
|
+
title: t('type'),
|
|
32959
32969
|
ellipsis: true,
|
|
32960
32970
|
show: true,
|
|
32961
32971
|
render: (v, all) => {
|
|
@@ -33528,6 +33538,12 @@ const TablePage = ({
|
|
|
33528
33538
|
breadcrumbs = [],
|
|
33529
33539
|
onDownload
|
|
33530
33540
|
}) => {
|
|
33541
|
+
const _options = React.useMemo(() => {
|
|
33542
|
+
return {
|
|
33543
|
+
...options,
|
|
33544
|
+
...data?.options
|
|
33545
|
+
};
|
|
33546
|
+
}, [options, data?.options]);
|
|
33531
33547
|
const {
|
|
33532
33548
|
activeTab,
|
|
33533
33549
|
selectOptions,
|
|
@@ -33543,7 +33559,7 @@ const TablePage = ({
|
|
|
33543
33559
|
location,
|
|
33544
33560
|
getData,
|
|
33545
33561
|
extendingFilters,
|
|
33546
|
-
options,
|
|
33562
|
+
options: _options,
|
|
33547
33563
|
t,
|
|
33548
33564
|
goTo,
|
|
33549
33565
|
user,
|
|
@@ -35083,23 +35099,27 @@ const checkboxConfig = {
|
|
|
35083
35099
|
name: "Name",
|
|
35084
35100
|
datastakeId: "ID"
|
|
35085
35101
|
};
|
|
35086
|
-
const
|
|
35087
|
-
|
|
35088
|
-
|
|
35089
|
-
|
|
35090
|
-
|
|
35091
|
-
|
|
35092
|
-
|
|
35093
|
-
|
|
35094
|
-
|
|
35095
|
-
|
|
35096
|
-
|
|
35097
|
-
|
|
35098
|
-
|
|
35099
|
-
}, {
|
|
35100
|
-
|
|
35101
|
-
|
|
35102
|
-
}
|
|
35102
|
+
const getPartnerTypes = t => {
|
|
35103
|
+
return [{
|
|
35104
|
+
label: t("Individual"),
|
|
35105
|
+
value: "individual"
|
|
35106
|
+
}, {
|
|
35107
|
+
label: t("Organisation"),
|
|
35108
|
+
value: "organisation"
|
|
35109
|
+
}];
|
|
35110
|
+
};
|
|
35111
|
+
const getPartnershipTypes = t => {
|
|
35112
|
+
return [{
|
|
35113
|
+
label: t("Source"),
|
|
35114
|
+
value: "source"
|
|
35115
|
+
}, {
|
|
35116
|
+
label: t("Client"),
|
|
35117
|
+
value: "client"
|
|
35118
|
+
}, {
|
|
35119
|
+
label: t("Exchange"),
|
|
35120
|
+
value: "exchange"
|
|
35121
|
+
}];
|
|
35122
|
+
};
|
|
35103
35123
|
|
|
35104
35124
|
const getColumns$2 = ({
|
|
35105
35125
|
t,
|
|
@@ -35152,6 +35172,7 @@ const getColumns$2 = ({
|
|
|
35152
35172
|
className: "daf-default-cell"
|
|
35153
35173
|
});
|
|
35154
35174
|
}
|
|
35175
|
+
const partnershipTypes = getPartnershipTypes(t);
|
|
35155
35176
|
return partnershipTypes.find(v => v.value === val)?.label || val || "-";
|
|
35156
35177
|
}
|
|
35157
35178
|
}, {
|
|
@@ -35168,6 +35189,7 @@ const getColumns$2 = ({
|
|
|
35168
35189
|
className: "daf-default-cell"
|
|
35169
35190
|
});
|
|
35170
35191
|
}
|
|
35192
|
+
const partnerTypes = getPartnerTypes(t);
|
|
35171
35193
|
return partnerTypes.find(v => v.value === val)?.label || val || "-";
|
|
35172
35194
|
}
|
|
35173
35195
|
}, {
|
|
@@ -35473,6 +35495,8 @@ const Create = ({
|
|
|
35473
35495
|
getAppHeader = () => {},
|
|
35474
35496
|
getApiBaseUrl = () => {}
|
|
35475
35497
|
}) => {
|
|
35498
|
+
const partnerTypes = React.useMemo(() => getPartnerTypes(t), [t]);
|
|
35499
|
+
const partnershipTypes = React.useMemo(() => getPartnershipTypes(t), [t]);
|
|
35476
35500
|
const form = React.useMemo(() => ({
|
|
35477
35501
|
identification: {
|
|
35478
35502
|
partnershipType: {
|
|
@@ -35679,6 +35703,8 @@ const Edit = ({
|
|
|
35679
35703
|
}) => {
|
|
35680
35704
|
const [MainForm] = antd.Form.useForm();
|
|
35681
35705
|
const [loading, setLoading] = React.useState(false);
|
|
35706
|
+
React.useMemo(() => getPartnerTypes(t), [t]);
|
|
35707
|
+
const partnershipTypes = React.useMemo(() => getPartnershipTypes(t), [t]);
|
|
35682
35708
|
React.useEffect(() => {
|
|
35683
35709
|
MainForm.setFieldsValue({
|
|
35684
35710
|
...partner,
|
|
@@ -36263,7 +36289,7 @@ const getKeyIndicatorConfig = ({
|
|
|
36263
36289
|
}
|
|
36264
36290
|
}];
|
|
36265
36291
|
|
|
36266
|
-
const KeyInformation$
|
|
36292
|
+
const KeyInformation$2 = ({
|
|
36267
36293
|
options = {},
|
|
36268
36294
|
selectedPartners = {},
|
|
36269
36295
|
t = () => {},
|
|
@@ -37235,6 +37261,9 @@ const TradeRelationships = ({
|
|
|
37235
37261
|
operatorData,
|
|
37236
37262
|
APP
|
|
37237
37263
|
});
|
|
37264
|
+
console.log({
|
|
37265
|
+
graphData
|
|
37266
|
+
});
|
|
37238
37267
|
React.useEffect(() => {
|
|
37239
37268
|
const defaultProduct = filterConfig?.[0]?.options?.[0]?.value;
|
|
37240
37269
|
if (!filters.products && defaultProduct) {
|
|
@@ -37914,12 +37943,12 @@ const OperatorSummary = ({
|
|
|
37914
37943
|
});
|
|
37915
37944
|
return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
|
|
37916
37945
|
header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
|
|
37917
|
-
title: hasSelect ? t("Operator Review") :
|
|
37946
|
+
title: hasSelect ? t("Operator Review") : `${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`,
|
|
37918
37947
|
className: "with-border-header h-w-btn-header no-px-body",
|
|
37919
37948
|
goBackTo: !hasSelect && goBack,
|
|
37920
37949
|
breadcrumbs: breadcrumbs,
|
|
37921
37950
|
addedHeaderFirst: true,
|
|
37922
|
-
actionButtons: [{
|
|
37951
|
+
actionButtons: hasSelect ? [] : [{
|
|
37923
37952
|
tooltip: t("Details"),
|
|
37924
37953
|
icon: "FileEdit",
|
|
37925
37954
|
onClick: () => {
|
|
@@ -37933,9 +37962,6 @@ const OperatorSummary = ({
|
|
|
37933
37962
|
}],
|
|
37934
37963
|
addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37935
37964
|
className: "flex flex-row gap-4",
|
|
37936
|
-
style: {
|
|
37937
|
-
marginRight: 8
|
|
37938
|
-
},
|
|
37939
37965
|
children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
37940
37966
|
options: [...sourceOptions],
|
|
37941
37967
|
isAvatarGroup: true,
|
|
@@ -37951,7 +37977,10 @@ const OperatorSummary = ({
|
|
|
37951
37977
|
dropDownWidth: 200,
|
|
37952
37978
|
defaultSelected: (partners || []).map(p => p.id) || []
|
|
37953
37979
|
}, partners?.length)
|
|
37954
|
-
})
|
|
37980
|
+
}),
|
|
37981
|
+
onDownload: () => {
|
|
37982
|
+
console.log("onDownload");
|
|
37983
|
+
}
|
|
37955
37984
|
}),
|
|
37956
37985
|
children: [hasSelect && /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
37957
37986
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
@@ -37972,7 +38001,7 @@ const OperatorSummary = ({
|
|
|
37972
38001
|
size: "small"
|
|
37973
38002
|
}) : null
|
|
37974
38003
|
})
|
|
37975
|
-
}), /*#__PURE__*/jsxRuntime.jsx(KeyInformation$
|
|
38004
|
+
}), /*#__PURE__*/jsxRuntime.jsx(KeyInformation$2, {
|
|
37976
38005
|
options: options,
|
|
37977
38006
|
selectedPartners: selectedPartners,
|
|
37978
38007
|
t: t,
|
|
@@ -42091,6 +42120,63 @@ const renderNumber = (val, doubleDigit = false) => {
|
|
|
42091
42120
|
return _string;
|
|
42092
42121
|
};
|
|
42093
42122
|
|
|
42123
|
+
/**
|
|
42124
|
+
* Calculates stat change object for StatCard component based on current and previous values
|
|
42125
|
+
* @param {Object} data - Object with current and previous values
|
|
42126
|
+
* @param {number} data.current - Current value
|
|
42127
|
+
* @param {number} data.previous - Previous value
|
|
42128
|
+
* @param {Object} options - Optional configuration
|
|
42129
|
+
* @param {string} options.tooltipText - Custom tooltip text
|
|
42130
|
+
* @param {string} options.format - Format type: 'percentage' (default) or 'absolute'
|
|
42131
|
+
* @param {number} options.decimalPlaces - Number of decimal places for percentage (default: 1)
|
|
42132
|
+
* @returns {Object|null} Change object for StatCard or null if data is invalid
|
|
42133
|
+
*/
|
|
42134
|
+
const calculateStatChange = (data, options = {}) => {
|
|
42135
|
+
if (!data || typeof data !== 'object') {
|
|
42136
|
+
return null;
|
|
42137
|
+
}
|
|
42138
|
+
const {
|
|
42139
|
+
current,
|
|
42140
|
+
previous
|
|
42141
|
+
} = data;
|
|
42142
|
+
|
|
42143
|
+
// Validate that both values are numbers
|
|
42144
|
+
if (typeof current !== 'number' || typeof previous !== 'number') {
|
|
42145
|
+
return null;
|
|
42146
|
+
}
|
|
42147
|
+
|
|
42148
|
+
// If previous is 0, we can't calculate percentage change
|
|
42149
|
+
if (previous === 0) {
|
|
42150
|
+
return null;
|
|
42151
|
+
}
|
|
42152
|
+
const {
|
|
42153
|
+
tooltipText,
|
|
42154
|
+
format = 'percentage',
|
|
42155
|
+
decimalPlaces = 1
|
|
42156
|
+
} = options;
|
|
42157
|
+
|
|
42158
|
+
// Calculate the difference
|
|
42159
|
+
const difference = current - previous;
|
|
42160
|
+
const isPositive = difference >= 0;
|
|
42161
|
+
const direction = isPositive ? 'up' : 'down';
|
|
42162
|
+
|
|
42163
|
+
// Format the value
|
|
42164
|
+
let value;
|
|
42165
|
+
if (format === 'absolute') {
|
|
42166
|
+
// Show absolute difference
|
|
42167
|
+
value = Math.abs(difference).toLocaleString();
|
|
42168
|
+
} else {
|
|
42169
|
+
// Show percentage change
|
|
42170
|
+
const percentageChange = Math.abs(difference) / previous * 100;
|
|
42171
|
+
value = `${percentageChange.toFixed(decimalPlaces)}%`;
|
|
42172
|
+
}
|
|
42173
|
+
return {
|
|
42174
|
+
value,
|
|
42175
|
+
direction,
|
|
42176
|
+
tooltipText: tooltipText || undefined
|
|
42177
|
+
};
|
|
42178
|
+
};
|
|
42179
|
+
|
|
42094
42180
|
styled__default["default"].div`
|
|
42095
42181
|
height: 333px;
|
|
42096
42182
|
width: calc(100% - 48px);
|
|
@@ -43245,7 +43331,7 @@ styled__default["default"].div`
|
|
|
43245
43331
|
flex: 1;
|
|
43246
43332
|
`;
|
|
43247
43333
|
|
|
43248
|
-
const getKeyIndicatorsRowConfig$
|
|
43334
|
+
const getKeyIndicatorsRowConfig$2 = ({
|
|
43249
43335
|
t,
|
|
43250
43336
|
data = {}
|
|
43251
43337
|
}) => [{
|
|
@@ -43904,7 +43990,7 @@ const RestorationActivitySummary = ({
|
|
|
43904
43990
|
loading,
|
|
43905
43991
|
t = () => {}
|
|
43906
43992
|
}) => {
|
|
43907
|
-
const keyIndicatorsConfig = React.useMemo(() => getKeyIndicatorsRowConfig$
|
|
43993
|
+
const keyIndicatorsConfig = React.useMemo(() => getKeyIndicatorsRowConfig$2({
|
|
43908
43994
|
t,
|
|
43909
43995
|
data: activityData
|
|
43910
43996
|
}), [t, activityData]);
|
|
@@ -44114,63 +44200,6 @@ const PlantingLocations = ({
|
|
|
44114
44200
|
});
|
|
44115
44201
|
};
|
|
44116
44202
|
|
|
44117
|
-
/**
|
|
44118
|
-
* Calculates stat change object for StatCard component based on current and previous values
|
|
44119
|
-
* @param {Object} data - Object with current and previous values
|
|
44120
|
-
* @param {number} data.current - Current value
|
|
44121
|
-
* @param {number} data.previous - Previous value
|
|
44122
|
-
* @param {Object} options - Optional configuration
|
|
44123
|
-
* @param {string} options.tooltipText - Custom tooltip text
|
|
44124
|
-
* @param {string} options.format - Format type: 'percentage' (default) or 'absolute'
|
|
44125
|
-
* @param {number} options.decimalPlaces - Number of decimal places for percentage (default: 1)
|
|
44126
|
-
* @returns {Object|null} Change object for StatCard or null if data is invalid
|
|
44127
|
-
*/
|
|
44128
|
-
const calculateStatChange = (data, options = {}) => {
|
|
44129
|
-
if (!data || typeof data !== 'object') {
|
|
44130
|
-
return null;
|
|
44131
|
-
}
|
|
44132
|
-
const {
|
|
44133
|
-
current,
|
|
44134
|
-
previous
|
|
44135
|
-
} = data;
|
|
44136
|
-
|
|
44137
|
-
// Validate that both values are numbers
|
|
44138
|
-
if (typeof current !== 'number' || typeof previous !== 'number') {
|
|
44139
|
-
return null;
|
|
44140
|
-
}
|
|
44141
|
-
|
|
44142
|
-
// If previous is 0, we can't calculate percentage change
|
|
44143
|
-
if (previous === 0) {
|
|
44144
|
-
return null;
|
|
44145
|
-
}
|
|
44146
|
-
const {
|
|
44147
|
-
tooltipText,
|
|
44148
|
-
format = 'percentage',
|
|
44149
|
-
decimalPlaces = 1
|
|
44150
|
-
} = options;
|
|
44151
|
-
|
|
44152
|
-
// Calculate the difference
|
|
44153
|
-
const difference = current - previous;
|
|
44154
|
-
const isPositive = difference >= 0;
|
|
44155
|
-
const direction = isPositive ? 'up' : 'down';
|
|
44156
|
-
|
|
44157
|
-
// Format the value
|
|
44158
|
-
let value;
|
|
44159
|
-
if (format === 'absolute') {
|
|
44160
|
-
// Show absolute difference
|
|
44161
|
-
value = Math.abs(difference).toLocaleString();
|
|
44162
|
-
} else {
|
|
44163
|
-
// Show percentage change
|
|
44164
|
-
const percentageChange = Math.abs(difference) / previous * 100;
|
|
44165
|
-
value = `${percentageChange.toFixed(decimalPlaces)}%`;
|
|
44166
|
-
}
|
|
44167
|
-
return {
|
|
44168
|
-
value,
|
|
44169
|
-
direction,
|
|
44170
|
-
tooltipText: tooltipText || undefined
|
|
44171
|
-
};
|
|
44172
|
-
};
|
|
44173
|
-
|
|
44174
44203
|
/**
|
|
44175
44204
|
* Formats a date based on the time filter
|
|
44176
44205
|
* @param {dayjs.Dayjs} date - The date to format
|
|
@@ -46528,7 +46557,7 @@ const AssociatedInformation = ({
|
|
|
46528
46557
|
});
|
|
46529
46558
|
};
|
|
46530
46559
|
|
|
46531
|
-
const getKeyIndicatorsRowConfig = ({
|
|
46560
|
+
const getKeyIndicatorsRowConfig$1 = ({
|
|
46532
46561
|
t,
|
|
46533
46562
|
data = {}
|
|
46534
46563
|
}) => [{
|
|
@@ -46568,7 +46597,7 @@ const getKeyIndicatorsRowConfig = ({
|
|
|
46568
46597
|
}
|
|
46569
46598
|
}];
|
|
46570
46599
|
|
|
46571
|
-
const KeyInformation = ({
|
|
46600
|
+
const KeyInformation$1 = ({
|
|
46572
46601
|
id,
|
|
46573
46602
|
t = () => {},
|
|
46574
46603
|
getSummaryDetail,
|
|
@@ -46602,7 +46631,7 @@ const KeyInformation = ({
|
|
|
46602
46631
|
config: defaultConfig,
|
|
46603
46632
|
getData: customGetData
|
|
46604
46633
|
});
|
|
46605
|
-
const keyIndicatorsConfig = React.useMemo(() => getKeyIndicatorsRowConfig({
|
|
46634
|
+
const keyIndicatorsConfig = React.useMemo(() => getKeyIndicatorsRowConfig$1({
|
|
46606
46635
|
t,
|
|
46607
46636
|
data: keyInformationData
|
|
46608
46637
|
}), [t, keyInformationData]);
|
|
@@ -46637,7 +46666,7 @@ const PlantingCycleSummary = ({
|
|
|
46637
46666
|
goBackTo: header?.goBackTo,
|
|
46638
46667
|
loading: header?.loading
|
|
46639
46668
|
}),
|
|
46640
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(KeyInformation, {
|
|
46669
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(KeyInformation$1, {
|
|
46641
46670
|
id: id,
|
|
46642
46671
|
t: t,
|
|
46643
46672
|
getSummaryDetail: getSummaryDetail,
|
|
@@ -46674,6 +46703,786 @@ const PlantingCycleSummary = ({
|
|
|
46674
46703
|
});
|
|
46675
46704
|
};
|
|
46676
46705
|
|
|
46706
|
+
const getKeyIndicatorsRowConfig = ({
|
|
46707
|
+
t,
|
|
46708
|
+
data = {}
|
|
46709
|
+
}) => [{
|
|
46710
|
+
label: t('Region'),
|
|
46711
|
+
render: () => {
|
|
46712
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46713
|
+
children: data?.region || '-'
|
|
46714
|
+
});
|
|
46715
|
+
}
|
|
46716
|
+
}, {
|
|
46717
|
+
label: t('Associated Plots'),
|
|
46718
|
+
render: () => {
|
|
46719
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46720
|
+
children: data?.associatedPlotsCount || '0'
|
|
46721
|
+
});
|
|
46722
|
+
}
|
|
46723
|
+
}, {
|
|
46724
|
+
label: t('Implementation Partners'),
|
|
46725
|
+
render: () => {
|
|
46726
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46727
|
+
children: data?.partnersCount || '0'
|
|
46728
|
+
});
|
|
46729
|
+
}
|
|
46730
|
+
}, {
|
|
46731
|
+
label: t('Total Activities'),
|
|
46732
|
+
render: () => {
|
|
46733
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46734
|
+
children: data?.activitiesCount || '0'
|
|
46735
|
+
});
|
|
46736
|
+
}
|
|
46737
|
+
}, {
|
|
46738
|
+
label: t('Information Sources'),
|
|
46739
|
+
render: () => {
|
|
46740
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46741
|
+
children: data?.informationSourcesCount || '0'
|
|
46742
|
+
});
|
|
46743
|
+
}
|
|
46744
|
+
}];
|
|
46745
|
+
|
|
46746
|
+
const KeyInformation = ({
|
|
46747
|
+
id,
|
|
46748
|
+
t = () => {},
|
|
46749
|
+
getSummaryDetail,
|
|
46750
|
+
loading = false
|
|
46751
|
+
}) => {
|
|
46752
|
+
const defaultConfig = React.useMemo(() => ({
|
|
46753
|
+
basepath: "events/monitoring-campaign",
|
|
46754
|
+
url: `/summary/${id}/key-information`,
|
|
46755
|
+
stop: !id
|
|
46756
|
+
}), [id]);
|
|
46757
|
+
const customGetData = React.useMemo(() => {
|
|
46758
|
+
if (getSummaryDetail && id) {
|
|
46759
|
+
return ({
|
|
46760
|
+
url,
|
|
46761
|
+
params = {}
|
|
46762
|
+
}) => {
|
|
46763
|
+
const match = url.match(/\/summary\/[^/]+\/(.+)/);
|
|
46764
|
+
if (match) {
|
|
46765
|
+
const [, type] = match;
|
|
46766
|
+
return getSummaryDetail(id, type, params);
|
|
46767
|
+
}
|
|
46768
|
+
throw new Error(`Invalid URL format: ${url}`);
|
|
46769
|
+
};
|
|
46770
|
+
}
|
|
46771
|
+
return undefined;
|
|
46772
|
+
}, [getSummaryDetail, id]);
|
|
46773
|
+
const {
|
|
46774
|
+
loading: keyInformationLoading,
|
|
46775
|
+
data: keyInformationData
|
|
46776
|
+
} = useWidgetFetch({
|
|
46777
|
+
config: defaultConfig,
|
|
46778
|
+
getData: customGetData
|
|
46779
|
+
});
|
|
46780
|
+
const keyIndicatorsConfig = React.useMemo(() => getKeyIndicatorsRowConfig({
|
|
46781
|
+
t,
|
|
46782
|
+
data: keyInformationData
|
|
46783
|
+
}), [t, keyInformationData]);
|
|
46784
|
+
return /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
46785
|
+
children: /*#__PURE__*/jsxRuntime.jsx(KeyIndicatorsWidget, {
|
|
46786
|
+
title: t("Key Information"),
|
|
46787
|
+
config: keyIndicatorsConfig,
|
|
46788
|
+
loading: loading || keyInformationLoading
|
|
46789
|
+
})
|
|
46790
|
+
});
|
|
46791
|
+
};
|
|
46792
|
+
|
|
46793
|
+
const VISITS_TAB = "visits";
|
|
46794
|
+
const GROWTH_AND_SURVIVAL_TAB = "growthAndSurvival";
|
|
46795
|
+
const FAUNA_SIGHTINGS_TAB = "faunaSightings";
|
|
46796
|
+
const INVASIVE_SPECIES_TAB = "invasiveSpecies";
|
|
46797
|
+
const SYMPTOM_HOTSPOTS_TAB = "symptomHotspots";
|
|
46798
|
+
const SOIL_TAB = "soil";
|
|
46799
|
+
const MonitoringScopeAndFindings = ({
|
|
46800
|
+
id,
|
|
46801
|
+
getSummaryDetail,
|
|
46802
|
+
loading = false,
|
|
46803
|
+
t = s => s
|
|
46804
|
+
}) => {
|
|
46805
|
+
const [activeTab, setActiveTab] = React.useState(VISITS_TAB);
|
|
46806
|
+
const defaultConfig = React.useMemo(() => ({
|
|
46807
|
+
basepath: "events/monitoring-campaign",
|
|
46808
|
+
url: `/summary/${id}/monitoring-scope`,
|
|
46809
|
+
stop: !id
|
|
46810
|
+
}), [id]);
|
|
46811
|
+
const customGetData = React.useMemo(() => {
|
|
46812
|
+
if (getSummaryDetail && id) {
|
|
46813
|
+
return ({
|
|
46814
|
+
url,
|
|
46815
|
+
params = {}
|
|
46816
|
+
}) => {
|
|
46817
|
+
const match = url.match(/\/summary\/[^/]+\/(.+)/);
|
|
46818
|
+
if (match) {
|
|
46819
|
+
const [, type] = match;
|
|
46820
|
+
return getSummaryDetail(id, type, {
|
|
46821
|
+
...params,
|
|
46822
|
+
tab: activeTab
|
|
46823
|
+
});
|
|
46824
|
+
}
|
|
46825
|
+
throw new Error(`Invalid URL format: ${url}`);
|
|
46826
|
+
};
|
|
46827
|
+
}
|
|
46828
|
+
return undefined;
|
|
46829
|
+
}, [getSummaryDetail, id, activeTab]);
|
|
46830
|
+
const {
|
|
46831
|
+
loading: monitoringScopeLoading,
|
|
46832
|
+
data: monitoringScopeData
|
|
46833
|
+
} = useWidgetFetch({
|
|
46834
|
+
config: defaultConfig,
|
|
46835
|
+
getData: customGetData
|
|
46836
|
+
});
|
|
46837
|
+
const filtersConfig = React.useMemo(() => {
|
|
46838
|
+
switch (activeTab) {
|
|
46839
|
+
case GROWTH_AND_SURVIVAL_TAB:
|
|
46840
|
+
return [{
|
|
46841
|
+
label: t("Mangrove Survival Rate"),
|
|
46842
|
+
placeholder: t("Select"),
|
|
46843
|
+
key: "mangroveSurvivalRate",
|
|
46844
|
+
type: "slider"
|
|
46845
|
+
}, {
|
|
46846
|
+
label: t("Planting Density"),
|
|
46847
|
+
placeholder: t("Select"),
|
|
46848
|
+
key: "plantingDensity",
|
|
46849
|
+
type: "select"
|
|
46850
|
+
}];
|
|
46851
|
+
case FAUNA_SIGHTINGS_TAB:
|
|
46852
|
+
return [{
|
|
46853
|
+
label: t("Fauna Observed"),
|
|
46854
|
+
placeholder: t("Select"),
|
|
46855
|
+
key: "faunaSightings",
|
|
46856
|
+
type: "select",
|
|
46857
|
+
options: [{
|
|
46858
|
+
label: t("Birds"),
|
|
46859
|
+
value: "birds"
|
|
46860
|
+
}, {
|
|
46861
|
+
label: t("Crabs"),
|
|
46862
|
+
value: "crabs"
|
|
46863
|
+
}, {
|
|
46864
|
+
label: t("Fish"),
|
|
46865
|
+
value: "fish"
|
|
46866
|
+
}, {
|
|
46867
|
+
label: t("Molluscs"),
|
|
46868
|
+
value: "molluscs"
|
|
46869
|
+
}, {
|
|
46870
|
+
label: t("Oysters"),
|
|
46871
|
+
value: "oysters"
|
|
46872
|
+
}]
|
|
46873
|
+
}];
|
|
46874
|
+
case INVASIVE_SPECIES_TAB:
|
|
46875
|
+
return [{
|
|
46876
|
+
label: t("Fauna Observed"),
|
|
46877
|
+
placeholder: t("Select"),
|
|
46878
|
+
key: "invasiveSpecies",
|
|
46879
|
+
type: "select",
|
|
46880
|
+
options: [{
|
|
46881
|
+
label: t("Spiders"),
|
|
46882
|
+
value: "spiders"
|
|
46883
|
+
}, {
|
|
46884
|
+
label: t("Scale insects"),
|
|
46885
|
+
value: "scaleInsects"
|
|
46886
|
+
}, {
|
|
46887
|
+
label: t("Caterpillars"),
|
|
46888
|
+
value: "caterpillars"
|
|
46889
|
+
}, {
|
|
46890
|
+
label: t("Unidentified pests"),
|
|
46891
|
+
value: "unidentifiedPests"
|
|
46892
|
+
}, {
|
|
46893
|
+
label: t("Other"),
|
|
46894
|
+
value: "other"
|
|
46895
|
+
}]
|
|
46896
|
+
}];
|
|
46897
|
+
case SYMPTOM_HOTSPOTS_TAB:
|
|
46898
|
+
return [{
|
|
46899
|
+
label: t("Symptom Hotspots"),
|
|
46900
|
+
placeholder: t("Select"),
|
|
46901
|
+
key: "symptomHotspots",
|
|
46902
|
+
type: "select",
|
|
46903
|
+
options: [{
|
|
46904
|
+
label: t("Reddish spots on leaves"),
|
|
46905
|
+
value: "reddishSpotsOnLeaves"
|
|
46906
|
+
}, {
|
|
46907
|
+
label: t("Black spots on leaves"),
|
|
46908
|
+
value: "blackSpotsOnLeaves"
|
|
46909
|
+
}, {
|
|
46910
|
+
label: t("Yellowing of leaves"),
|
|
46911
|
+
value: "yellowingOfLeaves"
|
|
46912
|
+
}, {
|
|
46913
|
+
label: t("Presence of mosaic"),
|
|
46914
|
+
value: "presenceOfMosaic"
|
|
46915
|
+
}]
|
|
46916
|
+
}];
|
|
46917
|
+
case SOIL_TAB:
|
|
46918
|
+
return [{
|
|
46919
|
+
label: t("Soil"),
|
|
46920
|
+
placeholder: t("Select"),
|
|
46921
|
+
key: "soil",
|
|
46922
|
+
type: "select",
|
|
46923
|
+
options: [{
|
|
46924
|
+
label: t("Sandy"),
|
|
46925
|
+
value: "sandy"
|
|
46926
|
+
}, {
|
|
46927
|
+
label: t("Clay"),
|
|
46928
|
+
value: "clay"
|
|
46929
|
+
}, {
|
|
46930
|
+
label: t("Muddy"),
|
|
46931
|
+
value: "muddy"
|
|
46932
|
+
}, {
|
|
46933
|
+
label: t("Loamy"),
|
|
46934
|
+
value: "loamy"
|
|
46935
|
+
}, {
|
|
46936
|
+
label: t("Mixed"),
|
|
46937
|
+
value: "mixed"
|
|
46938
|
+
}]
|
|
46939
|
+
}];
|
|
46940
|
+
default:
|
|
46941
|
+
return [];
|
|
46942
|
+
}
|
|
46943
|
+
}, [activeTab, t]);
|
|
46944
|
+
const mappedData = React.useMemo(() => {
|
|
46945
|
+
if (!monitoringScopeData || !monitoringScopeData.plots) {
|
|
46946
|
+
return [];
|
|
46947
|
+
}
|
|
46948
|
+
const {
|
|
46949
|
+
plots = [],
|
|
46950
|
+
monitoringActivities = []
|
|
46951
|
+
} = monitoringScopeData;
|
|
46952
|
+
if (activeTab === VISITS_TAB) {
|
|
46953
|
+
return plots.map((plot, index) => {
|
|
46954
|
+
const area = plot?.perimeter ? plot.perimeter.map(coord => Array.isArray(coord) && coord.length >= 2 ? [coord[1], coord[0]] : coord) : null;
|
|
46955
|
+
const validArea = area && Array.isArray(area) && area.length >= 3 ? area : null;
|
|
46956
|
+
const matchingActivity = monitoringActivities?.find(activity => activity.plotId === plot.id || activity.plotId === plot._id);
|
|
46957
|
+
const gps = matchingActivity?.locationCheckArrival ? {
|
|
46958
|
+
latitude: matchingActivity.locationCheckArrival.latitude,
|
|
46959
|
+
longitude: matchingActivity.locationCheckArrival.longitude
|
|
46960
|
+
} : null;
|
|
46961
|
+
return {
|
|
46962
|
+
_id: plot._id || {},
|
|
46963
|
+
area: validArea,
|
|
46964
|
+
color: "#15FFFFB2",
|
|
46965
|
+
datastakeId: plot.datastakeId || `PLOT-${String(index + 1).padStart(9, '0')}`,
|
|
46966
|
+
gps: gps,
|
|
46967
|
+
id: plot.id || plot._id || `plot-${index}`,
|
|
46968
|
+
name: plot.name || t("Plot"),
|
|
46969
|
+
date: matchingActivity?.date,
|
|
46970
|
+
subTitle: matchingActivity?.date ? renderDateFormatted(matchingActivity.date, "DD MMM YY") : plot.name,
|
|
46971
|
+
plotName: plot.name,
|
|
46972
|
+
territoryTitle: plot.name,
|
|
46973
|
+
type: plot.type || 'Operational Plot',
|
|
46974
|
+
lastVisit: matchingActivity?.date,
|
|
46975
|
+
implementer: matchingActivity?.implementer,
|
|
46976
|
+
areaHa: plot.area
|
|
46977
|
+
};
|
|
46978
|
+
});
|
|
46979
|
+
}
|
|
46980
|
+
return plots.map((plot, index) => {
|
|
46981
|
+
const area = plot?.perimeter ? plot.perimeter.map(coord => Array.isArray(coord) && coord.length >= 2 ? [coord[1], coord[0]] : coord) : null;
|
|
46982
|
+
const validArea = area && Array.isArray(area) && area.length >= 3 ? area : null;
|
|
46983
|
+
return {
|
|
46984
|
+
_id: plot._id || {},
|
|
46985
|
+
area: validArea,
|
|
46986
|
+
color: "#15FFFFB2",
|
|
46987
|
+
datastakeId: plot.datastakeId || `PLOT-${String(index + 1).padStart(9, '0')}`,
|
|
46988
|
+
id: plot.id || plot._id || `plot-${index}`,
|
|
46989
|
+
name: plot.name || t("Plot"),
|
|
46990
|
+
plotName: plot.name,
|
|
46991
|
+
territoryTitle: plot.name,
|
|
46992
|
+
type: plot.type || 'Operational Plot'
|
|
46993
|
+
};
|
|
46994
|
+
});
|
|
46995
|
+
}, [monitoringScopeData, activeTab, t]);
|
|
46996
|
+
return /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
46997
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
46998
|
+
title: t("Monitoring Scope & Findings"),
|
|
46999
|
+
className: "v2-widget no-px no-p-body h-w-btn-header with-border-header",
|
|
47000
|
+
style: {
|
|
47001
|
+
height: '100%',
|
|
47002
|
+
display: 'flex',
|
|
47003
|
+
flexDirection: 'column'
|
|
47004
|
+
},
|
|
47005
|
+
tabsConfig: {
|
|
47006
|
+
tabs: [{
|
|
47007
|
+
label: t("Visits"),
|
|
47008
|
+
value: VISITS_TAB
|
|
47009
|
+
}, {
|
|
47010
|
+
label: t("Growth & Survival"),
|
|
47011
|
+
value: GROWTH_AND_SURVIVAL_TAB
|
|
47012
|
+
}, {
|
|
47013
|
+
label: t("Fauna Sightings"),
|
|
47014
|
+
value: FAUNA_SIGHTINGS_TAB
|
|
47015
|
+
}, {
|
|
47016
|
+
label: t("Invasive Species"),
|
|
47017
|
+
value: INVASIVE_SPECIES_TAB
|
|
47018
|
+
}, {
|
|
47019
|
+
label: t("Symptom Hotspots"),
|
|
47020
|
+
value: SYMPTOM_HOTSPOTS_TAB
|
|
47021
|
+
}, {
|
|
47022
|
+
label: t("Soil"),
|
|
47023
|
+
value: SOIL_TAB
|
|
47024
|
+
}],
|
|
47025
|
+
value: activeTab,
|
|
47026
|
+
onChange: setActiveTab
|
|
47027
|
+
},
|
|
47028
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Map$1, {
|
|
47029
|
+
data: mappedData,
|
|
47030
|
+
link: false,
|
|
47031
|
+
style: {
|
|
47032
|
+
height: '100%',
|
|
47033
|
+
width: '100%'
|
|
47034
|
+
},
|
|
47035
|
+
maxZoom: 18,
|
|
47036
|
+
isSatellite: true,
|
|
47037
|
+
onClickLink: () => {},
|
|
47038
|
+
onFilterChange: () => {},
|
|
47039
|
+
primaryLink: true,
|
|
47040
|
+
showSider: false,
|
|
47041
|
+
filtersConfig: filtersConfig,
|
|
47042
|
+
renderTooltipForLocation: data => {
|
|
47043
|
+
if (activeTab === VISITS_TAB && data.gps) {
|
|
47044
|
+
const coordinates = data.gps?.latitude && data.gps?.longitude ? convertDMS(data.gps.latitude, data.gps.longitude) : null;
|
|
47045
|
+
if (!coordinates) {
|
|
47046
|
+
return [];
|
|
47047
|
+
}
|
|
47048
|
+
const iconColor = "#016C6E";
|
|
47049
|
+
const tooltipItems = [{
|
|
47050
|
+
label: t("Coordinates"),
|
|
47051
|
+
value: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
47052
|
+
style: {
|
|
47053
|
+
display: 'flex',
|
|
47054
|
+
alignItems: 'center',
|
|
47055
|
+
gap: '6px',
|
|
47056
|
+
flexWrap: 'nowrap'
|
|
47057
|
+
},
|
|
47058
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
47059
|
+
style: {
|
|
47060
|
+
display: 'flex',
|
|
47061
|
+
alignItems: 'center'
|
|
47062
|
+
},
|
|
47063
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
47064
|
+
name: "SpacingHeight",
|
|
47065
|
+
width: 14,
|
|
47066
|
+
height: 14,
|
|
47067
|
+
color: iconColor
|
|
47068
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
47069
|
+
style: {
|
|
47070
|
+
fontWeight: 600,
|
|
47071
|
+
marginLeft: '4px'
|
|
47072
|
+
},
|
|
47073
|
+
children: coordinates[0]
|
|
47074
|
+
})]
|
|
47075
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
47076
|
+
style: {
|
|
47077
|
+
display: 'flex',
|
|
47078
|
+
alignItems: 'center'
|
|
47079
|
+
},
|
|
47080
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
47081
|
+
name: "SpacingWidth",
|
|
47082
|
+
width: 14,
|
|
47083
|
+
height: 14,
|
|
47084
|
+
color: iconColor
|
|
47085
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
47086
|
+
style: {
|
|
47087
|
+
fontWeight: 600,
|
|
47088
|
+
marginLeft: '4px'
|
|
47089
|
+
},
|
|
47090
|
+
children: coordinates[1]
|
|
47091
|
+
})]
|
|
47092
|
+
})]
|
|
47093
|
+
})
|
|
47094
|
+
}];
|
|
47095
|
+
if (data.date) {
|
|
47096
|
+
tooltipItems.push({
|
|
47097
|
+
label: t("Date"),
|
|
47098
|
+
value: renderDateFormatted(data.date, "DD MMM YY")
|
|
47099
|
+
});
|
|
47100
|
+
}
|
|
47101
|
+
if (data.implementer) {
|
|
47102
|
+
tooltipItems.push({
|
|
47103
|
+
label: t("Implementer"),
|
|
47104
|
+
value: data.implementer
|
|
47105
|
+
});
|
|
47106
|
+
}
|
|
47107
|
+
return tooltipItems;
|
|
47108
|
+
}
|
|
47109
|
+
return [];
|
|
47110
|
+
},
|
|
47111
|
+
renderTooltipForTerritory: data => {
|
|
47112
|
+
const items = [{
|
|
47113
|
+
label: t("Plot Name"),
|
|
47114
|
+
value: data.plotName || data.name || "--"
|
|
47115
|
+
}];
|
|
47116
|
+
if (activeTab === VISITS_TAB && data.lastVisit) {
|
|
47117
|
+
items.push({
|
|
47118
|
+
label: t("Last visit"),
|
|
47119
|
+
value: renderDateFormatted(data.lastVisit, "DD MMM YY")
|
|
47120
|
+
});
|
|
47121
|
+
}
|
|
47122
|
+
if (activeTab === VISITS_TAB && data.areaHa) {
|
|
47123
|
+
items.push({
|
|
47124
|
+
label: t("Area"),
|
|
47125
|
+
value: `${data.areaHa} ha`
|
|
47126
|
+
});
|
|
47127
|
+
}
|
|
47128
|
+
return items;
|
|
47129
|
+
},
|
|
47130
|
+
renderTooltipTags: () => {},
|
|
47131
|
+
type: "location-territory",
|
|
47132
|
+
loading: loading || monitoringScopeLoading
|
|
47133
|
+
})
|
|
47134
|
+
})
|
|
47135
|
+
});
|
|
47136
|
+
};
|
|
47137
|
+
|
|
47138
|
+
const COLORS$1 = ['#016C6E', '#F5C2AC', '#F0A888', '#DF571E', '#C04B19', '#9B3D14', '#7A2F0F'];
|
|
47139
|
+
const VegetationHealth = ({
|
|
47140
|
+
vegetationHealthChart,
|
|
47141
|
+
t = s => s
|
|
47142
|
+
}) => {
|
|
47143
|
+
const pieData = React.useMemo(() => {
|
|
47144
|
+
const data = vegetationHealthChart || [];
|
|
47145
|
+
const total = data.reduce((sum, item) => sum + (Number(item?.value) || 0), 0);
|
|
47146
|
+
return data.map((item, index) => ({
|
|
47147
|
+
value: Number(item?.value) || 0,
|
|
47148
|
+
percent: total > 0 ? (Number(item?.value) || 0) / total : 0,
|
|
47149
|
+
color: COLORS$1[index % COLORS$1.length],
|
|
47150
|
+
label: item?.type || '',
|
|
47151
|
+
key: item?.type || `item-${index}`
|
|
47152
|
+
}));
|
|
47153
|
+
}, [vegetationHealthChart]);
|
|
47154
|
+
const isEmpty = React.useMemo(() => {
|
|
47155
|
+
return !vegetationHealthChart || vegetationHealthChart.length === 0 || vegetationHealthChart.every(item => !item?.value || Number(item.value) === 0);
|
|
47156
|
+
}, [vegetationHealthChart]);
|
|
47157
|
+
const getTooltipChildren = React.useCallback(item => {
|
|
47158
|
+
if (isEmpty) {
|
|
47159
|
+
return null;
|
|
47160
|
+
}
|
|
47161
|
+
return renderTooltipJsx({
|
|
47162
|
+
title: t("Vegetation Health"),
|
|
47163
|
+
items: [{
|
|
47164
|
+
color: item.color,
|
|
47165
|
+
label: item.label || '',
|
|
47166
|
+
value: `${item.value || 0}%`
|
|
47167
|
+
}]
|
|
47168
|
+
});
|
|
47169
|
+
}, [t, isEmpty]);
|
|
47170
|
+
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
47171
|
+
title: t("Vegetation Health"),
|
|
47172
|
+
className: "with-border-header h-w-btn-header",
|
|
47173
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47174
|
+
className: "flex flex-1 flex-column justify-content-center",
|
|
47175
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47176
|
+
className: "flex justify-content-center w-full",
|
|
47177
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Chart, {
|
|
47178
|
+
data: pieData,
|
|
47179
|
+
isPie: true,
|
|
47180
|
+
isEmpty: isEmpty,
|
|
47181
|
+
getTooltipChildren: getTooltipChildren,
|
|
47182
|
+
mouseXOffset: 10,
|
|
47183
|
+
mouseYOffset: 10,
|
|
47184
|
+
changeOpacityOnHover: false,
|
|
47185
|
+
doConstraints: false
|
|
47186
|
+
})
|
|
47187
|
+
})
|
|
47188
|
+
})
|
|
47189
|
+
});
|
|
47190
|
+
};
|
|
47191
|
+
|
|
47192
|
+
const SeedlingsHeight = ({
|
|
47193
|
+
seedlingsHeightChart,
|
|
47194
|
+
t = s => s
|
|
47195
|
+
}) => {
|
|
47196
|
+
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
47197
|
+
title: t("Seedlings Height"),
|
|
47198
|
+
className: "with-border-header h-w-btn-header",
|
|
47199
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47200
|
+
className: "flex flex-1 flex-column justify-content-center",
|
|
47201
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47202
|
+
className: "flex justify-content-center w-full",
|
|
47203
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ColumnChart, {
|
|
47204
|
+
data: seedlingsHeightChart || [],
|
|
47205
|
+
xFieldKey: "label",
|
|
47206
|
+
yFieldKey: "value",
|
|
47207
|
+
animated: true,
|
|
47208
|
+
height: 200,
|
|
47209
|
+
color: "#016C6E",
|
|
47210
|
+
renderTooltipContent: (title, data) => {
|
|
47211
|
+
if (!data || data.length === 0) return {};
|
|
47212
|
+
const item = data[0]?.data || data[0];
|
|
47213
|
+
return {
|
|
47214
|
+
title: t("Seedlings Height"),
|
|
47215
|
+
subTitle: title,
|
|
47216
|
+
items: [{
|
|
47217
|
+
label: t("Count"),
|
|
47218
|
+
value: item?.value || 0
|
|
47219
|
+
}]
|
|
47220
|
+
};
|
|
47221
|
+
}
|
|
47222
|
+
})
|
|
47223
|
+
})
|
|
47224
|
+
})
|
|
47225
|
+
});
|
|
47226
|
+
};
|
|
47227
|
+
|
|
47228
|
+
const COLORS = ['#016C6E', '#F5C2AC', '#F0A888', '#DF571E', '#C04B19', '#9B3D14', '#7A2F0F'];
|
|
47229
|
+
const PlantedSpecies = ({
|
|
47230
|
+
plantedSpeciesChart,
|
|
47231
|
+
t = s => s
|
|
47232
|
+
}) => {
|
|
47233
|
+
const pieData = React.useMemo(() => {
|
|
47234
|
+
const data = plantedSpeciesChart || [];
|
|
47235
|
+
const total = data.reduce((sum, item) => sum + (Number(item?.value) || 0), 0);
|
|
47236
|
+
return data.map((item, index) => ({
|
|
47237
|
+
value: Number(item?.value) || 0,
|
|
47238
|
+
percent: total > 0 ? (Number(item?.value) || 0) / total : 0,
|
|
47239
|
+
color: COLORS[index % COLORS.length],
|
|
47240
|
+
label: item?.type || '',
|
|
47241
|
+
key: item?.type || `item-${index}`
|
|
47242
|
+
}));
|
|
47243
|
+
}, [plantedSpeciesChart]);
|
|
47244
|
+
const isEmpty = React.useMemo(() => {
|
|
47245
|
+
return !plantedSpeciesChart || plantedSpeciesChart.length === 0 || plantedSpeciesChart.every(item => !item?.value || Number(item.value) === 0);
|
|
47246
|
+
}, [plantedSpeciesChart]);
|
|
47247
|
+
const getTooltipChildren = React.useCallback(item => {
|
|
47248
|
+
if (isEmpty) {
|
|
47249
|
+
return null;
|
|
47250
|
+
}
|
|
47251
|
+
return renderTooltipJsx({
|
|
47252
|
+
title: t("Planted Species"),
|
|
47253
|
+
items: [{
|
|
47254
|
+
color: item.color,
|
|
47255
|
+
label: item.label || '',
|
|
47256
|
+
value: item.value || 0
|
|
47257
|
+
}]
|
|
47258
|
+
});
|
|
47259
|
+
}, [t, isEmpty]);
|
|
47260
|
+
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
47261
|
+
title: t("Planted Species"),
|
|
47262
|
+
className: "with-border-header h-w-btn-header",
|
|
47263
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47264
|
+
className: "flex flex-1 flex-column justify-content-center",
|
|
47265
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47266
|
+
className: "flex justify-content-center w-full",
|
|
47267
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Chart, {
|
|
47268
|
+
data: pieData,
|
|
47269
|
+
isPie: true,
|
|
47270
|
+
isEmpty: isEmpty,
|
|
47271
|
+
getTooltipChildren: getTooltipChildren,
|
|
47272
|
+
mouseXOffset: 10,
|
|
47273
|
+
mouseYOffset: 10,
|
|
47274
|
+
changeOpacityOnHover: false,
|
|
47275
|
+
doConstraints: false
|
|
47276
|
+
})
|
|
47277
|
+
})
|
|
47278
|
+
})
|
|
47279
|
+
});
|
|
47280
|
+
};
|
|
47281
|
+
|
|
47282
|
+
const Stats = ({
|
|
47283
|
+
survivalRate,
|
|
47284
|
+
averageHeight,
|
|
47285
|
+
averageDiameter,
|
|
47286
|
+
t = s => s
|
|
47287
|
+
}) => {
|
|
47288
|
+
const survivalRateChange = React.useMemo(() => {
|
|
47289
|
+
if (!survivalRate) return null;
|
|
47290
|
+
return calculateStatChange({
|
|
47291
|
+
current: Number(survivalRate.current) || 0,
|
|
47292
|
+
previous: Number(survivalRate.previous) || 0
|
|
47293
|
+
}, {
|
|
47294
|
+
tooltipText: t("In comparison to last period"),
|
|
47295
|
+
format: 'absolute'
|
|
47296
|
+
});
|
|
47297
|
+
}, [survivalRate, t]);
|
|
47298
|
+
const averageHeightChange = React.useMemo(() => {
|
|
47299
|
+
if (!averageHeight) return null;
|
|
47300
|
+
return calculateStatChange({
|
|
47301
|
+
current: Number(averageHeight.current) || 0,
|
|
47302
|
+
previous: Number(averageHeight.previous) || 0
|
|
47303
|
+
}, {
|
|
47304
|
+
tooltipText: t("In comparison to last period"),
|
|
47305
|
+
format: 'absolute'
|
|
47306
|
+
});
|
|
47307
|
+
}, [averageHeight, t]);
|
|
47308
|
+
const averageDiameterChange = React.useMemo(() => {
|
|
47309
|
+
if (!averageDiameter) return null;
|
|
47310
|
+
return calculateStatChange({
|
|
47311
|
+
current: Number(averageDiameter.current) || 0,
|
|
47312
|
+
previous: Number(averageDiameter.previous) || 0
|
|
47313
|
+
}, {
|
|
47314
|
+
tooltipText: t("In comparison to last period"),
|
|
47315
|
+
format: 'absolute'
|
|
47316
|
+
});
|
|
47317
|
+
}, [averageDiameter, t]);
|
|
47318
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
47319
|
+
style: {
|
|
47320
|
+
display: "flex",
|
|
47321
|
+
gap: "24px",
|
|
47322
|
+
marginBottom: "24px"
|
|
47323
|
+
},
|
|
47324
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47325
|
+
style: {
|
|
47326
|
+
flex: 1
|
|
47327
|
+
},
|
|
47328
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StatCard, {
|
|
47329
|
+
title: t("Survival Rate"),
|
|
47330
|
+
value: survivalRate ? Number(survivalRate.current).toLocaleString() : "0",
|
|
47331
|
+
icon: "EventCalendar",
|
|
47332
|
+
change: survivalRateChange
|
|
47333
|
+
})
|
|
47334
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47335
|
+
style: {
|
|
47336
|
+
flex: 1
|
|
47337
|
+
},
|
|
47338
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StatCard, {
|
|
47339
|
+
title: t("Average Height"),
|
|
47340
|
+
value: averageHeight ? Number(averageHeight.current).toLocaleString() + " cm" : "0 cm",
|
|
47341
|
+
icon: "ProjectLocation",
|
|
47342
|
+
change: averageHeightChange
|
|
47343
|
+
})
|
|
47344
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47345
|
+
style: {
|
|
47346
|
+
flex: 1
|
|
47347
|
+
},
|
|
47348
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StatCard, {
|
|
47349
|
+
title: t("Average Diameter"),
|
|
47350
|
+
value: averageDiameter ? Number(averageDiameter.current).toLocaleString() + " mm" : "0 mm",
|
|
47351
|
+
icon: "Activity",
|
|
47352
|
+
change: averageDiameterChange
|
|
47353
|
+
})
|
|
47354
|
+
})]
|
|
47355
|
+
});
|
|
47356
|
+
};
|
|
47357
|
+
|
|
47358
|
+
const MangroveGrowth = ({
|
|
47359
|
+
id,
|
|
47360
|
+
getSummaryDetail,
|
|
47361
|
+
loading = false,
|
|
47362
|
+
t = s => s
|
|
47363
|
+
}) => {
|
|
47364
|
+
const defaultConfig = React.useMemo(() => ({
|
|
47365
|
+
basepath: "events/monitoring-campaign",
|
|
47366
|
+
url: `/summary/${id}/outcomes`,
|
|
47367
|
+
stop: !id
|
|
47368
|
+
}), [id]);
|
|
47369
|
+
const customGetData = React.useMemo(() => {
|
|
47370
|
+
if (getSummaryDetail && id) {
|
|
47371
|
+
return ({
|
|
47372
|
+
url,
|
|
47373
|
+
params = {}
|
|
47374
|
+
}) => {
|
|
47375
|
+
const match = url.match(/\/summary\/[^/]+\/(.+)/);
|
|
47376
|
+
if (match) {
|
|
47377
|
+
const [, type] = match;
|
|
47378
|
+
return getSummaryDetail(id, type, params);
|
|
47379
|
+
}
|
|
47380
|
+
throw new Error(`Invalid URL format: ${url}`);
|
|
47381
|
+
};
|
|
47382
|
+
}
|
|
47383
|
+
return undefined;
|
|
47384
|
+
}, [getSummaryDetail, id]);
|
|
47385
|
+
const {
|
|
47386
|
+
loading: outcomesLoading,
|
|
47387
|
+
data: outcomesData
|
|
47388
|
+
} = useWidgetFetch({
|
|
47389
|
+
config: defaultConfig,
|
|
47390
|
+
getData: customGetData
|
|
47391
|
+
});
|
|
47392
|
+
const {
|
|
47393
|
+
survivalRate,
|
|
47394
|
+
averageHeight,
|
|
47395
|
+
averageDiameter,
|
|
47396
|
+
vegetationHealthChart,
|
|
47397
|
+
seedlingsHeightChart,
|
|
47398
|
+
plantedSpeciesChart
|
|
47399
|
+
} = outcomesData || {};
|
|
47400
|
+
return /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47401
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Widget, {
|
|
47402
|
+
title: t("Mangrove Growth"),
|
|
47403
|
+
loading: loading || outcomesLoading,
|
|
47404
|
+
className: "with-border-header h-w-btn-header",
|
|
47405
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Stats, {
|
|
47406
|
+
survivalRate: survivalRate,
|
|
47407
|
+
averageHeight: averageHeight,
|
|
47408
|
+
averageDiameter: averageDiameter,
|
|
47409
|
+
t: t
|
|
47410
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
47411
|
+
style: {
|
|
47412
|
+
display: "flex",
|
|
47413
|
+
gap: "24px"
|
|
47414
|
+
},
|
|
47415
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47416
|
+
style: {
|
|
47417
|
+
flex: 1
|
|
47418
|
+
},
|
|
47419
|
+
children: /*#__PURE__*/jsxRuntime.jsx(VegetationHealth, {
|
|
47420
|
+
vegetationHealthChart: vegetationHealthChart,
|
|
47421
|
+
t: t
|
|
47422
|
+
})
|
|
47423
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47424
|
+
style: {
|
|
47425
|
+
flex: 1
|
|
47426
|
+
},
|
|
47427
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SeedlingsHeight, {
|
|
47428
|
+
seedlingsHeightChart: seedlingsHeightChart,
|
|
47429
|
+
t: t
|
|
47430
|
+
})
|
|
47431
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47432
|
+
style: {
|
|
47433
|
+
flex: 1
|
|
47434
|
+
},
|
|
47435
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PlantedSpecies, {
|
|
47436
|
+
plantedSpeciesChart: plantedSpeciesChart,
|
|
47437
|
+
t: t
|
|
47438
|
+
})
|
|
47439
|
+
})]
|
|
47440
|
+
})]
|
|
47441
|
+
})
|
|
47442
|
+
});
|
|
47443
|
+
};
|
|
47444
|
+
|
|
47445
|
+
const MonitoringCampaignSummary = ({
|
|
47446
|
+
header,
|
|
47447
|
+
activityData,
|
|
47448
|
+
loading = false,
|
|
47449
|
+
id,
|
|
47450
|
+
projectId,
|
|
47451
|
+
t = () => {},
|
|
47452
|
+
getSummaryDetail,
|
|
47453
|
+
navigate,
|
|
47454
|
+
selectOptions
|
|
47455
|
+
}) => {
|
|
47456
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
|
|
47457
|
+
header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
|
|
47458
|
+
title: header?.title + ' Summary' || '',
|
|
47459
|
+
supportText: header?.supportText || '',
|
|
47460
|
+
onDownload: header?.onDownload,
|
|
47461
|
+
downloadDisabled: header?.downloadDisabled,
|
|
47462
|
+
actionButtons: header?.actionButtons,
|
|
47463
|
+
breadcrumbs: header?.breadcrumbs,
|
|
47464
|
+
goBackTo: header?.goBackTo,
|
|
47465
|
+
loading: header?.loading
|
|
47466
|
+
}),
|
|
47467
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(KeyInformation, {
|
|
47468
|
+
id: id,
|
|
47469
|
+
t: t,
|
|
47470
|
+
getSummaryDetail: getSummaryDetail,
|
|
47471
|
+
loading: loading
|
|
47472
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MonitoringScopeAndFindings, {
|
|
47473
|
+
id: id,
|
|
47474
|
+
t: t,
|
|
47475
|
+
getSummaryDetail: getSummaryDetail,
|
|
47476
|
+
loading: loading
|
|
47477
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MangroveGrowth, {
|
|
47478
|
+
id: id,
|
|
47479
|
+
t: t,
|
|
47480
|
+
getSummaryDetail: getSummaryDetail,
|
|
47481
|
+
loading: loading
|
|
47482
|
+
})]
|
|
47483
|
+
});
|
|
47484
|
+
};
|
|
47485
|
+
|
|
46677
47486
|
const IconNodesConfig = {
|
|
46678
47487
|
operator: {
|
|
46679
47488
|
name: "Operators",
|
|
@@ -47063,13 +47872,12 @@ const MineSummary = ({
|
|
|
47063
47872
|
});
|
|
47064
47873
|
return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
|
|
47065
47874
|
header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
|
|
47066
|
-
title: hasSelect ? t("Mine Review") :
|
|
47875
|
+
title: hasSelect ? t("Mine Review") : `${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`,
|
|
47067
47876
|
className: "with-border-header h-w-btn-header no-px-body",
|
|
47068
47877
|
goBackTo: !hasSelect && goBack,
|
|
47069
|
-
loading: loading,
|
|
47070
47878
|
breadcrumbs: breadcrumbs,
|
|
47071
47879
|
addedHeaderFirst: true,
|
|
47072
|
-
actionButtons: [{
|
|
47880
|
+
actionButtons: hasSelect ? [] : [{
|
|
47073
47881
|
tooltip: t("Details"),
|
|
47074
47882
|
icon: "FileEdit",
|
|
47075
47883
|
onClick: () => {
|
|
@@ -47083,9 +47891,6 @@ const MineSummary = ({
|
|
|
47083
47891
|
}],
|
|
47084
47892
|
addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47085
47893
|
className: "flex flex-row gap-4",
|
|
47086
|
-
style: {
|
|
47087
|
-
marginRight: 8
|
|
47088
|
-
},
|
|
47089
47894
|
children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
47090
47895
|
options: [...sourceOptions],
|
|
47091
47896
|
isAvatarGroup: true,
|
|
@@ -47101,7 +47906,10 @@ const MineSummary = ({
|
|
|
47101
47906
|
dropDownWidth: 200,
|
|
47102
47907
|
defaultSelected: (partners || []).map(p => p.id) || []
|
|
47103
47908
|
}, partners?.length)
|
|
47104
|
-
})
|
|
47909
|
+
}),
|
|
47910
|
+
onDownload: () => {
|
|
47911
|
+
console.log("onDownload");
|
|
47912
|
+
}
|
|
47105
47913
|
}),
|
|
47106
47914
|
children: [hasSelect && /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
47107
47915
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
@@ -47258,19 +48066,19 @@ const usePrepareForm = ({
|
|
|
47258
48066
|
linkingForms = {}
|
|
47259
48067
|
} = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
|
|
47260
48068
|
if (data.datastakeId === id || id === "user") {
|
|
47261
|
-
if (viewConfig.linkingSubjects.includes(namespace)) {
|
|
47262
|
-
|
|
47263
|
-
|
|
47264
|
-
|
|
47265
|
-
|
|
47266
|
-
|
|
47267
|
-
|
|
47268
|
-
|
|
47269
|
-
|
|
47270
|
-
|
|
47271
|
-
} else {
|
|
47272
|
-
|
|
47273
|
-
}
|
|
48069
|
+
// if (viewConfig.linkingSubjects.includes(namespace)) {
|
|
48070
|
+
setForm({
|
|
48071
|
+
...form,
|
|
48072
|
+
linking: {
|
|
48073
|
+
position: 100,
|
|
48074
|
+
excludeFromEdit: true,
|
|
48075
|
+
label: t("Linked Subjects"),
|
|
48076
|
+
template: "linkingSubjects"
|
|
48077
|
+
}
|
|
48078
|
+
});
|
|
48079
|
+
// } else {
|
|
48080
|
+
// setForm(form);
|
|
48081
|
+
// }
|
|
47274
48082
|
setData(data);
|
|
47275
48083
|
setGroups(config.groups || {});
|
|
47276
48084
|
setLinkingForms(linkingForms);
|
|
@@ -47577,6 +48385,18 @@ const renderType = ({
|
|
|
47577
48385
|
}
|
|
47578
48386
|
return "--";
|
|
47579
48387
|
};
|
|
48388
|
+
const namespaceMap = {
|
|
48389
|
+
locations: "location",
|
|
48390
|
+
documents: "document",
|
|
48391
|
+
stakeholders: "stakeholder",
|
|
48392
|
+
events: "event",
|
|
48393
|
+
incidents: "event",
|
|
48394
|
+
correctiveActions: "event",
|
|
48395
|
+
"production-sites": "location",
|
|
48396
|
+
operators: "stakeholder",
|
|
48397
|
+
workers: "stakeholder",
|
|
48398
|
+
activities: "event"
|
|
48399
|
+
};
|
|
47580
48400
|
|
|
47581
48401
|
const getColumns = ({
|
|
47582
48402
|
t,
|
|
@@ -47831,10 +48651,11 @@ const LinkingTemplate = ({
|
|
|
47831
48651
|
}), [conf]);
|
|
47832
48652
|
const id = conf.allData.id;
|
|
47833
48653
|
const dataSource = conf?.linkingTemplateContextData?.[id];
|
|
48654
|
+
const _namespace = namespaceMap[namespace];
|
|
47834
48655
|
const changeData = async () => {
|
|
47835
48656
|
try {
|
|
47836
48657
|
const _data = await LinkedSubjectsService$1.getLinkedSubjects({
|
|
47837
|
-
namespace,
|
|
48658
|
+
namespace: _namespace,
|
|
47838
48659
|
id,
|
|
47839
48660
|
mod: conf.mod
|
|
47840
48661
|
});
|
|
@@ -47920,18 +48741,10 @@ function Template({
|
|
|
47920
48741
|
conf,
|
|
47921
48742
|
namespace
|
|
47922
48743
|
}) {
|
|
47923
|
-
|
|
47924
|
-
|
|
47925
|
-
|
|
47926
|
-
|
|
47927
|
-
case 'events':
|
|
47928
|
-
return /*#__PURE__*/jsxRuntime.jsx(LinkingTemplate, {
|
|
47929
|
-
conf: conf,
|
|
47930
|
-
namespace: namespace
|
|
47931
|
-
});
|
|
47932
|
-
default:
|
|
47933
|
-
return null;
|
|
47934
|
-
}
|
|
48744
|
+
return /*#__PURE__*/jsxRuntime.jsx(LinkingTemplate, {
|
|
48745
|
+
conf: conf,
|
|
48746
|
+
namespace: namespace
|
|
48747
|
+
});
|
|
47935
48748
|
}
|
|
47936
48749
|
|
|
47937
48750
|
const View = ({
|
|
@@ -48145,14 +48958,12 @@ const View = ({
|
|
|
48145
48958
|
addedHeaderFirst: true,
|
|
48146
48959
|
addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
48147
48960
|
className: "flex flex-row gap-4",
|
|
48148
|
-
style: {
|
|
48149
|
-
marginRight: 8
|
|
48150
|
-
},
|
|
48151
48961
|
children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
48152
48962
|
options: [...sourceOptions],
|
|
48153
48963
|
isAvatarGroup: true,
|
|
48154
48964
|
selectionType: "checkbox",
|
|
48155
48965
|
canUnselectLast: false,
|
|
48966
|
+
isSingle: true,
|
|
48156
48967
|
onChange: selected => {
|
|
48157
48968
|
setSelectedPartners(prev => ({
|
|
48158
48969
|
...prev,
|
|
@@ -48239,6 +49050,7 @@ exports.EventsTable = EventsTable;
|
|
|
48239
49050
|
exports.IncidentsTable = IncidentsTable;
|
|
48240
49051
|
exports.LocationsTable = LocationsTable;
|
|
48241
49052
|
exports.MineSummary = MineSummary;
|
|
49053
|
+
exports.MonitoringCampaignSummary = MonitoringCampaignSummary;
|
|
48242
49054
|
exports.OperatorSummary = OperatorSummary;
|
|
48243
49055
|
exports.OperatorsTable = OperatorsTable;
|
|
48244
49056
|
exports.PartnersTable = PartnersTable;
|