datastake-daf 0.6.337 → 0.6.339

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.
@@ -55621,7 +55621,7 @@ const checkboxConfig$8 = {
55621
55621
  datastakeId: "ID"
55622
55622
  };
55623
55623
  function getNameByLevel(data, level) {
55624
- const entry = Object.values(data).find(item => item.level === level);
55624
+ const entry = Object.values(data || {}).find(item => item.level === level);
55625
55625
  return entry ? entry.name : null;
55626
55626
  }
55627
55627
  const getColumns$2 = ({
@@ -55660,8 +55660,8 @@ const getColumns$2 = ({
55660
55660
  }
55661
55661
  }, {
55662
55662
  title: t("ID"),
55663
- dataIndex: "id",
55664
- key: "id",
55663
+ dataIndex: "datastakeId",
55664
+ key: "datastakeId",
55665
55665
  ellipsis: true,
55666
55666
  show: true,
55667
55667
  render: (value, all) => {
@@ -55744,11 +55744,11 @@ const getColumns$2 = ({
55744
55744
  if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
55745
55745
  label = all?.linking?.SCL?.value?.name;
55746
55746
  } else {
55747
- label = getNameByLevel(all?.linking?.SCL, value);
55747
+ label = getNameByLevel(all?.linking?.SCL, "level_1");
55748
55748
  }
55749
55749
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55750
- title: label,
55751
- children: label
55750
+ title: label || '-',
55751
+ children: label || '-'
55752
55752
  });
55753
55753
  }
55754
55754
  }, {
@@ -55758,15 +55758,20 @@ const getColumns$2 = ({
55758
55758
  show: true,
55759
55759
  ellipsis: true,
55760
55760
  render: (value, all) => {
55761
+ if (all.empty) {
55762
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
55763
+ className: "daf-default-cell"
55764
+ });
55765
+ }
55761
55766
  let label;
55762
55767
  if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
55763
55768
  label = all?.linking?.SCL?.value?.name;
55764
55769
  } else {
55765
- label = getNameByLevel(all?.linking?.SCL, value);
55770
+ label = getNameByLevel(all?.linking?.SCL, "level_2");
55766
55771
  }
55767
55772
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55768
- title: label,
55769
- children: label
55773
+ title: label || '-',
55774
+ children: label || '-'
55770
55775
  });
55771
55776
  }
55772
55777
  }, {
@@ -55782,7 +55787,7 @@ const getColumns$2 = ({
55782
55787
  }
55783
55788
  const MAX_SOURCES = 3;
55784
55789
  const count = value.length === MAX_SOURCES + 1 ? value.length : MAX_SOURCES;
55785
- return /*#__PURE__*/jsxRuntime.jsx(antd.Avatar.Group, {
55790
+ return Array.isArray(value) && value.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(antd.Avatar.Group, {
55786
55791
  max: {
55787
55792
  count: count,
55788
55793
  style: {
@@ -55809,7 +55814,7 @@ const getColumns$2 = ({
55809
55814
  color: token.baseGray90
55810
55815
  })
55811
55816
  }, i))
55812
- });
55817
+ }) : '-';
55813
55818
  }
