datastake-daf 0.6.771 → 0.6.772

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.
@@ -9725,19 +9725,18 @@ const resolveDynamicLabel = (labelConfig, item, defaultLabel) => {
9725
9725
  return labelConfig || defaultLabel;
9726
9726
  };
9727
9727
 
9728
- const handleSectionChildren = _ref => {
9729
- let {
9730
- config,
9731
- allData,
9732
- level,
9733
- t,
9734
- rootForm,
9735
- user,
9736
- getApiBaseUrl = () => {},
9737
- getAppHeader = () => {},
9738
- app,
9739
- TreeNodeComponent
9740
- } = _ref;
9728
+ const handleSectionChildren = ({
9729
+ config,
9730
+ allData,
9731
+ level,
9732
+ t,
9733
+ rootForm,
9734
+ user,
9735
+ getApiBaseUrl = () => {},
9736
+ getAppHeader = () => {},
9737
+ app,
9738
+ TreeNodeComponent
9739
+ }) => {
9741
9740
  if (!(level === 0 && config && typeof config === 'object')) {
9742
9741
  return null;
9743
9742
  }
@@ -9751,14 +9750,14 @@ const handleSectionChildren = _ref => {
9751
9750
  let fieldValue;
9752
9751
 
9753
9752
  // Determine field value based on type
9754
- if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData === null || allData === void 0 ? void 0 : allData[fieldKey])) {
9753
+ if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData?.[fieldKey])) {
9755
9754
  fieldValue = allData[fieldKey];
9756
- } else if (fieldConfig.type === 'dataLinkGroup' && allData !== null && allData !== void 0 && allData[fieldKey]) {
9755
+ } else if (fieldConfig.type === 'dataLinkGroup' && allData?.[fieldKey]) {
9757
9756
  fieldValue = allData[fieldKey];
9758
9757
  } else if (fieldConfig.type === 'group') {
9759
9758
  fieldValue = {};
9760
9759
  } else {
9761
- fieldValue = allData === null || allData === void 0 ? void 0 : allData[fieldKey];
9760
+ fieldValue = allData?.[fieldKey];
9762
9761
  }
9763
9762
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
9764
9763
  nodeKey: fieldKey,
@@ -14719,7 +14718,8 @@ const useMap$1 = ({
14719
14718
  const excludedType = ['village', 'town', 'area', 'territory'];
14720
14719
  const filteredData = data?.filter(obj => !excludedType.includes(obj?.type) && (obj?.stakeholders?.length > 0 || data.some(other => other.datastakeId !== obj.datastakeId && (other.stakeholders || []).some(stk => (stk.links || []).includes(obj.datastakeId)))));
14721
14720
  const maxTotal = Math.max(...(data || []).map(d => d.total));
14722
- filteredData.forEach((d, i) => {
14721
+ const dataToRender = type === "chain" ? filteredData : data;
14722
+ dataToRender.forEach((d, i) => {
14723
14723
  addIconToMapInitialy([d?.marker?.lat, d?.marker?.lng], "location", d.category || "mineSite", d, maxTotal, i);
14724
14724
  });
14725
14725
  polylinesRef.current.forEach(polyline => {
@@ -9901,7 +9901,8 @@ const useMap = ({
9901
9901
  const excludedType = ['village', 'town', 'area', 'territory'];
9902
9902
  const filteredData = data?.filter(obj => !excludedType.includes(obj?.type) && (obj?.stakeholders?.length > 0 || data.some(other => other.datastakeId !== obj.datastakeId && (other.stakeholders || []).some(stk => (stk.links || []).includes(obj.datastakeId)))));
9903
9903
  const maxTotal = Math.max(...(data || []).map(d => d.total));
9904
- filteredData.forEach((d, i) => {
9904
+ const dataToRender = type === "chain" ? filteredData : data;
9905
+ dataToRender.forEach((d, i) => {
9905
9906
  addIconToMapInitialy([d?.marker?.lat, d?.marker?.lng], "location", d.category || "mineSite", d, maxTotal, i);
9906
9907
  });
9907
9908
  polylinesRef.current.forEach(polyline => {
@@ -1495,12 +1495,14 @@ class OperatorService extends BaseService {
1495
1495
  }
1496
1496
  });
1497
1497
  }
1498
- getData(id, sourceId) {
1498
+ getData(id, sourceId, source, version) {
1499
1499
  return this.apiGet({
1500
1500
  isApp: true,
1501
1501
  url: `/stakeholder/${id}`,
1502
1502
  params: {
1503
- authorId: sourceId
1503
+ authorId: sourceId,
1504
+ source,
1505
+ version
1504
1506
  }
1505
1507
  });
1506
1508
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.771",
3
+ "version": "0.6.772",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -205,7 +205,9 @@ export const useMap = ({
205
205
  )
206
206
  ));
207
207
  const maxTotal = Math.max(...(data || []).map((d) => d.total));
208
- filteredData.forEach((d, i) => {
208
+
209
+ const dataToRender = type === "chain" ? filteredData : data;
210
+ dataToRender.forEach((d, i) => {
209
211
  addIconToMapInitialy(
210
212
  [d?.marker?.lat, d?.marker?.lng],
211
213
  "location",
@@ -45,11 +45,11 @@ class OperatorService extends BaseService {
45
45
  });
46
46
  }
47
47
 
48
- getData(id, sourceId) {
48
+ getData(id, sourceId, source, version) {
49
49
  return this.apiGet({
50
50
  isApp: true,
51
51
  url: `/stakeholder/${id}`,
52
- params: { authorId: sourceId },
52
+ params: { authorId: sourceId, source, version },
53
53
  });
54
54
  }
55
55