datastake-daf 0.6.762 → 0.6.763

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.
@@ -9511,24 +9511,29 @@ const processConditionalTableKeys = (tableKeys, item) => {
9511
9511
  });
9512
9512
  return processedKeys;
9513
9513
  };
9514
- const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, allValues, formValues = {}) => {
9514
+ const renderFieldData = function (type, value, user, config) {
9515
+ let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
9516
+ let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
9517
+ let app = arguments.length > 6 ? arguments[6] : undefined;
9518
+ let allValues = arguments.length > 7 ? arguments[7] : undefined;
9519
+ let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
9515
9520
  switch (type) {
9516
9521
  case 'year':
9517
9522
  return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
9518
9523
  case 'date':
9519
9524
  {
9520
- const language = user?.language && user?.language === 'sp' ? 'es' : user?.language;
9525
+ 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;
9521
9526
  return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
9522
9527
  }
9523
9528
  case 'select':
9524
9529
  {
9525
- const options = config?.options || [];
9530
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9526
9531
  const option = findOptions(value, options);
9527
9532
  return option;
9528
9533
  }
9529
9534
  case 'multiselect':
9530
9535
  {
9531
- const options = config?.options || [];
9536
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9532
9537
  const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
9533
9538
  const option = findOptions(_val, options);
9534
9539
  return option.join(', ');
@@ -9543,7 +9548,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9543
9548
  formValues: formValues
9544
9549
  });
9545
9550
  case 'percentage':
9546
- return value === '-' || value === null || value === undefined ? '-' : `${value} %`;
9551
+ return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
9547
9552
  case 'geolocation':
9548
9553
  {
9549
9554
  const val = JSON.parse(value) || {};
@@ -9557,7 +9562,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9557
9562
  case 'upload':
9558
9563
  case 'videoUpload':
9559
9564
  {
9560
- const documentName = allValues?.map(item => item?.name).join(', ');
9565
+ const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
9561
9566
  return documentName;
9562
9567
  }
9563
9568
  default:
@@ -9565,25 +9570,27 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9565
9570
  }
9566
9571
  };
9567
9572
 
9568
- const renderValue = ({
9569
- value,
9570
- hasChildren,
9571
- config,
9572
- user,
9573
- getApiBaseUrl = () => {},
9574
- getAppHeader = () => {},
9575
- app,
9576
- allData = {}
9577
- }) => {
9578
- if (config?.type === 'groupInputs') {
9579
- if (!config?.inputs) return null;
9573
+ const renderValue = _ref => {
9574
+ let {
9575
+ value,
9576
+ hasChildren,
9577
+ config,
9578
+ user,
9579
+ getApiBaseUrl = () => {},
9580
+ getAppHeader = () => {},
9581
+ app,
9582
+ allData = {}
9583
+ } = _ref;
9584
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9585
+ if (!(config !== null && config !== void 0 && config.inputs)) return null;
9580
9586
  const inputKeys = Object.keys(config.inputs).sort((a, b) => {
9581
- const positionA = config.inputs[a]?.position || 0;
9582
- const positionB = config.inputs[b]?.position || 0;
9587
+ var _config$inputs$a, _config$inputs$b;
9588
+ const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9589
+ const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9583
9590
  return positionA - positionB;
9584
9591
  });
9585
9592
  const values = inputKeys.map(inputKey => {
9586
- let inputValue = value?.[inputKey];
9593
+ let inputValue = value === null || value === void 0 ? void 0 : value[inputKey];
9587
9594
  if (inputValue === null || inputValue === undefined || inputValue === '') {
9588
9595
  return '';
9589
9596
  } else if (typeof inputValue === 'object' && inputValue !== null) {
@@ -9624,8 +9631,8 @@ const renderValue = ({
9624
9631
  } else {
9625
9632
  displayValue = String(value);
9626
9633
  }
9627
- const fieldType = config?.type || 'text';
9628
- let cssClass = `tree-value ${fieldType}-type`;
9634
+ const fieldType = (config === null || config === void 0 ? void 0 : config.type) || 'text';
9635
+ let cssClass = "tree-value ".concat(fieldType, "-type");
9629
9636
  if (displayValue === '-') {
9630
9637
  cssClass += ' empty';
9631
9638
  }
@@ -9635,19 +9642,21 @@ const renderValue = ({
9635
9642
  children: displayValue
9636
9643
  });
9637
9644
  };
9638
- const determineHasChildren = ({
9639
- config,
9640
- level
9641
- }) => {
9642
- if (config?.type === 'groupInputs') {
9645
+ const determineHasChildren = _ref2 => {
9646
+ var _config$meta;
9647
+ let {
9648
+ config,
9649
+ level
9650
+ } = _ref2;
9651
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9643
9652
  return false;
9644
9653
  }
9645
- if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
9654
+ if ((config === null || config === void 0 ? void 0 : config.type) === 'header' && config !== null && config !== void 0 && config.inputs && Object.keys(config.inputs).length > 0) {
9646
9655
  return true;
9647
9656
  }
9648
- return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
9657
+ 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' ||
9649
9658
  // Add this line
9650
- 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);
9659
+ (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);
9651
9660
  };
9652
9661
 
9653
9662
  const sortByPosition = (items, getConfig) => {
@@ -9921,44 +9930,44 @@ function useAjaxModal$2({
9921
9930
  }
9922
9931
 
9923
9932
  const mergeObject = obj => {
9924
- return Object.entries(obj || {}).reduce((acc, _ref) => {
9925
- let [key, value] = _ref;
9933
+ return Object.entries(obj || {}).reduce((acc, [key, value]) => {
9926
9934
  if (typeof value === "object" && !Array.isArray(value) && value !== null) {
9927
- return _objectSpread2(_objectSpread2({}, acc), value);
9935
+ return {
9936
+ ...acc,
9937
+ ...value
9938
+ };
9928
9939
  }
9929
- return _objectSpread2(_objectSpread2({}, acc), {}, {
9940
+ return {
9941
+ ...acc,
9930
9942
  [key]: value
9931
- });
9943
+ };
9932
9944
  }, {});
9933
9945
  };
9934
- const handleDataLinkGroupWithTableKeys = _ref2 => {
9935
- var _inputConfig$meta, _config$meta2, _inputConfig$meta3, _inputConfig$meta4, _inputConfig$meta5;
9936
- let {
9937
- config,
9938
- inputConfig,
9939
- inputKey,
9940
- value,
9941
- level,
9942
- t,
9943
- rootForm,
9944
- allData,
9945
- user,
9946
- getApiBaseUrl = () => {},
9947
- getAppHeader = () => {},
9948
- app,
9949
- TreeNodeComponent
9950
- } = _ref2;
9946
+ const handleDataLinkGroupWithTableKeys = ({
9947
+ config,
9948
+ inputConfig,
9949
+ inputKey,
9950
+ value,
9951
+ level,
9952
+ t,
9953
+ rootForm,
9954
+ allData,
9955
+ user,
9956
+ getApiBaseUrl = () => {},
9957
+ getAppHeader = () => {},
9958
+ app,
9959
+ TreeNodeComponent
9960
+ }) => {
9951
9961
  if (!(config.type === 'dataLinkGroup' || config.type === 'dataLink')) {
9952
9962
  return null;
9953
9963
  }
9954
- 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)) {
9964
+ if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
9955
9965
  const parentInputKeys = Object.keys(config.inputs || {});
9956
9966
  const isHandledBySiblingDataLink = parentInputKeys.some(otherInputKey => {
9957
9967
  const otherConfig = config.inputs[otherInputKey];
9958
- if ((otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.type) === 'dataLink') {
9959
- var _otherConfig$meta, _config$meta;
9960
- const siblingTableKeys = (otherConfig === null || otherConfig === void 0 || (_otherConfig$meta = otherConfig.meta) === null || _otherConfig$meta === void 0 ? void 0 : _otherConfig$meta.tableKeys) || [];
9961
- const additionalTableKeys = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.additionalTableKeys) || [];
9968
+ if (otherConfig?.type === 'dataLink') {
9969
+ const siblingTableKeys = otherConfig?.meta?.tableKeys || [];
9970
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
9962
9971
  const allSiblingKeys = [...siblingTableKeys, ...additionalTableKeys];
9963
9972
  return allSiblingKeys.includes(inputKey) && otherInputKey !== inputKey;
9964
9973
  }
@@ -9972,26 +9981,23 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
9972
9981
  return null;
9973
9982
  }
9974
9983
  const tableKeys = inputConfig.meta.tableKeys;
9975
- const additionalTableKeys = ((_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.additionalTableKeys) || [];
9984
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
9976
9985
  const parentInputKeys = Object.keys(config.inputs || {});
9977
9986
  const siblingInputsMatchingTableKeys = parentInputKeys.filter(siblingKey => siblingKey !== inputKey).filter(siblingKey => tableKeys.includes(siblingKey) || additionalTableKeys.includes(siblingKey));
9978
9987
  [...new Set([...tableKeys, ...siblingInputsMatchingTableKeys])];
9979
- const isAjaxModal = React.useMemo(() => {
9980
- var _inputConfig$meta2;
9981
- return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
9982
- }, [inputConfig]);
9988
+ const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
9983
9989
  const ajaxModalValues = useAjaxModal$2({
9984
9990
  name: inputKey,
9985
9991
  user,
9986
- namespace: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta3 = inputConfig.meta) === null || _inputConfig$meta3 === void 0 ? void 0 : _inputConfig$meta3.namespace,
9987
- skipFetch: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta4 = inputConfig.meta) === null || _inputConfig$meta4 === void 0 ? void 0 : _inputConfig$meta4.skipFetch,
9992
+ namespace: inputConfig?.meta?.namespace,
9993
+ skipFetch: inputConfig?.meta?.skipFetch,
9988
9994
  isAjaxModal,
9989
- formScope: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta5 = inputConfig.meta) === null || _inputConfig$meta5 === void 0 ? void 0 : _inputConfig$meta5.formScope,
9995
+ formScope: inputConfig?.meta?.formScope,
9990
9996
  APP: app,
9991
9997
  apiBaseUrl: getApiBaseUrl(),
9992
9998
  _getAppHeader: getAppHeader
9993
9999
  });
9994
- const dataLinkForm = ajaxModalValues === null || ajaxModalValues === void 0 ? void 0 : ajaxModalValues.form;
10000
+ const dataLinkForm = ajaxModalValues?.form;
9995
10001
  const createInputsAndValues = item => {
9996
10002
  const inputs = {};
9997
10003
  const values = {};
@@ -10003,12 +10009,12 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10003
10009
  'videos': 'Video'
10004
10010
  };
10005
10011
  tableKeys.filter(tableKey => tableKey !== 'datastakeId').forEach(tableKey => {
10006
- var _dataLinkForm$identif;
10007
- 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]);
10012
+ const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
10008
10013
  if (formInputConfig) {
10009
- inputs[tableKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10014
+ inputs[tableKey] = {
10015
+ ...formInputConfig,
10010
10016
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
10011
- });
10017
+ };
10012
10018
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10013
10019
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10014
10020
  let resolvedLabel = null;
@@ -10016,7 +10022,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10016
10022
  const parts = labelKey.split(' is ');
10017
10023
  if (parts.length === 2) {
10018
10024
  const [conditionKey, conditionValue] = parts;
10019
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10025
+ if (item?.[conditionKey] === conditionValue) {
10020
10026
  resolvedLabel = formInputConfig.label[labelKey];
10021
10027
  break;
10022
10028
  }
@@ -10024,37 +10030,37 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10024
10030
  }
10025
10031
  inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
10026
10032
  }
10027
- values[tableKey] = item === null || item === void 0 ? void 0 : item[tableKey];
10033
+ values[tableKey] = item?.[tableKey];
10028
10034
  } else {
10029
- var _item$linking;
10030
10035
  inputs[tableKey] = {
10031
10036
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
10032
- type: inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type
10037
+ type: inputConfig?.type
10033
10038
  };
10034
- 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]);
10039
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
10035
10040
  }
10036
10041
  });
10037
10042
  siblingInputsMatchingTableKeys.forEach(siblingKey => {
10038
10043
  const siblingConfig = config.inputs[siblingKey];
10039
10044
  if (siblingConfig) {
10040
- inputs[siblingKey] = _objectSpread2(_objectSpread2({}, siblingConfig), {}, {
10045
+ inputs[siblingKey] = {
10046
+ ...siblingConfig,
10041
10047
  label: siblingConfig.label || siblingKey
10042
- });
10043
- values[siblingKey] = item === null || item === void 0 ? void 0 : item[siblingKey];
10048
+ };
10049
+ values[siblingKey] = item?.[siblingKey];
10044
10050
  }
10045
10051
  });
10046
- if (dataLinkForm !== null && dataLinkForm !== void 0 && dataLinkForm.identification && typeof dataLinkForm.identification === 'object') {
10052
+ if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
10047
10053
  Object.keys(dataLinkForm.identification).filter(fieldKey => fieldKey !== 'datastakeId' && !tableKeys.includes(fieldKey)).filter(fieldKey => {
10048
10054
  const formInputConfig = dataLinkForm.identification[fieldKey];
10049
10055
  return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
10050
10056
  }).forEach(fieldKey => {
10051
- var _item$linking2;
10052
10057
  const formInputConfig = dataLinkForm.identification[fieldKey];
10053
- inputs[fieldKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10058
+ inputs[fieldKey] = {
10059
+ ...formInputConfig,
10054
10060
  label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
10055
- });
10056
- if (formInputConfig !== null && formInputConfig !== void 0 && formInputConfig.label && typeof (formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label) === 'object') {
10057
- const dynamicLabelKeys = Object.keys(formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label);
10061
+ };
10062
+ if (formInputConfig?.label && typeof formInputConfig?.label === 'object') {
10063
+ const dynamicLabelKeys = Object.keys(formInputConfig?.label);
10058
10064
  let resolvedLabel = null;
10059
10065
  for (const labelKey of dynamicLabelKeys) {
10060
10066
  const parts = labelKey.split(' is ');
@@ -10063,7 +10069,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10063
10069
  const flattenedItem = Object.assign({}, item.location, {
10064
10070
  address: item.address
10065
10071
  });
10066
- if ((flattenedItem === null || flattenedItem === void 0 ? void 0 : flattenedItem[conditionKey]) === conditionValue) {
10072
+ if (flattenedItem?.[conditionKey] === conditionValue) {
10067
10073
  resolvedLabel = formInputConfig.label[labelKey];
10068
10074
  break;
10069
10075
  }
@@ -10071,7 +10077,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10071
10077
  }
10072
10078
  inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
10073
10079
  }
10074
- 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]);
10080
+ values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[fieldKey];
10075
10081
  });
10076
10082
  }
10077
10083
  return {
@@ -10081,17 +10087,16 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10081
10087
  };
10082
10088
  if (Array.isArray(value)) {
10083
10089
  return value.map((item, itemIndex) => {
10084
- var _merged$inputKey;
10085
10090
  const merged = mergeObject(item);
10086
- 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);
10091
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10087
10092
  const {
10088
10093
  inputs,
10089
10094
  values
10090
10095
  } = createInputsAndValues(merged);
10091
10096
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10092
- nodeKey: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10097
+ nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10093
10098
  config: {
10094
- label: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10099
+ label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10095
10100
  type: 'custom-datalink-group',
10096
10101
  inputs: inputs
10097
10102
  },
@@ -10105,12 +10110,11 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10105
10110
  getApiBaseUrl: getApiBaseUrl,
10106
10111
  getAppHeader: getAppHeader,
10107
10112
  app: app
10108
- }, "".concat(inputKey, "-").concat(itemIndex));
10113
+ }, `${inputKey}-${itemIndex}`);
10109
10114
  });