55814
55819
  }, {
55815
55820
  title: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.337",
3
+ "version": "0.6.339",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -27,50 +27,155 @@ export const Primary = {
27
27
  data: {
28
28
  data: [
29
29
  {
30
- id: "LOC0000001",
31
- name: "Location 1",
32
- category: "CAT1",
33
- country: "AL",
34
- adminLevel1: "Admin Level 1-1",
35
- adminLevel2: "Admin Level 2-1",
36
- sources: [{}, {}],
30
+ "_id": {},
31
+ "createdAt": "2025-09-22T14:32:31.513Z",
32
+ "updatedAt": "2025-09-22T14:32:31.513Z",
33
+ "id": "937b8b13-947d-4ee0-accf-961cbc63c663",
34
+ "name": "Armed Group",
35
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
36
+ "collectId": "5d0ba2c7110a07ae97fa63e06b1041fe76367e2b",
37
+ "country": "AL",
38
+ "category": "nonStateArmedGroup",
39
+ "sources": [],
40
+ "subCategory": "militia",
41
+ "datastakeId": "STK-00000000452",
42
+ "linking": {
43
+ "SCL": {
44
+ "6839cb26-5af4-44a3-b136-a0f0a0bcecc6": {
45
+ "_id": {},
46
+ "createdAt": "2023-02-19T17:25:34.444Z",
47
+ "updatedAt": "2023-02-19T17:25:34.444Z",
48
+ "id": "6839cb26-5af4-44a3-b136-a0f0a0bcecc6",
49
+ "level": "level_1",
50
+ "country": "AL",
51
+ "collectId": "1e29d64aee47553eba7e89bf04d43cc7c1c1a017",
52
+ "name": "Berat",
53
+ "__v": 0
54
+ }
55
+ }
56
+ },
57
+ "__v": 0
37
58
  },
38
59
  {
39
- id: "LOC0000002",
40
- name: "Location 2",
41
- category: "CAT2",
42
- country: "AL",
43
- adminLevel1: "Admin Level 1-2",
44
- adminLevel2: "Admin Level 2-2",
45
- sources: [{}, {}, {}, {}, {}, {}],
60
+ "_id": {},
61
+ "createdAt": "2025-09-23T09:43:09.055Z",
62
+ "updatedAt": "2025-09-23T09:43:09.055Z",
63
+ "id": "e3d4b71c-63b2-4a57-8833-ea4cfa519a67",
64
+ "name": "Test",
65
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
66
+ "collectId": "cc1e6e29bb85f01ec835687b607f8179d7ea3ff3",
67
+ "country": "AL",
68
+ "category": "nonStateArmedGroup",
69
+ "sources": [],
70
+ "subCategory": "militia",
71
+ "datastakeId": "STK-00000000453",
72
+ "linking": {
73
+ "SCL": {
74
+ "6839cb26-5af4-44a3-b136-a0f0a0bcecc6": {
75
+ "_id": {},
76
+ "createdAt": "2023-02-19T17:25:34.444Z",
77
+ "updatedAt": "2023-02-19T17:25:34.444Z",
78
+ "id": "6839cb26-5af4-44a3-b136-a0f0a0bcecc6",
79
+ "level": "level_1",
80
+ "country": "AL",
81
+ "collectId": "1e29d64aee47553eba7e89bf04d43cc7c1c1a017",
82
+ "name": "Berat",
83
+ "__v": 0
84
+ }
85
+ }
86
+ },
87
+ "__v": 0
46
88
  },
47
89
  {
48
- id: "LOC0000003",
49
- name: "Location 3",
50
- category: "CAT3",
51
- country: "DZ",
52
- adminLevel1: "Admin Level 1-3",
53
- adminLevel2: "Admin Level 2-3",
54
- sources: [{}, {}],
90
+ "_id": {},
91
+ "createdAt": "2025-09-25T10:28:05.989Z",
92
+ "updatedAt": "2025-09-25T10:28:05.989Z",
93
+ "id": "1f5ac021-c82d-46ce-817a-c4045392b13d",
94
+ "name": "This operator will have a name so ridiculously long that every other name will sulk in jealousy, rushing to hand over their daughters just like in the medieval days, hoping his children will inherit even half the glory of that absurdly oversized title.",
95
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
96
+ "collectId": "203f6b80dac93e506d50073b0a8e365a727aceae",
97
+ "country": "AX",
98
+ "category": "corporation",
99
+ "sources": [],
100
+ "subCategory": "publicCompany",
101
+ "datastakeId": "STK-00000000454",
102
+ "__v": 0
55
103
  },
56
104
  {
57
- id: "LOC0000004",
58
- name: "Location 4",
59
- category: "CAT4",
60
- country: "AL",
61
- adminLevel1: "Admin Level 1-4",
62
- adminLevel2: "Admin Level 2-4",
63
- sources: [{}, {}, {}, {}],
105
+ "_id": {},
106
+ "createdAt": "2025-09-26T12:29:52.120Z",
107
+ "updatedAt": "2025-09-26T12:29:52.120Z",
108
+ "id": "9fe2475c-98a6-4a72-a9c7-0b459f44c0ed",
109
+ "name": "ANOTHER OP",
110
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
111
+ "collectId": "d77e36a69838047cc627933b935a93dcedb1ee06",
112
+ "country": "AL",
113
+ "category": "corporation",
114
+ "sources": [],
115
+ "subCategory": "publicCompany",
116
+ "datastakeId": "STK-00000000455",
117
+ "__v": 0
64
118
  },
65
119
  {
66
- id: "LOC0000005",
67
- name: "Location 5",
68
- category: "CAT4",
69
- country: "AL",
70
- adminLevel1: "Admin Level 1-5",
71
- adminLevel2: "Admin Level 2-5",
72
- sources: [{}, {}, {}, {}, {}],
120
+ "_id": {},
121
+ "createdAt": "2025-09-26T12:33:31.263Z",
122
+ "updatedAt": "2025-09-26T12:33:31.263Z",
123
+ "id": "9c561b78-452a-468a-9c71-a8380d1bdc1d",
124
+ "name": "SOME GUY",
125
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
126
+ "collectId": "a94ffae8f0f46dcde6d9c5f21eab16b041051209",
127
+ "country": "AL",
128
+ "category": "corporation",
129
+ "sources": [],
130
+ "subCategory": "publicCompany",
131
+ "datastakeId": "STK-00000000456",
132
+ "__v": 0
73
133
  },
134
+ {
135
+ "_id": {},
136
+ "createdAt": "2025-09-26T13:26:02.415Z",
137
+ "updatedAt": "2025-09-26T13:26:02.415Z",
138
+ "id": "bb2a2497-eae6-47a4-b903-9f0663dc8b0c",
139
+ "name": "THIS SOWULD BE THE 4-th OP FOR THIS MS",
140
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
141
+ "collectId": "da9d2cb826b1ffb51f3acc97a3bc2d2110bad033",
142
+ "country": "AL",
143
+ "category": "corporation",
144
+ "sources": [],
145
+ "subCategory": "privateCompany",
146
+ "datastakeId": "STK-00000000457",
147
+ "__v": 0
148
+ },
149
+ {
150
+ "_id": {},
151
+ "createdAt": "2025-09-26T13:33:36.403Z",
152
+ "updatedAt": "2025-09-26T13:33:36.403Z",
153
+ "id": "058894d7-22a8-4804-b4a8-98be5003f310",
154
+ "name": "THE BES OP EVER",
155
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
156
+ "collectId": "6d8b56767a7edc6fc605d9c669ce0878d4918630",
157
+ "country": "AX",
158
+ "category": "corporation",
159
+ "sources": [],
160
+ "subCategory": "stockCompany",
161
+ "datastakeId": "STK-00000000458",
162
+ "__v": 0
163
+ },
164
+ {
165
+ "_id": {},
166
+ "createdAt": "2025-09-26T13:48:09.933Z",
167
+ "updatedAt": "2025-09-26T13:48:09.933Z",
168
+ "id": "0777e572-6f47-4d54-a58c-7a43ef26d3c1",
169
+ "name": "Grupim i armatosur",
170
+ "authorId": "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
171
+ "collectId": "8c26f08b914b23459e52e3506e30caf508d9679d",
172
+ "country": "AL",
173
+ "category": "nonStateArmedGroup",
174
+ "sources": [],
175
+ "subCategory": "militia",
176
+ "datastakeId": "STK-00000000459",
177
+ "__v": 0
178
+ }
74
179
  ],
75
180
  meta: {
76
181
  total: 0,
@@ -64,7 +64,7 @@ export const checkboxConfig = {
64
64
  };
65
65
 
66
66
  function getNameByLevel(data, level) {
67
- const entry = Object.values(data).find(item => item.level === level);
67
+ const entry = Object.values(data || {}).find(item => item.level === level);
68
68
  return entry ? entry.name : null;
69
69
  }
70
70
 
@@ -111,8 +111,8 @@ export const getColumns = ({
111
111
  },
112
112
  {
113
113
  title: t("ID"),
114
- dataIndex: "id",
115
- key: "id",
114
+ dataIndex: "datastakeId",
115
+ key: "datastakeId",
116
116
  ellipsis: true,
117
117
  show: true,
118
118
  render: (value, all) => {
@@ -183,10 +183,10 @@ export const getColumns = ({
183
183
  if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
184
184
  label = all?.linking?.SCL?.value?.name
185
185
  } else {
186
- label = getNameByLevel(all?.linking?.SCL, value, "level_1")
186
+ label = getNameByLevel(all?.linking?.SCL, "level_1")
187
187
  }
188
188
 
189
- return <Tooltip title={label}>{label}</Tooltip>;
189
+ return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
190
190
  },
191
191
  },
192
192
  {
@@ -196,14 +196,18 @@ export const getColumns = ({
196
196
  show: true,
197
197
  ellipsis: true,
198
198
  render: (value, all) => {
199
+ if (all.empty) {
200
+ return <div className="daf-default-cell" />;
201
+ }
202
+
199
203
  let label;
200
204
  if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
201
205
  label = all?.linking?.SCL?.value?.name
202
206
  } else {
203
- label = getNameByLevel(all?.linking?.SCL, value, "level_2")
207
+ label = getNameByLevel(all?.linking?.SCL, "level_2")
204
208
  }
205
209
 
206
- return <Tooltip title={label}>{label}</Tooltip>;
210
+ return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
207
211
  },
208
212
  },
209
213
  {
@@ -219,39 +223,39 @@ export const getColumns = ({
219
223
  const MAX_SOURCES = 3;
220
224
  const count = value.length === MAX_SOURCES + 1 ? value.length : MAX_SOURCES;
221
225
  return (
222
- <Avatar.Group
223
- max={{
224
- count: count,
225
- style: {
226
- color: token.baseGray90,
226
+ Array.isArray(value) && value.length > 0 ? <Avatar.Group
227
+ max={{
228
+ count: count,
229
+ style: {
230
+ color: token.baseGray90,
231
+ backgroundColor: token.baseGray20,
232
+ border: `1px solid ${token.baseGray40}`,
233
+ },
234
+ }}
235
+ size={"small"}
236
+ >
237
+ {value.map((v, i) => (
238
+ <Avatar
239
+ key={i}
240
+ size={"small"}
241
+ style={{
227
242
  backgroundColor: token.baseGray20,
243
+ color: token.baseGray90,
228
244
  border: `1px solid ${token.baseGray40}`,
229
- },
230
- }}
231
- size={"small"}
232
- >
233
- {value.map((v, i) => (
234
- <Avatar
235
- key={i}
236
- size={"small"}
237
- style={{
238
- backgroundColor: token.baseGray20,
239
- color: token.baseGray90,
240
- border: `1px solid ${token.baseGray40}`,
241
- display: "flex",
242
- alignItems: "center",
243
- justifyContent: "center",
244
- }}
245
- >
246
- <CustomIcon
247
- name="Organisation02"
248
- width={18}
249
- height={18}
250
- color={token.baseGray90}
251
- />
252
- </Avatar>
253
- ))}
254
- </Avatar.Group>
245
+ display: "flex",
246
+ alignItems: "center",
247
+ justifyContent: "center",
248
+ }}
249
+ >
250
+ <CustomIcon
251
+ name="Organisation02"
252
+ width={18}
253
+ height={18}
254
+ color={token.baseGray90}
255
+ />
256
+ </Avatar>
257
+ ))}
258
+ </Avatar.Group> : '-'
255
259
  );
256
260
  },
257
261
  },