datastake-daf 0.6.816 → 0.6.818

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 (37) hide show
  1. package/dist/components/index.js +1236 -1281
  2. package/dist/pages/index.js +1326 -426
  3. package/dist/services/index.js +202 -0
  4. package/dist/utils/index.js +28 -0
  5. package/package.json +1 -1
  6. package/public/Vegetation/damage-from-insects-default.svg +1 -0
  7. package/public/Vegetation/dry-or-dead-default.svg +1 -0
  8. package/public/Vegetation/healthy-default.svg +1 -0
  9. package/public/Vegetation/yellowing.svg +1 -0
  10. package/src/@daf/core/components/Charts/RadarChart/index.jsx +51 -9
  11. package/src/@daf/core/components/Charts/style.js +0 -1
  12. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +123 -104
  13. package/src/@daf/core/components/Table/index.jsx +11 -6
  14. package/src/@daf/pages/Events/Activities/columns.js +15 -11
  15. package/src/@daf/pages/Events/Incidents/columns.js +15 -11
  16. package/src/@daf/pages/Events/Testimonials/columns.js +173 -0
  17. package/src/@daf/pages/Events/Testimonials/config.js +175 -0
  18. package/src/@daf/pages/Events/columns.js +7 -3
  19. package/src/@daf/pages/Locations/ConflictAreas/columns.js +140 -0
  20. package/src/@daf/pages/Locations/ConflictAreas/config.js +41 -0
  21. package/src/@daf/pages/Locations/MineSite/columns.js +21 -12
  22. package/src/@daf/pages/Locations/MineSite/config.js +2 -1
  23. package/src/@daf/pages/Locations/columns.js +7 -3
  24. package/src/@daf/pages/Stakeholders/ArmedGroups/columns.js +110 -0
  25. package/src/@daf/pages/Stakeholders/ArmedGroups/config.js +41 -0
  26. package/src/@daf/pages/Stakeholders/Operators/columns.js +30 -14
  27. package/src/@daf/pages/Stakeholders/Workers/columns.js +23 -13
  28. package/src/@daf/pages/Stakeholders/columns.js +8 -4
  29. package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/index.jsx +4 -2
  30. package/src/@daf/pages/TablePage/config.js +1 -1
  31. package/src/@daf/pages/TablePage/helper.js +45 -0
  32. package/src/@daf/services/EventsService.js +115 -0
  33. package/src/@daf/services/LinkedSubjects.js +1 -0
  34. package/src/@daf/services/WorkersService.js +80 -0
  35. package/src/helpers/errorHandling.js +142 -74
  36. package/src/services.js +3 -1
  37. package/src/utils.js +1 -1
@@ -16,6 +16,7 @@ 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');
19
20
  require('@elfalem/leaflet-curve');
20
21
  var react = require('@xyflow/react');
21
22
  var g2plot = require('@antv/g2plot');
@@ -9401,8 +9402,8 @@ function LocationIcon({
9401
9402
  activeMarker,
9402
9403
  setActiveMarker
9403
9404
  }) {
9404
- const rootsMapRef = React.useRef(new Map());
9405
9405
  const markersRef = React.useRef([]);
9406
+ const [portalContainers, setPortalContainers] = React.useState([]);
9406
9407
  const isSelected = selectedMarkersId.includes(data.datastakeId);
9407
9408
  const Marker = React.useMemo(() => {
9408
9409
  if (isMineSite(data.type)) {
@@ -9410,7 +9411,7 @@ function LocationIcon({
9410
9411
  }
9411
9412
  return VillageMarker;
9412
9413
  }, [data.type]);
9413
- const [isHovering, setIsHovering] = React.useState(false);
9414
+ React.useState(false);
9414
9415
  const linkedNodesData = React.useMemo(() => {
9415
9416
  const nodes = [];
9416
9417
  const links = data.links || [];
@@ -9475,31 +9476,32 @@ function LocationIcon({
9475
9476
  return nodes;
9476
9477
  }, [JSON.stringify(allData), JSON.stringify(data.links), JSON.stringify(data.stakeholders), zoom]);
9477
9478
  const stakeholdersOfLocation = React.useMemo(() => {
9478
- return data?.stakeholders || [];
9479
- }, [data.stakeholders, zoom]);
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]);
9480
9488
  React.useEffect(() => {
9481
- const currentRoots = rootsMapRef.current;
9482
- const currentMarkers = markersRef.current;
9483
- currentMarkers.forEach(marker => {
9484
- if (mapRef.hasLayer(marker)) {
9489
+ markersRef.current.forEach(marker => {
9490
+ if (mapRef && mapRef.hasLayer(marker)) {
9485
9491
  mapRef.removeLayer(marker);
9486
9492
  }
9487
9493
  });
9488
- currentRoots.forEach(root => {
9489
- root.unmount();
9490
- });
9491
- currentRoots.clear();
9492
9494
  markersRef.current = [];
9493
-
9494
- // Only create stakeholder markers if this location or any of its stakeholders are selected
9495
+ setPortalContainers([]);
9495
9496
  const shouldShowStakeholders = isSelected || stakeholdersOfLocation.some(stk => selectedMarkersId.includes(stk.datastakeId));
9496
9497
  if (!shouldShowStakeholders || selectedMarkersId.length === 0) {
9497
9498
  return;
9498
9499
  }
9499
9500
 
9500
- // Create new markers only when selected
9501
+ // Create markers and store their container references
9502
+ const containers = [];
9501
9503
  stakeholdersOfLocation.forEach((stakeholder, index) => {
9502
- const markerId = `${stakeholder.datastakeId}`;
9504
+ const markerId = `${data.datastakeId}-${stakeholder.datastakeId}`;
9503
9505
  const {
9504
9506
  x,
9505
9507
  y,
@@ -9522,41 +9524,29 @@ function LocationIcon({
9522
9524
  const pathLocLatLng = mapRef.layerPointToLatLng(pathLocPoint);
9523
9525
  const isForceOpen = activeMarker?.datastakeId === data.datastakeId;
9524
9526
  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;
9525
9531
  const marker = L__namespace.marker(stakeholderLatLng, {
9526
9532
  icon: L__namespace.divIcon({
9527
- html: `<div id="${markerId}"></div>`,
9533
+ html: containerDiv.outerHTML,
9528
9534
  className: "marker-chain",
9529
9535
  iconSize: iconSize
9530
9536
  })
9531
9537
  }).addTo(mapRef);
9532
9538
  markersRef.current.push(marker);
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);
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
+ });
9560
9550
  setMapMarkers(prev => {
9561
9551
  const array = [...prev, {
9562
9552
  id: marker._leaflet_id,
@@ -9588,17 +9578,19 @@ function LocationIcon({
9588
9578
  animated: true
9589
9579
  });
9590
9580
  });
9581
+
9582
+ // Update portal containers after markers are created
9583
+ setTimeout(() => {
9584
+ setPortalContainers(containers);
9585
+ }, 0);
9591
9586
  return () => {
9592
9587
  markersRef.current.forEach(marker => {
9593
- if (mapRef.hasLayer(marker)) {
9588
+ if (mapRef && mapRef.hasLayer(marker)) {
9594
9589
  mapRef.removeLayer(marker);
9595
9590
  }
9596
9591
  });
9597
- rootsMapRef.current.forEach(root => {
9598
- root.unmount();
9599
- });
9600
- rootsMapRef.current.clear();
9601
9592
  markersRef.current = [];
9593
+ setPortalContainers([]);
9602
9594
  };
9603
9595
  }, [stakeholdersOfLocation, selectedMarkersId, activeMarker, zoom]);
9604
9596
 
@@ -9682,57 +9674,81 @@ function LocationIcon({
9682
9674
  });
9683
9675
  });
9684
9676
  }, [linkedNodesData, selectedMarkersId, zoom, stakeholdersOfLocation, isSelected]);
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"
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;
9709
9692
  },
9710
- children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
9693
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
9711
9694
  style: {
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);
9695
+ position: "relative",
9696
+ display: "inline-block"
9727
9697
  },
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,
9728
9733
  zoom: zoom,
9729
- onMouseEnter: () => setIsHovering(true),
9730
- onMouseLeave: () => {
9731
- setIsHovering(false);
9732
- },
9733
- selectedMarkersId: selectedMarkersId
9734
- })]
9735
- })
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
+ })]
9736
9752
  });
9737
9753
  }
9738
9754
 
@@ -12753,7 +12769,6 @@ const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
12753
12769
  const Container$1 = styled__default["default"].div`
12754
12770
  height: ${props => props.height || '300px'};
12755
12771
  width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
12756
- overflow: ${props => props.style?.overflow || 'visible'};
12757
12772
  `;
12758
12773
 
12759
12774
  const useLegendConfig = ({
@@ -14161,7 +14176,7 @@ const getTabs = t => {
14161
14176
  label: t("Events")
14162
14177
  }];
14163
14178
  };