10110
10115
  } else {
10111
- var _merged$inputKey2;
10112
10116
  const merged = mergeObject(value);
10113
- 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);
10117
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10114
10118
  const {
10115
10119
  inputs,
10116
10120
  values
@@ -10132,7 +10136,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10132
10136
  getApiBaseUrl: getApiBaseUrl,
10133
10137
  getAppHeader: getAppHeader,
10134
10138
  app: app
10135
- }, "".concat(inputKey, "-group"));
10139
+ }, `${inputKey}-group`);
10136
10140
  }
10137
10141
  };
10138
10142
 
@@ -10490,11 +10494,12 @@ const AjaxSubGroup$2 = ({
10490
10494
  };
10491
10495
 
10492
10496
  const handleAjaxSubGroupChildren = props => {
10493
- var _props$config;
10494
- if (((_props$config = props.config) === null || _props$config === void 0 ? void 0 : _props$config.type) !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
10497
+ if (props.config?.type !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
10495
10498
  return null;
10496
10499
  }
10497
- return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2, _objectSpread2({}, props), "ajax-subgroup")];
10500
+ return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2, {
10501
+ ...props
10502
+ }, "ajax-subgroup")];
10498
10503
  };
10499
10504
 
10500
10505
  const TreeNode = _ref => {
@@ -44105,10 +44110,6 @@ const useFilters = ({
44105
44110
  }, [pagination]);
44106
44111
  const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
44107
44112
  const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
44108
- console.log({
44109
- totalPages,
44110
- pagination
44111
- });
44112
44113
  const goPrev = () => {
44113
44114
  if (!canGoPrev) {
44114
44115
  return;
@@ -49148,6 +49149,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
49148
49149
  withDuration = true,
49149
49150
  onFilterChange,
49150
49151
  isPdf,
49152
+ zoomOutTransition = false,
49151
49153
  ...props
49152
49154
  }, ref) {
49153
49155
  const {
@@ -49203,8 +49205,11 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
49203
49205
  fitView: true // zoom out on default
49204
49206
  ,
49205
49207
  fitViewOptions: {
49206
- padding: 0.2 //zoom out on default
49207
- // duration: withDuration ? 300 : undefined,
49208
+ padding: 0.2,
49209
+ //zoom out on default
49210
+ ...(zoomOutTransition ? {
49211
+ duration: withDuration ? 300 : undefined
49212
+ } : {})
49208
49213
  },
49209
49214
  ...props,
49210
49215
  children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
@@ -49801,7 +49806,8 @@ function StakeholderMappings(_ref3) {
49801
49806
  iconOffsetY = 250,
49802
49807
  t = s => s,
49803
49808
  emptyString = undefined,
49804
- isPdf = false
49809
+ isPdf = false,
49810
+ zoomOutTransition = false
49805
49811
  } = _ref3;
49806
49812
  const reactFlowWrapper = React.useRef(null);
49807
49813
  const [nodes, setNodes] = react.useNodesState([]);
@@ -50066,6 +50072,7 @@ function StakeholderMappings(_ref3) {
50066
50072
  });
50067
50073
  }, [reactFlowWrapper.current, JSON.stringify(data), JSON.stringify(selectedIconNodes), isAllOpenDefault, isSelectable, isChanged, emptyString]);
