datastake-daf 0.6.778 → 0.6.779

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.
@@ -8486,20 +8486,22 @@ const useHeader = _ref => {
8486
8486
  const {
8487
8487
  useToken: useToken$m
8488
8488
  } = antd.theme;
8489
- function BreadCrumbs({
8490
- breadcrumbs = [],
8491
- mainContWidth = 0
8492
- }) {
8489
+ function BreadCrumbs(_ref) {
8490
+ let {
8491
+ breadcrumbs = [],
8492
+ mainContWidth = 0
8493
+ } = _ref;
8493
8494
  const [splitIndex, setSplitIndex] = React.useState(0);
8494
8495
  const {
8495
8496
  token
8496
8497
  } = useToken$m();
8497
- const _renderBreadcrumb = (b, i, isLast, noOnClickLast = false) => {
8498
+ const _renderBreadcrumb = function (b, i, isLast) {
8499
+ let noOnClickLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8498
8500
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
8499
8501
  className: "flex breadcrumb-item",
8500
- onClick: noOnClickLast && isLast ? undefined : b?.onClick,
8502
+ onClick: noOnClickLast && isLast ? undefined : b === null || b === void 0 ? void 0 : b.onClick,
8501
8503
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
8502
- children: b?.label
8504
+ children: b === null || b === void 0 ? void 0 : b.label
8503
8505
  }), !isLast && /*#__PURE__*/jsxRuntime.jsx("div", {
8504
8506
  className: "flex flex-column justify-content-center",
8505
8507
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -8509,7 +8511,7 @@ function BreadCrumbs({
8509
8511
  color: token.baseGray50
8510
8512
  })
8511
8513
  })]
8512
- }, `breadcrumb-item-${i}`);
8514
+ }, "breadcrumb-item-".concat(i));
8513
8515
  };
