@datarailsshared/dr_renderer 1.5.74 → 1.5.76

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.5.74",
3
+ "version": "1.5.76",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -10012,8 +10012,23 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
10012
10012
  // It is just not counting sum there. So we remove it in order not to show improper values
10013
10013
  if ((calculatedValuesInValsCount > 1 || calculatedValuesInValsCount && widget.vals.length > 1) && !widget.rows.length) {
10014
10014
  res = lodash.filter(res, record => {
10015
+ // Check if record is metadata (has col_keys or row_keys)
10016
+ const isMetadata = typeof record['col_keys'] !== 'undefined' || typeof record['row_keys'] !== 'undefined';
10017
+ if (isMetadata) {
10018
+ return false;
10019
+ }
10020
+
10015
10021
  const isColsTotal = typeof record['DR_Values'] === 'undefined';
10016
- return !isColsTotal;
10022
+
10023
+ if (!isColsTotal) {
10024
+ return true;
10025
+ }
10026
+
10027
+ // If it doesn't have DR_Values, check if it has any value fields
10028
+ // Records with value fields are valid data, not empty subtotals
10029
+ return lodash.some(fieldWithDrValuesNames, fieldName => {
10030
+ return typeof record[fieldName] !== 'undefined' || typeof record['value'] !== 'undefined';
10031
+ });
10017
10032
  })
10018
10033
  }
10019
10034
  }