14164
- const getFiltersConfig$b = ({
14179
+ const getFiltersConfig$e = ({
14165
14180
  t,
14166
14181
  filters,
14167
14182
  activeTab,
@@ -14396,7 +14411,7 @@ function MineSites({
14396
14411
  config: dataFetchConfig
14397
14412
  });
14398
14413
  const tabs = React.useMemo(() => getTabs(t), [t]);
14399
- const filtersConfig = React.useMemo(() => getFiltersConfig$b({
14414
+ const filtersConfig = React.useMemo(() => getFiltersConfig$e({
14400
14415
  t,
14401
14416
  filters,
14402
14417
  options,
@@ -15549,7 +15564,12 @@ function DAFTable({
15549
15564
  doEmptyRows,
15550
15565
  ...rest
15551
15566
  }) {
15552
- const [source, setSource] = React.useState([]);
15567
+ const source = React.useMemo(() => {
15568
+ if (data && Array.isArray(data)) {
15569
+ return data;
15570
+ }
15571
+ return [];
15572
+ }, [data]);
15553
15573
  const projectData = (projects || []).find(p => p.id === selectedProject);
15554
15574
  const [filtersInit, setFiltersInit] = React.useState(!loading);
15555
15575
  React.useEffect(() => {
@@ -15594,11 +15614,13 @@ function DAFTable({
15594
15614
  }
15595
15615
  } : filtersConfig;
15596
15616
  }, [sourcesKey, sources, filtersConfig, t]);
15597
- React.useEffect(() => {
15598
- if (data && Array.isArray(data)) {
15599
- setSource(data);
15600
- }
15601
- }, [data, data.length]);
15617
+
15618
+ // useEffect(() => {
15619
+ // if (data && Array.isArray(data)) {
15620
+ // setSource(data);
15621
+ // }
15622
+ // }, [data, data.length]);
15623
+
15602
15624
  const paginationPageSize = pagination?.pageSize;
15603
15625
  const dataSource = React.useMemo(() => {
15604
15626
  const pageSize = paginationPageSize ? paginationPageSize : source.length > 10 ? source.length : 10;
@@ -16088,7 +16110,7 @@ const NavigationAction = ({
16088
16110
  });
16089
16111
  };
16090
16112
 
16091
- const getColumns$g = ({
16113
+ const getColumns$j = ({
16092
16114
  t,
16093
16115
  data,
16094
16116
  user,
@@ -16214,7 +16236,7 @@ function OrganisationInformation({
16214
16236
  });
16215
16237
  }, [organisationInfo, data]);
16216
16238
  const columns = React.useMemo(() => {
16217
- return getColumns$g({
16239
+ return getColumns$j({
16218
16240
  t,
16219
16241
  data: tableData,
16220
16242
  user,
@@ -16345,7 +16367,7 @@ const Style$8 = styled__default["default"].div`
16345
16367
  }
16346
16368
  `;
16347
16369
 
16348
- const getColumns$f = ({
16370
+ const getColumns$i = ({
16349
16371
  t = () => {},
16350
16372
  options = {},
16351
16373
  user = {},
@@ -16502,7 +16524,7 @@ function ProductionSites({
16502
16524
  return productionSites?.length > 5 ? ComponentWithFocus : "div";
16503
16525
  }, [productionSites]);
16504
16526
  const columns = React.useMemo(() => {
16505
- return getColumns$f({
16527
+ return getColumns$i({
16506
16528
  t,
16507
16529
  options,
16508
16530
  user,
@@ -16736,7 +16758,7 @@ const getAdminLevelName = (data, level) => {
16736
16758
  return entry?.name || "-";
16737
16759
  };
16738
16760
 
16739
- const getColumns$e = ({
16761
+ const getColumns$h = ({
16740
16762
  t,
16741
16763
  activeTab,
16742
16764
  options,
@@ -17030,7 +17052,7 @@ function AssociatedInformation$1({
17030
17052
  console.log({
17031
17053
  data
17032
17054
  });
17033
- const columns = React.useMemo(() => getColumns$e({
17055
+ const columns = React.useMemo(() => getColumns$h({
17034
17056
  t,
17035
17057
  isMonitoring: false,
17036
17058
  activeTab,
@@ -17414,7 +17436,7 @@ const getPartnershipTypes = t => {
17414
17436
  }];
17415
17437
  };
17416
17438
 
17417
- const getColumns$d = ({
17439
+ const getColumns$g = ({
17418
17440
  t,
17419
17441
  accept,
17420
17442
  decline,
@@ -40800,7 +40822,7 @@ const PartnersTable = ({
40800
40822
  setTotalRequests,
40801
40823
  t
40802
40824
  });
40803
- const columns = React.useMemo(() => getColumns$d({
40825
+ const columns = React.useMemo(() => getColumns$g({
40804
40826
  t,
40805
40827
  accept,
40806
40828
  decline,
@@ -41037,7 +41059,7 @@ const Create = ({
41037
41059
  });
41038
41060
  };
41039
41061
 
41040
- const getFiltersConfig$a = ({
41062
+ const getFiltersConfig$d = ({
41041
41063
  t
41042
41064
  }) => {
41043
41065
  return {
@@ -41068,7 +41090,7 @@ const getFiltersConfig$a = ({
41068
41090
  }
41069
41091
  };
41070
41092
  };
41071
- const getFilterOptions$a = (options, t) => {
41093
+ const getFilterOptions$d = (options, t) => {
41072
41094
  const {
41073
41095
  countries,
41074
41096
  category,
@@ -41079,13 +41101,13 @@ const getFilterOptions$a = (options, t) => {
41079
41101
  category: categoriesOptions || category || []
41080
41102
  };
41081
41103
  };
41082
- const formConfig$8 = {
41104
+ const formConfig$b = {
41083
41105
  namespace: 'stakeholders',
41084
41106
  view: 'scoping',
41085
41107
  scope: 'create',
41086
41108
  formType: 'stakeholder'
41087
41109
  };
41088
- const viewConfig$8 = {
41110
+ const viewConfig$b = {
41089
41111
  title: "Stakeholders",
41090
41112
  createTitle: "Create Stakeholder"
41091
41113
  };
@@ -41172,7 +41194,7 @@ function sourceAvatarConfig(items, user, applications) {
41172
41194
  });
41173
41195
  }
41174
41196
 
41175
- const getColumns$c = ({
41197
+ const getColumns$f = ({
41176
41198
  t,
41177
41199
  goTo,
41178
41200
  user,
@@ -41225,7 +41247,8 @@ const getColumns$c = ({
41225
41247
  className: "daf-default-cell"
41226
41248
  });
41227
41249
  }
41228
- const category = findOptions(v, options?.categoriesOptions);
41250
+ const categoriesOptions = [...(options?.categoriesOptions || []), ...(options?.category || [])];
41251
+ const category = findOptions(v, categoriesOptions);
41229
41252
  return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41230
41253
  title: category,
41231
41254
  children: category
@@ -41242,7 +41265,8 @@ const getColumns$c = ({
41242
41265
  className: "daf-default-cell"
41243
41266
  });
41244
41267
  }
41245
- const subCategory = findOptions(v, options?.subCategoriesOptions);
41268
+ const subCategoriesOptions = [...(options?.subCategoriesOptions || []), ...(options?.subCategory || [])];
41269
+ const subCategory = findOptions(v, subCategoriesOptions);
41246
41270
  return subCategory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41247
41271
  title: subCategory,
41248
41272
  children: subCategory
@@ -41277,7 +41301,7 @@ const getColumns$c = ({
41277
41301
  });
41278
41302
  }
41279
41303
  if (!val || val?.length === 0) {
41280
- return "--";
41304
+ return "-";
41281
41305
  }
41282
41306
  const sources = sourceAvatarConfig(val, user, applications);
41283
41307
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
@@ -41326,7 +41350,7 @@ const getColumns$c = ({
41326
41350
  }
41327
41351
  }].filter(column => column.show !== false);
41328
41352
 
41329
- const getFiltersConfig$9 = ({
41353
+ const getFiltersConfig$c = ({
41330
41354
  t
41331
41355
  }) => {
41332
41356
  return {
@@ -41494,7 +41518,7 @@ const getFiltersConfig$9 = ({
41494
41518
  }
41495
41519
  };
41496
41520
  };
41497
- const getFilterOptions$9 = (options, t) => {
41521
+ const getFilterOptions$c = (options, t) => {
41498
41522
  const {
41499
41523
  statusOptions,
41500
41524
  categoryOptions,
@@ -41516,13 +41540,13 @@ const getFilterOptions$9 = (options, t) => {
41516
41540
  };
41517
41541
  return _default;
41518
41542
  };
41519
- const formConfig$7 = {
41543
+ const formConfig$a = {
41520
41544
  namespace: 'OPERATOR',
41521
41545
  view: ['scoping', 'new'],
41522
41546
  scope: 'global',
41523
41547
  formType: 'operator'
41524
41548
  };
41525
- const viewConfig$7 = {
41549
+ const viewConfig$a = {
41526
41550
  title: "Operators",
41527
41551
  createTitle: "Create Operator"
41528
41552
  };
@@ -41563,7 +41587,7 @@ const renderStatusTag = ({
41563
41587
  }
41564
41588
  };
41565
41589
 
41566
- const getColumns$b = ({
41590
+ const getColumns$e = ({
41567
41591
  t,
41568
41592
  goTo,
41569
41593
  user,
@@ -41621,7 +41645,8 @@ const getColumns$b = ({
41621
41645
  className: "daf-default-cell"
41622
41646
  });
41623
41647
  }
41624
- const country = findOptions(v, data?.options?.positionSupplyChainOptions || data?.options?.optionPositionSupplyChain);
41648
+ const positionSupplyChainOptions = [...(data?.options?.positionSupplyChainOptions || []), ...(options?.positionSupplyChainOptions || []), ...(options?.optionPositionSupplyChain || [])];
41649
+ const country = findOptions(v, positionSupplyChainOptions);
41625
41650
  return country ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41626
41651
  title: country,
41627
41652
  children: country
@@ -41640,7 +41665,8 @@ const getColumns$b = ({
41640
41665
  className: "daf-default-cell"
41641
41666
  });
41642
41667
  }
41643
- const subCategory = findOptions(v, data?.options?.subCategoriesOptions || data?.options?.subCategory);
41668
+ const subCategoriesOptions = [...(data?.options?.subCategoriesOptions || []), ...(options?.subCategoriesOptions || []), ...(options?.subCategory || [])];
41669
+ const subCategory = findOptions(v, subCategoriesOptions);
41644
41670
  return subCategory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41645
41671
  title: subCategory,
41646
41672
  children: subCategory
@@ -41709,6 +41735,9 @@ const getColumns$b = ({
41709
41735
  className: "daf-default-cell"
41710
41736
  });
41711
41737
  }
41738
+ if (!val || val?.length === 0) {
41739
+ return "-";
41740
+ }
41712
41741
  const sources = sourceAvatarConfig(val, user, applications);
41713
41742
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
41714
41743
  items: sources
@@ -41770,7 +41799,7 @@ const getColumns$b = ({
41770
41799
  }
41771
41800
  }].filter(column => column.show !== false);
41772
41801
 
41773
- const getFiltersConfig$8 = ({
41802
+ const getFiltersConfig$b = ({
41774
41803
  t
41775
41804
  }) => {
41776
41805
  return {
@@ -41911,7 +41940,7 @@ const getFiltersConfig$8 = ({
41911
41940
  }
41912
41941
  };
41913
41942
  };
41914
- const getFilterOptions$8 = (options, t) => {
41943
+ const getFilterOptions$b = (options, t) => {
41915
41944
  const {
41916
41945
  statusOptions,
41917
41946
  categoryOptions,
@@ -41938,18 +41967,18 @@ const getFilterOptions$8 = (options, t) => {
41938
41967
  };
41939
41968
  return _default;
41940
41969
  };
41941
- const formConfig$6 = {
41970
+ const formConfig$9 = {
41942
41971
  namespace: 'WORKERS',
41943
41972
  view: ['scoping', 'new'],
41944
41973
  scope: 'global',
41945
41974
  formType: 'worker'
41946
41975
  };
41947
- const viewConfig$6 = {
41976
+ const viewConfig$9 = {
41948
41977
  title: "Workers",
41949
41978
  createTitle: "Create Worker"
41950
41979
  };
41951
41980
 
41952
- const getColumns$a = ({
41981
+ const getColumns$d = ({
41953
41982
  t,
41954
41983
  goTo,
41955
41984
  user,
@@ -42028,7 +42057,8 @@ const getColumns$a = ({
42028
42057
  className: "daf-default-cell"
42029
42058
  });
42030
42059
  }
42031
- const activity = findOptions(v, data?.options?.activityAtSiteOptions || data?.options?.activityAtSite);
42060
+ const activityAtSiteOptions = [...(data?.options?.activityAtSiteOptions || []), ...(options?.activityAtSiteOptions || []), ...(options?.activityAtSite || [])];
42061
+ const activity = findOptions(v, activityAtSiteOptions);
42032
42062
  return activity ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
42033
42063
  title: activity,
42034
42064
  children: activity
@@ -42079,6 +42109,9 @@ const getColumns$a = ({
42079
42109
  className: "daf-default-cell"
42080
42110
  });
42081
42111
  }
42112
+ if (!val || val?.length === 0) {
42113
+ return "-";
42114
+ }
42082
42115
  const sources = sourceAvatarConfig(val, user, applications);
42083
42116
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
42084
42117
  items: sources
@@ -42125,7 +42158,175 @@ const getColumns$a = ({
42125
42158
  }
42126
42159
  }].filter(column => column.show !== false);
42127
42160
 
42128
- const getFiltersConfig$7 = ({
42161
+ const getFiltersConfig$a = ({
42162
+ t
42163
+ }) => {
42164
+ return {
42165
+ status: {
42166
+ type: "select",
42167
+ label: "Status",
42168
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
42169
+ style: {
42170
+ flex: 1
42171
+ },
42172
+ labelStyle: {
42173
+ fley: 1
42174
+ },
42175
+ getLabel: option => option.label,
42176
+ getValue: option => option.value
42177
+ },
42178
+ timeframe: {
42179
+ type: "timeframe",
42180
+ label: "Timeframe",
42181
+ style: {
42182
+ flex: 1
42183
+ }
42184
+ }
42185
+ };
42186
+ };
42187
+ const getFilterOptions$a = (options, t) => {
42188
+ const _default = {
42189
+ status: getStatusOptions(t) || [],
42190
+ timeframe: []
42191
+ };
42192
+ return _default;
42193
+ };
42194
+ const formConfig$8 = {
42195
+ namespace: 'armed-groups',
42196
+ view: ['scoping', 'new'],
42197
+ scope: 'global',
42198
+ formType: 'armed-group'
42199
+ };
42200
+ const viewConfig$8 = {
42201
+ title: "Armed Groups",
42202
+ createTitle: "New Armed Group"
42203
+ };
42204
+
42205
+ const getColumns$c = ({
42206
+ t,
42207
+ goTo,
42208
+ user,
42209
+ options,
42210
+ activeTab,
42211
+ getRedirectLink,
42212
+ theme,
42213
+ subject,
42214
+ data,
42215
+ applications
42216
+ }) => [{
42217
+ dataIndex: 'datastakeId',
42218
+ title: t('ID'),
42219
+ ellipsis: true,
42220
+ show: true,
42221
+ key: "datastakeId",
42222
+ sorter: () => 0 + 0,
42223
+ render: (v, all) => {
42224
+ if (all.empty) {
42225
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42226
+ className: "daf-default-cell"
42227
+ });
42228
+ }
42229
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
42230
+ title: v,
42231
+ children: v
42232
+ });
42233
+ }
42234
+ }, {
42235
+ dataIndex: 'name',
42236
+ title: t('Name'),
42237
+ ellipsis: true,
42238
+ show: true,
42239
+ key: "name",
42240
+ sorter: () => 0 + 0,
42241
+ render: (v, all) => {
42242
+ if (all.empty) {
42243
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42244
+ className: "daf-default-cell"
42245
+ });
42246
+ }
42247
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
42248
+ title: v,
42249
+ children: v
42250
+ });
42251
+ }
42252
+ }, {
42253
+ title: t("Last Update"),
42254
+ dataIndex: "updatedAt",
42255
+ key: "updatedAt",
42256
+ render: (date, all) => {
42257
+ if (all.empty) {
42258
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42259
+ className: "daf-default-cell"
42260
+ });
42261
+ }
42262
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
42263
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
42264
+ title: _date,
42265
+ children: _date
42266
+ });
42267
+ },
42268
+ ellipsis: true
42269
+ }, {
42270
+ title: t("Sources"),
42271
+ dataIndex: "sources",
42272
+ key: "sources",
42273
+ show: activeTab !== "own",
42274
+ render: (val, all) => {
42275
+ if (all.empty) {
42276
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42277
+ className: "daf-default-cell"
42278
+ });
42279
+ }
42280
+ if (!val || val?.length === 0) {
42281
+ return "-";
42282
+ }
42283
+ const sources = sourceAvatarConfig(val, user, applications);
42284
+ return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
42285
+ items: sources
42286
+ });
42287
+ }
42288
+ }, {
42289
+ title: t("Status"),
42290
+ dataIndex: 'status',
42291
+ ellipsis: true,
42292
+ show: activeTab == "own",
42293
+ render: (v, all) => {
42294
+ if (all.empty) {
42295
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42296
+ className: "daf-default-cell"
42297
+ });
42298
+ }
42299
+ const _val = all?.published || all?.status === "submitted" ? "submitted" : v;
42300
+ return renderStatusTag({
42301
+ value: _val,
42302
+ t
42303
+ });
42304
+ }
42305
+ }, {
42306
+ id: 'actions',
42307
+ title: "",
42308
+ width: 60,
42309
+ render: (_, all) => {
42310
+ if (all.empty) {
42311
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
42312
+ className: "daf-default-cell"
42313
+ });
42314
+ }
42315
+ const onClick = () => {
42316
+ let link = `/app/view/${subject}/${all.datastakeId}`;
42317
+ if (activeTab === "shared") {
42318
+ link += `?sourceId=${all?.authorId?.id}`;
42319
+ }
42320
+ goTo(getRedirectLink(link));
42321
+ };
42322
+ return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
42323
+ onClick: onClick,
42324
+ theme: theme
42325
+ });
42326
+ }
42327
+ }].filter(column => column.show !== false);
42328
+
42329
+ const getFiltersConfig$9 = ({
42129
42330
  t
42130
42331
  }) => {
42131
42332
  return {
@@ -42277,7 +42478,7 @@ const getFiltersConfig$7 = ({
42277
42478
  }
42278
42479
  };
42279
42480
  };
42280
- const getFilterOptions$7 = (options, t) => {
42481
+ const getFilterOptions$9 = (options, t) => {
42281
42482
  const {
42282
42483
  timeframe = [],
42283
42484
  status,
@@ -42303,13 +42504,13 @@ const getFilterOptions$7 = (options, t) => {
42303
42504
  }]
42304
42505
  };
42305
42506
  };
42306
- const formConfig$5 = {
42507
+ const formConfig$7 = {
42307
42508
  namespace: 'event',
42308
42509
  view: 'scoping',
42309
42510
  scope: 'create',
42310
42511
  formType: 'event'
42311
42512
  };
42312
- const viewConfig$5 = {
42513
+ const viewConfig$7 = {
42313
42514
  title: "Events",
42314
42515
  createTitle: "Create Event"
42315
42516
  };
@@ -42436,7 +42637,7 @@ MoreTags.propTypes = {
42436
42637
  limit: PropTypes__default["default"].number
42437
42638
  };
42438
42639
 
42439
- const getColumns$9 = ({
42640
+ const getColumns$b = ({
42440
42641
  t,
42441
42642
  goTo,
42442
42643
  user,
@@ -42598,6 +42799,9 @@ const getColumns$9 = ({
42598
42799
  className: "daf-default-cell"
42599
42800
  });
42600
42801
  }
42802
+ if (!val || val?.length === 0) {
42803
+ return "-";
42804
+ }
42601
42805
  const sources = sourceAvatarConfig(val, user, applications);
42602
42806
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
42603
42807
  items: sources
@@ -42668,7 +42872,7 @@ const getColumns$9 = ({
42668
42872
  }
42669
42873
  }].filter(column => column.show !== false);
42670
42874
 
42671
- const getFiltersConfig$6 = ({
42875
+ const getFiltersConfig$8 = ({
42672
42876
  t
42673
42877
  }) => {
42674
42878
  return {
@@ -42840,7 +43044,7 @@ const getFiltersConfig$6 = ({
42840
43044
  }
42841
43045
  };
42842
43046
  };
42843
- const getFilterOptions$6 = (options, t) => {
43047
+ const getFilterOptions$8 = (options, t) => {
42844
43048
  const {
42845
43049
  timeframe = [],
42846
43050
  statusOptions,
@@ -42873,13 +43077,13 @@ const getFilterOptions$6 = (options, t) => {
42873
43077
  };
42874
43078
  return _default;
42875
43079
  };
42876
- const formConfig$4 = {
43080
+ const formConfig$6 = {
42877
43081
  namespace: 'corrective-actions',
42878
43082
  view: 'corrective-actions',
42879
43083
  scope: 'createActivity',
42880
43084
  formType: 'activity'
42881
43085
  };
42882
- const viewConfig$4 = {
43086
+ const viewConfig$6 = {
42883
43087
  title: "Activities",
42884
43088
  createTitle: "Create Activity"
42885
43089
  };
@@ -42893,7 +43097,7 @@ const getEventCategoryBySubject = (eventCategoryObject, subject, isSingular = fa
42893
43097
  return eventCategoryObject[key] || null;
42894
43098
  };
42895
43099
 
42896
- const getColumns$8 = ({
43100
+ const getColumns$a = ({
42897
43101
  t,
42898
43102
  goTo,
42899
43103
  user,
@@ -43040,6 +43244,9 @@ const getColumns$8 = ({
43040
43244
  className: "daf-default-cell"
43041
43245
  });
43042
43246
  }
43247
+ if (!val || val?.length === 0) {
43248
+ return "-";
43249
+ }
43043
43250
  const sources = sourceAvatarConfig(val, user, applications);
43044
43251
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43045
43252
  items: sources
@@ -43103,7 +43310,7 @@ const getColumns$8 = ({
43103
43310
  }
43104
43311
  }].filter(column => column.show !== false);
43105
43312
 
43106
- const getFiltersConfig$5 = ({
43313
+ const getFiltersConfig$7 = ({
43107
43314
  t
43108
43315
  }) => {
43109
43316
  return {
@@ -43274,7 +43481,7 @@ const getFiltersConfig$5 = ({
43274
43481
  }
43275
43482
  };
43276
43483
  };
43277
- const getFilterOptions$5 = (options, t) => {
43484
+ const getFilterOptions$7 = (options, t) => {
43278
43485
  const {
43279
43486
  timeframe = [],
43280
43487
  statusOptions,
@@ -43307,18 +43514,18 @@ const getFilterOptions$5 = (options, t) => {
43307
43514
  };
43308
43515
  return _default;
43309
43516
  };
43310
- const formConfig$3 = {
43517
+ const formConfig$5 = {
43311
43518
  namespace: 'incident',
43312
43519
  view: 'incident',
43313
43520
  scope: 'createIncident',
43314
43521
  formType: 'incident'
43315
43522
  };
43316
- const viewConfig$3 = {
43523
+ const viewConfig$5 = {
43317
43524
  title: "Incidents",
43318
43525
  createTitle: "Create Incident"
43319
43526
  };
43320
43527
 
43321
- const getColumns$7 = ({
43528
+ const getColumns$9 = ({
43322
43529
  t,
43323
43530
  goTo,
43324
43531
  user,
@@ -43465,6 +43672,9 @@ const getColumns$7 = ({
43465
43672
  className: "daf-default-cell"
43466
43673
  });
43467
43674
  }
43675
+ if (!val || val?.length === 0) {
43676
+ return "-";
43677
+ }
43468
43678
  const sources = sourceAvatarConfig(val, user, applications);
43469
43679
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43470
43680
  items: sources
@@ -43528,233 +43738,651 @@ const getColumns$7 = ({
43528
43738
  }
43529
43739
  }].filter(column => column.show !== false);
43530
43740
 
43531
- const getFiltersConfig$4 = ({
43741
+ const getFiltersConfig$6 = ({
43532
43742
  t
43533
43743
  }) => {
43534
43744
  return {
43535
- country: {
43536
- type: 'select',
43537
- placeholder: t('Country'),
43745
+ timeframe: {
43746
+ type: "timeframe",
43747
+ label: "Timeframe",
43538
43748
  style: {
43539
43749
  flex: 1
43540
43750
  },
43541
- labelStyle: {
43542
- flex: 1
43543
- },
43544
- getLabel: option => option.label,
43545
- getValue: option => option.value
43751
+ t: t
43546
43752
  },
43547
- category: {
43548
- type: 'select',
43549
- label: 'Category',
43550
- placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
43551
- style: {
43552
- flex: 1
43553
- },
43554
- labelStyle: {
43555
- flex: 1
43556
- },
43557
- getLabel: option => option.label,
43558
- getValue: option => option.value
43559
- }
43560
- };
43561
- };
43562
- const getFilterOptions$4 = (options, t) => {
43563
- const {
43564
- countries,
43565
- category,
43566
- locationCategories
43567
- } = options || {};
43568
- return {
43569
- country: countries || [],
43570
- category: locationCategories || category || []
43571
- };
43572
- };
43573
- const formConfig$2 = {
43574
- namespace: 'locations',
43575
- view: 'scoping',
43576
- scope: 'create',
43577
- formType: 'location'
43578
- };
43579
- const viewConfig$2 = {
43580
- title: "Locations",
43581
- createTitle: "Create Location"
43582
- };
43583
-
43584
- const getColumns$6 = ({
43585
- t,
43586
- goTo,
43587
- user,
43588
- options,
43589
- activeTab,
43590
- getRedirectLink,
43591
- theme,
43592
- subject,
43593
- data,
43594
- applications
43595
- }) => [{
43596
- dataIndex: 'datastakeId',
43597
- title: t('ID'),
43598
- ellipsis: true,
43599
- show: true,
43600
- render: (v, all) => {
43601
- if (all.empty) {
43602
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43603
- className: "daf-default-cell"
43604
- });
43605
- }
43606
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43607
- title: v,
43608
- children: v
43609
- });
43610
- }
43611
- }, {
43612
- dataIndex: 'name',
43613
- title: t('Name'),
43614
- ellipsis: true,
43615
- show: true,
43616
- render: (v, all) => {
43617
- if (all.empty) {
43618
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43619
- className: "daf-default-cell"
43620
- });
43621
- }
43622
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43623
- title: v,
43624
- children: v
43625
- });
43626
- }
43627
- }, {
43628
- dataIndex: 'category',
43629
- title: t('Category'),
43630
- ellipsis: true,
43631
- show: true,
43632
- render: (v, all) => {
43633
- if (all.empty) {
43634
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43635
- className: "daf-default-cell"
43636
- });
43637
- }
43638
- const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
43639
- const category = findOptions(v, locationCategories);
43640
- return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43641
- title: category,
43642
- children: category
43643
- }) : '-';
43644
- }
43645
- }, {
43646
- dataIndex: 'country',
43647
- title: t('Country'),
43648
- ellipsis: true,
43649
- show: true,
43650
- render: (v, all) => {
43651
- if (all.empty) {
43652
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43653
- className: "daf-default-cell"
43654
- });
43655
- }
43656
- const country = findOptions(v, options?.countries);
43657
- return country ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43658
- title: country,
43659
- children: country
43660
- }) : '-';
43661
- }
43662
- }, {
43663
- dataIndex: 'province',
43664
- title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
43665
- ellipsis: true,
43666
- show: true,
43667
- render: (v, all) => {
43668
- if (all.empty) {
43669
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43670
- className: "daf-default-cell"
43671
- });
43672
- }
43673
- const province = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
43674
- return province ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43675
- title: province,
43676
- children: province
43677
- }) : '-';
43678
- }
43679
- }, {
43680
- dataIndex: 'territory',
43681
- title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
43682
- ellipsis: true,
43683
- show: true,
43684
- render: (v, all) => {
43685
- if (all.empty) {
43686
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43687
- className: "daf-default-cell"
43688
- });
43689
- }
43690
- const territory = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
43691
- return territory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43692
- title: territory,
43693
- children: territory
43694
- }) : '-';
43695
- }
43696
- }, {
43697
- title: t("Sources"),
43698
- dataIndex: "sources",
43699
- key: "sources",
43700
- show: activeTab !== "own",
43701
- render: (val, all) => {
43702
- if (all.empty) {
43703
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43704
- className: "daf-default-cell"
43705
- });
43706
- }
43707
- const sources = sourceAvatarConfig(val, user, applications);
43708
- return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
43709
- items: sources
43710
- });
43711
- }
43712
- }, {
43713
- title: t("Last Update"),
43714
- dataIndex: "updatedAt",
43715
- key: "updatedAt",
43716
- width: 125,
43717
- render: (date, all) => {
43718
- if (all.empty) {
43719
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43720
- className: "daf-default-cell"
43721
- });
43722
- }
43723
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
43724
- return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43725
- title: _date,
43726
- children: _date
43727
- });
43728
- },
43729
- ellipsis: true
43730
- }, {
43731
- id: 'actions',
43732
- title: "",
43733
- width: 60,
43734
- render: (_, all) => {
43735
- if (all.empty) {
43736
- return /*#__PURE__*/jsxRuntime.jsx("div", {
43737
- className: "daf-default-cell"
43738
- });
43739
- }
43740
- const onClick = () => {
43741
- let link = `/app/view/${subject}/${all.datastakeId}`;
43742
- if (activeTab === "shared") {
43743
- link += `?sourceId=${all?.authorId?.id}`;
43744
- }
43745
- goTo(getRedirectLink(link));
43746
- };
43747
- return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
43748
- onClick: onClick,
43749
- theme: theme
43750
- });
43751
- }
43752
- }].filter(column => column.show !== false);
43753
-
43754
- const getFiltersConfig$3 = ({
43755
- t
43756
- }) => {
43757
- return {
43753
+ country: {
43754
+ type: 'select',
43755
+ label: 'Country',
43756
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
43757
+ style: {
43758
+ flex: 1
43759
+ },
43760
+ labelStyle: {
43761
+ flex: 1
43762
+ },
43763
+ getLabel: option => option.label,
43764
+ getValue: option => option.value
43765
+ },
43766
+ administrativeLevel1: {
43767
+ type: 'ajaxSelect',
43768
+ label: ({
43769
+ t = s => s,
43770
+ options = {},
43771
+ filters = {},
43772
+ language = 'en'
43773
+ }) => {
43774
+ const {
43775
+ administrativeLevel1
43776
+ } = options;
43777
+ if (administrativeLevel1) {
43778
+ if (options.country) {
43779
+ const _item = administrativeLevel1[filters.country];
43780
+ if (_item) {
43781
+ if (_item[language]) {
43782
+ return _item[language];
43783
+ }
43784
+ }
43785
+ }
43786
+ }
43787
+ return t('Province');
43788
+ },
43789
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
43790
+ filters: data => ({
43791
+ country: data.country,
43792
+ level: 'level_1'
43793
+ }),
43794
+ show: data => !data.country,
43795
+ disabled: data => !data.country,
43796
+ mapper: {
43797
+ label: "name",
43798
+ value: "id"
43799
+ },
43800
+ method: 'getOptions',
43801
+ entity: 'AdministrativeLevel',
43802
+ style: {
43803
+ flex: 1
43804
+ },
43805
+ labelStyle: {
43806
+ flex: 1
43807
+ }
43808
+ },
43809
+ administrativeLevel2: {
43810
+ type: 'ajaxSelect',
43811
+ label: ({
43812
+ t = s => s,
43813
+ options = {},
43814
+ filters = {},
43815
+ language = 'en'
43816
+ }) => {
43817
+ const {
43818
+ administrativeLevel2
43819
+ } = options;
43820
+ if (administrativeLevel2) {
43821
+ if (options.country) {
43822
+ const _item = administrativeLevel2[filters.country];
43823
+ if (_item) {
43824
+ if (_item[language]) {
43825
+ return _item[language];
43826
+ }
43827
+ }
43828
+ }
43829
+ }
43830
+ return t('Province');
43831
+ },
43832
+ show: data => !(data.country && data.administrativeLevel1),
43833
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
43834
+ filters: data => ({
43835
+ country: data.country,
43836
+ level: 'level_2',
43837
+ administrativeLevel1: data.administrativeLevel1
43838
+ }),
43839
+ disabled: data => !(data.country && data.administrativeLevel1),
43840
+ mapper: {
43841
+ label: "name",
43842
+ value: "id"
43843
+ },
43844
+ method: 'getOptions',
43845
+ entity: 'AdministrativeLevel',
43846
+ style: {
43847
+ flex: 1
43848
+ },
43849
+ labelStyle: {
43850
+ flex: 1
43851
+ }
43852
+ },
43853
+ eventCategory: {
43854
+ type: 'select',
43855
+ label: 'Category',
43856
+ placeholder: () => `${t('Filter by')} ${t('Category').toLowerCase()}`,
43857
+ style: {
43858
+ flex: 1
43859
+ },
43860
+ labelStyle: {
43861
+ flex: 1
43862
+ },
43863
+ getLabel: option => option.label,
43864
+ getValue: option => option.value,
43865
+ filterOptions: val => {
43866
+ if (val) {
43867
+ const {
43868
+ option,
43869
+ filters
43870
+ } = val;
43871
+ if (filters && option) {
43872
+ const {
43873
+ filters: optionFilters
43874
+ } = option;
43875
+ if (Array.isArray(optionFilters) && optionFilters.length) {
43876
+ const {
43877
+ value,
43878
+ condition
43879
+ } = optionFilters[0];
43880
+ if (condition === 'includes') {
43881
+ return value.includes('corporation');
43882
+ }
43883
+ }
43884
+ }
43885
+ }
43886
+ return true;
43887
+ }
43888
+ },
43889
+ // positionInTheMineralSupplyChain: {
43890
+ // type: 'select',
43891
+ // label: 'Position',
43892
+ // placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
43893
+ // style: { flex: 1 },
43894
+ // labelStyle: { flex: 1 },
43895
+ // getLabel: (option) => option.label,
43896
+ // getValue: (option) => option.value,
43897
+ // },
43898
+ status: {
43899
+ type: "select",
43900
+ label: "Status",
43901
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
43902
+ style: {
43903
+ flex: 1
43904
+ },
43905
+ labelStyle: {
43906
+ fley: 1
43907
+ },
43908
+ getLabel: option => option.label,
43909
+ getValue: option => option.value
43910
+ }
43911
+ };
43912
+ };
43913
+ const getFilterOptions$6 = (options, t) => {
43914
+ const {
43915
+ timeframe = [],
43916
+ statusOptions,
43917
+ categoryOptions,
43918
+ countries,
43919
+ subCategory,
43920
+ category,
43921
+ stakeholderCategoryOptions,
43922
+ stakeholderSubCategoriesOptions,
43923
+ administrativeLevel1,
43924
+ administrativeLevel2,
43925
+ positionInMineralSupplyChainOptions,
43926
+ subCategoriesOptions,
43927
+ eventCategoryOptions
43928
+ } = options || {};
43929
+ const _categoryOptions = (eventCategoryOptions || categoryOptions || [])?.map(item => ({
43930
+ value: item.value,
43931
+ label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label
43932
+ }));
43933
+ const _default = {
43934
+ timeframe: timeframe,
43935
+ status: getStatusOptions(t) || [],
43936
+ eventCategory: _categoryOptions || [],
43937
+ country: countries || [],
43938
+ subCategory: subCategoriesOptions || [],
43939
+ // category: category,
43940
+ administrativeLevel1,
43941
+ administrativeLevel2
43942
+ // positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions || [],
43943
+ };
43944
+ return _default;
43945
+ };
43946
+ const formConfig$4 = {
43947
+ namespace: 'testimonials',
43948
+ view: 'testimonials',
43949
+ scope: 'create',
43950
+ formType: 'testimonial'
43951
+ };
43952
+ const viewConfig$4 = {
43953
+ title: "Testimonials",
43954
+ createTitle: "New Testimonial"
43955
+ };
43956
+
43957
+ const getColumns$8 = ({
43958
+ t,
43959
+ goTo,
43960
+ user,
43961
+ options,
43962
+ activeTab,
43963
+ getRedirectLink,
43964
+ theme,
43965
+ subject,
43966
+ data,
43967
+ applications
43968
+ }) => [{
43969
+ dataIndex: 'datastakeId',
43970
+ title: t('ID'),
43971
+ ellipsis: true,
43972
+ show: true,
43973
+ key: "datastakeId",
43974
+ sorter: () => 0 + 0,
43975
+ render: (v, all) => {
43976
+ if (all.empty) {
43977
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
43978
+ className: "daf-default-cell"
43979
+ });
43980
+ }
43981
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
43982
+ title: v,
43983
+ children: v
43984
+ });
43985
+ }
43986
+ }, {
43987
+ dataIndex: 'name',
43988
+ title: t('Title'),
43989
+ ellipsis: true,
43990
+ show: true,
43991
+ key: "name",
43992
+ sorter: () => 0 + 0,
43993
+ render: (v, all) => {
43994
+ if (all.empty) {
43995
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
43996
+ className: "daf-default-cell"
43997
+ });
43998
+ }
43999
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44000
+ title: v,
44001
+ children: v
44002
+ });
44003
+ }
44004
+ }, {
44005
+ title: t("type"),
44006
+ dataIndex: "typeOfTestimonials",
44007
+ key: "typeOfTestimonials",
44008
+ sorter: () => 0 + 0,
44009
+ show: true,
44010
+ render: (title, all) => {
44011
+ if (all.empty) {
44012
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44013
+ className: "daf-default-cell"
44014
+ });
44015
+ }
44016
+ const type = findOptions(title, data?.options?.testimonialsType);
44017
+ return type ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44018
+ title: type,
44019
+ children: type
44020
+ }) : '-';
44021
+ },
44022
+ ellipsis: true
44023
+ }, {
44024
+ title: t("Date"),
44025
+ dataIndex: "date",
44026
+ key: "date",
44027
+ sorter: () => 0 + 0,
44028
+ render: (date, all) => {
44029
+ if (all.empty) {
44030
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44031
+ className: "daf-default-cell"
44032
+ });
44033
+ }
44034
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
44035
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44036
+ title: _date,
44037
+ children: _date
44038
+ });
44039
+ },
44040
+ ellipsis: true
44041
+ }, {
44042
+ dataIndex: 'mineSite',
44043
+ title: t('Location'),
44044
+ ellipsis: true,
44045
+ show: true,
44046
+ render: (v, all) => {
44047
+ if (all.empty) {
44048
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44049
+ className: "daf-default-cell"
44050
+ });
44051
+ }
44052
+
44053
+ // const country = findOptions(v, data?.options?.positionSupplyChainOptions);
44054
+ const mineSite = all?.location?.name;
44055
+ return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44056
+ title: mineSite,
44057
+ children: mineSite
44058
+ }) : '-';
44059
+ }
44060
+ }, {
44061
+ dataIndex: 'eventCategory',
44062
+ title: t('Category'),
44063
+ ellipsis: true,
44064
+ show: true,
44065
+ render: (v, all) => {
44066
+ if (all.empty) {
44067
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44068
+ className: "daf-default-cell"
44069
+ });
44070
+ }
44071
+ const eventCategory = findOptions(v, data?.options?.eventCategoryOptions || data?.options?.categoryOptions);
44072
+ const categoryValue = getEventCategoryBySubject(eventCategory, subject);
44073
+ return categoryValue ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44074
+ title: categoryValue,
44075
+ children: categoryValue
44076
+ }) : '-';
44077
+ }
44078
+ }, {
44079
+ title: t("Sources"),
44080
+ dataIndex: "sources",
44081
+ key: "sources",
44082
+ show: activeTab !== "own",
44083
+ render: (val, all) => {
44084
+ if (all.empty) {
44085
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44086
+ className: "daf-default-cell"
44087
+ });
44088
+ }
44089
+ if (!val || val?.length === 0) {
44090
+ return "-";
44091
+ }
44092
+ const sources = sourceAvatarConfig(val, user, applications);
44093
+ return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
44094
+ items: sources
44095
+ });
44096
+ }
44097
+ }, {
44098
+ title: t("Status"),
44099
+ dataIndex: "status",
44100
+ key: "status",
44101
+ show: activeTab === "own",
44102
+ render: (val, all) => {
44103
+ if (all.empty) {
44104
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44105
+ className: "daf-default-cell"
44106
+ });
44107
+ }
44108
+ const _val = all?.published || all?.status === "submitted" ? "submitted" : val;
44109
+ return renderStatusTag({
44110
+ value: _val,
44111
+ t
44112
+ });
44113
+ }
44114
+ }, {
44115
+ title: t("Last Update"),
44116
+ dataIndex: "updatedAt",
44117
+ key: "updatedAt",
44118
+ render: (date, all) => {
44119
+ if (all.empty) {
44120
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44121
+ className: "daf-default-cell"
44122
+ });
44123
+ }
44124
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
44125
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44126
+ title: _date,
44127
+ children: _date
44128
+ });
44129
+ },
44130
+ ellipsis: true
44131
+ }, {
44132
+ id: 'actions',
44133
+ title: "",
44134
+ width: 60,
44135
+ render: (_, all) => {
44136
+ if (all.empty) {
44137
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44138
+ className: "daf-default-cell"
44139
+ });
44140
+ }
44141
+ const onClick = () => {
44142
+ let link = `/app/view/${subject}/${all.datastakeId}`;
44143
+ if (activeTab === "shared") {
44144
+ link += `?sourceId=${all?.authorId?.id}`;
44145
+ }
44146
+ goTo(getRedirectLink(link));
44147
+ };
44148
+ return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
44149
+ onClick: onClick,
44150
+ theme: theme
44151
+ });
44152
+ }
44153
+ }].filter(column => column.show !== false);
44154
+
44155
+ const getFiltersConfig$5 = ({
44156
+ t
44157
+ }) => {
44158
+ return {
44159
+ country: {
44160
+ type: 'select',
44161
+ placeholder: t('Country'),
44162
+ style: {
44163
+ flex: 1
44164
+ },
44165
+ labelStyle: {
44166
+ flex: 1
44167
+ },
44168
+ getLabel: option => option.label,
44169
+ getValue: option => option.value
44170
+ },
44171
+ category: {
44172
+ type: 'select',
44173
+ label: 'Category',
44174
+ placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
44175
+ style: {
44176
+ flex: 1
44177
+ },
44178
+ labelStyle: {
44179
+ flex: 1
44180
+ },
44181
+ getLabel: option => option.label,
44182
+ getValue: option => option.value
44183
+ }
44184
+ };
44185
+ };
44186
+ const getFilterOptions$5 = (options, t) => {
44187
+ const {
44188
+ countries,
44189
+ category,
44190
+ locationCategories
44191
+ } = options || {};
44192
+ return {
44193
+ country: countries || [],
44194
+ category: locationCategories || category || []
44195
+ };
44196
+ };
44197
+ const formConfig$3 = {
44198
+ namespace: 'locations',
44199
+ view: 'scoping',
44200
+ scope: 'create',
44201
+ formType: 'location'
44202
+ };
44203
+ const viewConfig$3 = {
44204
+ title: "Locations",
44205
+ createTitle: "Create Location"
44206
+ };
44207
+
44208
+ const getColumns$7 = ({
44209
+ t,
44210
+ goTo,
44211
+ user,
44212
+ options,
44213
+ activeTab,
44214
+ getRedirectLink,
44215
+ theme,
44216
+ subject,
44217
+ data,
44218
+ applications
44219
+ }) => [{
44220
+ dataIndex: 'datastakeId',
44221
+ title: t('ID'),
44222
+ ellipsis: true,
44223
+ show: true,
44224
+ render: (v, all) => {
44225
+ if (all.empty) {
44226
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44227
+ className: "daf-default-cell"
44228
+ });
44229
+ }
44230
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44231
+ title: v,
44232
+ children: v
44233
+ });
44234
+ }
44235
+ }, {
44236
+ dataIndex: 'name',
44237
+ title: t('Name'),
44238
+ ellipsis: true,
44239
+ show: true,
44240
+ render: (v, all) => {
44241
+ if (all.empty) {
44242
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44243
+ className: "daf-default-cell"
44244
+ });
44245
+ }
44246
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44247
+ title: v,
44248
+ children: v
44249
+ });
44250
+ }
44251
+ }, {
44252
+ dataIndex: 'category',
44253
+ title: t('Category'),
44254
+ ellipsis: true,
44255
+ show: true,
44256
+ render: (v, all) => {
44257
+ if (all.empty) {
44258
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44259
+ className: "daf-default-cell"
44260
+ });
44261
+ }
44262
+ const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
44263
+ const category = findOptions(v, locationCategories);
44264
+ return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44265
+ title: category,
44266
+ children: category
44267
+ }) : '-';
44268
+ }
44269
+ }, {
44270
+ dataIndex: 'country',
44271
+ title: t('Country'),
44272
+ ellipsis: true,
44273
+ show: true,
44274
+ render: (v, all) => {
44275
+ if (all.empty) {
44276
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44277
+ className: "daf-default-cell"
44278
+ });
44279
+ }
44280
+ const country = findOptions(v, options?.countries);
44281
+ return country ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44282
+ title: country,
44283
+ children: country
44284
+ }) : '-';
44285
+ }
44286
+ }, {
44287
+ dataIndex: 'province',
44288
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
44289
+ ellipsis: true,
44290
+ show: true,
44291
+ render: (v, all) => {
44292
+ if (all.empty) {
44293
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44294
+ className: "daf-default-cell"
44295
+ });
44296
+ }
44297
+ const province = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
44298
+ return province ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44299
+ title: province,
44300
+ children: province
44301
+ }) : '-';
44302
+ }
44303
+ }, {
44304
+ dataIndex: 'territory',
44305
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
44306
+ ellipsis: true,
44307
+ show: true,
44308
+ render: (v, all) => {
44309
+ if (all.empty) {
44310
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44311
+ className: "daf-default-cell"
44312
+ });
44313
+ }
44314
+ const territory = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
44315
+ return territory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44316
+ title: territory,
44317
+ children: territory
44318
+ }) : '-';
44319
+ }
44320
+ }, {
44321
+ title: t("Sources"),
44322
+ dataIndex: "sources",
44323
+ key: "sources",
44324
+ show: activeTab !== "own",
44325
+ render: (val, all) => {
44326
+ if (all.empty) {
44327
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44328
+ className: "daf-default-cell"
44329
+ });
44330
+ }
44331
+ if (!val || val?.length === 0) {
44332
+ return "-";
44333
+ }
44334
+ const sources = sourceAvatarConfig(val, user, applications);
44335
+ return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
44336
+ items: sources
44337
+ });
44338
+ }
44339
+ }, {
44340
+ title: t("Last Update"),
44341
+ dataIndex: "updatedAt",
44342
+ key: "updatedAt",
44343
+ width: 125,
44344
+ render: (date, all) => {
44345
+ if (all.empty) {
44346
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44347
+ className: "daf-default-cell"
44348
+ });
44349
+ }
44350
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
44351
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44352
+ title: _date,
44353
+ children: _date
44354
+ });
44355
+ },
44356
+ ellipsis: true
44357
+ }, {
44358
+ id: 'actions',
44359
+ title: "",
44360
+ width: 60,
44361
+ render: (_, all) => {
44362
+ if (all.empty) {
44363
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44364
+ className: "daf-default-cell"
44365
+ });
44366
+ }
44367
+ const onClick = () => {
44368
+ let link = `/app/view/${subject}/${all.datastakeId}`;
44369
+ if (activeTab === "shared") {
44370
+ link += `?sourceId=${all?.authorId?.id}`;
44371
+ }
44372
+ goTo(getRedirectLink(link));
44373
+ };
44374
+ return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
44375
+ onClick: onClick,
44376
+ theme: theme
44377
+ });
44378
+ }
44379
+ }].filter(column => column.show !== false);
44380
+
44381
+ const getFiltersConfig$4 = ({
44382
+ t,
44383
+ screen
44384
+ }) => {
44385
+ return {
43758
44386
  country: {
43759
44387
  type: 'select',
43760
44388
  label: 'Country',
@@ -43879,7 +44507,8 @@ const getFiltersConfig$3 = ({
43879
44507
  flex: 1
43880
44508
  },
43881
44509
  getLabel: option => option.label,
43882
- getValue: option => option.value
44510
+ getValue: option => option.value,
44511
+ show: () => screen === 'scl'
43883
44512
  },
43884
44513
  positionInTheMineralSupplyChain: {
43885
44514
  type: 'select',
@@ -43909,7 +44538,7 @@ const getFiltersConfig$3 = ({
43909
44538
  }
43910
44539
  };
43911
44540
  };
43912
- const getFilterOptions$3 = (options, t) => {
44541
+ const getFilterOptions$4 = (options, t) => {
43913
44542
  const {
43914
44543
  statusOptions = [],
43915
44544
  categoryOptions = [],
@@ -43938,13 +44567,13 @@ const getFilterOptions$3 = (options, t) => {
43938
44567
  };
43939
44568
  return _default;
43940
44569
  };
43941
- const formConfig$1 = {
44570
+ const formConfig$2 = {
43942
44571
  namespace: 'PRODUCTION SITES',
43943
44572
  view: ['scoping', 'new'],
43944
44573
  scope: 'global',
43945
44574
  formType: 'production-sites'
43946
44575
  };
43947
- const viewConfig$1 = {
44576
+ const viewConfig$2 = {
43948
44577
  title: "Production Sites",
43949
44578
  createTitle: "Create Production Site"
43950
44579
  };
@@ -43995,7 +44624,7 @@ MoreOptions.propTypes = {
43995
44624
  limit: PropTypes__default["default"].number
43996
44625
  };
43997
44626
 
43998
- const getColumns$5 = ({
44627
+ const getColumns$6 = ({
43999
44628
  t,
44000
44629
  goTo,
44001
44630
  user,
@@ -44054,7 +44683,7 @@ const getColumns$5 = ({
44054
44683
  className: "daf-default-cell"
44055
44684
  });
44056
44685
  }
44057
- const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
44686
+ const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || []), ...(options?.locationCategories || [])];
44058
44687
  const category = findOptions(v, locationCategories);
44059
44688
  return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44060
44689
  title: category,
@@ -44167,16 +44796,19 @@ const getColumns$5 = ({
44167
44796
  }
44168
44797
  }, {
44169
44798
  title: t("Sources"),
44170
- dataIndex: 'sources',
44171
- ellipsis: true,
44799
+ dataIndex: "sources",
44800
+ key: "sources",
44172
44801
  show: activeTab !== "own",
44173
- render: (v, all) => {
44802
+ render: (val, all) => {
44174
44803
  if (all.empty) {
44175
44804
  return /*#__PURE__*/jsxRuntime.jsx("div", {
44176
44805
  className: "daf-default-cell"
44177
44806
  });
44178
44807
  }
44179
- const sources = sourceAvatarConfig(v, user, applications);
44808
+ if (!val || val?.length === 0) {
44809
+ return "-";
44810
+ }
44811
+ const sources = sourceAvatarConfig(val, user, applications);
44180
44812
  return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
44181
44813
  items: sources
44182
44814
  });
@@ -44222,6 +44854,208 @@ const getColumns$5 = ({
44222
44854
  }
44223
44855
  }].filter(column => column.show !== false);
44224
44856
 
44857
+ const getFiltersConfig$3 = ({
44858
+ t
44859
+ }) => {
44860
+ return {
44861
+ status: {
44862
+ type: "select",
44863
+ label: "Status",
44864
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
44865
+ style: {
44866
+ flex: 1
44867
+ },
44868
+ labelStyle: {
44869
+ fley: 1
44870
+ },
44871
+ getLabel: option => option.label,
44872
+ getValue: option => option.value
44873
+ },
44874
+ timeframe: {
44875
+ type: "timeframe",
44876
+ label: "Timeframe",
44877
+ style: {
44878
+ flex: 1
44879
+ }
44880
+ }
44881
+ };
44882
+ };
44883
+ const getFilterOptions$3 = (options, t) => {
44884
+ const _default = {
44885
+ status: getStatusOptions(t) || [],
44886
+ timeframe: []
44887
+ };
44888
+ return _default;
44889
+ };
44890
+ const formConfig$1 = {
44891
+ namespace: 'conflict-areas',
44892
+ view: ['scoping', 'new'],
44893
+ scope: 'conflictAreaCreate',
44894
+ formType: 'conflict-area'
44895
+ };
44896
+ const viewConfig$1 = {
44897
+ title: "Conflict Areas",
44898
+ createTitle: "New Conflict Area"
44899
+ };
44900
+
44901
+ const getColumns$5 = ({
44902
+ t,
44903
+ goTo,
44904
+ user,
44905
+ options,
44906
+ activeTab,
44907
+ getRedirectLink,
44908
+ theme,
44909
+ subject,
44910
+ data,
44911
+ applications
44912
+ }) => [{
44913
+ dataIndex: 'datastakeId',
44914
+ title: t('ID'),
44915
+ ellipsis: true,
44916
+ show: true,
44917
+ key: "datastakeId",
44918
+ sorter: () => 0 + 0,
44919
+ render: (v, all) => {
44920
+ if (all.empty) {
44921
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44922
+ className: "daf-default-cell"
44923
+ });
44924
+ }
44925
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44926
+ title: v,
44927
+ children: v
44928
+ });
44929
+ }
44930
+ }, {
44931
+ dataIndex: "name",
44932
+ title: t('Name'),
44933
+ ellipsis: true,
44934
+ show: true,
44935
+ key: "name",
44936
+ sorter: () => 0 + 0,
44937
+ render: (v, all) => {
44938
+ if (all.empty) {
44939
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44940
+ className: "daf-default-cell"
44941
+ });
44942
+ }
44943
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44944
+ title: v,
44945
+ children: v
44946
+ });
44947
+ }
44948
+ }, {
44949
+ dataIndex: 'region',
44950
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
44951
+ ellipsis: true,
44952
+ show: true,
44953
+ render: (v, all) => {
44954
+ if (all.empty) {
44955
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44956
+ className: "daf-default-cell"
44957
+ });
44958
+ }
44959
+ const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
44960
+ return region ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44961
+ title: region,
44962
+ children: region
44963
+ }) : '-';
44964
+ }
44965
+ }, {
44966
+ dataIndex: 'territory',
44967
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
44968
+ ellipsis: true,
44969
+ show: true,
44970
+ render: (v, all) => {
44971
+ if (all.empty) {
44972
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44973
+ className: "daf-default-cell"
44974
+ });
44975
+ }
44976
+ const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
44977
+ return district ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44978
+ title: district,
44979
+ children: district
44980
+ }) : '-';
44981
+ }
44982
+ }, {
44983
+ title: t("Last Update"),
44984
+ dataIndex: "updatedAt",
44985
+ key: "updatedAt",
44986
+ render: (date, all) => {
44987
+ if (all.empty) {
44988
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
44989
+ className: "daf-default-cell"
44990
+ });
44991
+ }
44992
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
44993
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44994
+ title: _date,
44995
+ children: _date
44996
+ });
44997
+ },
44998
+ ellipsis: true
44999
+ }, {
45000
+ title: t("Sources"),
45001
+ dataIndex: "sources",
45002
+ key: "sources",
45003
+ show: activeTab !== "own",
45004
+ render: (val, all) => {
45005
+ if (all.empty) {
45006
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
45007
+ className: "daf-default-cell"
45008
+ });
45009
+ }
45010
+ if (!val || val?.length === 0) {
45011
+ return "-";
45012
+ }
45013
+ const sources = sourceAvatarConfig(val, user, applications);
45014
+ return /*#__PURE__*/jsxRuntime.jsx(AvatarGroup, {
45015
+ items: sources
45016
+ });
45017
+ }
45018
+ }, {
45019
+ title: t("Status"),
45020
+ dataIndex: 'status',
45021
+ ellipsis: true,
45022
+ show: activeTab == "own",
45023
+ render: (v, all) => {
45024
+ if (all.empty) {
45025
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
45026
+ className: "daf-default-cell"
45027
+ });
45028
+ }
45029
+ const _val = all?.published || all?.status === "submitted" ? "submitted" : v;
45030
+ return renderStatusTag({
45031
+ value: _val,
45032
+ t
45033
+ });
45034
+ }
45035
+ }, {
45036
+ id: 'actions',
45037
+ title: "",
45038
+ width: 60,
45039
+ render: (_, all) => {
45040
+ if (all.empty) {
45041
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
45042
+ className: "daf-default-cell"
45043
+ });
45044
+ }
45045
+ const onClick = () => {
45046
+ let link = `/app/view/${subject}/${all.datastakeId}`;
45047
+ if (activeTab === "shared") {
45048
+ link += `?sourceId=${all?.authorId?.id}`;
45049
+ }
45050
+ goTo(getRedirectLink(link));
45051
+ };
45052
+ return /*#__PURE__*/jsxRuntime.jsx(NavigationAction, {
45053
+ onClick: onClick,
45054
+ theme: theme
45055
+ });
45056
+ }
45057
+ }].filter(column => column.show !== false);
45058
+
44225
45059
  const getFiltersConfig$2 = ({
44226
45060
  t
44227
45061
  }) => {
@@ -44376,62 +45210,83 @@ const getColumns$4 = ({
44376
45210
 
44377
45211
  const FILTER_REGISTRY = {
44378
45212
  stakeholders: {
45213
+ config: getFiltersConfig$d,
45214
+ options: getFilterOptions$d,
45215
+ formConfig: formConfig$b,
45216
+ viewConfig: viewConfig$b,
45217
+ columns: getColumns$f
45218
+ },
45219
+ workers: {
45220
+ config: getFiltersConfig$b,
45221
+ options: getFilterOptions$b,
45222
+ formConfig: formConfig$9,
45223
+ viewConfig: viewConfig$9,
45224
+ columns: getColumns$d
45225
+ },
45226
+ operators: {
45227
+ config: getFiltersConfig$c,
45228
+ options: getFilterOptions$c,
45229
+ formConfig: formConfig$a,
45230
+ viewConfig: viewConfig$a,
45231
+ columns: getColumns$e
45232
+ },
45233
+ "armed-groups": {
44379
45234
  config: getFiltersConfig$a,
44380
45235
  options: getFilterOptions$a,
44381
45236
  formConfig: formConfig$8,
44382
45237
  viewConfig: viewConfig$8,
44383
45238
  columns: getColumns$c
44384
45239
  },
44385
- workers: {
45240
+ events: {
45241
+ config: getFiltersConfig$9,
45242
+ options: getFilterOptions$9,
45243
+ formConfig: formConfig$7,
45244
+ viewConfig: viewConfig$7,
45245
+ columns: getColumns$b
45246
+ },
45247
+ activities: {
44386
45248
  config: getFiltersConfig$8,
44387
45249
  options: getFilterOptions$8,
44388
45250
  formConfig: formConfig$6,
44389
45251
  viewConfig: viewConfig$6,
44390
45252
  columns: getColumns$a
44391
45253
  },
44392
- operators: {
44393
- config: getFiltersConfig$9,
44394
- options: getFilterOptions$9,
44395
- formConfig: formConfig$7,
44396
- viewConfig: viewConfig$7,
44397
- columns: getColumns$b
45254
+ 'corrective-actions': {
45255
+ config: getFiltersConfig$8,
45256
+ options: getFilterOptions$8,
45257
+ formConfig: formConfig$6,
45258
+ viewConfig: viewConfig$6,
45259
+ columns: getColumns$a
44398
45260
  },
44399
- events: {
45261
+ incidents: {
44400
45262
  config: getFiltersConfig$7,
44401
45263
  options: getFilterOptions$7,
44402
45264
  formConfig: formConfig$5,
44403
45265
  viewConfig: viewConfig$5,
44404
45266
  columns: getColumns$9
44405
45267
  },
44406
- activities: {
45268
+ testimonials: {
44407
45269
  config: getFiltersConfig$6,
44408
45270
  options: getFilterOptions$6,
44409
45271
  formConfig: formConfig$4,
44410
45272
  viewConfig: viewConfig$4,
44411
45273
  columns: getColumns$8
44412
45274
  },
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: {
45275
+ locations: {
44421
45276
  config: getFiltersConfig$5,
44422
45277
  options: getFilterOptions$5,
44423
45278
  formConfig: formConfig$3,
44424
45279
  viewConfig: viewConfig$3,
44425
45280
  columns: getColumns$7
44426
45281
  },
44427
- locations: {
45282
+ 'production-sites': {
44428
45283
  config: getFiltersConfig$4,
44429
45284
  options: getFilterOptions$4,
44430
45285
  formConfig: formConfig$2,
44431
45286
  viewConfig: viewConfig$2,
44432
45287
  columns: getColumns$6
44433
45288
  },
44434
- 'production-sites': {
45289
+ "conflict-areas": {
44435
45290
  config: getFiltersConfig$3,
44436
45291
  options: getFilterOptions$3,
44437
45292
  formConfig: formConfig$1,
@@ -44439,11 +45294,11 @@ const FILTER_REGISTRY = {
44439
45294
  columns: getColumns$5
44440
45295
  },
44441
45296
  scl: {
44442
- config: getFiltersConfig$3,
44443
- options: getFilterOptions$3,
45297
+ config: getFiltersConfig$4,
45298
+ options: getFilterOptions$4,
44444
45299
  formConfig: sclFormConfig,
44445
45300
  viewConfig: sclViewConfig,
44446
- columns: getColumns$5
45301
+ columns: getColumns$6
44447
45302
  },
44448
45303
  documents: {
44449
45304
  config: getFiltersConfig$2,
@@ -44477,7 +45332,8 @@ const getFiltersConfig$1 = ({
44477
45332
  }) => {
44478
45333
  const registry = FILTER_REGISTRY[subject] || FILTER_REGISTRY[DEFAULT_SUBJECT];
44479
45334
  return registry?.config({
44480
- t
45335
+ t,
45336
+ screen: subject
44481
45337
  });
44482
45338
  };
44483
45339
  const getFilterOptions$1 = ({
@@ -51437,6 +52293,44 @@ const RadarChart = ({
51437
52293
  legendConfig,
51438
52294
  isPdf
51439
52295
  });
52296
+
52297
+ // Helper function to wrap long text labels to multiple lines
52298
+ // Ensures text is never hidden - wraps to multiple lines if needed
52299
+ const wrapLabel = React.useCallback((text, maxLength = 10) => {
52300
+ if (!text) {
52301
+ return '';
52302
+ }
52303
+ const formattedText = formattedXAxis(text);
52304
+
52305
+ // If text is short enough, return as is
52306
+ if (formattedText.length <= maxLength) {
52307
+ return formattedText;
52308
+ }
52309
+
52310
+ // Split by spaces to find word boundaries
52311
+ const words = formattedText.split(' ');
52312
+ const lines = [];
52313
+ let currentLine = '';
52314
+ words.forEach((word, index) => {
52315
+ // If adding this word would exceed maxLength, start a new line
52316
+ if (currentLine && (currentLine + ' ' + word).length > maxLength) {
52317
+ if (currentLine) {
52318
+ lines.push(currentLine);
52319
+ }
52320
+ currentLine = word;
52321
+ } else {
52322
+ currentLine = currentLine ? currentLine + ' ' + word : word;
52323
+ }
52324
+
52325
+ // If it's the last word, add it to lines
52326
+ if (index === words.length - 1 && currentLine) {
52327
+ lines.push(currentLine);
52328
+ }
52329
+ });
52330
+
52331
+ // Ensure we always return something - never empty
52332
+ return lines.length > 0 ? lines.join('\n') : formattedText;
52333
+ }, [formattedXAxis]);
51440
52334
  React.useEffect(() => {
51441
52335
  if (!containerRef.current) {
51442
52336
  return;
@@ -51457,16 +52351,20 @@ const RadarChart = ({
51457
52351
  ...tooltipConfig
51458
52352
  },
51459
52353
  color: color || token.colorPrimary7,
51460
- paddingX: 60,
51461
- paddingY: 60,
52354
+ // Increased padding to ensure labels are never clipped
52355
+ padding: [50, 50, 50, 50],
51462
52356
  xAxis: {
51463
52357
  label: {
51464
- formatter: formattedXAxis,
52358
+ formatter: text => wrapLabel(text, 10),
51465
52359
  offset: 15,
52360
+ autoRotate: false,
52361
+ autoHide: false,
52362
+ // Never hide labels
52363
+ autoEllipsis: false,
52364
+ // Never truncate with ellipsis
51466
52365
  style: {
51467
52366
  fontSize: 12,
51468
- fill: '#666',
51469
- textAlign: 'center'
52367
+ fill: '#666'
51470
52368
  }
51471
52369
  },
51472
52370
  line: null,
@@ -51525,7 +52423,7 @@ const RadarChart = ({
51525
52423
  } else {
51526
52424
  chartRef.current.update(chartConfig);
51527
52425
  }
51528
- }, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, rest]);
52426
+ }, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, wrapLabel, rest]);
51529
52427
  React.useEffect(() => {
51530
52428
  return () => {
51531
52429
  if (chartRef.current) {
@@ -51536,23 +52434,12 @@ const RadarChart = ({
51536
52434
  }, []);
51537
52435
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
51538
52436
  className: "flex flex-1 flex-column justify-content-center",
51539
- style: {
51540
- overflow: 'visible'
51541
- },
51542
52437
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
51543
52438
  className: "flex justify-content-center",
51544
- style: {
51545
- paddingX: '30px',
51546
- overflow: 'visible',
51547
- width: '100%'
51548
- },
51549
52439
  children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
51550
52440
  ref: containerRef,
51551
52441
  height: height,
51552
- isPdf: isPdf,
51553
- style: {
51554
- paddingX: '30px'
51555
- }
52442
+ isPdf: isPdf
51556
52443
  })
51557
52444
  }), legendEnabled && legendPosition === 'bottom' && /*#__PURE__*/jsxRuntime.jsx(CustomLegend, {
51558
52445
  items: legendItems,
@@ -57664,21 +58551,29 @@ const BiodiversityHabitat = ({
57664
58551
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
57665
58552
  style: {
57666
58553
  display: "flex",
57667
- gap: "24px"
58554
+ gap: "24px",
58555
+ flexWrap: "wrap"
57668
58556
  },
57669
58557
  children: [/*#__PURE__*/jsxRuntime.jsx("section", {
57670
58558
  style: {
57671
- flex: 1
58559
+ flex: 1,
58560
+ minWidth: "300px"
57672
58561
  },
57673
58562
  children: /*#__PURE__*/jsxRuntime.jsx(ObservedFauna, {
57674
58563
  observedFaunaChart: observedFauna,
57675
58564
  t: t,
57676
58565
  options: options
57677
58566
  })
57678
- }), /*#__PURE__*/jsxRuntime.jsx(InvasiveSpecies, {
57679
- invasiveSpeciesChart: invasiveSpecies,
57680
- t: t,
57681
- options: options
58567
+ }), /*#__PURE__*/jsxRuntime.jsx("section", {
58568
+ style: {
58569
+ flex: 1,
58570
+ minWidth: "300px"
58571
+ },
58572
+ children: /*#__PURE__*/jsxRuntime.jsx(InvasiveSpecies, {
58573
+ invasiveSpeciesChart: invasiveSpecies,
58574
+ t: t,
58575
+ options: options
58576
+ })
57682
58577
  })]
57683
58578
  })]
57684
58579
  })
@@ -60634,6 +61529,11 @@ class LinkedSubjectsService extends BaseService {
60634
61529
  getForm({
60635
61530
  namespace
60636
61531
  }, language = "en", scope) {
61532
+ console.log({
61533
+ namespace,
61534
+ language,
61535
+ scope
61536
+ });
60637
61537
  return this.apiGet({
60638
61538
  url: `forms/${namespace === "documents" ? namespace : getNamespace(namespace)}`,
60639
61539
  isApp: true,