ebta-workflow-prod 4.0.15 → 4.0.16

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebta-workflow-prod",
3
3
  "private": false,
4
- "version": "4.0.15",
4
+ "version": "4.0.16",
5
5
  "description": "",
6
6
  "license": "UNLICENSED",
7
7
  "author": "",
@@ -269,7 +269,16 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
269
269
  const filteredAttributes = {};
270
270
  for (const key of attributeList) {
271
271
  if (key in feature.attributes) {
272
- filteredAttributes[key] = originalData.find(attri => attri.name === key)?.type == 'date' ? epoch2MelbDate(Number(feature.attributes[key]) / 1000) : feature.attributes[key];
272
+ const isDate = originalData.find(attri => attri.name === key)?.type == 'date';
273
+ const rawVal = feature.attributes[key];
274
+ if (isDate) {
275
+ const epoch = Number(rawVal);
276
+ filteredAttributes[key] = (rawVal !== null && rawVal !== undefined && epoch > 0)
277
+ ? epoch2MelbDate(epoch / 1000)
278
+ : null; // keep as null, generateAttributeSummary will skip it
279
+ } else {
280
+ filteredAttributes[key] = rawVal;
281
+ }
273
282
  }
274
283
  }
275
284
  return filteredAttributes;
@@ -890,7 +899,9 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
890
899
  // Iterate through the features array
891
900
  features.forEach((feature) => {
892
901
  const value = feature[attributeName];
902
+ if (value === null || value === undefined || value === '') return;
893
903
  if (value) {
904
+
894
905
  // Count the occurrence of each value for the attribute
895
906
  if (!attributeSummary[value]) {
896
907
  attributeSummary[value] = 0;