8514
8516
  React.useEffect(() => {
8515
8517
  const _placeholderCont = document.getElementById("header-breadcrumbs");
@@ -8552,7 +8554,7 @@ function BreadCrumbs({
8552
8554
  placement: "bottomRight",
8553
8555
  menu: {
8554
8556
  items: groupedBreadCrumbs[2].map((it, i) => ({
8555
- key: `items-${i}`,
8557
+ key: "items-".concat(i),
8556
8558
  label: it.label,
8557
8559
  onClick: it.onClick
8558
8560
  }))
@@ -9603,27 +9605,25 @@ const renderFieldData = function (type, value, user, config) {
9603
9605
  }
9604
9606
  };
9605
9607
 
9606
- const renderValue = _ref => {
9607
- let {
9608
- value,
9609
- hasChildren,
9610
- config,
9611
- user,
9612
- getApiBaseUrl = () => {},
9613
- getAppHeader = () => {},
9614
- app,
9615
- allData = {}
9616
- } = _ref;
9617
- if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9618
- if (!(config !== null && config !== void 0 && config.inputs)) return null;
9608
+ const renderValue = ({
9609
+ value,
9610
+ hasChildren,
9611
+ config,
9612
+ user,
9613
+ getApiBaseUrl = () => {},
9614
+ getAppHeader = () => {},
9615
+ app,
9616
+ allData = {}
9617
+ }) => {
9618
+ if (config?.type === 'groupInputs') {
9619
+ if (!config?.inputs) return null;
9619
9620
  const inputKeys = Object.keys(config.inputs).sort((a, b) => {
9620
- var _config$inputs$a, _config$inputs$b;
9621
- const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9622
- const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9621
+ const positionA = config.inputs[a]?.position || 0;
9622
+ const positionB = config.inputs[b]?.position || 0;
9623
9623
  return positionA - positionB;
9624
9624
  });
9625
9625
  const values = inputKeys.map(inputKey => {
9626
- let inputValue = value === null || value === void 0 ? void 0 : value[inputKey];
9626
+ let inputValue = value?.[inputKey];
9627
9627
  if (inputValue === null || inputValue === undefined || inputValue === '') {
9628
9628
  return '';
9629
9629
  } else if (typeof inputValue === 'object' && inputValue !== null) {
@@ -9664,8 +9664,8 @@ const renderValue = _ref => {
9664
9664
  } else {
9665
9665
  displayValue = String(value);
9666
9666
  }
9667
- const fieldType = (config === null || config === void 0 ? void 0 : config.type) || 'text';
9668
- let cssClass = "tree-value ".concat(fieldType, "-type");
9667
+ const fieldType = config?.type || 'text';
9668
+ let cssClass = `tree-value ${fieldType}-type`;
9669
9669
  if (displayValue === '-') {
9670
9670
  cssClass += ' empty';
9671
9671
  }
@@ -9675,21 +9675,19 @@ const renderValue = _ref => {
9675
9675
  children: displayValue
9676
9676
  });
9677
9677
  };
9678
- const determineHasChildren = _ref2 => {
9679
- var _config$meta;
9680
- let {
9681
- config,
9682
- level
9683
- } = _ref2;
9684
- if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9678
+ const determineHasChildren = ({
9679
+ config,
9680
+ level
9681
+ }) => {
9682
+ if (config?.type === 'groupInputs') {
9685
9683
  return false;
9686
9684
  }
9687
- if ((config === null || config === void 0 ? void 0 : config.type) === 'header' && config !== null && config !== void 0 && config.inputs && Object.keys(config.inputs).length > 0) {
9685
+ if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
9688
9686
  return true;
9689
9687
  }
9690
- 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' ||
9688
+ return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
9691
9689
  // Add this line
9692
- (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);
9690
+ 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);
9693
9691
  };
9694
9692
 
9695
9693
  const sortByPosition = (items, getConfig) => {
@@ -9774,28 +9772,30 @@ const handleSectionChildren = ({
9774
9772
  });
9775
9773
  };
9776
9774
 
9777
- const handleArrayChildren = ({
9778
- value,
9779
- config,
9780
- label,
9781
- level,
9782
- t,
9783
- rootForm,
9784
- allData,
9785
- user,
9786
- getApiBaseUrl = () => {},
9787
- getAppHeader = () => {},
9788
- app,
9789
- TreeNodeComponent
9790
- }) => {
9775
+ const handleArrayChildren = _ref => {
9776
+ let {
9777
+ value,
9778
+ config,
9779
+ label,
9780
+ level,
9781
+ t,
9782
+ rootForm,
9783
+ allData,
9784
+ user,
9785
+ getApiBaseUrl = () => {},
9786
+ getAppHeader = () => {},
9787
+ app,
9788
+ TreeNodeComponent
9789
+ } = _ref;
9791
9790
  if (!Array.isArray(value)) {
9792
9791
  return null;
9793
9792
  }
9794
9793
  return value.map((item, itemIndex) => /*#__PURE__*/jsxRuntime.jsx("div", {
9795
9794
  className: "array-item",
9796
9795
  children: Object.keys(config.inputs).sort((a, b) => {
9797
- const positionA = config.inputs[a]?.position || 0;
9798
- const positionB = config.inputs[b]?.position || 0;
9796
+ var _config$inputs$a, _config$inputs$b;
9797
+ const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9798
+ const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9799
9799
  return positionA - positionB;
9800
9800
  }).map(subInputKey => {
9801
9801
  const subInputConfig = config.inputs[subInputKey];
@@ -9813,9 +9813,9 @@ const handleArrayChildren = ({
9813
9813
  getApiBaseUrl: getApiBaseUrl,
9814
9814
  getAppHeader: getAppHeader,
9815
9815
  app: app
9816
- }, `${itemIndex}-${subInputKey}`);
9816
+ }, "".concat(itemIndex, "-").concat(subInputKey));
9817
9817
  })
9818
- }, `${itemIndex}`));
9818
+ }, "".concat(itemIndex)));
9819
9819
  };
9820
9820
 
9821
9821
  const noDafApps = ['tif', 'cukura']; //PACKAGE_CHANGE_LATER (remove sbg)
@@ -10170,42 +10170,37 @@ const handleDataLinkGroupWithTableKeys = ({
10170
10170
  }
10171
10171
  };
10172
10172
 
10173
- const handleDataLinkWithTableKeys = _ref => {
10174
- var _inputConfig$meta, _inputConfig$meta3, _inputConfig$meta4, _inputConfig$meta5;
10175
- let {
10176
- inputConfig,
10177
- inputKey,
10178
- value,
10179
- level,
10180
- t,
10181
- rootForm,
10182
- allData,
10183
- user,
10184
- getApiBaseUrl = () => {},
10185
- getAppHeader = () => {},
10186
- app,
10187
- TreeNodeComponent
10188
- } = _ref;
10189
- 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)) {
10173
+ const handleDataLinkWithTableKeys = ({
10174
+ inputConfig,
10175
+ inputKey,
10176
+ value,
10177
+ level,
10178
+ t,
10179
+ rootForm,
10180
+ allData,
10181
+ user,
10182
+ getApiBaseUrl = () => {},
10183
+ getAppHeader = () => {},
10184
+ app,
10185
+ TreeNodeComponent
10186
+ }) => {
10187
+ if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
10190
10188
  return null;
10191
10189
  }
10192
10190
  const tableKeys = inputConfig.meta.tableKeys;
10193
- const isAjaxModal = React.useMemo(() => {
10194
- var _inputConfig$meta2;
10195
- return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
10196
- }, [inputConfig]);
10191
+ const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
10197
10192
  const ajaxModalValues = useAjaxModal$2({
10198
10193
  name: inputKey,
10199
10194
  user,
10200
- namespace: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta3 = inputConfig.meta) === null || _inputConfig$meta3 === void 0 ? void 0 : _inputConfig$meta3.namespace,
10201
- skipFetch: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta4 = inputConfig.meta) === null || _inputConfig$meta4 === void 0 ? void 0 : _inputConfig$meta4.skipFetch,
10195
+ namespace: inputConfig?.meta?.namespace,
10196
+ skipFetch: inputConfig?.meta?.skipFetch,
10202
10197
  isAjaxModal,
10203
- formScope: inputConfig === null || inputConfig === void 0 || (_inputConfig$meta5 = inputConfig.meta) === null || _inputConfig$meta5 === void 0 ? void 0 : _inputConfig$meta5.formScope,
10198
+ formScope: inputConfig?.meta?.formScope,
10204
10199
  APP: app,
10205
10200
  apiBaseUrl: getApiBaseUrl(),
10206
10201
  _getAppHeader: getAppHeader
10207
10202
  });
10208
- const dataLinkForm = ajaxModalValues === null || ajaxModalValues === void 0 ? void 0 : ajaxModalValues.form;
10203
+ const dataLinkForm = ajaxModalValues?.form;
10209
10204
  const createInputsAndValues = item => {
10210
10205
  const inputs = {};
10211
10206
  const values = {};
@@ -10218,20 +10213,19 @@ const handleDataLinkWithTableKeys = _ref => {
10218
10213
  };
10219
10214
  const isUploadFieldEmpty = (fieldKey, itemToCheck) => {
10220
10215
  if (uploadTypeFields.includes(fieldKey)) {
10221
- const itemValue = itemToCheck === null || itemToCheck === void 0 ? void 0 : itemToCheck[fieldKey];
10216
+ const itemValue = itemToCheck?.[fieldKey];
10222
10217
  return itemValue === undefined || itemValue === null || Array.isArray(itemValue) && itemValue.length === 0;
10223
10218
  }
10224
10219
  return false;
10225
10220
  };
10226
10221
  const processedTableKeys = processConditionalTableKeys(tableKeys, item);
10227
10222
  processedTableKeys.filter(tableKey => tableKey !== 'datastakeId').filter(tableKey => !isUploadFieldEmpty(tableKey, item)).forEach(tableKey => {
10228
- var _dataLinkForm$identif;
10229
- 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]);
10223
+ const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
10230
10224
  if (formInputConfig) {
10231
- var _item$linking, _formInputConfig$meta, _formInputConfig$tabl;
10232
- inputs[tableKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10225
+ inputs[tableKey] = {
10226
+ ...formInputConfig,
10233
10227
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
10234
- });
10228
+ };
10235
10229
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10236
10230
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10237
10231
  let resolvedLabel = null;
@@ -10239,7 +10233,7 @@ const handleDataLinkWithTableKeys = _ref => {
10239
10233
  const parts = labelKey.split(' is ');
10240
10234
  if (parts.length === 2) {
10241
10235
  const [conditionKey, conditionValue] = parts;
10242
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10236
+ if (item?.[conditionKey] === conditionValue) {
10243
10237
  resolvedLabel = formInputConfig.label[labelKey];
10244
10238
  break;
10245
10239
  }
@@ -10247,17 +10241,16 @@ const handleDataLinkWithTableKeys = _ref => {
10247
10241
  }
10248
10242
  inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
10249
10243
  }
10250
- 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]);
10244
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item[formInputConfig?.meta?.onNewSetValueKey] || item?.[formInputConfig?.tableLabel?.toLowerCase()] || item?.[tableKey];
10251
10245
  } else {
10252
- var _item$linking2;
10253
10246
  inputs[tableKey] = {
10254
10247
  label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
10255
- type: inputConfig === null || inputConfig === void 0 ? void 0 : inputConfig.type
10248
+ type: inputConfig?.type
10256
10249
  };
10257
- 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]);
10250
+ values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
10258
10251
  }
