datastake-daf 0.6.789 → 0.6.791

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.
@@ -9558,24 +9558,29 @@ const processConditionalTableKeys = (tableKeys, item) => {
9558
9558
  });
9559
9559
  return processedKeys;
9560
9560
  };
9561
- const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, allValues, formValues = {}) => {
9561
+ const renderFieldData = function (type, value, user, config) {
9562
+ let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
9563
+ let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
9564
+ let app = arguments.length > 6 ? arguments[6] : undefined;
9565
+ let allValues = arguments.length > 7 ? arguments[7] : undefined;
9566
+ let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
9562
9567
  switch (type) {
9563
9568
  case 'year':
9564
9569
  return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
9565
9570
  case 'date':
9566
9571
  {
9567
- const language = user?.language && user?.language === 'sp' ? 'es' : user?.language;
9572
+ 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;
9568
9573
  return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
9569
9574
  }
9570
9575
  case 'select':
9571
9576
  {
9572
- const options = config?.options || [];
9577
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9573
9578
  const option = findOptions(value, options);
9574
9579
  return option;
9575
9580
  }
9576
9581
  case 'multiselect':
9577
9582
  {
9578
- const options = config?.options || [];
9583
+ const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9579
9584
  const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
9580
9585
  const option = findOptions(_val, options);
9581
9586
  return option.join(', ');
@@ -9590,7 +9595,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9590
9595
  formValues: formValues
9591
9596
  });
9592
9597
  case 'percentage':
9593
- return value === '-' || value === null || value === undefined ? '-' : `${value} %`;
9598
+ return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
9594
9599
  case 'geolocation':
9595
9600
  {
9596
9601
  const val = JSON.parse(value) || {};
@@ -9604,7 +9609,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9604
9609
  case 'upload':
9605
9610
  case 'videoUpload':
9606
9611
  {
9607
- const documentName = allValues?.map(item => item?.name).join(', ');
9612
+ const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
9608
9613
  return documentName;
9609
9614
  }
9610
9615
  default:
@@ -9732,18 +9737,19 @@ const resolveDynamicLabel = (labelConfig, item, defaultLabel) => {
9732
9737
  return labelConfig || defaultLabel;
9733
9738
  };
9734
9739
 
9735
- const handleSectionChildren = ({
9736
- config,
9737
- allData,
9738
- level,
9739
- t,
9740
- rootForm,
9741
- user,
9742
- getApiBaseUrl = () => {},
9743
- getAppHeader = () => {},
9744
- app,
9745
- TreeNodeComponent
9746
- }) => {
9740
+ const handleSectionChildren = _ref => {
9741
+ let {
9742
+ config,
9743
+ allData,
9744
+ level,
9745
+ t,
9746
+ rootForm,
9747
+ user,
9748
+ getApiBaseUrl = () => {},
9749
+ getAppHeader = () => {},
9750
+ app,
9751
+ TreeNodeComponent
9752
+ } = _ref;
9747
9753
  if (!(level === 0 && config && typeof config === 'object')) {
9748
9754
  return null;
9749
9755
  }
@@ -9757,14 +9763,14 @@ const handleSectionChildren = ({
9757
9763
  let fieldValue;
9758
9764
 
9759
9765
  // Determine field value based on type
9760
- if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData?.[fieldKey])) {
9766
+ if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData === null || allData === void 0 ? void 0 : allData[fieldKey])) {
9761
9767
  fieldValue = allData[fieldKey];
9762
- } else if (fieldConfig.type === 'dataLinkGroup' && allData?.[fieldKey]) {
9768
+ } else if (fieldConfig.type === 'dataLinkGroup' && allData !== null && allData !== void 0 && allData[fieldKey]) {
9763
9769
  fieldValue = allData[fieldKey];
9764
9770
  } else if (fieldConfig.type === 'group') {
9765
9771
  fieldValue = {};
9766
9772
  } else {
9767
- fieldValue = allData?.[fieldKey];
9773
+ fieldValue = allData === null || allData === void 0 ? void 0 : allData[fieldKey];
9768
9774
  }
9769
9775
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
9770
9776
  nodeKey: fieldKey,
@@ -9969,44 +9975,44 @@ function useAjaxModal$2({
9969
9975
  }
9970
9976
 
9971
9977
  const mergeObject = obj => {
9972
- return Object.entries(obj || {}).reduce((acc, _ref) => {
9973
- let [key, value] = _ref;
9978
+ return Object.entries(obj || {}).reduce((acc, [key, value]) => {
9974
9979
  if (typeof value === "object" && !Array.isArray(value) && value !== null) {
9975
- return _objectSpread2(_objectSpread2({}, acc), value);
9980
+ return {
9981
+ ...acc,
9982
+ ...value
9983
+ };
9976
9984
  }
9977
- return _objectSpread2(_objectSpread2({}, acc), {}, {
9985
+ return {
9986
+ ...acc,
9978
9987
  [key]: value
9979
- });
9988
+ };
9980
9989
  }, {});
9981
9990
  };
9982
- const handleDataLinkGroupWithTableKeys = _ref2 => {
9983
- var _inputConfig$meta, _config$meta2, _inputConfig$meta3, _inputConfig$meta4, _inputConfig$meta5;
9984
- let {
9985
- config,
9986
- inputConfig,
9987
- inputKey,
9988
- value,
9989
- level,
9990
- t,
9991
- rootForm,
9992
- allData,
9993
- user,
9994
- getApiBaseUrl = () => {},
9995
- getAppHeader = () => {},
9996
- app,
9997
- TreeNodeComponent
9998
- } = _ref2;
9991
+ const handleDataLinkGroupWithTableKeys = ({
9992
+ config,
9993
+ inputConfig,
9994
+ inputKey,
9995
+ value,
9996
+ level,
9997
+ t,
9998
+ rootForm,
9999
+ allData,
10000
+ user,
10001
+ getApiBaseUrl = () => {},
10002
+ getAppHeader = () => {},
10003
+ app,
10004
+ TreeNodeComponent
10005
+ }) => {
9999
10006
  if (!(config.type === 'dataLinkGroup' || config.type === 'dataLink')) {
10000
10007
  return null;
10001
10008
  }
10002
- 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)) {
10009
+ if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
10003
10010
  const parentInputKeys = Object.keys(config.inputs || {});
10004
10011
  const isHandledBySiblingDataLink = parentInputKeys.some(otherInputKey => {
10005
10012
  const otherConfig = config.inputs[otherInputKey];
10006
- if ((otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.type) === 'dataLink') {
10007
- var _otherConfig$meta, _config$meta;
10008
- const siblingTableKeys = (otherConfig === null || otherConfig === void 0 || (_otherConfig$meta = otherConfig.meta) === null || _otherConfig$meta === void 0 ? void 0 : _otherConfig$meta.tableKeys) || [];
10009
- const additionalTableKeys = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.additionalTableKeys) || [];
10013
+ if (otherConfig?.type === 'dataLink') {
10014
+ const siblingTableKeys = otherConfig?.meta?.tableKeys || [];
10015
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
10010
10016
  const allSiblingKeys = [...siblingTableKeys, ...additionalTableKeys];
10011
10017
  return allSiblingKeys.includes(inputKey) && otherInputKey !== inputKey;
10012
10018
  }
@@ -10020,26 +10026,23 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10020
10026
  return null;
10021
10027
  }
10022
10028
  const tableKeys = inputConfig.meta.tableKeys;
10023
- const additionalTableKeys = ((_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.additionalTableKeys) || [];
10029
+ const additionalTableKeys = config.meta?.additionalTableKeys || [];
10024
10030
  const parentInputKeys = Object.keys(config.inputs || {});
10025
10031
  const siblingInputsMatchingTableKeys = parentInputKeys.filter(siblingKey => siblingKey !== inputKey).filter(siblingKey => tableKeys.includes(siblingKey) || additionalTableKeys.includes(siblingKey));
10026
10032
  [...new Set([...tableKeys, ...siblingInputsMatchingTableKeys])];
10027
- const isAjaxModal = React.useMemo(() => {
10028
- var _inputConfig$meta2;
10029
- return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
10030
- }, [inputConfig]);
10033
+ const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
10031
10034
  const ajaxModalValues = useAjaxModal$2({
10032
10035
  name: inputKey,
10033
10036
  user,
10034
- namespace: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta3 = inputConfig.meta) === null || _inputConfig$meta3 === void 0 ? void 0 : _inputConfig$meta3.namespace,
10035
- skipFetch: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta4 = inputConfig.meta) === null || _inputConfig$meta4 === void 0 ? void 0 : _inputConfig$meta4.skipFetch,
10037
+ namespace: inputConfig?.meta?.namespace,
10038
+ skipFetch: inputConfig?.meta?.skipFetch,
10036
10039
  isAjaxModal,
10037
- formScope: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta5 = inputConfig.meta) === null || _inputConfig$meta5 === void 0 ? void 0 : _inputConfig$meta5.formScope,
10040
+ formScope: inputConfig?.meta?.formScope,
10038
10041
  APP: app,
10039
10042
  apiBaseUrl: getApiBaseUrl(),
10040
10043
  _getAppHeader: getAppHeader
10041
10044
  });
10042
- const dataLinkForm = ajaxModalValues === null || ajaxModalValues === void 0 ? void 0 : ajaxModalValues.form;
10045
+ const dataLinkForm = ajaxModalValues?.form;
10043
10046
  const createInputsAndValues = item => {
10044
10047
  const inputs = {};
10045
10048
  const values = {};
@@ -10051,12 +10054,12 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10051
10054
  'videos': 'Video'
10052
10055
  };
10053
10056
  tableKeys.filter(tableKey => tableKey !== 'datastakeId').forEach(tableKey => {
10054
- var _dataLinkForm$identif;
10055
- 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]);
10057
+ const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
10056
10058
  if (formInputConfig) {
10057
- inputs[tableKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10059
+ inputs[tableKey] = {
10060
+ ...formInputConfig,
10058
10061
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
10059
- });
10062
+ };
10060
10063
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10061
10064
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10062
10065
  let resolvedLabel = null;
@@ -10064,7 +10067,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10064
10067
  const parts = labelKey.split(' is ');
10065
10068
  if (parts.length === 2) {
10066
10069
  const [conditionKey, conditionValue] = parts;
10067
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10070
+ if (item?.[conditionKey] === conditionValue) {
10068
10071
  resolvedLabel = formInputConfig.label[labelKey];
10069
10072
  break;
10070
10073
  }
@@ -10072,37 +10075,37 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10072
10075
  }
10073
10076
  inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
10074
10077
  }
10075
- values[tableKey] = item === null || item === void 0 ? void 0 : item[tableKey];
10078
+ values[tableKey] = item?.[tableKey];
10076
10079
  } else {
10077
- var _item$linking;
10078
10080
  inputs[tableKey] = {
10079
10081
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
10080
- type: inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type
10082
+ type: inputConfig?.type
10081
10083
  };
10082
- 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]);
10084
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
10083
10085
  }
10084
10086
  });
10085
10087
  siblingInputsMatchingTableKeys.forEach(siblingKey => {
10086
10088
  const siblingConfig = config.inputs[siblingKey];
10087
10089
  if (siblingConfig) {
10088
- inputs[siblingKey] = _objectSpread2(_objectSpread2({}, siblingConfig), {}, {
10090
+ inputs[siblingKey] = {
10091
+ ...siblingConfig,
10089
10092
  label: siblingConfig.label || siblingKey
10090
- });
10091
- values[siblingKey] = item === null || item === void 0 ? void 0 : item[siblingKey];
10093
+ };
10094
+ values[siblingKey] = item?.[siblingKey];
10092
10095
  }
10093
10096
  });
10094
- if (dataLinkForm !== null && dataLinkForm !== void 0 && dataLinkForm.identification && typeof dataLinkForm.identification === 'object') {
10097
+ if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
10095
10098
  Object.keys(dataLinkForm.identification).filter(fieldKey => fieldKey !== 'datastakeId' && !tableKeys.includes(fieldKey)).filter(fieldKey => {
10096
10099
  const formInputConfig = dataLinkForm.identification[fieldKey];
10097
10100
  return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
10098
10101
  }).forEach(fieldKey => {
10099
- var _item$linking2;
10100
10102
  const formInputConfig = dataLinkForm.identification[fieldKey];
10101
- inputs[fieldKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10103
+ inputs[fieldKey] = {
10104
+ ...formInputConfig,
10102
10105
  label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
10103
- });
10104
- if (formInputConfig !== null && formInputConfig !== void 0 && formInputConfig.label && typeof (formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label) === 'object') {
10105
- const dynamicLabelKeys = Object.keys(formInputConfig === null || formInputConfig === void 0 ? void 0 : formInputConfig.label);
10106
+ };
10107
+ if (formInputConfig?.label && typeof formInputConfig?.label === 'object') {
10108
+ const dynamicLabelKeys = Object.keys(formInputConfig?.label);
10106
10109
  let resolvedLabel = null;
10107
10110
  for (const labelKey of dynamicLabelKeys) {
10108
10111
  const parts = labelKey.split(' is ');
@@ -10111,7 +10114,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10111
10114
  const flattenedItem = Object.assign({}, item.location, {
10112
10115
  address: item.address
10113
10116
  });
10114
- if ((flattenedItem === null || flattenedItem === void 0 ? void 0 : flattenedItem[conditionKey]) === conditionValue) {
10117
+ if (flattenedItem?.[conditionKey] === conditionValue) {
10115
10118
  resolvedLabel = formInputConfig.label[labelKey];
10116
10119
  break;
10117
10120
  }
@@ -10119,7 +10122,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10119
10122
  }
10120
10123
  inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
10121
10124
  }
10122
- 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]);
10125
+ values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[fieldKey];
10123
10126
  });
10124
10127
  }