50068
50074
  return /*#__PURE__*/jsxRuntime.jsx(BaseGraph, {
50075
+ zoomOutTransition: zoomOutTransition,
50069
50076
  nodes: nodes,
50070
50077
  mandatoryNodesToFit: mandatoryNodesToFit,
50071
50078
  edges: edges,
@@ -419,10 +419,6 @@ const useFilters = ({
419
419
  }, [pagination]);
420
420
  const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
421
421
  const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
422
- console.log({
423
- totalPages,
424
- pagination
425
- });
426
422
  const goPrev = () => {
427
423
  if (!canGoPrev) {
428
424
  return;
@@ -6966,7 +6966,7 @@ const getRowConfig$1 = ({
6966
6966
  children: t("Identified Mine Sites")
6967
6967
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
6968
6968
  className: "cursor-pointer",
6969
- onClick: () => goTo(getRedirectLink("/app/scl")),
6969
+ onClick: () => goTo(getRedirectLink("/app/production-sites")),
6970
6970
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
6971
6971
  name: "LinkNewTab",
6972
6972
  width: 16,
@@ -11637,6 +11637,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
11637
11637
  withDuration = true,
11638
11638
  onFilterChange,
11639
11639
  isPdf,
11640
+ zoomOutTransition = false,
11640
11641
  ...props
11641
11642
  }, ref) {
11642
11643
  const {
@@ -11692,8 +11693,11 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
11692
11693
  fitView: true // zoom out on default
11693
11694
  ,
11694
11695
  fitViewOptions: {
11695
- padding: 0.2 //zoom out on default
11696
- // duration: withDuration ? 300 : undefined,
11696
+ padding: 0.2,
11697
+ //zoom out on default
11698
+ ...(zoomOutTransition ? {
11699
+ duration: withDuration ? 300 : undefined
11700
+ } : {})
11697
11701
  },
11698
11702
  ...props,
11699
11703
  children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
@@ -14607,6 +14611,7 @@ function DataCompilation({
14607
14611
  title: t("Data Compilation"),
14608
14612
  className: "with-border-header",
14609
14613
  expandable: true,
14614
+ defaultExpanded: true,
14610
14615
  addedHeaderFirst: true,
14611
14616
  addedHeader: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
14612
14617
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -14658,7 +14663,6 @@ function DataConsilidation({
14658
14663
  title: t("Data Consolidation"),
14659
14664
  className: "with-border-header",
14660
14665
  expandable: true,
14661
- defaultExpanded: true,
14662
14666
  addedHeaderFirst: true,
14663
14667
  addedHeader: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
14664
14668
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -15521,10 +15525,6 @@ const useFilters = ({
15521
15525
  }, [pagination]);
15522
15526
  const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
15523
15527
  const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
15524
- console.log({
15525
- totalPages,
15526
- pagination
15527
- });
15528
15528
  const goPrev = () => {
15529
15529
  if (!canGoPrev) {
15530
15530
  return;
@@ -31827,9 +31827,6 @@ const getFilterOptions$6 = (options, t) => {
31827
31827
  countries = [],
31828
31828
  category = []
31829
31829
  } = options || {};
31830
- console.log({
31831
- options
31832
- });
31833
31830
  const _default = {
31834
31831
  timeframe: timeframe,
31835
31832
  country: countries,
@@ -34467,6 +34464,42 @@ const IncidentsTable = ({
34467
34464
  });
34468
34465
  };
34469
34466
 
34467
+ const MoreOptions = ({
34468
+ data,
34469
+ limit = 2,
34470
+ toolTipPlacement = 'top'
34471
+ }) => {
34472
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
34473
+ style: {
34474
+ overflow: 'hidden',
34475
+ textOverflow: 'ellipsis',
34476
+ whiteSpace: 'nowrap',
34477
+ display: 'inline-block'
34478
+ },
34479
+ placement: toolTipPlacement,
34480
+ title: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
34481
+ children: [data?.slice(0, 10).map((value, index) => /*#__PURE__*/jsxRuntime.jsxs("span", {
34482
+ children: [typeof value === 'string' ? value : value?.name, /*#__PURE__*/jsxRuntime.jsx("br", {})]
34483
+ }, index)), data?.length > 10 && /*#__PURE__*/jsxRuntime.jsxs("span", {
34484
+ children: ["+", data?.length - 10]
34485
+ })]
34486
+ }),
34487
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
34488
+ style: {
34489
+ overflow: 'hidden',
34490
+ textOverflow: 'ellipsis',
34491
+ whiteSpace: 'nowrap',
34492
+ maxWidth: '95%'
34493
+ },
34494
+ children: data?.length > limit ? `${data.slice(0, limit).map(value => typeof value === 'string' ? value : value?.name).join(', ')}, +${data?.length - limit}` : data.map(value => typeof value === 'string' ? value : value?.name).join(', ')
34495
+ })
34496
+ });
34497
+ };
34498
+ MoreOptions.propTypes = {
34499
+ data: PropTypes__default["default"].array.isRequired,
34500
+ limit: PropTypes__default["default"].number
34501
+ };
34502
+
34470
34503
  const getColumns$1 = ({
34471
34504
  t,
34472
34505
  goTo,
@@ -34572,10 +34605,10 @@ const getColumns$1 = ({
34572
34605
  className: "daf-default-cell"
34573
34606
  });
34574
34607
  }
34575
- const operator = getLinkValue(all?.operator, all?.linking?.SCL);
34576
- return operator ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
34577
- title: operator,
34578
- children: operator
34608
+ const operators = all?.operatorOfLocation?.map(operator => operator?.clientLocation?.name);
34609
+ return operators && operators.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(MoreOptions, {
34610
+ data: operators || [],
34611
+ tooltipPlacement: "topLeft"
34579
34612
  }) : '-';
34580
34613
  }
34581
34614
  }, {
@@ -34859,9 +34892,6 @@ const getFilterOptions$1 = (options, t) => {
34859
34892
  administrativeLevel1,
34860
34893
  administrativeLevel2
34861
34894
  } = options || {};
34862
- console.log({
34863
- options
34864
- });
34865
34895
  const _default = {
34866
34896
  category: stakeholderCategoryOptions || categoryOptions,
34867
34897
  country: countries,
@@ -35409,9 +35439,6 @@ const getFilterOptions = (options, t) => {
35409
35439
  timeframeOptions = [],
35410
35440
  userRoleOptions = []
35411
35441
  } = options || {};
35412
- console.log({
35413
- options
35414
- });
35415
35442
  const _default = {
35416
35443
  timeframe: timeframeOptions,
35417
35444
  email: emailOptions,
@@ -37224,7 +37251,8 @@ function StakeholderMappings({
37224
37251
  iconOffsetY = 250,
37225
37252
  t = s => s,
37226
37253
  emptyString = undefined,
37227
- isPdf = false
37254
+ isPdf = false,
37255
+ zoomOutTransition = false
37228
37256
  }) {
37229
37257
  const reactFlowWrapper = React.useRef(null);
37230
37258
  const [nodes, setNodes] = react.useNodesState([]);
@@ -37485,6 +37513,7 @@ function StakeholderMappings({
37485
37513
  });
37486
37514
  }, [reactFlowWrapper.current, JSON.stringify(data), JSON.stringify(selectedIconNodes), isAllOpenDefault, isSelectable, isChanged, emptyString]);
37487
37515
  return /*#__PURE__*/jsxRuntime.jsx(BaseGraph, {
37516
+ zoomOutTransition: zoomOutTransition,
37488
37517
  nodes: nodes,
37489
37518
  mandatoryNodesToFit: mandatoryNodesToFit,
37490
37519
  edges: edges,
@@ -37755,11 +37784,6 @@ styled__default["default"].div`
37755
37784
  pagination: PropTypes__default["default"].any
37756
37785
  });
37757
37786
 
37758
- ({
37759
- data: PropTypes__default["default"].array.isRequired,
37760
- limit: PropTypes__default["default"].number
37761
- });
37762
-
37763
37787
  ({
37764
37788
  content: PropTypes__default["default"].string,
37765
37789
  size: PropTypes__default["default"].oneOf(['large', 'middle', 'small']),
@@ -14257,12 +14257,6 @@ const renderBreadCrumbs = ({
14257
14257
  return Boolean(cond); // Boolean condition
14258
14258
  };
14259
14259
  const config = breadCrumbConfig[view];
14260
- console.log({
14261
- config,
14262
- breadCrumbConfig,
14263
- breadCrumbsLabels,
14264
- condition
14265
- });
14266
14260
  if (config) {
14267
14261
  const conditionContext = {
14268
14262
  isDataStore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.762",
3
+ "version": "0.6.763",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -163,6 +163,7 @@ function StakeholderMappings({
163
163
  t = (s) => s,
164
164
  emptyString = undefined,
165
165
  isPdf = false,
166
+ zoomOutTransition = false,
166
167
  }) {
167
168
  const reactFlowWrapper = useRef(null);
168
169
  const [nodes, setNodes] = useNodesState([]);
@@ -472,6 +473,7 @@ function StakeholderMappings({
472
473
 
473
474
  return (
474
475
  <BaseGraph
476
+ zoomOutTransition={zoomOutTransition}
475
477
  nodes={nodes}
476
478
  mandatoryNodesToFit={mandatoryNodesToFit}
477
479
  edges={edges}
@@ -33,6 +33,7 @@ const BaseGraph = forwardRef(function BaseGraph(
33
33
  withDuration = true,
34
34
  onFilterChange,
35
35
  isPdf,
36
+ zoomOutTransition = false,
36
37
  ...props
37
38
  },
38
39
  ref,
@@ -86,7 +87,7 @@ const BaseGraph = forwardRef(function BaseGraph(
86
87
  fitView={true} // zoom out on default
87
88
  fitViewOptions={{
88
89
  padding: 0.2, //zoom out on default
89
- // duration: withDuration ? 300 : undefined,
90
+ ...(zoomOutTransition ? { duration: withDuration ? 300 : undefined } : {}),
90
91
  }}
91
92
  {...props}
92
93
  >
@@ -54,7 +54,6 @@ export const getFilterOptions = (options, t) => {
54
54
  timeframeOptions = [],
55
55
  userRoleOptions = [],
56
56
  } = options || {};
57
- console.log({options})
58
57
 
59
58
  const _default = {
60
59
  timeframe: timeframeOptions,
@@ -234,8 +234,6 @@ export const useFilters = ({
234
234
  const canGoPrev = useMemo(() => pagination.current !== 1, [pagination]);
235
235
  const canGoNext = useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
236
236
 
237
- console.log({totalPages, pagination})
238
-
239
237
  const goPrev = () => {
240
238
  if (!canGoPrev) {
241
239
  return;
@@ -6,7 +6,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
6
6
  label: (
7
7
  <div className="flex">
8
8
  <div className="flex-1">{t("Identified Mine Sites")}</div>
9
- <div className="cursor-pointer" onClick={() => goTo(getRedirectLink("/app/scl"))}>
9
+ <div className="cursor-pointer" onClick={() => goTo(getRedirectLink("/app/production-sites"))}>
10
10
  <CustomIcon
11
11
  name="LinkNewTab"
12
12
  width={16}
@@ -16,6 +16,7 @@ function DataCompilation({
16
16
  title={t("Data Compilation")}
17
17
  className="with-border-header"
18
18
  expandable
19
+ defaultExpanded
19
20
  addedHeaderFirst
20
21
  addedHeader={
21
22
  <>
@@ -16,7 +16,6 @@ function DataConsilidation({
16
16
  title={t("Data Consolidation")}
17
17
  className="with-border-header"
18
18
  expandable
19
- defaultExpanded
20
19
  addedHeaderFirst
21
20
  addedHeader={
22
21
  <>
@@ -151,7 +151,6 @@ export const getFilterOptions = (options, t) => {
151
151
 
152
152
  category=[],
153
153
  } = options || {};
154
- console.log({options})
155
154
 
156
155
  const _default = {
157
156
  timeframe: timeframe,
@@ -6,6 +6,7 @@ import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
6
6
  import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
7
7
  import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
8
8
  import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
+ import MoreOptions from '../../../core/components/Table/MoreOptions/index.jsx';
9
10
 
10
11
  export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
11
12
  {
@@ -88,9 +89,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
88
89
  return <div className="daf-default-cell" />
89
90
  }
90
91
 
91
- const operator = getLinkValue(all?.operator, all?.linking?.SCL);
92
-
93
- return operator ? <Tooltip title={operator}>{operator}</Tooltip> : '-';
92
+ const operators = all?.operatorOfLocation?.map((operator) => operator?.clientLocation?.name);
93
+ return (operators && operators.length > 0) ? <MoreOptions data={operators || []} tooltipPlacement="topLeft" /> : '-';
94
94
  },
95
95
  },
96
96
  {
@@ -140,7 +140,6 @@ export const getFilterOptions = (options, t) => {
140
140
  administrativeLevel1,
141
141
  administrativeLevel2,
142
142
  } = options || {};
143
- console.log({options})
144
143
 
145
144
  const _default = {
146
145
  category: stakeholderCategoryOptions || categoryOptions,
@@ -95,8 +95,6 @@ export const renderBreadCrumbs = ({
95
95
 
96
96
  const config = breadCrumbConfig[view];
97
97
 
98
- console.log({config, breadCrumbConfig, breadCrumbsLabels, condition})
99
-
100
98
  if (config) {
101
99
  const conditionContext = {
102
100
  isDataStore,