10259
10252
  });
10260
- if (dataLinkForm !== null && dataLinkForm !== void 0 && dataLinkForm.identification && typeof dataLinkForm.identification === 'object') {
10253
+ if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
10261
10254
  Object.keys(dataLinkForm.identification).filter(fieldKey => {
10262
10255
  if (uploadTypeFields.includes(fieldKey)) {
10263
10256
  return !isUploadFieldEmpty(fieldKey, item);
@@ -10267,11 +10260,11 @@ const handleDataLinkWithTableKeys = _ref => {
10267
10260
  const formInputConfig = dataLinkForm.identification[fieldKey];
10268
10261
  return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
10269
10262
  }).forEach(fieldKey => {
10270
- var _item$linking3, _formInputConfig$tabl2;
10271
10263
  const formInputConfig = dataLinkForm.identification[fieldKey];
10272
- inputs[fieldKey] = _objectSpread2(_objectSpread2({}, formInputConfig), {}, {
10264
+ inputs[fieldKey] = {
10265
+ ...formInputConfig,
10273
10266
  label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
10274
- });
10267
+ };
10275
10268
  if (formInputConfig.label && typeof formInputConfig.label === 'object') {
10276
10269
  const dynamicLabelKeys = Object.keys(formInputConfig.label);
10277
10270
  let resolvedLabel = null;
@@ -10279,7 +10272,7 @@ const handleDataLinkWithTableKeys = _ref => {
10279
10272
  const parts = labelKey.split(' is ');
10280
10273
  if (parts.length === 2) {
10281
10274
  const [conditionKey, conditionValue] = parts;
10282
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
10275
+ if (item?.[conditionKey] === conditionValue) {
10283
10276
  resolvedLabel = formInputConfig.label[labelKey];
10284
10277
  break;
10285
10278
  }
@@ -10287,7 +10280,7 @@ const handleDataLinkWithTableKeys = _ref => {
10287
10280
  }
10288
10281
  inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
10289
10282
  }
10290
- 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]);
10283
+ values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[formInputConfig?.tableLabel?.toLowerCase()] || item?.[fieldKey];
10291
10284
  });
10292
10285
  }
10293
10286
  return {
@@ -10297,7 +10290,7 @@ const handleDataLinkWithTableKeys = _ref => {
10297
10290
  };
10298
10291
  if (Array.isArray(value)) {
10299
10292
  return value.map((item, itemIndex) => {
10300
- const datastakeIdValue = item === null || item === void 0 ? void 0 : item.datastakeId;
10293
+ const datastakeIdValue = item?.datastakeId;
10301
10294
  const {
10302
10295
  inputs,
10303
10296
  values
@@ -10306,9 +10299,9 @@ const handleDataLinkWithTableKeys = _ref => {
10306
10299
  return null;
10307
10300
  }
10308
10301
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10309
- nodeKey: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10302
+ nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10310
10303
  config: {
10311
- label: datastakeIdValue || t("No ID ".concat(itemIndex + 1)),
10304
+ label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
10312
10305
  type: 'custom-datalink',
10313
10306
  inputs: inputs
10314
10307
  },
@@ -10322,10 +10315,10 @@ const handleDataLinkWithTableKeys = _ref => {
10322
10315
  getApiBaseUrl: getApiBaseUrl,
10323
10316
  getAppHeader: getAppHeader,
10324
10317
  app: app
10325
- }, "".concat(inputKey, "-").concat(itemIndex));
10318
+ }, `${inputKey}-${itemIndex}`);
10326
10319
  });
10327
10320
  } else {
10328
- const datastakeIdValue = value === null || value === void 0 ? void 0 : value.datastakeId;
10321
+ const datastakeIdValue = value?.datastakeId;
10329
10322
  const {
10330
10323
  inputs,
10331
10324
  values
@@ -10350,7 +10343,7 @@ const handleDataLinkWithTableKeys = _ref => {
10350
10343
  getApiBaseUrl: getApiBaseUrl,
10351
10344
  getAppHeader: getAppHeader,
10352
10345
  app: app
10353
- }, "".concat(inputKey, "-single"));
10346
+ }, `${inputKey}-single`);
10354
10347
  }
