datastake-daf 0.6.815 → 0.6.816

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.
Files changed (30) hide show
  1. package/dist/components/index.js +1703 -1578
  2. package/dist/pages/index.js +344 -685
  3. package/dist/style/datastake/mapbox-gl.css +330 -0
  4. package/dist/utils/index.js +0 -28
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/Charts/RadarChart/index.jsx +12 -3
  7. package/src/@daf/core/components/Charts/style.js +2 -1
  8. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +104 -123
  9. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx +0 -4
  10. package/src/@daf/core/components/Table/index.jsx +6 -11
  11. package/src/@daf/pages/Events/Activities/columns.js +11 -15
  12. package/src/@daf/pages/Events/Incidents/columns.js +11 -15
  13. package/src/@daf/pages/Events/columns.js +3 -7
  14. package/src/@daf/pages/Locations/MineSite/columns.js +11 -16
  15. package/src/@daf/pages/Locations/columns.js +3 -7
  16. package/src/@daf/pages/Stakeholders/Operators/columns.js +12 -16
  17. package/src/@daf/pages/Stakeholders/Workers/columns.js +12 -16
  18. package/src/@daf/pages/Stakeholders/columns.js +4 -8
  19. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/ObservedFauna.jsx +6 -11
  20. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/PlantedSpecies.jsx +25 -10
  21. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/SeedlingsHeight.jsx +10 -13
  22. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/VegetationHealth.jsx +19 -4
  23. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/SoilType.jsx +22 -10
  24. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/WaterQuality.jsx +26 -10
  25. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/chartHelpers.js +74 -0
  26. package/src/@daf/pages/TablePage/helper.js +0 -15
  27. package/src/helpers/errorHandling.js +74 -142
  28. package/src/utils.js +1 -1
  29. package/src/@daf/pages/Events/Testimonials/columns.js +0 -173
  30. package/src/@daf/pages/Events/Testimonials/config.js +0 -175
@@ -16,7 +16,6 @@ var reactCollapsed = require('react-collapsed');
16
16
  var L$1 = require('leaflet');
17
17
  var countryCityLocation = require('country-city-location');
18
18
  var client = require('react-dom/client');
19
- var reactDom = require('react-dom');
20
19
  require('@elfalem/leaflet-curve');
21
20
  var react = require('@xyflow/react');
22
21
  var g2plot = require('@antv/g2plot');
@@ -9402,8 +9401,8 @@ function LocationIcon({
9402
9401
  activeMarker,
9403
9402
  setActiveMarker
9404
9403
  }) {
9404
+ const rootsMapRef = React.useRef(new Map());
9405
9405
  const markersRef = React.useRef([]);
9406
- const [portalContainers, setPortalContainers] = React.useState([]);
9407
9406
  const isSelected = selectedMarkersId.includes(data.datastakeId);
9408
9407
  const Marker = React.useMemo(() => {
9409
9408
  if (isMineSite(data.type)) {
@@ -9411,7 +9410,7 @@ function LocationIcon({
9411
9410
  }
9412
9411
  return VillageMarker;
9413
9412
  }, [data.type]);
9414
- React.useState(false);
9413
+ const [isHovering, setIsHovering] = React.useState(false);
9415
9414
  const linkedNodesData = React.useMemo(() => {
9416
9415
  const nodes = [];
9417
9416
  const links = data.links || [];
@@ -9476,32 +9475,31 @@ function LocationIcon({
9476
9475
  return nodes;
9477
9476
  }, [JSON.stringify(allData), JSON.stringify(data.links), JSON.stringify(data.stakeholders), zoom]);
9478
9477
  const stakeholdersOfLocation = React.useMemo(() => {
9479
- return (data?.stakeholders || []).filter(stakeholder => {
9480
- if (!stakeholder.links || stakeholder.links.length === 0) {
9481
- return true;
9482
- }
9483
- const locationsWithThisStakeholder = allData.filter(loc => loc.stakeholders?.some(s => s.datastakeId === stakeholder.datastakeId)).map(loc => loc.datastakeId);
9484
- const primaryLocation = locationsWithThisStakeholder.sort()[0];
9485
- return data.datastakeId === primaryLocation;
9486
- });
9487
- }, [data.stakeholders, data.datastakeId, allData, zoom]);
9478
+ return data?.stakeholders || [];
9479
+ }, [data.stakeholders, zoom]);
9488
9480
  React.useEffect(() => {
9489
- markersRef.current.forEach(marker => {
9490
- if (mapRef && mapRef.hasLayer(marker)) {
9481
+ const currentRoots = rootsMapRef.current;
9482
+ const currentMarkers = markersRef.current;
9483
+ currentMarkers.forEach(marker => {
9484
+ if (mapRef.hasLayer(marker)) {
9491
9485
  mapRef.removeLayer(marker);
9492
9486
  }
9493
9487
  });
9488
+ currentRoots.forEach(root => {
9489
+ root.unmount();
9490
+ });
9491
+ currentRoots.clear();
9494
9492
  markersRef.current = [];
9495
- setPortalContainers([]);
9493
+
9494
+ // Only create stakeholder markers if this location or any of its stakeholders are selected
9496
9495
  const shouldShowStakeholders = isSelected || stakeholdersOfLocation.some(stk => selectedMarkersId.includes(stk.datastakeId));
9497
9496
  if (!shouldShowStakeholders || selectedMarkersId.length === 0) {
9498
9497
  return;
9499
9498
  }
9500
9499
 
9501
- // Create markers and store their container references
9502
- const containers = [];
9500
+ // Create new markers only when selected
9503
9501
  stakeholdersOfLocation.forEach((stakeholder, index) => {
9504
- const markerId = `${data.datastakeId}-${stakeholder.datastakeId}`;
9502
+ const markerId = `${stakeholder.datastakeId}`;
9505
9503
  const {
9506
9504
  x,
9507
9505
  y,
@@ -9524,29 +9522,41 @@ function LocationIcon({
9524
9522
  const pathLocLatLng = mapRef.layerPointToLatLng(pathLocPoint);
9525
9523
  const isForceOpen = activeMarker?.datastakeId === data.datastakeId;
9526
9524
  const iconSize = isSmallMarker(zoom) || isExtraSmallMarker(zoom) ? [11, 11] : [25, 25];
9527
-
9528
- // Create container div
9529
- const containerDiv = document.createElement('div');
9530
- containerDiv.id = markerId;
9531
9525
  const marker = L__namespace.marker(stakeholderLatLng, {
9532
9526
  icon: L__namespace.divIcon({
9533
- html: containerDiv.outerHTML,
9527
+ html: `<div id="${markerId}"></div>`,
9534
9528
  className: "marker-chain",
9535
9529
  iconSize: iconSize
9536
9530
  })
9537
9531
  }).addTo(mapRef);
9538
9532
  markersRef.current.push(marker);
9539
-
9540
- // Store container info for portal rendering
9541
- containers.push({
9542
- markerId,
9543
- stakeholder,
9544
- x,
9545
- y,
9546
- radius,
9547
- index,
9548
- isForceOpen
9549
- });
9533
+ setTimeout(() => {
9534
+ const div = document.getElementById(markerId);
9535
+ if (div && !rootsMapRef.current.has(markerId)) {
9536
+ const root = client.createRoot(div);
9537
+ rootsMapRef.current.set(markerId, root);
9538
+ root.render( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
9539
+ data: stakeholder,
9540
+ zoom: zoom,
9541
+ allData: allData,
9542
+ link: link,
9543
+ parentId: data.datastakeId,
9544
+ renderTooltip: renderTooltip,
9545
+ onClickLink: onClickLink,
9546
+ selectedMarkersId: selectedMarkersId,
9547
+ handleSelectMarker: handleSelectMarker,
9548
+ mapRef: mapRef,
9549
+ radius: radius,
9550
+ index: index,
9551
+ x: x,
9552
+ y: y,
9553
+ openPopupIdRef: openPopupIdRef,
9554
+ polylinesRef: polylinesRef,
9555
+ isForceOpen: isForceOpen,
9556
+ activeMarker: activeMarker
9557
+ }));
9558
+ }
9559
+ }, 0);
9550
9560
  setMapMarkers(prev => {
9551
9561
  const array = [...prev, {
9552
9562
  id: marker._leaflet_id,
@@ -9578,19 +9588,17 @@ function LocationIcon({
9578
9588
  animated: true
9579
9589
  });
9580
9590
  });
9581
-
9582
- // Update portal containers after markers are created
9583
- setTimeout(() => {
9584
- setPortalContainers(containers);
9585
- }, 0);
9586
9591
  return () => {
9587
9592
  markersRef.current.forEach(marker => {
9588
- if (mapRef && mapRef.hasLayer(marker)) {
9593
+ if (mapRef.hasLayer(marker)) {
9589
9594
  mapRef.removeLayer(marker);
9590
9595
  }
9591
9596
  });
9597
+ rootsMapRef.current.forEach(root => {
9598
+ root.unmount();
9599
+ });
9600
+ rootsMapRef.current.clear();
9592
9601
  markersRef.current = [];
9593
- setPortalContainers([]);
9594
9602
  };
9595
9603
  }, [stakeholdersOfLocation, selectedMarkersId, activeMarker, zoom]);
9596
9604
 
@@ -9674,81 +9682,57 @@ function LocationIcon({
9674
9682
  });
9675
9683
  });
9676
9684
  }, [linkedNodesData, selectedMarkersId, zoom, stakeholdersOfLocation, isSelected]);
9677
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
9678
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
9679
- content: renderTooltipJsx({
9680
- title: data.name,
9681
- subTitle: data.subTitle,
9682
- total: data.sources,
9683
- className: "pt-0 pb-0",
9684
- items: renderTooltip(data),
9685
- link,
9686
- onClickLink: () => onClickLink(data),
9687
- isNewTab: true
9688
- }),
9689
- getPopupContainer: triggerNode => {
9690
- const mapElement = document.getElementById("map");
9691
- return mapElement || triggerNode.parentElement || document.body;
9685
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
9686
+ content: renderTooltipJsx({
9687
+ title: data.name,
9688
+ subTitle: data.subTitle,
9689
+ total: data.sources,
9690
+ className: "pt-0 pb-0",
9691
+ items: renderTooltip(data),
9692
+ link,
9693
+ onClickLink: () => onClickLink(data),
9694
+ isNewTab: true
9695
+ })
9696
+ // open={
9697
+ // (!openPopupIdRef.current || openPopupIdRef.current === data.datastakeId) &&
9698
+ // isHovering
9699
+ // }
9700
+ ,
9701
+ getPopupContainer: triggerNode => {
9702
+ const mapElement = document.getElementById("map");
9703
+ return mapElement || triggerNode.parentElement || document.body;
9704
+ },
9705
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
9706
+ style: {
9707
+ position: "relative",
9708
+ display: "inline-block"
9692
9709
  },
9693
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
9710
+ children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
9694
9711
  style: {
9695
- position: "relative",
9696
- display: "inline-block"
9712
+ position: "absolute",
9713
+ bottom: "0",
9714
+ left: "50%",
9715
+ transform: "translateX(-50%)",
9716
+ width: "12px",
9717
+ height: "6px",
9718
+ background: "rgba(0,0,0,0.15)",
9719
+ borderRadius: "50%",
9720
+ filter: "blur(3px)"
9721
+ }
9722
+ }), /*#__PURE__*/jsxRuntime.jsx(Marker, {
9723
+ isSelected: isSelected,
9724
+ onClick: () => {
9725
+ handleSelectMarker(data);
9726
+ setActiveMarker(isSelected ? null : data);
9697
9727
  },
9698
- children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
9699
- style: {
9700
- position: "absolute",
9701
- bottom: "0",
9702
- left: "50%",
9703
- transform: "translateX(-50%)",
9704
- width: "12px",
9705
- height: "6px",
9706
- background: "rgba(0,0,0,0.15)",
9707
- borderRadius: "50%",
9708
- filter: "blur(3px)"
9709
- }
9710
- }), /*#__PURE__*/jsxRuntime.jsx(Marker, {
9711
- isSelected: isSelected,
9712
- onClick: () => {
9713
- handleSelectMarker(data);
9714
- setActiveMarker(isSelected ? null : data);
9715
- },
9716
- zoom: zoom,
9717
- selectedMarkersId: selectedMarkersId
9718
- })]
9719
- })
9720
- }), portalContainers.map(({
9721
- markerId,
9722
- stakeholder,
9723
- x,
9724
- y,
9725
- radius,
9726
- index,
9727
- isForceOpen
9728
- }) => {
9729
- const container = document.getElementById(markerId);
9730
- if (!container) return null;
9731
- return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
9732
- data: stakeholder,
9733
9728
  zoom: zoom,
9734
- allData: allData,
9735
- link: link,
9736
- parentId: data.datastakeId,
9737
- renderTooltip: renderTooltip,
9738
- onClickLink: onClickLink,
9739
- selectedMarkersId: selectedMarkersId,
9740
- handleSelectMarker: handleSelectMarker,
9741
- mapRef: mapRef,
9742
- radius: radius,
9743
- index: index,
9744
- x: x,
9745
- y: y,
9746
- openPopupIdRef: openPopupIdRef,
9747
- polylinesRef: polylinesRef,
9748
- isForceOpen: isForceOpen,
9749
- activeMarker: activeMarker
9750
- }, markerId), container);
9751
- })]
9729
+ onMouseEnter: () => setIsHovering(true),
9730
+ onMouseLeave: () => {
9731
+ setIsHovering(false);
9732
+ },
9733
+ selectedMarkersId: selectedMarkersId
9734
+ })]
9735
+ })
9752
9736
  });
