datastake-daf 0.6.767 → 0.6.768

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 (43) hide show
  1. package/dist/components/index.js +257 -196
  2. package/dist/pages/index.js +17468 -18460
  3. package/package.json +1 -1
  4. package/src/@daf/core/components/Dashboard/Map/ChainIcon/Markers/StakeholderMarker.js +5 -2
  5. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +67 -27
  6. package/src/@daf/core/components/Dashboard/Map/hook.js +26 -32
  7. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -1
  8. package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +1 -1
  9. package/src/@daf/core/components/UI/MissingTagButton/index.jsx +36 -0
  10. package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +0 -2
  11. package/src/@daf/pages/Documents/config.js +0 -10
  12. package/src/@daf/pages/Documents/index.jsx +51 -108
  13. package/src/@daf/pages/Events/Activities/config.js +1 -11
  14. package/src/@daf/pages/Events/Activities/index.jsx +47 -105
  15. package/src/@daf/pages/Events/Incidents/config.js +1 -11
  16. package/src/@daf/pages/Events/Incidents/index.jsx +47 -105
  17. package/src/@daf/pages/Events/config.js +18 -34
  18. package/src/@daf/pages/Events/index.jsx +49 -111
  19. package/src/@daf/pages/Locations/MineSite/config.js +0 -10
  20. package/src/@daf/pages/Locations/MineSite/index.jsx +47 -105
  21. package/src/@daf/pages/Locations/config.js +4 -16
  22. package/src/@daf/pages/Locations/index.jsx +53 -110
  23. package/src/@daf/pages/Stakeholders/Operators/config.js +0 -10
  24. package/src/@daf/pages/Stakeholders/Operators/index.jsx +47 -105
  25. package/src/@daf/pages/Stakeholders/Workers/config.js +0 -10
  26. package/src/@daf/pages/Stakeholders/Workers/index.jsx +47 -105
  27. package/src/@daf/pages/Stakeholders/config.js +3 -15
  28. package/src/@daf/pages/Stakeholders/index.jsx +53 -109
  29. package/src/@daf/pages/TablePage/config.js +78 -0
  30. package/src/@daf/{core/components/Screens/TableScreen/TableWithTabsAndCreate → pages/TablePage}/create.jsx +6 -5
  31. package/src/@daf/pages/TablePage/hook.js +123 -0
  32. package/src/@daf/pages/TablePage/index.jsx +142 -0
  33. package/src/index.js +1 -0
  34. package/src/@daf/core/components/Screens/TableScreen/TableWithTabsAndCreate/index.jsx +0 -115
  35. package/src/@daf/pages/Documents/create.jsx +0 -105
  36. package/src/@daf/pages/Events/Activities/create.jsx +0 -104
  37. package/src/@daf/pages/Events/Incidents/create.jsx +0 -104
  38. package/src/@daf/pages/Events/create.jsx +0 -104
  39. package/src/@daf/pages/Locations/MineSite/create.jsx +0 -104
  40. package/src/@daf/pages/Locations/create.jsx +0 -104
  41. package/src/@daf/pages/Stakeholders/Operators/create.jsx +0 -104
  42. package/src/@daf/pages/Stakeholders/Workers/create.jsx +0 -104
  43. package/src/@daf/pages/Stakeholders/create.jsx +0 -105
@@ -9522,24 +9522,29 @@ const processConditionalTableKeys = (tableKeys, item) => {
9522
9522
  });
9523
9523
  return processedKeys;
9524
9524
  };