10355
10348
  };
10356
10349
 
@@ -42770,6 +42770,7 @@ const PlantingLocations = ({
42770
42770
  longitude: locationCheckArrival.longitude
42771
42771
  };
42772
42772
  const color = "#15FFFFB2";
42773
+ const locationName = matchingLocation?.name || locationCheckArrival.name || 'Planting Location';
42773
42774
  return {
42774
42775
  _id: locationCheckArrival._id || event._id || {},
42775
42776
  area: area,
@@ -42777,13 +42778,16 @@ const PlantingLocations = ({
42777
42778
  datastakeId: `LOC-${String(index + 1).padStart(9, '0')}`,
42778
42779
  gps: gps,
42779
42780
  id: matchingLocation?.id || locationCheckArrival._id || `event-${index}`,
42780
- name: locationCheckArrival.name || matchingLocation?.name || `Event ${index + 1}`,
42781
+ name: event.name || t("Activity Start"),
42782
+ date: event.date,
42781
42783
  sources: 1,
42782
- subTitle: locationCheckArrival.name || matchingLocation?.name || 'Planting Location',
42784
+ subTitle: event.date ? renderDateFormatted(event.date, "DD MMM YY") : locationName,
42785
+ plotName: locationName,
42786
+ territoryTitle: locationName,
42783
42787
  type: 'Planting Location'
42784
42788
  };
42785
42789
  });
42786
- }, [plantingLocationsData]);
42790
+ }, [plantingLocationsData, t]);
42787
42791
  return /*#__PURE__*/jsxRuntime.jsx("section", {
42788
42792
  children: /*#__PURE__*/jsxRuntime.jsx(Widget, {
42789
42793
  title: t("Planting Locations"),
@@ -42805,7 +42809,66 @@ const PlantingLocations = ({
42805
42809
  onClickLink: () => {},
42806
42810
  onFilterChange: () => {},
42807
42811
  primaryLink: true,
42808
- renderTooltip: () => {},
42812
+ renderTooltipForLocation: data => {
42813
+ const coordinates = data.gps?.latitude && data.gps?.longitude ? convertDMS(data.gps.latitude, data.gps.longitude) : null;
42814
+ if (!coordinates) {
42815
+ return [];
42816
+ }
42817
+ const iconColor = "#016C6E"; // Activity Start color
42818
+
42819
+ return [{
42820
+ label: t("Coordinates"),
42821
+ value: /*#__PURE__*/jsxRuntime.jsxs("div", {
42822
+ style: {
42823
+ display: 'flex',
42824
+ alignItems: 'center',
42825
+ gap: '6px',
42826
+ flexWrap: 'nowrap'
42827
+ },
42828
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
42829
+ style: {
42830
+ display: 'flex',
42831
+ alignItems: 'center'
42832
+ },
42833
+ children: [/*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
42834
+ name: "SpacingHeight",
42835
+ width: 14,
42836
+ height: 14,
42837
+ color: iconColor
42838
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
42839
+ style: {
42840
+ fontWeight: 600,
42841
+ marginLeft: '4px'
42842
+ },
42843
+ children: coordinates[0]
42844
+ })]
42845
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
42846
+ style: {
42847
+ display: 'flex',
42848
+ alignItems: 'center'
42849
+ },
42850
+ children: [/*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
42851
+ name: "SpacingWidth",
42852
+ width: 14,
42853
+ height: 14,
42854
+ color: iconColor
42855
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
42856
+ style: {
42857
+ fontWeight: 600,
42858
+ marginLeft: '4px'
42859
+ },
42860
+ children: coordinates[1]
42861
+ })]
42862
+ })]
42863
+ })
42864
+ }];
42865
+ },
42866
+ renderTooltipForTerritory: data => {
42867
+ return [{
42868
+ label: t("Plot Name"),
42869
+ value: data.plotName || data.name || "--"
42870
+ }];
42871
+ },
42809
42872
  renderTooltipTags: () => {},
42810
42873
  type: "location-territory"
42811
42874
  })
@@ -44839,9 +44902,10 @@ const getColumns = ({
44839
44902
  className: "daf-default-cell"
44840
44903
  });
44841
44904
  }
44905
+ const title = findOptions(value, selectOptions?.implPartnersCategory || []) || '-';
44842
44906
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44843
- title: value,
44844
- children: value || '-'
44907
+ title: title,
44908
+ children: title
44845
44909
  });
44846
44910
  }
44847
44911
  }, {
@@ -44855,9 +44919,10 @@ const getColumns = ({
44855
44919
  className: "daf-default-cell"
44856
44920
  });
44857
44921
  }
44922
+ const title = findOptions(value, selectOptions?.implPartnersSubcategory || []) || '-';
44858
44923
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
44859
- title: value,
44860
- children: value || '-'
44924
+ title: title,
44925
+ children: title
44861
44926
  });
44862
44927
  }
44863
44928
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.778",
3
+ "version": "0.6.779",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -348,7 +348,8 @@ export const getColumns = ({
348
348
  if (all.empty) {
349
349
  return <div className="daf-default-cell" />;
350
350
  }
351
- return <Tooltip title={value}>{value || '-'}</Tooltip>;
351
+ const title = findOptions(value, selectOptions?.implPartnersCategory || []) || '-';
352
+ return <Tooltip title={title}>{title}</Tooltip>;
352
353
  },
353
354
  },
354
355
  {
@@ -360,7 +361,8 @@ export const getColumns = ({
360
361
  if (all.empty) {
361
362
  return <div className="daf-default-cell" />;
362
363
  }
363
- return <Tooltip title={value}>{value || '-'}</Tooltip>;
364
+ const title = findOptions(value, selectOptions?.implPartnersSubcategory || []) || '-';
365
+ return <Tooltip title={title}>{title}</Tooltip>;
364
366
  },
365
367
  },
366
368
  {
@@ -50,6 +50,7 @@ const AssociatedInformation = ({
50
50
  }) => {
51
51
  const [activeTab, setActiveTab] = useState(ACTIVITIES_TAB);
52
52
  const [search, setSearch] = useState('');
53
+
53
54
 
54
55
  const searchFields = useMemo(() => searchFieldsMap(activeTab), [activeTab, searchFieldsMap]);
55
56
 
@@ -1,6 +1,9 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { Widget, MineSiteMap } from '../../../../../../../../src/index.js';
3
3
  import { useWidgetFetch } from '../../../../../../hooks/useWidgetFetch.js';
4
+ import { convertDMS } from '../../../../../../../../src/helpers/Map';
5
+ import CustomIcon from '../../../../../../../../src/@daf/core/components/Icon/CustomIcon.jsx';
6
+ import { renderDateFormatted } from '../../../../../../../../src/helpers/Forms';
4
7
 
5
8
  const PlantingLocations = ({
6
9
  id,
@@ -76,6 +79,8 @@ const PlantingLocations = ({
76
79
 
77
80
  const color = "#15FFFFB2"
78
81
 
82
+ const locationName = matchingLocation?.name || locationCheckArrival.name || 'Planting Location';
83
+
79
84
  return {
80
85
  _id: locationCheckArrival._id || event._id || {},
81
86
  area: area,
@@ -83,13 +88,16 @@ const PlantingLocations = ({
83
88
  datastakeId: `LOC-${String(index + 1).padStart(9, '0')}`,
84
89
  gps: gps,
85
90
  id: matchingLocation?.id || locationCheckArrival._id || `event-${index}`,
86
- name: locationCheckArrival.name || matchingLocation?.name || `Event ${index + 1}`,
91
+ name: event.name || t("Activity Start"),
92
+ date: event.date,
87
93
  sources: 1,
88
- subTitle: locationCheckArrival.name || matchingLocation?.name || 'Planting Location',
94
+ subTitle: event.date ? renderDateFormatted(event.date, "DD MMM YY") : locationName,
95
+ plotName: locationName,
96
+ territoryTitle: locationName,
89
97
  type: 'Planting Location'
90
98
  };
91
99
  });
92
- }, [plantingLocationsData]);
100
+ }, [plantingLocationsData, t]);
93
101
 
94
102
  return (
95
103
  <section>
@@ -107,7 +115,55 @@ const PlantingLocations = ({
107
115
  onClickLink={() => { }}
108
116
  onFilterChange={() => { }}
109
117
  primaryLink
110
- renderTooltip={() => { }}
118
+ renderTooltipForLocation={(data) => {
119
+ const coordinates = data.gps?.latitude && data.gps?.longitude
120
+ ? convertDMS(data.gps.latitude, data.gps.longitude)
121
+ : null;
122
+
123
+ if (!coordinates) {
124
+ return [];
125
+ }
126
+
127
+ const iconColor = "#016C6E"; // Activity Start color
128
+
129
+ return [
130
+ {
131
+ label: t("Coordinates"),
132
+ value: (
133
+ <div style={{ display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'nowrap' }}>
134
+ {/* Latitude icon (vertical) */}
135
+ <div style={{ display: 'flex', alignItems: 'center' }}>
136
+ <CustomIcon
137
+ name="SpacingHeight"
138
+ width={14}
139
+ height={14}
140
+ color={iconColor}
141
+ />
142
+ <span style={{ fontWeight: 600, marginLeft: '4px' }}>{coordinates[0]}</span>
143
+ </div>
144
+ {/* Longitude icon (horizontal) */}
145
+ <div style={{ display: 'flex', alignItems: 'center' }}>
146
+ <CustomIcon
147
+ name="SpacingWidth"
148
+ width={14}
149
+ height={14}
150
+ color={iconColor}
151
+ />
152
+ <span style={{ fontWeight: 600, marginLeft: '4px' }}>{coordinates[1]}</span>
153
+ </div>
154
+ </div>
155
+ ),
156
+ },
157
+ ];
158
+ }}
159
+ renderTooltipForTerritory={(data) => {
160
+ return [
161
+ {
162
+ label: t("Plot Name"),
163
+ value: data.plotName || data.name || "--",
164
+ },
165
+ ];
166
+ }}
111
167
  renderTooltipTags={() => { }}
112
168
  type="location-territory"
113
169
  />