10125
10128
  return {
@@ -10129,17 +10132,16 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10129
10132
  };
10130
10133
  if (Array.isArray(value)) {
10131
10134
  return value.map((item, itemIndex) => {
10132
- var _merged$inputKey;
10133
10135
  const merged = mergeObject(item);
10134
- 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);
10136
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10135
10137
  const {
10136
10138
  inputs,
10137
10139
  values
10138
10140
  } = createInputsAndValues(merged);
10139
10141
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10140
- nodeKey: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10142
+ nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10141
10143
  config: {
10142
- label: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10144
+ label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10143
10145
  type: 'custom-datalink-group',
10144
10146
  inputs: inputs
10145
10147
  },
@@ -10153,12 +10155,11 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10153
10155
  getApiBaseUrl: getApiBaseUrl,
10154
10156
  getAppHeader: getAppHeader,
10155
10157
  app: app
10156
- }, "".concat(inputKey, "-").concat(itemIndex));
10158
+ }, `${inputKey}-${itemIndex}`);
10157
10159
  });
10158
10160
  } else {
10159
- var _merged$inputKey2;
10160
10161
  const merged = mergeObject(value);
10161
- 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);
10162
+ const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
10162
10163
  const {
10163
10164
  inputs,
10164
10165
  values
@@ -10180,7 +10181,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
10180
10181
  getApiBaseUrl: getApiBaseUrl,
10181
10182
  getAppHeader: getAppHeader,
10182
10183
  app: app
10183
- }, "".concat(inputKey, "-group"));
10184
+ }, `${inputKey}-group`);
10184
10185
  }