9753
9737
  }
9754
9738
 
@@ -12768,7 +12752,8 @@ const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
12768
12752
 
12769
12753
  const Container$1 = styled__default["default"].div`
12770
12754
  height: ${props => props.height || '300px'};
12771
- width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
12755
+ width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
12756
+ overflow: ${props => props.style?.overflow || 'visible'};
12772
12757
  `;
12773
12758
 
12774
12759
  const useLegendConfig = ({
@@ -14176,7 +14161,7 @@ const getTabs = t => {
14176
14161
  label: t("Events")
14177
14162
  }];
14178
14163
  };
14179
- const getFiltersConfig$c = ({
14164
+ const getFiltersConfig$b = ({
14180
14165
  t,
14181
14166
  filters,
14182
14167
  activeTab,
@@ -14411,7 +14396,7 @@ function MineSites({
14411
14396
  config: dataFetchConfig
14412
14397
  });
14413
14398
  const tabs = React.useMemo(() => getTabs(t), [t]);
14414
- const filtersConfig = React.useMemo(() => getFiltersConfig$c({
14399
+ const filtersConfig = React.useMemo(() => getFiltersConfig$b({
14415
14400
  t,
14416
14401
  filters,
14417
14402
  options,
@@ -15564,12 +15549,7 @@ function DAFTable({
15564
15549
  doEmptyRows,
15565
15550
  ...rest
15566
15551
  }) {
15567
- const source = React.useMemo(() => {
15568
- if (data && Array.isArray(data)) {
15569
- return data;
15570
- }
15571
- return [];
15572
- }, [data]);
15552
+ const [source, setSource] = React.useState([]);
15573
15553
  const projectData = (projects || []).find(p => p.id === selectedProject);
15574
15554
  const [filtersInit, setFiltersInit] = React.useState(!loading);
15575
15555
  React.useEffect(() => {
@@ -15614,13 +15594,11 @@ function DAFTable({
15614
15594
  }
15615
15595
  } : filtersConfig;
15616
15596
  }, [sourcesKey, sources, filtersConfig, t]);
15617
-
15618
- // useEffect(() => {
15619
- // if (data && Array.isArray(data)) {
15620
- // setSource(data);
15621
- // }
15622
- // }, [data, data.length]);
15623
-
15597
+ React.useEffect(() => {
15598
+ if (data && Array.isArray(data)) {
15599
+ setSource(data);
15600
+ }
15601
+ }, [data, data.length]);
15624
15602
  const paginationPageSize = pagination?.pageSize;
15625
15603
  const dataSource = React.useMemo(() => {
15626
15604
  const pageSize = paginationPageSize ? paginationPageSize : source.length > 10 ? source.length : 10;
@@ -16110,7 +16088,7 @@ const NavigationAction = ({
16110
16088
  });
16111
16089
  };
16112
16090
 
16113
- const getColumns$h = ({
16091
+ const getColumns$g = ({
16114
16092
  t,
16115
16093
  data,
16116
16094
  user,
@@ -16236,7 +16214,7 @@ function OrganisationInformation({
16236
16214
  });
16237
16215
  }, [organisationInfo, data]);
16238
16216
  const columns = React.useMemo(() => {
16239
- return getColumns$h({
16217
+ return getColumns$g({
16240
16218
  t,
16241
16219
  data: tableData,
16242
16220
  user,
@@ -16367,7 +16345,7 @@ const Style$8 = styled__default["default"].div`
16367
16345
  }
16368
16346
  `;
16369
16347
 
16370
- const getColumns$g = ({
16348
+ const getColumns$f = ({
16371
16349
  t = () => {},
16372
16350
  options = {},
16373
16351
  user = {},
@@ -16524,7 +16502,7 @@ function ProductionSites({
16524
16502
  return productionSites?.length > 5 ? ComponentWithFocus : "div";
16525
16503
  }, [productionSites]);
16526
16504
  const columns = React.useMemo(() => {
16527
- return getColumns$g({
16505
+ return getColumns$f({
16528
16506
  t,
16529
16507
  options,
16530
16508
  user,
@@ -16758,7 +16736,7 @@ const getAdminLevelName = (data, level) => {
16758
16736
  return entry?.name || "-";
16759
16737
  };
16760
16738
 
16761
- const getColumns$f = ({
16739
+ const getColumns$e = ({
16762
16740
  t,
16763
16741
  activeTab,
16764
16742
  options,
@@ -17052,7 +17030,7 @@ function AssociatedInformation$1({
17052
17030
  console.log({
17053
17031
  data
17054
17032
  });
17055
- const columns = React.useMemo(() => getColumns$f({
17033
+ const columns = React.useMemo(() => getColumns$e({
17056
17034
  t,
17057
17035
  isMonitoring: false,
17058
17036
  activeTab,
@@ -17436,7 +17414,7 @@ const getPartnershipTypes = t => {
17436
17414
  }];
17437
17415
  };
17438
17416
 
17439
- const getColumns$e = ({
17417
+ const getColumns$d = ({
17440
17418
  t,
17441
17419
  accept,
17442
17420
  decline,
@@ -40822,7 +40800,7 @@ const PartnersTable = ({
40822
40800
  setTotalRequests,
40823
40801
  t
40824
40802
  });
40825
- const columns = React.useMemo(() => getColumns$e({
40803
+ const columns = React.useMemo(() => getColumns$d({
40826
40804
  t,
40827
40805
  accept,
40828
40806
  decline,
@@ -41059,7 +41037,7 @@ const Create = ({
41059
41037
  });
41060
41038
  };
41061
41039
 
41062
- const getFiltersConfig$b = ({
41040
+ const getFiltersConfig$a = ({
41063
41041
  t
41064
41042
  }) => {
41065
41043
  return {
@@ -41090,7 +41068,7 @@ const getFiltersConfig$b = ({
41090
41068
  }
41091
41069
  };
41092
41070
  };
41093
- const getFilterOptions$b = (options, t) => {
41071
+ const getFilterOptions$a = (options, t) => {
41094
41072
  const {
41095
41073
  countries,
41096
41074
  category,
@@ -41101,13 +41079,13 @@ const getFilterOptions$b = (options, t) => {
41101
41079
  category: categoriesOptions || category || []
41102
41080
  };
41103
41081
  };
41104
- const formConfig$9 = {
41082
+ const formConfig$8 = {
41105
41083
  namespace: 'stakeholders',
41106
41084
  view: 'scoping',
41107
41085
  scope: 'create',
41108
41086
  formType: 'stakeholder'
41109
41087
  };
41110
- const viewConfig$9 = {
41088
+ const viewConfig$8 = {
41111
41089
  title: "Stakeholders",
41112
41090
  createTitle: "Create Stakeholder"
41113
41091
  };
@@ -41194,7 +41172,7 @@ function sourceAvatarConfig(items, user, applications) {
41194
41172
  });
41195
41173
  }
41196
41174
 
41197
- const getColumns$d = ({
41175
+ const getColumns$c = ({
41198
41176
  t,
41199
41177
  goTo,
41200
41178
  user,
@@ -41247,8 +41225,7 @@ const getColumns$d = ({
41247
41225
  className: "daf-default-cell"
41248
41226
  });
41249
41227
  }
41250
- const categoriesOptions = [...(options?.categoriesOptions || []), ...(options?.category || [])];
41251
- const category = findOptions(v, categoriesOptions);
41228
+ const category = findOptions(v, options?.categoriesOptions);
41252
41229
  return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41253
41230
  title: category,
41254
41231
  children: category
@@ -41265,8 +41242,7 @@ const getColumns$d = ({
41265
41242
  className: "daf-default-cell"
41266
41243
  });
41267
41244
  }
41268
- const subCategoriesOptions = [...(options?.subCategoriesOptions || []), ...(options?.subCategory || [])];
41269
- const subCategory = findOptions(v, subCategoriesOptions);
41245
+ const subCategory = findOptions(v, options?.subCategoriesOptions);
41270
41246
  return subCategory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41271
41247
  title: subCategory,
41272
41248
  children: subCategory
@@ -41301,7 +41277,7 @@ const getColumns$d = ({
41301
41277
  });
41302
41278
  }
41303
41279
  if (!val || val?.length === 0) {
41304
- return "-";
41280
+ return "--";
41305
41281
  }
41306
41282
  const sources = sourceAvatarConfig(val, user, applications);
41307
41283
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
@@ -41350,7 +41326,7 @@ const getColumns$d = ({
41350
41326
  }
41351
41327
  }].filter(column => column.show !== false);
41352
41328
 
41353
- const getFiltersConfig$a = ({
41329
+ const getFiltersConfig$9 = ({
41354
41330
  t
41355
41331
  }) => {
41356
41332
  return {
@@ -41518,7 +41494,7 @@ const getFiltersConfig$a = ({
41518
41494
  }
41519
41495
  };
41520
41496
  };
41521
- const getFilterOptions$a = (options, t) => {
41497
+ const getFilterOptions$9 = (options, t) => {
41522
41498
  const {
41523
41499
  statusOptions,
41524
41500
  categoryOptions,
@@ -41540,13 +41516,13 @@ const getFilterOptions$a = (options, t) => {
41540
41516
  };
41541
41517
  return _default;
41542
41518
  };
41543
- const formConfig$8 = {
41519
+ const formConfig$7 = {
41544
41520
  namespace: 'OPERATOR',
41545
41521
  view: ['scoping', 'new'],
41546
41522
  scope: 'global',
41547
41523
  formType: 'operator'
41548
41524
  };
41549
- const viewConfig$8 = {
41525
+ const viewConfig$7 = {
41550
41526
  title: "Operators",
41551
41527
  createTitle: "Create Operator"
41552
41528
  };
@@ -41587,7 +41563,7 @@ const renderStatusTag = ({
41587
41563
  }
41588
41564
  };
41589
41565
 
41590
- const getColumns$c = ({
41566
+ const getColumns$b = ({
41591
41567
  t,
41592
41568
  goTo,
41593
41569
  user,
@@ -41733,9 +41709,6 @@ const getColumns$c = ({
41733
41709
  className: "daf-default-cell"
41734
41710
  });
41735
41711
  }
41736
- if (!val || val?.length === 0) {
41737
- return "-";
41738
- }
41739
41712
  const sources = sourceAvatarConfig(val, user, applications);
41740
41713
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
41741
41714
  items: sources
@@ -41797,7 +41770,7 @@ const getColumns$c = ({
41797
41770
  }
41798
41771
  }].filter(column => column.show !== false);
41799
41772
 
41800
- const getFiltersConfig$9 = ({
41773
+ const getFiltersConfig$8 = ({
41801
41774
  t
41802
41775
  }) => {
41803
41776
  return {
@@ -41938,7 +41911,7 @@ const getFiltersConfig$9 = ({
41938
41911
  }
41939
41912
  };
41940
41913
  };
41941
- const getFilterOptions$9 = (options, t) => {
41914
+ const getFilterOptions$8 = (options, t) => {
41942
41915
  const {
41943
41916
  statusOptions,
41944
41917
  categoryOptions,
@@ -41965,18 +41938,18 @@ const getFilterOptions$9 = (options, t) => {
41965
41938
  };
41966
41939
  return _default;
41967
41940
  };
41968
- const formConfig$7 = {
41941
+ const formConfig$6 = {
41969
41942
  namespace: 'WORKERS',
41970
41943
  view: ['scoping', 'new'],
41971
41944
  scope: 'global',
41972
41945
  formType: 'worker'
41973
41946
  };
41974
- const viewConfig$7 = {
41947
+ const viewConfig$6 = {
41975
41948
  title: "Workers",
41976
41949
  createTitle: "Create Worker"
41977
41950
  };
41978
41951
 
41979
- const getColumns$b = ({
41952
+ const getColumns$a = ({
41980
41953
  t,
41981
41954
  goTo,
41982
41955
  user,
@@ -42106,9 +42079,6 @@ const getColumns$b = ({
42106
42079
  className: "daf-default-cell"
42107
42080
  });
42108
42081
  }
42109
- if (!val || val?.length === 0) {
42110
- return "-";
42111
- }
42112
42082
  const sources = sourceAvatarConfig(val, user, applications);
42113
42083
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
42114
42084
  items: sources
@@ -42155,7 +42125,7 @@ const getColumns$b = ({
42155
42125
  }
42156
42126
  }].filter(column => column.show !== false);
42157
42127
 
42158
- const getFiltersConfig$8 = ({
42128
+ const getFiltersConfig$7 = ({
42159
42129
  t
42160
42130
  }) => {
42161
42131
  return {
@@ -42307,7 +42277,7 @@ const getFiltersConfig$8 = ({
42307
42277
  }
42308
42278
  };
42309
42279
  };
42310
- const getFilterOptions$8 = (options, t) => {
42280
+ const getFilterOptions$7 = (options, t) => {
42311
42281
  const {
42312
42282
  timeframe = [],
42313
42283
  status,
@@ -42333,13 +42303,13 @@ const getFilterOptions$8 = (options, t) => {
42333
42303
  }]
42334
42304
  };
42335
42305
  };
42336
- const formConfig$6 = {
42306
+ const formConfig$5 = {
42337
42307
  namespace: 'event',
42338
42308
  view: 'scoping',
42339
42309
  scope: 'create',
42340
42310
  formType: 'event'
42341
42311
  };
42342
- const viewConfig$6 = {
42312
+ const viewConfig$5 = {
42343
42313
  title: "Events",
42344
42314
  createTitle: "Create Event"
42345
42315
  };
@@ -42466,7 +42436,7 @@ MoreTags.propTypes = {
42466
42436
  limit: PropTypes__default["default"].number
42467
42437
  };
42468
42438
 
42469
- const getColumns$a = ({
42439
+ const getColumns$9 = ({
42470
42440
  t,
42471
42441
  goTo,
42472
42442
  user,
@@ -42628,9 +42598,6 @@ const getColumns$a = ({
42628
42598
  className: "daf-default-cell"
42629
42599
  });
42630
42600
  }
42631
- if (!val || val?.length === 0) {
42632
- return "-";
42633
- }
42634
42601
  const sources = sourceAvatarConfig(val, user, applications);
42635
42602
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
42636
42603
  items: sources
@@ -42701,7 +42668,7 @@ const getColumns$a = ({
42701
42668
  }
42702
42669
  }].filter(column => column.show !== false);
42703
42670
 
42704
- const getFiltersConfig$7 = ({
42671
+ const getFiltersConfig$6 = ({
42705
42672
  t
42706
42673
  }) => {
42707
42674
  return {
@@ -42873,7 +42840,7 @@ const getFiltersConfig$7 = ({
42873
42840
  }
42874
42841
  };
42875
42842
  };
42876
- const getFilterOptions$7 = (options, t) => {
42843
+ const getFilterOptions$6 = (options, t) => {
42877
42844
  const {
42878
42845
  timeframe = [],
42879
42846
  statusOptions,
@@ -42906,13 +42873,13 @@ const getFilterOptions$7 = (options, t) => {
42906
42873
  };
42907
42874
  return _default;
42908
42875
  };
42909
- const formConfig$5 = {
42876
+ const formConfig$4 = {
42910
42877
  namespace: 'corrective-actions',
42911
42878
  view: 'corrective-actions',
42912
42879
  scope: 'createActivity',
42913
42880
  formType: 'activity'
42914
42881
  };
42915
- const viewConfig$5 = {
42882
+ const viewConfig$4 = {
42916
42883
  title: "Activities",
42917
42884
  createTitle: "Create Activity"
42918
42885
  };
@@ -42926,7 +42893,7 @@ const getEventCategoryBySubject = (eventCategoryObject, subject, isSingular = fa
42926
42893
  return eventCategoryObject[key] || null;
42927
42894
  };
42928
42895
 
42929
- const getColumns$9 = ({
42896
+ const getColumns$8 = ({
42930
42897
  t,
42931
42898
  goTo,
42932
42899
  user,
@@ -43073,9 +43040,6 @@ const getColumns$9 = ({
43073
43040
  className: "daf-default-cell"
43074
43041
  });
43075
43042
  }
43076
- if (!val || val?.length === 0) {
43077
- return "-";
43078
- }
43079
43043
  const sources = sourceAvatarConfig(val, user, applications);
43080
43044
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43081
43045
  items: sources
@@ -43139,7 +43103,7 @@ const getColumns$9 = ({
43139
43103
  }
43140
43104
  }].filter(column => column.show !== false);
43141
43105
 
43142
- const getFiltersConfig$6 = ({
43106
+ const getFiltersConfig$5 = ({
43143
43107
  t
43144
43108
  }) => {
43145
43109
  return {
@@ -43310,7 +43274,7 @@ const getFiltersConfig$6 = ({
43310
43274
  }
43311
43275
  };
43312
43276
  };
43313
- const getFilterOptions$6 = (options, t) => {
43277
+ const getFilterOptions$5 = (options, t) => {
43314
43278
  const {
43315
43279
  timeframe = [],
43316
43280
  statusOptions,
@@ -43343,18 +43307,18 @@ const getFilterOptions$6 = (options, t) => {
43343
43307
  };
43344
43308
  return _default;
43345
43309
  };
43346
- const formConfig$4 = {
43310
+ const formConfig$3 = {
43347
43311
  namespace: 'incident',
43348
43312
  view: 'incident',
43349
43313
  scope: 'createIncident',
43350
43314
  formType: 'incident'
43351
43315
  };
43352
- const viewConfig$4 = {
43316
+ const viewConfig$3 = {
43353
43317
  title: "Incidents",
43354
43318
  createTitle: "Create Incident"
43355
43319
  };
43356
43320
 
43357
- const getColumns$8 = ({
43321
+ const getColumns$7 = ({
43358
43322
  t,
43359
43323
  goTo,
43360
43324
  user,
@@ -43501,423 +43465,6 @@ const getColumns$8 = ({
43501
43465
  className: "daf-default-cell"
43502
43466
  });
43503
43467
  }
43504
- if (!val || val?.length === 0) {
43505
- return "-";
43506
- }
43507
- const sources = sourceAvatarConfig(val, user, applications);
43508
- return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43509
- items: sources
43510
- });
43511
- }
43512
- }, {
43513
- title: t("Status"),
43514
- dataIndex: "status",
43515
- key: "status",
43516
- show: activeTab === "own",
43517
- render: (val, all) => {
43518
- if (all.empty) {
43519
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43520
- className: "daf-default-cell"
43521
- });
43522
- }
43523
- const _val = all?.published || all?.status === "submitted" ? "submitted" : val;
43524
- return renderStatusTag({
43525
- value: _val,
43526
- t
43527
- });
43528
- }
43529
- }, {
43530
- title: t("Last Update"),
43531
- dataIndex: "updatedAt",
43532
- key: "updatedAt",
43533
- render: (date, all) => {
43534
- if (all.empty) {
43535
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43536
- className: "daf-default-cell"
43537
- });
43538
- }
43539
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
43540
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43541
- title: _date,
43542
- children: _date
43543
- });
43544
- },
43545
- ellipsis: true
43546
- }, {
43547
- id: 'actions',
43548
- title: "",
43549
- width: 60,
43550
- render: (_, all) => {
43551
- if (all.empty) {
43552
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43553
- className: "daf-default-cell"
43554
- });
43555
- }
43556
- const onClick = () => {
43557
- let link = `/app/view/${subject}/${all.datastakeId}`;
43558
- if (activeTab === "shared") {
43559
- link += `?sourceId=${all?.authorId?.id}`;
43560
- }
43561
- goTo(getRedirectLink(link));
43562
- };
43563
- return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
43564
- onClick: onClick,
43565
- theme: theme
43566
- });
43567
- }
43568
- }].filter(column => column.show !== false);
43569
-
43570
- const getFiltersConfig$5 = ({
43571
- t
43572
- }) => {
43573
- return {
43574
- timeframe: {
43575
- type: "timeframe",
43576
- label: "Timeframe",
43577
- style: {
43578
- flex: 1
43579
- },
43580
- t: t
43581
- },
43582
- country: {
43583
- type: 'select',
43584
- label: 'Country',
43585
- placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
43586
- style: {
43587
- flex: 1
43588
- },
43589
- labelStyle: {
43590
- flex: 1
43591
- },
43592
- getLabel: option => option.label,
43593
- getValue: option => option.value
43594
- },
43595
- administrativeLevel1: {
43596
- type: 'ajaxSelect',
43597
- label: ({
43598
- t = s => s,
43599
- options = {},
43600
- filters = {},
43601
- language = 'en'
43602
- }) => {
43603
- const {
43604
- administrativeLevel1
43605
- } = options;
43606
- if (administrativeLevel1) {
43607
- if (options.country) {
43608
- const _item = administrativeLevel1[filters.country];
43609
- if (_item) {
43610
- if (_item[language]) {
43611
- return _item[language];
43612
- }
43613
- }
43614
- }
43615
- }
43616
- return t('Province');
43617
- },
43618
- placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
43619
- filters: data => ({
43620
- country: data.country,
43621
- level: 'level_1'
43622
- }),
43623
- show: data => !data.country,
43624
- disabled: data => !data.country,
43625
- mapper: {
43626
- label: "name",
43627
- value: "id"
43628
- },
43629
- method: 'getOptions',
43630
- entity: 'AdministrativeLevel',
43631
- style: {
43632
- flex: 1
43633
- },
43634
- labelStyle: {
43635
- flex: 1
43636
- }
43637
- },
43638
- administrativeLevel2: {
43639
- type: 'ajaxSelect',
43640
- label: ({
43641
- t = s => s,
43642
- options = {},
43643
- filters = {},
43644
- language = 'en'
43645
- }) => {
43646
- const {
43647
- administrativeLevel2
43648
- } = options;
43649
- if (administrativeLevel2) {
43650
- if (options.country) {
43651
- const _item = administrativeLevel2[filters.country];
43652
- if (_item) {
43653
- if (_item[language]) {
43654
- return _item[language];
43655
- }
43656
- }
43657
- }
43658
- }
43659
- return t('Province');
43660
- },
43661
- show: data => !(data.country && data.administrativeLevel1),
43662
- placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
43663
- filters: data => ({
43664
- country: data.country,
43665
- level: 'level_2',
43666
- administrativeLevel1: data.administrativeLevel1
43667
- }),
43668
- disabled: data => !(data.country && data.administrativeLevel1),
43669
- mapper: {
43670
- label: "name",
43671
- value: "id"
43672
- },
43673
- method: 'getOptions',
43674
- entity: 'AdministrativeLevel',
43675
- style: {
43676
- flex: 1
43677
- },
43678
- labelStyle: {
43679
- flex: 1
43680
- }
43681
- },
43682
- eventCategory: {
43683
- type: 'select',
43684
- label: 'Category',
43685
- placeholder: () => `${t('Filter by')} ${t('Category').toLowerCase()}`,
43686
- style: {
43687
- flex: 1
43688
- },
43689
- labelStyle: {
43690
- flex: 1
43691
- },
43692
- getLabel: option => option.label,
43693
- getValue: option => option.value,
43694
- filterOptions: val => {
43695
- if (val) {
43696
- const {
43697
- option,
43698
- filters
43699
- } = val;
43700
- if (filters && option) {
43701
- const {
43702
- filters: optionFilters
43703
- } = option;
43704
- if (Array.isArray(optionFilters) && optionFilters.length) {
43705
- const {
43706
- value,
43707
- condition
43708
- } = optionFilters[0];
43709
- if (condition === 'includes') {
43710
- return value.includes('corporation');
43711
- }
43712
- }
43713
- }
43714
- }
43715
- return true;
43716
- }
43717
- },
43718
- // positionInTheMineralSupplyChain: {
43719
- // type: 'select',
43720
- // label: 'Position',
43721
- // placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
43722
- // style: { flex: 1 },
43723
- // labelStyle: { flex: 1 },
43724
- // getLabel: (option) => option.label,
43725
- // getValue: (option) => option.value,
43726
- // },
43727
- status: {
43728
- type: "select",
43729
- label: "Status",
43730
- placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
43731
- style: {
43732
- flex: 1
43733
- },
43734
- labelStyle: {
43735
- fley: 1
43736
- },
43737
- getLabel: option => option.label,
43738
- getValue: option => option.value
43739
- }
43740
- };
43741
- };
43742
- const getFilterOptions$5 = (options, t) => {
43743
- const {
43744
- timeframe = [],
43745
- statusOptions,
43746
- categoryOptions,
43747
- countries,
43748
- subCategory,
43749
- category,
43750
- stakeholderCategoryOptions,
43751
- stakeholderSubCategoriesOptions,
43752
- administrativeLevel1,
43753
- administrativeLevel2,
43754
- positionInMineralSupplyChainOptions,
43755
- subCategoriesOptions,
43756
- eventCategoryOptions
43757
- } = options || {};
43758
- const _categoryOptions = (eventCategoryOptions || categoryOptions || [])?.map(item => ({
43759
- value: item.value,
43760
- label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label
43761
- }));
43762
- const _default = {
43763
- timeframe: timeframe,
43764
- status: getStatusOptions(t) || [],
43765
- eventCategory: _categoryOptions || [],
43766
- country: countries || [],
43767
- subCategory: subCategoriesOptions || [],
43768
- // category: category,
43769
- administrativeLevel1,
43770
- administrativeLevel2
43771
- // positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions || [],
43772
- };
43773
- return _default;
43774
- };
43775
- const formConfig$3 = {
43776
- namespace: 'testimonials',
43777
- view: 'testimonials',
43778
- scope: 'create',
43779
- formType: 'testimonial'
43780
- };
43781
- const viewConfig$3 = {
43782
- title: "Testimonials",
43783
- createTitle: "New Testimonial"
43784
- };
43785
-
43786
- const getColumns$7 = ({
43787
- t,
43788
- goTo,
43789
- user,
43790
- options,
43791
- activeTab,
43792
- getRedirectLink,
43793
- theme,
43794
- subject,
43795
- data,
43796
- applications
43797
- }) => [{
43798
- dataIndex: 'datastakeId',
43799
- title: t('ID'),
43800
- ellipsis: true,
43801
- show: true,
43802
- key: "datastakeId",
43803
- sorter: () => 0 + 0,
43804
- render: (v, all) => {
43805
- if (all.empty) {
43806
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43807
- className: "daf-default-cell"
43808
- });
43809
- }
43810
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43811
- title: v,
43812
- children: v
43813
- });
43814
- }
43815
- }, {
43816
- dataIndex: 'name',
43817
- title: t('Title'),
43818
- ellipsis: true,
43819
- show: true,
43820
- key: "name",
43821
- sorter: () => 0 + 0,
43822
- render: (v, all) => {
43823
- if (all.empty) {
43824
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43825
- className: "daf-default-cell"
43826
- });
43827
- }
43828
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43829
- title: v,
43830
- children: v
43831
- });
43832
- }
43833
- }, {
43834
- title: t("type"),
43835
- dataIndex: "typeOfTestimonials",
43836
- key: "typeOfTestimonials",
43837
- sorter: () => 0 + 0,
43838
- show: true,
43839
- render: (title, all) => {
43840
- if (all.empty) {
43841
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43842
- className: "daf-default-cell"
43843
- });
43844
- }
43845
- const type = findOptions(title, data?.options?.testimonialsType);
43846
- return type ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43847
- title: type,
43848
- children: type
43849
- }) : '-';
43850
- },
43851
- ellipsis: true
43852
- }, {
43853
- title: t("Date"),
43854
- dataIndex: "date",
43855
- key: "date",
43856
- sorter: () => 0 + 0,
43857
- render: (date, all) => {
43858
- if (all.empty) {
43859
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43860
- className: "daf-default-cell"
43861
- });
43862
- }
43863
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
43864
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43865
- title: _date,
43866
- children: _date
43867
- });
43868
- },
43869
- ellipsis: true
43870
- }, {
43871
- dataIndex: 'mineSite',
43872
- title: t('Location'),
43873
- ellipsis: true,
43874
- show: true,
43875
- render: (v, all) => {
43876
- if (all.empty) {
43877
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43878
- className: "daf-default-cell"
43879
- });
43880
- }
43881
-
43882
- // const country = findOptions(v, data?.options?.positionSupplyChainOptions);
43883
- const mineSite = all?.location?.name;
43884
- return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43885
- title: mineSite,
43886
- children: mineSite
43887
- }) : '-';
43888
- }
43889
- }, {
43890
- dataIndex: 'eventCategory',
43891
- title: t('Category'),
43892
- ellipsis: true,
43893
- show: true,
43894
- render: (v, all) => {
43895
- if (all.empty) {
43896
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43897
- className: "daf-default-cell"
43898
- });
43899
- }
43900
- const eventCategory = findOptions(v, data?.options?.eventCategoryOptions || data?.options?.categoryOptions);
43901
- const categoryValue = getEventCategoryBySubject(eventCategory, subject);
43902
- return categoryValue ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43903
- title: categoryValue,
43904
- children: categoryValue
43905
- }) : '-';
43906
- }
43907
- }, {
43908
- title: t("Sources"),
43909
- dataIndex: "sources",
43910
- key: "sources",
43911
- show: activeTab !== "own",
43912
- render: (val, all) => {
43913
- if (all.empty) {
43914
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43915
- className: "daf-default-cell"
43916
- });
43917
- }
43918
- if (!val || val?.length === 0) {
43919
- return "-";
43920
- }
43921
43468
  const sources = sourceAvatarConfig(val, user, applications);
43922
43469
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43923
43470
  items: sources
@@ -44157,9 +43704,6 @@ const getColumns$6 = ({
44157
43704
  className: "daf-default-cell"
44158
43705
  });
44159
43706
  }
44160
- if (!val || val?.length === 0) {
44161
- return "-";
44162
- }
44163
43707
  const sources = sourceAvatarConfig(val, user, applications);
44164
43708
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
44165
43709
  items: sources
@@ -44623,19 +44167,16 @@ const getColumns$5 = ({
44623
44167
  }
44624
44168
  }, {
44625
44169
  title: t("Sources"),
44626
- dataIndex: "sources",
44627
- key: "sources",
44170
+ dataIndex: 'sources',
44171
+ ellipsis: true,
44628
44172
  show: activeTab !== "own",
44629
- render: (val, all) => {
44173
+ render: (v, all) => {
44630
44174
  if (all.empty) {
44631
44175
  return /*#__PURE__*/jsxRuntime.jsx("div", {
44632
44176
  className: "daf-default-cell"
44633
44177
  });
44634
44178
  }
44635
- if (!val || val?.length === 0) {
44636
- return "-";
44637
- }
44638
- const sources = sourceAvatarConfig(val, user, applications);
44179
+ const sources = sourceAvatarConfig(v, user, applications);
44639
44180
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
44640
44181
  items: sources
44641
44182
  });
@@ -44835,55 +44376,48 @@ const getColumns$4 = ({
44835
44376
 
44836
44377
  const FILTER_REGISTRY = {
44837
44378
  stakeholders: {
44838
- config: getFiltersConfig$b,
44839
- options: getFilterOptions$b,
44840
- formConfig: formConfig$9,
44841
- viewConfig: viewConfig$9,
44842
- columns: getColumns$d
44843
- },
44844
- workers: {
44845
- config: getFiltersConfig$9,
44846
- options: getFilterOptions$9,
44847
- formConfig: formConfig$7,
44848
- viewConfig: viewConfig$7,
44849
- columns: getColumns$b
44850
- },
44851
- operators: {
44852
44379
  config: getFiltersConfig$a,
44853
44380
  options: getFilterOptions$a,
44854
44381
  formConfig: formConfig$8,
44855
44382
  viewConfig: viewConfig$8,
44856
44383
  columns: getColumns$c
44857
44384
  },
44858
- events: {
44385
+ workers: {
44859
44386
  config: getFiltersConfig$8,
44860
44387
  options: getFilterOptions$8,
44861
44388
  formConfig: formConfig$6,
44862
44389
  viewConfig: viewConfig$6,
44863
44390
  columns: getColumns$a
44864
44391
  },
44865
- activities: {
44866
- config: getFiltersConfig$7,
44867
- options: getFilterOptions$7,
44868
- formConfig: formConfig$5,
44869
- viewConfig: viewConfig$5,
44870
- columns: getColumns$9
44392
+ operators: {
44393
+ config: getFiltersConfig$9,
44394
+ options: getFilterOptions$9,
44395
+ formConfig: formConfig$7,
44396
+ viewConfig: viewConfig$7,
44397
+ columns: getColumns$b
44871
44398
  },
44872
- 'corrective-actions': {
44399
+ events: {
44873
44400
  config: getFiltersConfig$7,
44874
44401
  options: getFilterOptions$7,
44875
44402
  formConfig: formConfig$5,
44876
44403
  viewConfig: viewConfig$5,
44877
44404
  columns: getColumns$9
44878
44405
  },
44879
- incidents: {
44406
+ activities: {
44880
44407
  config: getFiltersConfig$6,
44881
44408
  options: getFilterOptions$6,
44882
44409
  formConfig: formConfig$4,
44883
44410
  viewConfig: viewConfig$4,
44884
44411
  columns: getColumns$8
44885
44412
  },
44886
- testimonials: {
44413
+ 'corrective-actions': {
44414
+ config: getFiltersConfig$6,
44415
+ options: getFilterOptions$6,
44416
+ formConfig: formConfig$4,
44417
+ viewConfig: viewConfig$4,
44418
+ columns: getColumns$8
44419
+ },
44420
+ incidents: {
44887
44421
  config: getFiltersConfig$5,
44888
44422
  options: getFilterOptions$5,
44889
44423
  formConfig: formConfig$3,
@@ -49422,17 +48956,10 @@ function VegetationWidget({
49422
48956
  ...props
49423
48957
  }) {
49424
48958
  let vegetationConfig = getVegetationConfig();
49425
-
49426
- // Get all VEGETATION_KEYS values before filtering (needed for mapping check)
49427
48959
  const allVegetationKeys = vegetationConfig.map(item => item.key);
49428
-
49429
- // Filter to show only specific keys if filterKeys is provided
49430
48960
  if (filterKeys && Array.isArray(filterKeys)) {
49431
48961
  vegetationConfig = vegetationConfig.filter(item => filterKeys.includes(item.key));
49432
48962
  }
49433
-
49434
- // Map growthObservations to VEGETATION_KEYS
49435
- // Handle both formats: growthObservations keys (e.g., "yellowing_leaves") and VEGETATION_KEYS (e.g., "yellowing")
49436
48963
  const mappedGrowthObservations = Array.isArray(growthObservations) ? growthObservations.map(obs => {
49437
48964
  // First try to map from growthObservations format
49438
48965
  const mapped = GROWTH_OBSERVATIONS_TO_VEGETATION_KEYS[obs];
@@ -51930,9 +51457,17 @@ const RadarChart = ({
51930
51457
  ...tooltipConfig
51931
51458
  },
51932
51459
  color: color || token.colorPrimary7,
51460
+ paddingX: 60,
51461
+ paddingY: 60,
51933
51462
  xAxis: {
51934
51463
  label: {
51935
- formatter: formattedXAxis
51464
+ formatter: formattedXAxis,
51465
+ offset: 15,
51466
+ style: {
51467
+ fontSize: 12,
51468
+ fill: '#666',
51469
+ textAlign: 'center'
51470
+ }
51936
51471
  },
51937
51472
  line: null,
51938
51473
  tickLine: null,
@@ -52001,12 +51536,23 @@ const RadarChart = ({
52001
51536
  }, []);
52002
51537
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
52003
51538
  className: "flex flex-1 flex-column justify-content-center",
51539
+ style: {
51540
+ overflow: 'visible'
51541
+ },
52004
51542
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
52005
51543
  className: "flex justify-content-center",
51544
+ style: {
51545
+ paddingX: '30px',
51546
+ overflow: 'visible',
51547
+ width: '100%'
51548
+ },
52006
51549
  children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
52007
51550
  ref: containerRef,
52008
51551
  height: height,
52009
- isPdf: isPdf
51552
+ isPdf: isPdf,
51553
+ style: {
51554
+ paddingX: '30px'
51555
+ }
52010
51556
  })
52011
51557
  }), legendEnabled && legendPosition === 'bottom' && /*#__PURE__*/jsxRuntime.jsx(CustomLegend, {
52012
51558
  items: legendItems,
@@ -57316,7 +56862,20 @@ const MonitoringScopeAndFindings = ({
57316
56862
  });
57317
56863
  };
57318
56864
 
57319
- const COLORS$3 = ['#016C6E', '#F5C2AC', '#F0A888', '#DF571E', '#C04B19', '#9B3D14', '#7A2F0F'];
56865
+ const VEGETATION_HEALTH_COLORS = {
56866
+ healthy_leaves: '#6AD99E',
56867
+ white_spots: '#E8F0F0',
56868
+ yellowing_leaves: '#CDC14F',
56869
+ black_spots: '#2E3131',
56870
+ reddish_spots: '#CB2525',
56871
+ leaf_mosaic: '#B59E76',
56872
+ spider_webs: '#F8F6EF',
56873
+ damage_from_insects: '#DE8954',
56874
+ dry_dead_leaves: '#767870',
56875
+ no_leaves: '#F97066',
56876
+ other: '#BDBDBD'
56877
+ };
56878
+ const DEFAULT_COLOR$3 = '#9E9E9E';
57320
56879
  const VegetationHealth = ({
57321
56880
  vegetationHealthChart,
57322
56881
  t = s => s,
@@ -57337,7 +56896,7 @@ const VegetationHealth = ({
57337
56896
  return data.map((item, index) => ({
57338
56897
  value: Number(item?.count) || 0,
57339
56898
  percent: total > 0 ? (Number(item?.count) || 0) / total : 0,
57340
- color: COLORS$3[index % COLORS$3.length],
56899
+ color: VEGETATION_HEALTH_COLORS[item?.name] || DEFAULT_COLOR$3,
57341
56900
  label: optionsMap[item?.name] || item?.name || '',
57342
56901
  key: item?.name || `item-${index}`
57343
56902
  }));
@@ -57435,6 +56994,80 @@ const calculateNiceAxisConfig = (data, valueField = 'value', multiplier = 1.2, d
57435
56994
  };
57436
56995
  };
57437
56996
 
56997
+ /**
56998
+ * Calculate y-axis configuration with natural numbers (integers) only
56999
+ * Always starts from 0 and extends slightly above max for better visualization
57000
+ * @param {number} maxValue - Maximum value from the data
57001
+ * @param {Object} options - Optional configuration
57002
+ * @param {number} options.minTicks - Minimum number of ticks to show (default: 4)
57003
+ * @param {number} options.maxTicks - Maximum number of ticks to show (default: 6)
57004
+ * @returns {Object} Axis configuration with min, max, and tickMethod
57005
+ */
57006
+ const calculateNaturalAxisConfig = (maxValue, options = {}) => {
57007
+ const {
57008
+ minTicks = 4,
57009
+ maxTicks = 6
57010
+ } = options;
57011
+ if (maxValue <= 0) {
57012
+ return {
57013
+ min: 0,
57014
+ max: 4,
57015
+ tickMethod: () => [0, 1, 2, 3, 4]
57016
+ };
57017
+ }
57018
+
57019
+ // For very small values (max <= 1), always show 0, 1, 2, 3, 4
57020
+ if (maxValue <= 1) {
57021
+ return {
57022
+ min: 0,
57023
+ max: 4,
57024
+ tickMethod: () => [0, 1, 2, 3, 4]
57025
+ };
57026
+ }
57027
+
57028
+ // Calculate appropriate step size based on max value
57029
+ let step = 1;
57030
+ let displayMax = maxValue;
57031
+ if (maxValue <= 5) {
57032
+ // For small values, use step of 1 and extend a bit above
57033
+ step = 1;
57034
+ displayMax = Math.max(5, Math.ceil(maxValue * 1.5));
57035
+ } else if (maxValue <= 10) {
57036
+ // For medium-small values, use step of 2
57037
+ step = 2;
57038
+ displayMax = Math.ceil(maxValue * 1.2 / step) * step;
57039
+ } else if (maxValue <= 20) {
57040
+ // For medium values, use step of 5
57041
+ step = 5;
57042
+ displayMax = Math.ceil(maxValue * 1.2 / step) * step;
57043
+ } else if (maxValue <= 50) {
57044
+ // For larger values, use step of 10
57045
+ step = 10;
57046
+ displayMax = Math.ceil(maxValue * 1.2 / step) * step;
57047
+ } else {
57048
+ // For very large values, calculate step to get 4-6 ticks
57049
+ const targetTicks = Math.min(maxTicks, Math.max(minTicks, Math.ceil(maxValue / 20)));
57050
+ step = Math.ceil(maxValue / targetTicks / 10) * 10; // Round to nearest 10
57051
+ displayMax = Math.ceil(maxValue * 1.2 / step) * step;
57052
+ }
57053
+
57054
+ // Generate ticks from 0 to displayMax
57055
+ const ticks = [];
57056
+ for (let i = 0; i <= displayMax; i += step) {
57057
+ ticks.push(i);
57058
+ }
57059
+
57060
+ // Ensure max value is included if it's close
57061
+ if (ticks[ticks.length - 1] < maxValue && maxValue - ticks[ticks.length - 1] <= step / 2) {
57062
+ ticks.push(maxValue);
57063
+ }
57064
+ return {
57065
+ min: 0,
57066
+ max: displayMax,
57067
+ tickMethod: () => ticks
57068
+ };
57069
+ };
57070
+
57438
57071
  /**
57439
57072
  * Merge default categories with backend data
57440
57073
  * Ensures all categories are displayed even if they have no data
@@ -57490,13 +57123,11 @@ const SeedlingsHeight$1 = ({
57490
57123
  return mergeDefaultCategories(seedlingsHeightChart, DEFAULT_HEIGHT_RANGES, 'range', 'count', 'label', 'value');
57491
57124
  }, [seedlingsHeightChart]);
57492
57125
  const yAxisConfig = React.useMemo(() => {
57493
- return calculateNiceAxisConfig(chartData, 'value', 2,
57494
- // multiplier: double the max value
57495
- {
57496
- min: 0,
57497
- max: 20,
57498
- tickMethod: () => [0, 5, 10, 15, 20]
57499
- });
57126
+ // Calculate max value from data
57127
+ const maxValue = chartData && chartData.length > 0 ? Math.max(...chartData.map(item => Number(item?.value) || 0)) : 0;
57128
+
57129
+ // Use the helper function to calculate natural number axis configuration
57130
+ return calculateNaturalAxisConfig(maxValue);
57500
57131
  }, [chartData]);
57501
57132
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
57502
57133
  title: t("Seedlings Height"),
@@ -57518,9 +57149,9 @@ const SeedlingsHeight$1 = ({
57518
57149
  const item = data[0]?.data || data[0];
57519
57150
  return {
57520
57151
  title: t("Seedlings Height"),
57521
- subTitle: title,
57522
57152
  items: [{
57523
- label: t("Count"),
57153
+ color: "#016C6E",
57154
+ label: title,
57524
57155
  value: item?.value || 0
57525
57156
  }]
57526
57157
  };
@@ -57531,7 +57162,12 @@ const SeedlingsHeight$1 = ({
57531
57162
  });
57532
57163
  };
57533
57164
 
57534
- const COLORS$2 = ['#6AD99E', '#F5C2AC', '#F0A888', '#DF571E', '#C04B19', '#9B3D14', '#7A2F0F'];
57165
+ const PLANTED_SPECIES_COLORS = {
57166
+ rhyzophora_mangle: '#016C6E',
57167
+ rhyzophora: '#00AEB1',
57168
+ rhyzophora_sp: '#A0EBEC'
57169
+ };
57170
+ const DEFAULT_COLOR$2 = '#9E9E9E';
57535
57171
  const PlantedSpecies$1 = ({
57536
57172
  plantedSpeciesChart,
57537
57173
  t = s => s,
@@ -57552,7 +57188,7 @@ const PlantedSpecies$1 = ({
57552
57188
  return data.map((item, index) => ({
57553
57189
  value: Number(item?.count) || 0,
57554
57190
  percent: total > 0 ? (Number(item?.count) || 0) / total : 0,
57555
- color: COLORS$2[index % COLORS$2.length],
57191
+ color: PLANTED_SPECIES_COLORS[item?.name] || DEFAULT_COLOR$2,
57556
57192
  label: optionsMap[item?.name] || item?.name || '',
57557
57193
  key: item?.name || `item-${index}`
57558
57194
  }));
@@ -57564,15 +57200,22 @@ const PlantedSpecies$1 = ({
57564
57200
  if (isEmpty) {
57565
57201
  return null;
57566
57202
  }
57203
+
57204
+ // Calculate total from all items
57205
+ const total = pieData.reduce((sum, dataItem) => sum + (dataItem.value || 0), 0);
57206
+
57207
+ // Show all items in the tooltip, sorted by value (descending)
57208
+ const allItems = pieData.filter(dataItem => dataItem.value > 0).sort((a, b) => b.value - a.value).map(dataItem => ({
57209
+ color: dataItem.color,
57210
+ label: dataItem.label || '',
57211
+ value: dataItem.value || 0
57212
+ }));
57567
57213
  return renderTooltipJsx({
57568
57214
  title: t("Planted Species"),
57569
- items: [{
57570
- color: item.color,
57571
- label: item.label || '',
57572
- value: item.value || 0
57573
- }]
57215
+ subTitle: total.toLocaleString(),
57216
+ items: allItems
57574
57217
  });
57575
- }, [t, isEmpty]);
57218
+ }, [t, isEmpty, pieData]);
57576
57219
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
57577
57220
  title: t("Planted Species"),
57578
57221
  className: "with-border-header h-w-btn-header",
@@ -57837,13 +57480,8 @@ const ObservedFauna = ({
57837
57480
  }));
57838
57481
  }, [observedFaunaChart, options]);
57839
57482
  const xAxisConfig = React.useMemo(() => {
57840
- return calculateNiceAxisConfig(chartData, 'value', 1.2,
57841
- // multiplier: 20% padding
57842
- {
57843
- min: 0,
57844
- max: 10,
57845
- tickMethod: () => [0, 2, 4, 6, 8, 10]
57846
- });
57483
+ const maxValue = chartData && chartData.length > 0 ? Math.max(...chartData.map(item => Number(item?.value) || 0)) : 0;
57484
+ return calculateNaturalAxisConfig(maxValue);
57847
57485
  }, [chartData]);
57848
57486
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
57849
57487
  title: t("Observed Fauna"),
@@ -58113,7 +57751,13 @@ const Stats = ({
58113
57751
  });
58114
57752
  };
58115
57753
 
58116
- const COLORS$1 = ['#016C6E', '#4FB3A1', '#A8E6CF', '#FFD93D', '#F0A888', '#DF571E', '#C04B19'];
57754
+ const SOIL_TYPE_COLORS$1 = {
57755
+ sandy: '#00AEB1',
57756
+ mixed: '#016C6E',
57757
+ clay: '#A0EBEC',
57758
+ muddy: '#4FB3A1'
57759
+ };
57760
+ const DEFAULT_COLOR$1 = '#9E9E9E';
58117
57761
  const SoilType = ({
58118
57762
  soilTypeChart,
58119
57763
  t = s => s,
@@ -58134,7 +57778,7 @@ const SoilType = ({
58134
57778
  return data.map((item, index) => ({
58135
57779
  value: Number(item?.count) || 0,
58136
57780
  percent: total > 0 ? (Number(item?.count) || 0) / total : 0,
58137
- color: COLORS$1[index % COLORS$1.length],
57781
+ color: SOIL_TYPE_COLORS$1[item?.soilType] || DEFAULT_COLOR$1,
58138
57782
  label: optionsMap[item?.soilType] || item?.soilType || '',
58139
57783
  key: item?.soilType || `item-${index}`
58140
57784
  }));
@@ -58146,15 +57790,18 @@ const SoilType = ({
58146
57790
  if (isEmpty) {
58147
57791
  return null;
58148
57792
  }
57793
+
57794
+ // Show all items in the tooltip, sorted by percentage (descending)
57795
+ const allItems = pieData.filter(dataItem => dataItem.value > 0).sort((a, b) => b.percent - a.percent).map(dataItem => ({
57796
+ color: dataItem.color,
57797
+ label: dataItem.label || '',
57798
+ value: renderPercentage(Math.round(dataItem.percent * 100))
57799
+ }));
58149
57800
  return renderTooltipJsx({
58150
57801
  title: t("Soil Type"),
58151
- items: [{
58152
- color: item.color,
58153
- label: optionsMap[item.label] || item.label || '',
58154
- value: `${renderPercentage(item.percent.toFixed(2) * 100)}`
58155
- }]
57802
+ items: allItems
58156
57803
  });
58157
- }, [t, isEmpty, optionsMap]);
57804
+ }, [t, isEmpty, pieData]);
58158
57805
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
58159
57806
  title: t("Soil Type"),
58160
57807
  className: "with-border-header h-w-btn-header",
@@ -58255,7 +57902,16 @@ const SalinityLevels = ({
58255
57902
  });
58256
57903
  };
58257
57904
 
58258
- const COLORS = ['#6AD99E', '#FFD93D', '#F0A888', '#DF571E', '#B0B0B0', '#016C6E', '#4FB3A1'];
57905
+ const WATER_QUALITY_COLORS = {
57906
+ fairly_clear: '#32D583',
57907
+ turbid: '#FFA940',
57908
+ polluted: '#F97066',
57909
+ oil_traces: '#2B3644',
57910
+ no_water: '#DAD6CE',
57911
+ clear: '#6AD99E',
57912
+ other: '#9E9E9E'
57913
+ };
57914
+ const DEFAULT_COLOR = '#9E9E9E';
58259
57915
  const WaterQuality = ({
58260
57916
  waterQualityChart,
58261
57917
  t = s => s,
@@ -58276,7 +57932,7 @@ const WaterQuality = ({
58276
57932
  return data.map((item, index) => ({
58277
57933
  value: Number(item?.count) || 0,
58278
57934
  percent: total > 0 ? (Number(item?.count) || 0) / total : 0,
58279
- color: COLORS[index % COLORS.length],
57935
+ color: WATER_QUALITY_COLORS[item?.waterQuality] || DEFAULT_COLOR,
58280
57936
  label: optionsMap[item?.waterQuality] || item?.waterQuality || '',
58281
57937
  key: item?.waterQuality || `item-${index}`
58282
57938
  }));
@@ -58288,15 +57944,18 @@ const WaterQuality = ({
58288
57944
  if (isEmpty) {
58289
57945
  return null;
58290
57946
  }
57947
+
57948
+ // Show all items in the tooltip, sorted by percentage (descending)
57949
+ const allItems = pieData.filter(dataItem => dataItem.value > 0).sort((a, b) => b.percent - a.percent).map(dataItem => ({
57950
+ color: dataItem.color,
57951
+ label: dataItem.label || '',
57952
+ value: renderPercentage(Math.round(dataItem.percent * 100))
57953
+ }));
58291
57954
  return renderTooltipJsx({
58292
57955
  title: t("Water Quality"),
58293
- items: [{
58294
- color: item.color,
58295
- label: item.label || '',
58296
- value: `${Math.round(item.percent * 100)}%`
58297
- }]
57956
+ items: allItems
58298
57957
  });
58299
- }, [t, isEmpty]);
57958
+ }, [t, isEmpty, pieData]);
58300
57959
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
58301
57960
  title: t("Water Quality"),
58302
57961
  className: "with-border-header h-w-btn-header",