@datarailsshared/dr_renderer 1.2.377 → 1.2.379

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.2.377",
3
+ "version": "1.2.379",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -8896,6 +8896,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8896
8896
  let datesFields = [];
8897
8897
  datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
8898
8898
  datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
8899
+ datesFields = lodash.cloneDeep(datesFields);
8899
8900
 
8900
8901
  const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
8901
8902
  if (isCustomSorting) {
@@ -8991,7 +8992,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8991
8992
 
8992
8993
  /* date string */
8993
8994
  var rowsAndCols = [];
8994
- rowsAndCols = widget.rows.concat(widget.cols);
8995
+ rowsAndCols = lodash.cloneDeep(widget.rows.concat(widget.cols));
8995
8996
 
8996
8997
  if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN && !highchartsRenderer.sortHasBeenDoneOnBE(lodash.get(widget, 'pivot.keysObject'))) {
8997
8998
 
@@ -9000,7 +9001,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9000
9001
  const isTwoColumnComparisonWidget = lodash.get(widget, 'options.breakdown_options.values.totals', []).length === 2;
9001
9002
  lodash.forEach(rowsAndCols, function (field) {
9002
9003
  const waterfallFieldType = field.id === widget.cols[0].id ? 'totals' : 'breakdown';
9003
- if (waterfallFieldType !== 'totals' || isTwoColumnComparisonWidget) {
9004
+
9005
+ if (field.type === 'Date') {
9006
+
9007
+ // set ascending date orders - due to issue with setting breakdown options order in webclient
9008
+ // this is for fixing already saved widgets with incorret order in breakdown options
9009
+ field.sorting = {
9010
+ is_absolute: false,
9011
+ sort_by: "field_items",
9012
+ type: "",
9013
+ };
9014
+ } else if (waterfallFieldType !== 'totals' || isTwoColumnComparisonWidget) {
9004
9015
  field.sorting = {
9005
9016
  type: 'CustomOrder',
9006
9017
  values: lodash.map(