9525
- const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, allValues, formValues = {}) => {
9525
+ const renderFieldData = function (type, value, user, config) {
9526
+ let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
9527
+ let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
9528
+ let app = arguments.length > 6 ? arguments[6] : undefined;
9529
+ let allValues = arguments.length > 7 ? arguments[7] : undefined;
9530
+ let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
9526
9531
  switch (type) {
9527
9532
  case 'year':
9528
9533
  return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
9529
9534
  case 'date':
9530
9535
  {
9531
- const language = user?.language && user?.language === 'sp' ? 'es' : user?.language;
9536
+ const language = user !== null && user !== void 0 && user.language && (user === null || user === void 0 ? void 0 : user.language) === 'sp' ? 'es' : user === null || user === void 0 ? void 0 : user.language;
9532
9537
  return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
9533
9538
  }
9534
9539
  case 'select':
9535
9540
  {
9536
- const options = config?.options || [];
9541
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9537
9542
  const option = findOptions(value, options);
9538
9543
  return option;
9539
9544
  }
9540
9545
  case 'multiselect':
9541
9546
  {
9542
- const options = config?.options || [];
9547
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9543
9548
  const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
9544
9549
  const option = findOptions(_val, options);
9545
9550
  return option.join(', ');
@@ -9554,7 +9559,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9554
9559
  formValues: formValues
9555
9560
  });
9556
9561
  case 'percentage':
9557
- return value === '-' || value === null || value === undefined ? '-' : `${value} %`;
9562
+ return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
9558
9563
  case 'geolocation':
9559
9564
  {
9560
9565
  const val = JSON.parse(value) || {};
@@ -9568,7 +9573,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9568
9573
  case 'upload':
9569
9574
  case 'videoUpload':
9570
9575
  {
9571
- const documentName = allValues?.map(item => item?.name).join(', ');
9576
+ const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
9572
9577
  return documentName;
9573
9578
  }
9574
9579
  default:
@@ -9576,25 +9581,27 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9576
9581
  }
9577
9582
  };
9578
9583
 
9579
- const renderValue = ({
9580
- value,
9581
- hasChildren,
9582
- config,
9583
- user,
9584
- getApiBaseUrl = () => {},
9585
- getAppHeader = () => {},
9586
- app,
9587
- allData = {}
9588
- }) => {
9589
- if (config?.type === 'groupInputs') {
9590
- if (!config?.inputs) return null;
9584
+ const renderValue = _ref => {
9585
+ let {
9586
+ value,
9587
+ hasChildren,
9588
+ config,
9589
+ user,
9590
+ getApiBaseUrl = () => {},
9591
+ getAppHeader = () => {},
9592
+ app,
9593
+ allData = {}
9594
+ } = _ref;
9595
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9596
+ if (!(config !== null && config !== void 0 && config.inputs)) return null;
9591
9597
  const inputKeys = Object.keys(config.inputs).sort((a, b) => {
9592
- const positionA = config.inputs[a]?.position || 0;
9593
- const positionB = config.inputs[b]?.position || 0;
9598
+ var _config$inputs$a, _config$inputs$b;
9599
+ const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9600
+ const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9594
9601
  return positionA - positionB;
9595
9602
  });
9596
9603
  const values = inputKeys.map(inputKey => {
9597
- let inputValue = value?.[inputKey];
9604
+ let inputValue = value === null || value === void 0 ? void 0 : value[inputKey];
9598
9605
  if (inputValue === null || inputValue === undefined || inputValue === '') {
9599
9606
  return '';
9600
9607
  } else if (typeof inputValue === 'object' && inputValue !== null) {
@@ -9635,8 +9642,8 @@ const renderValue = ({
9635
9642
  } else {
9636
9643
  displayValue = String(value);
9637
9644
  }
9638
- const fieldType = config?.type || 'text';
9639
- let cssClass = `tree-value ${fieldType}-type`;
9645
+ const fieldType = (config === null || config === void 0 ? void 0 : config.type) || 'text';
9646
+ let cssClass = "tree-value ".concat(fieldType, "-type");
9640
9647
  if (displayValue === '-') {
9641
9648
  cssClass += ' empty';
9642
9649
  }
@@ -9646,19 +9653,21 @@ const renderValue = ({
9646
9653
  children: displayValue
9647
9654
  });
9648
9655
  };
9649
- const determineHasChildren = ({
9650
- config,
9651
- level
9652
- }) => {
9653
- if (config?.type === 'groupInputs') {
9656
+ const determineHasChildren = _ref2 => {
9657
+ var _config$meta;
9658
+ let {
9659
+ config,
9660
+ level
9661
+ } = _ref2;
9662
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9654
9663
  return false;
9655
9664
  }
9656
- if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
9665
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'header' && config !== null && config !== void 0 && config.inputs && Object.keys(config.inputs).length > 0) {
9657
9666
  return true;
9658
9667
  }
9659
- return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
9668
+ return (config === null || config === void 0 ? void 0 : config.inputs) || (config === null || config === void 0 ? void 0 : config.type) === 'group' || (config === null || config === void 0 ? void 0 : config.type) === 'dataLinkGroup' || (config === null || config === void 0 ? void 0 : config.type) === 'section' || (config === null || config === void 0 ? void 0 : config.type) === 'ajaxSubGroup' ||
9660
9669
  // Add this line
9661
- config?.type === 'dataLink' && config?.meta?.tableKeys || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
9670
+ (config === null || config === void 0 ? void 0 : config.type) === 'dataLink' && (config === null || config === void 0 || (_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.tableKeys) || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
9662
9671
  };
9663
9672
 
9664
9673
  const sortByPosition = (items, getConfig) => {
@@ -9932,44 +9941,44 @@ function useAjaxModal$2({
9932
9941
  }
9933
9942
 
9934
9943
  const mergeObject = obj => {
9935
- return Object.entries(obj || {}).reduce((acc, _ref) => {
9936
- let [key, value] = _ref;
9944
+ return Object.entries(obj || {}).reduce((acc, [key, value]) => {
9937
9945
  if (typeof value === "object" && !Array.isArray(value) && value !== null) {
9938
- return _objectSpread2(_objectSpread2({}, acc), value);
9946
+ return {
9947
+ ...acc,
9948
+ ...value
9949
+ };
9939
9950
  }
9940
- return _objectSpread2(_objectSpread2({}, acc), {}, {
9951
+ return {
9952
+ ...acc,
9941
9953
  [key]: value
9942
- });
9954
+ };
9943
9955
  }, {});
9944
9956
  };
9945
- const handleDataLinkGroupWithTableKeys = _ref2 => {
9946
- var _inputConfig$meta, _config$meta2, _inputConfig$meta3, _inputConfig$meta4, _inputConfig$meta5;
9947
- let {
9948
- config,
9949
- inputConfig,
9950
- inputKey,
9951
- value,
9952
- level,
9953
- t,
9954
- rootForm,
9955
- allData,
9956
- user,
9957
- getApiBaseUrl = () => {},
9958
- getAppHeader = () => {},
9959
- app,
9960
- TreeNodeComponent
9961
- } = _ref2;
9957
+ const handleDataLinkGroupWithTableKeys = ({
9958
+ config,
9959
+ inputConfig,
9960
+ inputKey,
9961
+ value,
9962
+ level,
9963
+ t,
9964
+ rootForm,
9965
+ allData,
9966
+ user,
9967
+ getApiBaseUrl = () => {},
9968
+ getAppHeader = () => {},
9969
+ app,
9970
+ TreeNodeComponent
9971
+ }) => {
9962
9972
  if (!(config.type === 'dataLinkGroup' || config.type === 'dataLink')) {
9963
9973
  return null;
9964
9974
  }
9965
- if ((inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type) !== 'dataLink' || !(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta = inputConfig.meta) !== null && _inputConfig$meta !== void 0 && _inputConfig$meta.tableKeys)) {
9975
+ if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
9966
9976
  const parentInputKeys = Object.keys(config.inputs || {});
9967
9977
  const isHandledBySiblingDataLink = parentInputKeys.some(otherInputKey => {
9968
9978
  const otherConfig = config.inputs[otherInputKey];
9969
- if ((otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.type) === 'dataLink') {
9970
- var _otherConfig$meta, _config$meta;
9971
- const siblingTableKeys = (otherConfig === null || otherConfig === void 0 || (_otherConfig$meta = otherConfig.meta) === null || _otherConfig$meta === void 0 ? void 0 : _otherConfig$meta.tableKeys) || [];
9972
- const additionalTableKeys = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.additionalTableKeys) || [];
9979
+ if (otherConfig?.type === 'dataLink') {
9980
+ const siblingTableKeys = otherConfig?.meta?.tableKeys || [];
9981
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
9973
9982
  const allSiblingKeys = [...siblingTableKeys, ...additionalTableKeys];
9974
9983
  return allSiblingKeys.includes(inputKey) && otherInputKey !== inputKey;
9975
9984
  }
@@ -9983,26 +9992,23 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
9983
9992
  return null;
9984
9993
  }
9985
9994
  const tableKeys = inputConfig.meta.tableKeys;
9986
- const additionalTableKeys = ((_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.additionalTableKeys) || [];
9995
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
9987
9996
  const parentInputKeys = Object.keys(config.inputs || {});
9988
9997
  const siblingInputsMatchingTableKeys = parentInputKeys.filter(siblingKey => siblingKey !== inputKey).filter(siblingKey => tableKeys.includes(siblingKey) || additionalTableKeys.includes(siblingKey));
9989
9998
  [...new Set([...tableKeys, ...siblingInputsMatchingTableKeys])];
9990
- const isAjaxModal = React.useMemo(() => {
9991
- var _inputConfig$meta2;
9992
- return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
9993
- }, [inputConfig]);
9999
+ const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
9994
10000
  const ajaxModalValues = useAjaxModal$2({
9995
10001
  name: inputKey,
9996
10002
  user,
9997
- namespace: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta3 = inputConfig.meta) === null || _inputConfig$meta3 === void 0 ? void 0 : _inputConfig$meta3.namespace,
9998
- skipFetch: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta4 = inputConfig.meta) === null || _inputConfig$meta4 === void 0 ? void 0 : _inputConfig$meta4.skipFetch,
10003
+ namespace: inputConfig?.meta?.namespace,
10004
+ skipFetch: inputConfig?.meta?.skipFetch,
9999
10005
  isAjaxModal,
10000
- formScope: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta5 = inputConfig.meta) === null || _inputConfig$meta5 === void 0 ? void 0 : _inputConfig$meta5.formScope,
10006
+ formScope: inputConfig?.meta?.formScope,
10001
10007
  APP: app,
10002
10008
  apiBaseUrl: getApiBaseUrl(),
10003
10009
  _getAppHeader: getAppHeader
10004
10010
  });
10005
- const dataLinkForm = ajaxModalValues === null || ajaxModalValues === void 0 ? void 0 : ajaxModalValues.form;
10011
+ const dataLinkForm = ajaxModalValues?.form;
10006
10012
  const createInputsAndValues = item => {
10007
10013
  const inputs = {};
10008
10014
  const values = {};
@@ -10014,12 +10020,12 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10014
10020
  'videos': 'Video'
10015
10021
  };
10016
10022
  tableKeys.filter(tableKey => tableKey !== 'datastakeId').forEach(tableKey => {
10017
- var _dataLinkForm$identif;
10018
- const formInputConfig = (dataLinkForm === null || dataLinkForm === void 0 ? void 0 : dataLinkForm[tableKey]) || (dataLinkForm === null || dataLinkForm === void 0 || (_dataLinkForm$identif = dataLinkForm['identification']) === null || _dataLinkForm$identif === void 0 ? void 0 : _dataLinkForm$identif[tableKey]);
10023
+ const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
10019
10024
  if (formInputConfig) {
10020
- inputs[tableKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10025
+ inputs[tableKey] = {
10026
+ ...formInputConfig,
10021
10027
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
10022
- });
10028
+ };
10023
10029
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10024
10030
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10025
10031
  let resolvedLabel = null;
@@ -10027,7 +10033,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10027
10033
  const parts = labelKey.split(' is ');
10028
10034
  if (parts.length === 2) {
10029
10035
  const [conditionKey, conditionValue] = parts;
10030
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10036
+ if (item?.[conditionKey] === conditionValue) {
10031
10037
  resolvedLabel = formInputConfig.label[labelKey];
10032
10038
  break;
10033
10039
  }
@@ -10035,37 +10041,37 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10035
10041
  }
10036
10042
  inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
10037
10043
  }
10038
- values[tableKey] = item === null || item === void 0 ? void 0 : item[tableKey];
10044
+ values[tableKey] = item?.[tableKey];
10039
10045
  } else {
10040
- var _item$linking;
10041
10046
  inputs[tableKey] = {
10042
10047
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
10043
- type: inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type
10048
+ type: inputConfig?.type
10044
10049
  };
10045
- values[tableKey] = (item === null || item === void 0 || (_item$linking = item.linking) === null || _item$linking === void 0 || (_item$linking = _item$linking.SCL) === null || _item$linking === void 0 || (_item$linking = _item$linking[item === null || item === void 0 ? void 0 : item[tableKey]]) === null || _item$linking === void 0 ? void 0 : _item$linking.name) || (item === null || item === void 0 ? void 0 : item[tableKey]);
10050
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
10046
10051
  }
10047
10052
  });
10048
10053
  siblingInputsMatchingTableKeys.forEach(siblingKey => {
10049
10054
  const siblingConfig = config.inputs[siblingKey];
10050
10055
  if (siblingConfig) {
10051
- inputs[siblingKey] = _objectSpread2(_objectSpread2({}, siblingConfig), {}, {
10056
+ inputs[siblingKey] = {
10057
+ ...siblingConfig,
10052
10058
  label: siblingConfig.label || siblingKey
10053
- });
10054
- values[siblingKey] = item === null || item === void 0 ? void 0 : item[siblingKey];
10059
+ };
10060
+ values[siblingKey] = item?.[siblingKey];
10055
10061
  }
10056
10062
  });
10057
- if (dataLinkForm !== null && dataLinkForm !== void 0 && dataLinkForm.identification && typeof dataLinkForm.identification === 'object') {
10063
+ if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
10058
10064
  Object.keys(dataLinkForm.identification).filter(fieldKey => fieldKey !== 'datastakeId' && !tableKeys.includes(fieldKey)).filter(fieldKey => {
10059
10065
  const formInputConfig = dataLinkForm.identification[fieldKey];
10060
10066
  return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
10061
10067
  }).forEach(fieldKey => {
10062
- var _item$linking2;
10063
10068
  const formInputConfig = dataLinkForm.identification[fieldKey];
10064
- inputs[fieldKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10069
+ inputs[fieldKey] = {
10070
+ ...formInputConfig,
10065
10071
  label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
10066
- });
10067
- if (formInputConfig !== null && formInputConfig !== void 0 && formInputConfig.label && typeof (formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label) === 'object') {
10068
- const dynamicLabelKeys = Object.keys(formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label);
10072
+ };
10073
+ if (formInputConfig?.label && typeof formInputConfig?.label === 'object') {
10074
+ const dynamicLabelKeys = Object.keys(formInputConfig?.label);
10069
10075
  let resolvedLabel = null;
10070
10076
  for (const labelKey of dynamicLabelKeys) {
10071
10077
  const parts = labelKey.split(' is ');
@@ -10074,7 +10080,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10074
10080
  const flattenedItem = Object.assign({}, item.location, {
10075
10081
  address: item.address
10076
10082
  });
10077
- if ((flattenedItem === null || flattenedItem === void 0 ? void 0 : flattenedItem[conditionKey]) === conditionValue) {
10083
+ if (flattenedItem?.[conditionKey] === conditionValue) {
10078
10084
  resolvedLabel = formInputConfig.label[labelKey];
10079
10085
  break;
10080
10086
  }
@@ -10082,7 +10088,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10082
10088
  }
10083
10089
  inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
10084
10090
  }
10085
- values[fieldKey] = (item === null || item === void 0 || (_item$linking2 = item.linking) === null || _item$linking2 === void 0 || (_item$linking2 = _item$linking2.SCL) === null || _item$linking2 === void 0 || (_item$linking2 = _item$linking2[item === null || item === void 0 ? void 0 : item[fieldKey]]) === null || _item$linking2 === void 0 ? void 0 : _item$linking2.name) || (item === null || item === void 0 ? void 0 : item[fieldKey]);
10091
+ values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[fieldKey];
10086
10092
  });
10087
10093
  }
10088
10094
  return {
@@ -10092,17 +10098,16 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10092
10098
  };
10093
10099
  if (Array.isArray(value)) {
10094
10100
  return value.map((item, itemIndex) => {
10095
- var _merged$inputKey;
10096
10101
  const merged = mergeObject(item);
10097
- const datastakeIdValue = (merged === null || merged === void 0 || (_merged$inputKey = merged[inputKey]) === null || _merged$inputKey === void 0 ? void 0 : _merged$inputKey.datastakeId) || (merged === null || merged === void 0 ? void 0 : merged.datastakeId);
10102
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10098
10103
  const {
10099
10104
  inputs,
10100
10105
  values
10101
10106
  } = createInputsAndValues(merged);
10102
10107
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10103
- nodeKey: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10108
+ nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10104
10109
  config: {
10105
- label: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10110
+ label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10106
10111
  type: 'custom-datalink-group',
10107
10112
  inputs: inputs
10108
10113
  },
@@ -10116,12 +10121,11 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10116
10121
  getApiBaseUrl: getApiBaseUrl,
10117
10122
  getAppHeader: getAppHeader,
10118
10123
  app: app
10119
- }, "".concat(inputKey, "-").concat(itemIndex));
10124
+ }, `${inputKey}-${itemIndex}`);
10120
10125
  });
10121
10126
  } else {
10122
- var _merged$inputKey2;
10123
10127
  const merged = mergeObject(value);
10124
- const datastakeIdValue = (merged === null || merged === void 0 || (_merged$inputKey2 = merged[inputKey]) === null || _merged$inputKey2 === void 0 ? void 0 : _merged$inputKey2.datastakeId) || (merged === null || merged === void 0 ? void 0 : merged.datastakeId);
10128
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10125
10129
  const {
10126
10130
  inputs,
10127
10131
  values
@@ -10143,46 +10147,41 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10143
10147
  getApiBaseUrl: getApiBaseUrl,
10144
10148
  getAppHeader: getAppHeader,
10145
10149
  app: app
10146
- }, "".concat(inputKey, "-group"));
10150
+ }, `${inputKey}-group`);
10147
10151
  }
10148
10152
  };
10149
10153
 
10150
- const handleDataLinkWithTableKeys = _ref => {
10151
- var _inputConfig$meta, _inputConfig$meta3, _inputConfig$meta4, _inputConfig$meta5;
10152
- let {
10153
- inputConfig,
10154
- inputKey,
10155
- value,
10156
- level,
10157
- t,
10158
- rootForm,
10159
- allData,
10160
- user,
10161
- getApiBaseUrl = () => {},
10162
- getAppHeader = () => {},
10163
- app,
10164
- TreeNodeComponent
10165
- } = _ref;
10166
- if ((inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type) !== 'dataLink' || !(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta = inputConfig.meta) !== null && _inputConfig$meta !== void 0 && _inputConfig$meta.tableKeys)) {
10154
+ const handleDataLinkWithTableKeys = ({
10155
+ inputConfig,
10156
+ inputKey,
10157
+ value,
10158
+ level,
10159
+ t,
10160
+ rootForm,
10161
+ allData,
10162
+ user,
10163
+ getApiBaseUrl = () => {},
10164
+ getAppHeader = () => {},
10165
+ app,
10166
+ TreeNodeComponent
10167
+ }) => {
10168
+ if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
10167
10169
  return null;
10168
10170
  }
10169
10171
  const tableKeys = inputConfig.meta.tableKeys;
10170
- const isAjaxModal = React.useMemo(() => {
10171
- var _inputConfig$meta2;
10172
- return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
10173
- }, [inputConfig]);
10172
+ const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
10174
10173
  const ajaxModalValues = useAjaxModal$2({
10175
10174
  name: inputKey,
10176
10175
  user,
10177
- namespace: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta3 = inputConfig.meta) === null || _inputConfig$meta3 === void 0 ? void 0 : _inputConfig$meta3.namespace,
10178
- skipFetch: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta4 = inputConfig.meta) === null || _inputConfig$meta4 === void 0 ? void 0 : _inputConfig$meta4.skipFetch,
10176
+ namespace: inputConfig?.meta?.namespace,
10177
+ skipFetch: inputConfig?.meta?.skipFetch,
10179
10178
  isAjaxModal,
10180
- formScope: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta5 = inputConfig.meta) === null || _inputConfig$meta5 === void 0 ? void 0 : _inputConfig$meta5.formScope,
10179
+ formScope: inputConfig?.meta?.formScope,
10181
10180
  APP: app,
10182
10181
  apiBaseUrl: getApiBaseUrl(),
10183
10182
  _getAppHeader: getAppHeader
10184
10183
  });
10185
- const dataLinkForm = ajaxModalValues === null || ajaxModalValues === void 0 ? void 0 : ajaxModalValues.form;
10184
+ const dataLinkForm = ajaxModalValues?.form;
10186
10185
  const createInputsAndValues = item => {
10187
10186
  const inputs = {};
10188
10187
  const values = {};
@@ -10195,20 +10194,19 @@ const handleDataLinkWithTableKeys = _ref => {
10195
10194
  };
10196
10195
  const isUploadFieldEmpty = (fieldKey, itemToCheck) => {
10197
10196
  if (uploadTypeFields.includes(fieldKey)) {
10198
- const itemValue = itemToCheck === null || itemToCheck === void 0 ? void 0 : itemToCheck[fieldKey];
10197
+ const itemValue = itemToCheck?.[fieldKey];
10199
10198
  return itemValue === undefined || itemValue === null || Array.isArray(itemValue) && itemValue.length === 0;
10200
10199
  }
10201
10200
  return false;
10202
10201
  };
10203
10202
  const processedTableKeys = processConditionalTableKeys(tableKeys, item);
10204
10203
  processedTableKeys.filter(tableKey => tableKey !== 'datastakeId').filter(tableKey => !isUploadFieldEmpty(tableKey, item)).forEach(tableKey => {
10205
- var _dataLinkForm$identif;
10206
- const formInputConfig = (dataLinkForm === null || dataLinkForm === void 0 ? void 0 : dataLinkForm[tableKey]) || (dataLinkForm === null || dataLinkForm === void 0 || (_dataLinkForm$identif = dataLinkForm['identification']) === null || _dataLinkForm$identif === void 0 ? void 0 : _dataLinkForm$identif[tableKey]);
10204
+ const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
10207
10205
  if (formInputConfig) {
10208
- var _item$linking, _formInputConfig$meta, _formInputConfig$tabl;
10209
- inputs[tableKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10206
+ inputs[tableKey] = {
10207
+ ...formInputConfig,
10210
10208
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
10211
- });
10209
+ };
10212
10210
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10213
10211
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10214
10212
  let resolvedLabel = null;
@@ -10216,7 +10214,7 @@ const handleDataLinkWithTableKeys = _ref => {
10216
10214
  const parts = labelKey.split(' is ');
10217
10215
  if (parts.length === 2) {
10218
10216
  const [conditionKey, conditionValue] = parts;
10219
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10217
+ if (item?.[conditionKey] === conditionValue) {
10220
10218
  resolvedLabel = formInputConfig.label[labelKey];
10221
10219
  break;
10222
10220
  }
@@ -10224,17 +10222,16 @@ const handleDataLinkWithTableKeys = _ref => {
10224
10222
  }
10225
10223
  inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
10226
10224
  }
10227
- values[tableKey] = (item === null || item === void 0 || (_item$linking = item.linking) === null || _item$linking === void 0 || (_item$linking = _item$linking.SCL) === null || _item$linking === void 0 || (_item$linking = _item$linking[item === null || item === void 0 ? void 0 : item[tableKey]]) === null || _item$linking === void 0 ? void 0 : _item$linking.name) || item[formInputConfig === null || formInputConfig === void 0 || (_formInputConfig$meta = formInputConfig.meta) === null || _formInputConfig$meta === void 0 ? void 0 : _formInputConfig$meta.onNewSetValueKey] || (item === null || item === void 0 ? void 0 : item[formInputConfig === null || formInputConfig === void 0 || (_formInputConfig$tabl = formInputConfig.tableLabel) === null || _formInputConfig$tabl === void 0 ? void 0 : _formInputConfig$tabl.toLowerCase()]) || (item === null || item === void 0 ? void 0 : item[tableKey]);
10225
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item[formInputConfig?.meta?.onNewSetValueKey] || item?.[formInputConfig?.tableLabel?.toLowerCase()] || item?.[tableKey];
10228
10226
  } else {
10229
- var _item$linking2;
10230
10227
  inputs[tableKey] = {
10231
10228
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
10232
- type: inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type
10229
+ type: inputConfig?.type
10233
10230
  };
10234
- values[tableKey] = (item === null || item === void 0 || (_item$linking2 = item.linking) === null || _item$linking2 === void 0 || (_item$linking2 = _item$linking2.SCL) === null || _item$linking2 === void 0 || (_item$linking2 = _item$linking2[item === null || item === void 0 ? void 0 : item[tableKey]]) === null || _item$linking2 === void 0 ? void 0 : _item$linking2.name) || (item === null || item === void 0 ? void 0 : item[tableKey]);
10231
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
10235
10232
  }
10236
10233
  });
10237
- if (dataLinkForm !== null && dataLinkForm !== void 0 && dataLinkForm.identification && typeof dataLinkForm.identification === 'object') {
10234
+ if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
10238
10235
  Object.keys(dataLinkForm.identification).filter(fieldKey => {
10239
10236
  if (uploadTypeFields.includes(fieldKey)) {
10240
10237
  return !isUploadFieldEmpty(fieldKey, item);
@@ -10244,11 +10241,11 @@ const handleDataLinkWithTableKeys = _ref => {
10244
10241
  const formInputConfig = dataLinkForm.identification[fieldKey];
10245
10242
  return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
10246
10243
  }).forEach(fieldKey => {
10247
- var _item$linking3, _formInputConfig$tabl2;
10248
10244
  const formInputConfig = dataLinkForm.identification[fieldKey];
10249
- inputs[fieldKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10245
+ inputs[fieldKey] = {
10246
+ ...formInputConfig,
10250
10247
  label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
10251
- });
10248
+ };
10252
10249
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10253
10250
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10254
10251
  let resolvedLabel = null;
@@ -10256,7 +10253,7 @@ const handleDataLinkWithTableKeys = _ref => {
10256
10253
  const parts = labelKey.split(' is ');
10257
10254
  if (parts.length === 2) {
10258
10255
  const [conditionKey, conditionValue] = parts;
10259
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10256
+ if (item?.[conditionKey] === conditionValue) {
10260
10257
  resolvedLabel = formInputConfig.label[labelKey];
10261
10258
  break;
10262
10259
  }
@@ -10264,7 +10261,7 @@ const handleDataLinkWithTableKeys = _ref => {
10264
10261
  }
10265
10262
  inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
10266
10263
  }
10267
- values[fieldKey] = (item === null || item === void 0 || (_item$linking3 = item.linking) === null || _item$linking3 === void 0 || (_item$linking3 = _item$linking3.SCL) === null || _item$linking3 === void 0 || (_item$linking3 = _item$linking3[item === null || item === void 0 ? void 0 : item[fieldKey]]) === null || _item$linking3 === void 0 ? void 0 : _item$linking3.name) || (item === null || item === void 0 ? void 0 : item[formInputConfig === null || formInputConfig === void 0 || (_formInputConfig$tabl2 = formInputConfig.tableLabel) === null || _formInputConfig$tabl2 === void 0 ? void 0 : _formInputConfig$tabl2.toLowerCase()]) || (item === null || item === void 0 ? void 0 : item[fieldKey]);
10264
+ values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[formInputConfig?.tableLabel?.toLowerCase()] || item?.[fieldKey];
10268
10265
  });
10269
10266
  }
10270
10267
  return {
@@ -10274,7 +10271,7 @@ const handleDataLinkWithTableKeys = _ref => {
10274
10271
  };
10275
10272
  if (Array.isArray(value)) {
10276
10273
  return value.map((item, itemIndex) => {
10277
- const datastakeIdValue = item === null || item === void 0 ? void 0 : item.datastakeId;
10274
+ const datastakeIdValue = item?.datastakeId;
10278
10275
  const {
10279
10276
  inputs,
10280
10277
  values
@@ -10283,9 +10280,9 @@ const handleDataLinkWithTableKeys = _ref => {
10283
10280
  return null;
10284
10281
  }
10285
10282
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10286
- nodeKey: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10283
+ nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10287
10284
  config: {
10288
- label: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10285
+ label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10289
10286
  type: 'custom-datalink',
10290
10287
  inputs: inputs
10291
10288
  },
@@ -10299,10 +10296,10 @@ const handleDataLinkWithTableKeys = _ref => {
10299
10296
  getApiBaseUrl: getApiBaseUrl,
10300
10297
  getAppHeader: getAppHeader,
10301
10298
  app: app
10302
- }, "".concat(inputKey, "-").concat(itemIndex));
10299
+ }, `${inputKey}-${itemIndex}`);
10303
10300
  });
10304
10301
  } else {
10305
- const datastakeIdValue = value === null || value === void 0 ? void 0 : value.datastakeId;
10302
+ const datastakeIdValue = value?.datastakeId;
10306
10303
  const {
10307
10304
  inputs,
10308
10305
  values
@@ -10327,7 +10324,7 @@ const handleDataLinkWithTableKeys = _ref => {
10327
10324
  getApiBaseUrl: getApiBaseUrl,
10328
10325
  getAppHeader: getAppHeader,
10329
10326
  app: app
10330
- }, "".concat(inputKey, "-single"));
10327
+ }, `${inputKey}-single`);
10331
10328
  }
10332
10329
  };
10333
10330
 
@@ -13516,7 +13513,7 @@ function StakeholderIcon$1({
13516
13513
  React.useEffect(() => {
13517
13514
  linkNodesData.map(node => {
13518
13515
  const isConnectingToStakeholder = node.isStakeholder;
13519
- const id = `${data.datastakeId}-${node.stakeholderId}`;
13516
+ const id = `${data.datastakeId}-${node.stakeholderId || node.datastakeId}`;
13520
13517
  const targetsParentId = node.parentId;
13521
13518
  const targetMarkerIndex = node.stakeholdersIndex;
13522
13519
  const isSibling = targetsParentId === parentId;
@@ -13635,7 +13632,10 @@ function StakeholderIcon$1({
13635
13632
  onClickLink(data);
13636
13633
  }
13637
13634
  }),
13638
- getPopupContainer: () => document.getElementById("map"),
13635
+ getPopupContainer: triggerNode => {
13636
+ const mapElement = document.getElementById("map");
13637
+ return mapElement || triggerNode.parentElement || document.body;
13638
+ },
13639
13639
  children: /*#__PURE__*/jsxRuntime.jsx(StakeholderMarker, {
13640
13640
  className: `${data.type} ${isSelected ? "selected" : selectedMarkersId.length > 0 ? "unselected" : ""}
13641
13641
  ${isSmall ? "small" : isMedium ? "medium" : "large"}
@@ -13672,7 +13672,8 @@ function LocationIcon({
13672
13672
  activeMarker,
13673
13673
  setActiveMarker
13674
13674
  }) {
13675
- const root = React.useRef(null);
13675
+ const rootsMapRef = React.useRef(new Map());
13676
+ const markersRef = React.useRef([]);
13676
13677
  const isSelected = selectedMarkersId.includes(data.datastakeId);
13677
13678
  const Marker = React.useMemo(() => {
13678
13679
  if (isMineSite(data.type)) {
@@ -13709,7 +13710,21 @@ function LocationIcon({
13709
13710
  return data?.stakeholders || [];
13710
13711
  }, [data.stakeholders, zoom]);
13711
13712
  React.useEffect(() => {
13712
- stakeholdersOfLocation.map((stakeholder, index) => {
13713
+ const currentRoots = rootsMapRef.current;
13714
+ const currentMarkers = markersRef.current;
13715
+ currentMarkers.forEach(marker => {
13716
+ if (mapRef.hasLayer(marker)) {
13717
+ mapRef.removeLayer(marker);
13718
+ }
13719
+ });
13720
+ currentRoots.forEach(root => {
13721
+ root.unmount();
13722
+ });
13723
+ currentRoots.clear();
13724
+ markersRef.current = [];
13725
+
13726
+ // Create new markers
13727
+ stakeholdersOfLocation.forEach((stakeholder, index) => {
13713
13728
  const markerId = `${stakeholder.datastakeId}`;
13714
13729
  const {
13715
13730
  x,
@@ -13740,28 +13755,34 @@ function LocationIcon({
13740
13755
  iconSize: iconSize
13741
13756
  })
13742
13757
  }).addTo(mapRef);
13743
- const div = document.getElementById(markerId);
13744
- root.current = client.createRoot(div);
13745
- root.current.render( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
13746
- data: stakeholder,
13747
- zoom: zoom,
13748
- allData: allData,
13749
- link: link,
13750
- parentId: data.datastakeId,
13751
- renderTooltip: renderTooltip,
13752
- onClickLink: onClickLink,
13753
- selectedMarkersId: selectedMarkersId,
13754
- handleSelectMarker: handleSelectMarker,
13755
- mapRef: mapRef,
13756
- radius: radius,
13757
- index: index,
13758
- x: x,
13759
- y: y,
13760
- openPopupIdRef: openPopupIdRef,
13761
- polylinesRef: polylinesRef,
13762
- isForceOpen: isForceOpen,
13763
- activeMarker: activeMarker
13764
- }));
13758
+ markersRef.current.push(marker);
13759
+ setTimeout(() => {
13760
+ const div = document.getElementById(markerId);
13761
+ if (div && !rootsMapRef.current.has(markerId)) {
13762
+ const root = client.createRoot(div);
13763
+ rootsMapRef.current.set(markerId, root);
13764
+ root.render( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
13765
+ data: stakeholder,
13766
+ zoom: zoom,
13767
+ allData: allData,
13768
+ link: link,
13769
+ parentId: data.datastakeId,
13770
+ renderTooltip: renderTooltip,
13771
+ onClickLink: onClickLink,
13772
+ selectedMarkersId: selectedMarkersId,
13773
+ handleSelectMarker: handleSelectMarker,
13774
+ mapRef: mapRef,
13775
+ radius: radius,
13776
+ index: index,
13777
+ x: x,
13778
+ y: y,
13779
+ openPopupIdRef: openPopupIdRef,
13780
+ polylinesRef: polylinesRef,
13781
+ isForceOpen: isForceOpen,
13782
+ activeMarker: activeMarker
13783
+ }));
13784
+ }
13785
+ }, 0);
13765
13786
  setMapMarkers(prev => {
13766
13787
  const array = [...prev, {
13767
13788
  id: marker._leaflet_id,
@@ -13791,6 +13812,18 @@ function LocationIcon({
13791
13812
  listOfPolylines: polylinesRef.current
13792
13813
  });
13793
13814
  });
13815
+ return () => {
13816
+ markersRef.current.forEach(marker => {
13817
+ if (mapRef.hasLayer(marker)) {
13818
+ mapRef.removeLayer(marker);
13819
+ }
13820
+ });
13821
+ rootsMapRef.current.forEach(root => {
13822
+ root.unmount();
13823
+ });
13824
+ rootsMapRef.current.clear();
13825
+ markersRef.current = [];
13826
+ };
13794
13827
  }, [stakeholdersOfLocation, selectedMarkersId, activeMarker]);
13795
13828
  linkedNodesData.map(node => {
13796
13829
  const id = `${data.datastakeId}-${node.datastakeId}`;
@@ -13838,7 +13871,10 @@ function LocationIcon({
13838
13871
  // isHovering
13839
13872
  // }
13840
13873
  ,
13841
- getPopupContainer: () => document.getElementById("map"),
13874
+ getPopupContainer: triggerNode => {
13875
+ const mapElement = document.getElementById("map");
13876
+ return mapElement || triggerNode.parentElement || document.body;
13877
+ },
13842
13878
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
13843
13879
  style: {
13844
13880
  position: "relative",
@@ -14581,34 +14617,28 @@ const useMap$1 = ({
14581
14617
  }
14582
14618
  const highlightTable = {};
14583
14619
  for (const [node] of graph) {
14584
- const visited = new Set();
14585
- const queue = [node];
14586
- while (queue.length) {
14587
- const current = queue.shift();
14588
- if (visited.has(current)) continue;
14589
- const currentType = nodeTypes.get(current);
14590
- if (current !== node && isLocation(currentType)) continue;
14591
- visited.add(current);
14592
- for (const neighbor of graph.get(current)) {
14593
- if (!visited.has(neighbor)) queue.push(neighbor);
14594
- }
14595
- }
14596
- if (!isLocation(nodeTypes.get(node)) && stakeToLoc.has(node)) {
14597
- visited.add(stakeToLoc.get(node));
14598
- }
14599
- visited.add(node);
14600
- const extraLocs = new Set();
14601
- for (const n of visited) {
14602
- for (const neighbor of graph.get(n) || []) {
14603
- if (isLocation(nodeTypes.get(neighbor))) {
14604
- extraLocs.add(neighbor);
14620
+ const highlighted = new Set();
14621
+ highlighted.add(node);
14622
+ const nodeIsStakeholder = !isLocation(nodeTypes.get(node));
14623
+ if (nodeIsStakeholder && stakeToLoc.has(node)) {
14624
+ const parentLoc = stakeToLoc.get(node);
14625
+ highlighted.add(parentLoc);
14626
+ }
14627
+ for (const neighbor of graph.get(node) || []) {
14628
+ const neighborIsStakeholder = !isLocation(nodeTypes.get(neighbor));
14629
+ if (neighborIsStakeholder && stakeToLoc.has(neighbor)) {
14630
+ const neighborParent = stakeToLoc.get(neighbor);
14631
+ if (isLocation(nodeTypes.get(node)) && neighborParent === node || nodeIsStakeholder && stakeToLoc.get(node) === neighborParent) {
14632
+ highlighted.add(neighbor);
14633
+ } else {
14634
+ highlighted.add(neighbor);
14635
+ highlighted.add(neighborParent);
14605
14636
  }
14637
+ } else {
14638
+ highlighted.add(neighbor);
14606
14639
  }
14607
14640
  }
14608
- for (const loc of extraLocs) {
14609
- visited.add(loc);
14610
- }
14611
- highlightTable[node] = [...visited];
14641
+ highlightTable[node] = [...highlighted];
14612
14642
  }
14613
14643
  return highlightTable;
14614
14644
  }, [data, type]);
@@ -50168,6 +50198,7 @@ var index = withProvider(StakeholderMappings);
50168
50198
 
50169
50199
  const _excluded$1 = ["t", "checkboxConfig", "defaultTableFilters", "columns", "children", "data", "loading", "APP", "getApiBaseUrl", "selectOptions", "selectFilters", "showCreate", "location", "goTo", "getRedirectLink", "defaultUrlParams", "view", "module", "filtersConfig", "isMobile"];
50170
50200
  const BaseScreen = _ref => {
50201
+ var _data$data;
50171
50202
  let {
50172
50203
  t,
50173
50204
  // newFiltersConfig,
@@ -50267,7 +50298,7 @@ const BaseScreen = _ref => {
50267
50298
  className: "daf-table-wrapper pagination-w-padding",
50268
50299
  children: [/*#__PURE__*/jsxRuntime.jsx(DAFTable, _objectSpread2({
50269
50300
  columns: columns,
50270
- data: data === null || data === void 0 ? void 0 : data.data,
50301
+ data: Array.isArray(data === null || data === void 0 ? void 0 : data.data) ? data === null || data === void 0 ? void 0 : data.data : data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.data,
50271
50302
  loading: loading,
50272
50303
  hideOnLoading: false,
50273
50304
  pagination: pagination,
@@ -60529,6 +60560,35 @@ function KeyIndicatorNavigateLabel(_ref) {
60529
60560
  });
60530
60561
  }
60531
60562
 
60563
+ function MissingTagButton(_ref) {
60564
+ let {
60565
+ hasMissing,
60566
+ setHighlightMandatory,
60567
+ highlightMandatory,
60568
+ t
60569
+ } = _ref;
60570
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
60571
+ children: hasMissing ? /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
60572
+ onClick: () => setHighlightMandatory(!highlightMandatory),
60573
+ className: formatClassname(['ml-2 highlight-tag', highlightMandatory && 'highlighted']),
60574
+ style: {
60575
+ textAlign: "center"
60576
+ },
60577
+ children: t('missing-inputs')
60578
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
60579
+ title: t('all-inputs-fullfilled'),
60580
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
60581
+ onClick: () => setHighlightMandatory(!highlightMandatory),
60582
+ className: formatClassname(['ml-2 highlight-tag disabled']),
60583
+ style: {
60584
+ textAlign: "center"
60585
+ },
60586
+ children: t('missing-inputs')
60587
+ })
60588
+ })
60589
+ });
60590
+ }
60591
+
60532
60592
  var Style$5 = styled__default["default"].div`
60533
60593
  display: flex;
60534
60594
  flex-direction: column;
@@ -61879,6 +61939,7 @@ exports.LineChart = LineChart;
61879
61939
  exports.Loading = Loading;
61880
61940
  exports.LocationTable = LocationTable;
61881
61941
  exports.MineSiteMap = Map$3;
61942
+ exports.MissingTagButton = MissingTagButton;
61882
61943
  exports.Modal = Modal;
61883
61944
  exports.ModalHeader = ModalHeader;
61884
61945
  exports.MoreMenu = MoreMenu;