10185
10186
  };
10186
10187
 
@@ -15480,7 +15480,7 @@ const getColumns$d = ({
15480
15480
  }
15481
15481
  }, {
15482
15482
  dataIndex: 'province',
15483
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
15483
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
15484
15484
  ellipsis: true,
15485
15485
  show: true,
15486
15486
  render: (v, all) => {
@@ -15497,7 +15497,7 @@ const getColumns$d = ({
15497
15497
  }
15498
15498
  }, {
15499
15499
  dataIndex: 'territory',
15500
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
15500
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
15501
15501
  ellipsis: true,
15502
15502
  show: true,
15503
15503
  render: (v, all) => {
@@ -31971,7 +31971,7 @@ const getColumns$9 = ({
31971
31971
  }
31972
31972
  }, {
31973
31973
  dataIndex: 'province',
31974
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
31974
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
31975
31975
  ellipsis: true,
31976
31976
  show: true,
31977
31977
  render: (v, all) => {
@@ -31988,7 +31988,7 @@ const getColumns$9 = ({
31988
31988
  }
31989
31989
  }, {
31990
31990
  dataIndex: 'territory',
31991
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
31991
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
31992
31992
  ellipsis: true,
31993
31993
  show: true,
31994
31994
  render: (v, all) => {
@@ -32406,7 +32406,7 @@ const getColumns$8 = ({
32406
32406
  }
32407
32407
  }, {
32408
32408
  dataIndex: 'province',
32409
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
32409
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
32410
32410
  ellipsis: true,
32411
32411
  show: true,
32412
32412
  render: (v, all) => {
@@ -32423,7 +32423,7 @@ const getColumns$8 = ({
32423
32423
  }
32424
32424
  }, {
32425
32425
  dataIndex: 'territory',
32426
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
32426
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
32427
32427
  ellipsis: true,
32428
32428
  show: true,
32429
32429
  render: (v, all) => {
@@ -32637,7 +32637,8 @@ const getColumns$7 = ({
32637
32637
  className: "daf-default-cell"
32638
32638
  });
32639
32639
  }
32640
- const category = findOptions(v, data?.options?.locationCategories);
32640
+ const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
32641
+ const category = findOptions(v, locationCategories);
32641
32642
  return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
32642
32643
  title: category,
32643
32644
  children: category
@@ -32662,7 +32663,7 @@ const getColumns$7 = ({
32662
32663
  }
32663
32664
  }, {
32664
32665
  dataIndex: 'province',
32665
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
32666
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
32666
32667
  ellipsis: true,
32667
32668
  show: true,
32668
32669
  render: (v, all) => {
@@ -32679,7 +32680,7 @@ const getColumns$7 = ({
32679
32680
  }
32680
32681
  }, {
32681
32682
  dataIndex: 'territory',
32682
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
32683
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
32683
32684
  ellipsis: true,
32684
32685
  show: true,
32685
32686
  render: (v, all) => {
@@ -33039,7 +33040,7 @@ const getColumns$6 = ({
33039
33040
  }
33040
33041
  }, {
33041
33042
  dataIndex: 'region',
33042
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
33043
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
33043
33044
  ellipsis: true,
33044
33045
  show: true,
33045
33046
  render: (v, all) => {
@@ -33056,7 +33057,7 @@ const getColumns$6 = ({
33056
33057
  }
33057
33058
  }, {
33058
33059
  dataIndex: 'territory',
33059
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
33060
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
33060
33061
  ellipsis: true,
33061
33062
  show: true,
33062
33063
  render: (v, all) => {
@@ -33082,7 +33083,8 @@ const getColumns$6 = ({
33082
33083
  className: "daf-default-cell"
33083
33084
  });
33084
33085
  }
33085
- const category = findOptions(v, options?.locationCategories);
33086
+ const locationCategories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
33087
+ const category = findOptions(v, locationCategories);
33086
33088
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
33087
33089
  title: category,
33088
33090
  children: category
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.789",
3
+ "version": "0.6.791",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -72,7 +72,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
72
72
  },
73
73
  {
74
74
  dataIndex: 'province',
75
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
75
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
76
76
  ellipsis: true,
77
77
  show: true,
78
78
  render: (v, all) => {
@@ -87,7 +87,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
87
87
  },
88
88
  {
89
89
  dataIndex: 'territory',
90
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
90
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
91
91
  ellipsis: true,
92
92
  show: true,
93
93
  render: (v, all) => {
@@ -72,7 +72,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
72
72
  },
73
73
  {
74
74
  dataIndex: 'province',
75
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
75
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
76
76
  ellipsis: true,
77
77
  show: true,
78
78
  render: (v, all) => {
@@ -87,7 +87,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
87
87
  },
88
88
  {
89
89
  dataIndex: 'territory',
90
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
90
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
91
91
  ellipsis: true,
92
92
  show: true,
93
93
  render: (v, all) => {
@@ -42,7 +42,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
42
42
  },
43
43
  {
44
44
  dataIndex: 'region',
45
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
45
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
46
46
  ellipsis: true,
47
47
  show: true,
48
48
  render: (v, all) => {
@@ -57,7 +57,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
57
57
  },
58
58
  {
59
59
  dataIndex: 'territory',
60
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
60
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
61
61
  ellipsis: true,
62
62
  show: true,
63
63
  render: (v, all) => {
@@ -79,7 +79,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
79
79
  if (all.empty) {
80
80
  return <div className="daf-default-cell" />
81
81
  }
82
- const category = findOptions(v, options?.locationCategories);
82
+ const locationCategories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || [])]
83
+ const category = findOptions(v, locationCategories);
83
84
 
84
85
  return <Tooltip title={category}>{category}</Tooltip>;
85
86
  },
@@ -43,7 +43,9 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
43
43
  return <div className="daf-default-cell" />
44
44
  }
45
45
 
46
- const category = findOptions(v, data?.options?.locationCategories);
46
+ const locationCategories = [...(data?.options?.locationCategories || []), ...(options?.productionSiteCategories || [])]
47
+
48
+ const category = findOptions(v, locationCategories);
47
49
 
48
50
  return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
49
51
  },
@@ -65,7 +67,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
65
67
  },
66
68
  {
67
69
  dataIndex: 'province',
68
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
70
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
69
71
  ellipsis: true,
70
72
  show: true,
71
73
  render: (v, all) => {
@@ -80,7 +82,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
80
82
  },
81
83
  {
82
84
  dataIndex: 'territory',
83
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
85
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
84
86
  ellipsis: true,
85
87
  show: true,
86
88
  render: (v, all) => {
@@ -73,7 +73,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
73
73
  },
74
74
  {
75
75
  dataIndex: 'province',
76
- title: findOptions(user?.company?.country, options?.administrativeLevel1) || t("Province"),
76
+ title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
77
77
  ellipsis: true,
78
78
  show: true,
79
79
  render: (v, all) => {
@@ -88,7 +88,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
88
88
  },
89
89
  {
90
90
  dataIndex: 'territory',
91
- title: findOptions(user?.company?.country, options?.administrativeLevel2) || t("Territory"),
91
+ title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
92
92
  ellipsis: true,
93
93
  show: true,
94
94
  render: (v, all) => {