@datarailsshared/dr_renderer 1.4.136 → 1.5.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.
@@ -16,6 +16,10 @@ concurrency:
16
16
  group: '${{ github.ref }}-${{ github.workflow }}'
17
17
  cancel-in-progress: true
18
18
 
19
+ permissions:
20
+ contents: read
21
+ packages: write
22
+
19
23
  jobs:
20
24
  publish-npm:
21
25
  name: Build, Test and Publish to NPM
@@ -25,7 +29,7 @@ jobs:
25
29
  access_level: 'public'
26
30
  branch_postfix: false
27
31
  main_branch: 'master'
28
- version_prefix: '1.4'
32
+ version_prefix: '1.5'
29
33
  secrets:
30
34
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31
35
 
@@ -36,4 +40,5 @@ jobs:
36
40
  with:
37
41
  node_version: '14.16.1'
38
42
  package_scope: '@datarails'
39
- version: ${{ needs.publish-npm.outputs.version }}
43
+ version: ${{ needs.publish-npm.outputs.version }}
44
+ secrets: inherit
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Datarails renderer
1
+ # Datarails renderer
2
2
 
3
3
  This project was generated by amazing Datarails R&D team
4
4
 
@@ -62,3 +62,4 @@ try {
62
62
  ```
63
63
 
64
64
  ###
65
+ ##
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.4.136",
3
+ "version": "1.5.16",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -245,7 +245,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
245
245
  highchartsRenderer.hasFeature = function(featureFlagKey) {
246
246
  return lodash.includes(lodash.get(document, 'ReportHippo.user.features', []), featureFlagKey);
247
247
  }
248
-
248
+
249
249
  if (!!lodash.get(document, 'ReportHippo.user')) {
250
250
  disableAnimation = document.ReportHippo.user.organization && document.ReportHippo.user.organization.settings && document.ReportHippo.user.organization.settings.disable_animation
251
251
  highchartsRenderer.enabledNewWidgetValueFormatting = highchartsRenderer.hasFeature(FEATURES.ENABLE_NEW_WIDGET_VALUE_FORMATTING);
@@ -464,8 +464,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
464
464
  };
465
465
 
466
466
  /**
467
- * @param {String} value
468
- * @param {{ useUnitAbbreviation: boolean } labelOptions
467
+ * @param {String} value
468
+ * @param {{ useUnitAbbreviation: boolean } labelOptions
469
469
  * @returns {String}
470
470
  */
471
471
  const removeNumberFormatValueUnitSign = (value, labelOptions) => {
@@ -615,7 +615,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
615
615
  highchartsRenderer.defaultValueLabelsFormatter = function (pivotData, opts, forcePercentage = false) {
616
616
  const deltaColumn = lodash.get(opts, 'chartOptions.delta_column', null);
617
617
  const isPercentage = deltaColumn && deltaColumn.is_percentage && deltaColumn.only_variant || forcePercentage;
618
-
618
+
619
619
  if (isPercentage) {
620
620
  return highchartsRenderer.persantageValueLabelsFormatter(pivotData, opts);
621
621
  }
@@ -796,7 +796,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
796
796
  // do nothing
797
797
  }
798
798
  }
799
- let formattedValue = $.pivotUtilities.getFormattedNumber(value, null, opts).replace(/\u00A0/g, " ");
799
+ let formattedValue = $.pivotUtilities.getFormattedNumber(value, null, opts).replace(/\u00A0/g, " ");
800
800
  formattedValue = removeNumberFormatValueUnitSign(formattedValue, labelOptions);
801
801
  return formattedValue;
802
802
  };
@@ -872,10 +872,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
872
872
  let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this);
873
873
  var rows = series_name.split(highchartsRenderer.delimer);
874
874
  var cols = highchartsRenderer.getColsInFormatterContext(this);
875
-
875
+
876
876
  if (is_drill_down_pie && (highchartsRenderer.selfStartsWith(series_name,"Series ") || isChartWithMultiValues)) {
877
877
  rows = [];
878
-
878
+
879
879
  if (isChartWithMultiValues) {
880
880
  cols = pivotData.getColKeys()[0];
881
881
  }
@@ -942,7 +942,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
942
942
  }
943
943
 
944
944
  var aggr = pivotData.getAggregator(rows, cols);
945
-
945
+
946
946
  let formatted_value_to_return = $.pivotUtilities.getFormattedNumber(y, null, opts);
947
947
  if (aggr.value() || isWaterfallBreakdown || isChartWithMultiValues) {
948
948
  formatted_value_to_return = $.pivotUtilities.getFormattedNumber(
@@ -1006,7 +1006,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1006
1006
  var hasProp = {}.hasOwnProperty;
1007
1007
  var forExport = [];
1008
1008
 
1009
- const TOTAL_CELL = 'Totals';
1009
+ const TOTAL_CELL = 'Totals';
1010
1010
 
1011
1011
  colAttrs = pivotData.colAttrs;
1012
1012
  rowAttrs = pivotData.rowAttrs;
@@ -1148,7 +1148,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1148
1148
  const isPieChart = chartOptions.chart && chartOptions.chart.type === 'pie';
1149
1149
  const x = isPieChart ? 13 : 12;
1150
1150
  const y = isPieChart ? -9 : 6;
1151
- chartOptions.chart.spacingBottom = lodash.get(chartOptions, 'xAxis.title') ? 34 : 30;
1151
+ chartOptions.chart.spacingBottom = lodash.get(chartOptions, 'xAxis.title') ? 34 : 30;
1152
1152
  chartOptions.drilldown.breadcrumbs = {
1153
1153
  formatter: () => '< &nbsp;Back',
1154
1154
  showFullPath: false,
@@ -1210,7 +1210,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1210
1210
  chartOptions = highchartsRenderer.updateChartOptions(chartOptions, opts);
1211
1211
  chartOptions = highchartsRenderer.updateChartOptions(chartOptions, {credits: {enabled: false}});
1212
1212
  result = $("<div>").addClass("chart");
1213
-
1213
+
1214
1214
  // old angular
1215
1215
  if (result.highcharts) {
1216
1216
  setTimeout(() => {
@@ -1814,7 +1814,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1814
1814
  if (keys[0] === 'Total') {
1815
1815
  agg.uniq = pivotData.allTotal.uniq;
1816
1816
  }
1817
-
1817
+
1818
1818
  let val = agg.value();
1819
1819
 
1820
1820
  if (val != null && $.isNumeric(val)) {
@@ -1984,7 +1984,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1984
1984
  } else if (delta_column_options.chart == 'spline') {
1985
1985
  series.color = varianceColor;
1986
1986
  series.type = 'spline'
1987
- }
1987
+ }
1988
1988
  return series;
1989
1989
  }
1990
1990
 
@@ -2032,7 +2032,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2032
2032
  } else if (!isNaN(key)) {
2033
2033
  key = Number(key);
2034
2034
  }
2035
-
2035
+
2036
2036
  ob.drilldown = key;
2037
2037
  pie_series.push(ob);
2038
2038
  });
@@ -3097,7 +3097,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3097
3097
  };
3098
3098
  }
3099
3099
  chartOptions.plotOptions.series = highchartsRenderer.getDataLabelsOptions(additionOptions, chartOptions.plotOptions.series);
3100
-
3100
+
3101
3101
  if (opts.selectedPoint) {
3102
3102
  seriesPointStylesHelper.setInitialPointStyles(opts, chartOptions.series);
3103
3103
  }
@@ -3462,7 +3462,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3462
3462
  const additionOptions = opts.chartOptions
3463
3463
  ? opts.chartOptions
3464
3464
  : highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN);
3465
-
3465
+
3466
3466
  if (!highchartsRenderer.isSortingOnBackendEnabled) {
3467
3467
  pivotData.colKeys = lodash.map(lodash.keys(pivotData.colTotals), key => [key]);
3468
3468
  }
@@ -3857,7 +3857,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3857
3857
  number_format = this.widget_values_format;
3858
3858
  }
3859
3859
 
3860
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
3860
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
3861
3861
  if (aggregatorPercentageValue) {
3862
3862
  return aggregatorPercentageValue;
3863
3863
  }
@@ -3866,8 +3866,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3866
3866
 
3867
3867
  var formated_value = highchartsRenderer.formatValue('n', number_format, x);
3868
3868
 
3869
- return formated_value && formated_value.hasOwnProperty('value') && formated_value.value != null
3870
- ? formated_value.value
3869
+ return formated_value && formated_value.hasOwnProperty('value') && formated_value.value != null
3870
+ ? formated_value.value
3871
3871
  : x.toLocaleString();
3872
3872
  },
3873
3873
  numInputs: attr != null ? 0 : 1
@@ -3931,7 +3931,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3931
3931
  return ''
3932
3932
  }
3933
3933
 
3934
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.uniq, render_options, data, rowKey, colKey);
3934
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.uniq, render_options, data, rowKey, colKey);
3935
3935
  if (aggregatorPercentageValue) {
3936
3936
  return aggregatorPercentageValue;
3937
3937
  }
@@ -4023,7 +4023,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4023
4023
  number_format = this.widget_values_format;
4024
4024
  }
4025
4025
 
4026
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
4026
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
4027
4027
  if (aggregatorPercentageValue) {
4028
4028
  return aggregatorPercentageValue;
4029
4029
  }
@@ -4115,7 +4115,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4115
4115
  number_format = this.widget_values_format;
4116
4116
  }
4117
4117
 
4118
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.val, render_options, data, rowKey, colKey);
4118
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.val, render_options, data, rowKey, colKey);
4119
4119
  if (aggregatorPercentageValue) {
4120
4120
  return aggregatorPercentageValue;
4121
4121
  }
@@ -4207,7 +4207,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4207
4207
  number_format = this.widget_values_format;
4208
4208
  }
4209
4209
 
4210
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.val, render_options, data, rowKey, colKey);
4210
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.val, render_options, data, rowKey, colKey);
4211
4211
  if (aggregatorPercentageValue) {
4212
4212
  return aggregatorPercentageValue;
4213
4213
  }
@@ -4302,7 +4302,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4302
4302
  number_format = this.widget_values_format;
4303
4303
  }
4304
4304
 
4305
- const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
4305
+ const aggregatorPercentageValue = valueFormatter.getAggregatorPercentageValueIfRequired(this.sum, render_options, data, rowKey, colKey);
4306
4306
  if (aggregatorPercentageValue) {
4307
4307
  return aggregatorPercentageValue;
4308
4308
  }
@@ -4648,7 +4648,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4648
4648
  lodash.get(widget, 'options.sortingFields', []),
4649
4649
  sortingField => lodash.includes(['field_values', 'variance'], lodash.get(sortingField, 'sorting.sort_by'))
4650
4650
  );
4651
-
4651
+
4652
4652
  if (sortByValueSettings.length) {
4653
4653
  pivotData.sortByValueAttrs = lodash.map(sortByValueSettings, fieldSorting => fieldSorting.name);
4654
4654
  let new_sorting_function = highchartsRenderer.generateSortingFunctionByValues(sortByValueSettings, pivotData, opts, widget);
@@ -4794,7 +4794,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4794
4794
  lodash.get(widget, 'options.sortingFields', []),
4795
4795
  sortingField => lodash.includes(['field_values', 'variance'], lodash.get(sortingField, 'sorting.sort_by'))
4796
4796
  );
4797
-
4797
+
4798
4798
  if (sortByValueSettings.length) {
4799
4799
  pivotData.sortByValueAttrs = lodash.map(sortByValueSettings, fieldSorting => fieldSorting.name);
4800
4800
  let new_sorting_function = highchartsRenderer.generateSortingFunctionByValues(sortByValueSettings, pivotData, opts, widget);
@@ -5295,7 +5295,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5295
5295
  seriesOptions: []
5296
5296
  }
5297
5297
  }
5298
-
5298
+
5299
5299
  if (options.chartOptions && options.chartOptions.delta_column && options.chartOptions.delta_column.field === 'series') {
5300
5300
  let deltaColumnSeries = {
5301
5301
  series: options.chartOptions.delta_column.name,
@@ -6114,7 +6114,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6114
6114
 
6115
6115
  highchartsRenderer.getDefaultValueForSubOptions = function (option, existing_options, chartType) {
6116
6116
  const valToReturn = {};
6117
-
6117
+
6118
6118
  if (option) {
6119
6119
  const type = option.category_type;
6120
6120
 
@@ -6657,7 +6657,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6657
6657
  element_type: 'checkbox',
6658
6658
  value_name: 'dislay_empty_values',
6659
6659
  element_label: 'Display empty values',
6660
- default_value: false
6660
+ default_value: true
6661
6661
  },
6662
6662
  ]
6663
6663
  },
@@ -6685,7 +6685,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6685
6685
  element_type: 'checkbox',
6686
6686
  value_name: 'dislay_empty_values',
6687
6687
  element_label: 'Display empty values',
6688
- default_value: false
6688
+ default_value: true
6689
6689
  },
6690
6690
  {
6691
6691
  element_type: 'devider',
@@ -9342,7 +9342,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9342
9342
  }
9343
9343
  }
9344
9344
  };
9345
-
9345
+
9346
9346
  for (let i = 0; i < keys.length; i++) {
9347
9347
  replaceNestedKeys(keys[i]);
9348
9348
  }
@@ -9426,10 +9426,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9426
9426
  }
9427
9427
 
9428
9428
  if (!highchartsRenderer.sortHasBeenDoneOnBE(lodash.get(widget, 'pivot.keysObject'))) {
9429
-
9429
+
9430
9430
  lodash.forEach(datesFields, function (row) {
9431
9431
  row.values = lodash.uniq(row.values);
9432
-
9432
+
9433
9433
  const isTimestampDateField = row.type === 'Date' && lodash.some(row.values, value => typeof value ==='number');
9434
9434
  if (isTimestampDateField) {
9435
9435
  const nullValueIndex = row.values.indexOf(NULL_VALUE);
@@ -9443,7 +9443,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9443
9443
  } else {
9444
9444
  row.values = row.values.sort();
9445
9445
  }
9446
-
9446
+
9447
9447
  if (row.sorting && row.sorting.type == "largestToSmallest") {
9448
9448
  row.values = lodash.reverse(row.values);
9449
9449
  }
@@ -9531,7 +9531,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9531
9531
  if (widget.vals && widget.vals.length > 1) {
9532
9532
  datesFields.push({name: "DR_Values", values: lodash.map(widget.vals, 'name')});
9533
9533
  }
9534
-
9534
+
9535
9535
  /****** END *******/
9536
9536
 
9537
9537
  // TODO: Remove. sortingValues looks like lagacy which is not in use neither in webclient nor in renderer
@@ -9678,7 +9678,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9678
9678
  }
9679
9679
  }
9680
9680
 
9681
- if (isEditor == true) {
9681
+ if (isEditor == true) {
9682
9682
  subopts.rendererOptions.totalFilterElements = {
9683
9683
  col_total: $('<span>Grand Totals ' + highchartsRenderer.getIconsForTotalOptions(widget_obj.options, "col_total") + '</span>')[0],
9684
9684
  row_total: $('<span>Grand Totals ' + highchartsRenderer.getIconsForTotalOptions(widget_obj.options, "row_total") + '</span>')[0]
@@ -1,28 +0,0 @@
1
- name: NPM Build and Publish
2
-
3
- on:
4
- workflow_dispatch:
5
- pull_request:
6
- branches:
7
- - 'master'
8
- push:
9
- branches:
10
- - 'master'
11
-
12
- concurrency:
13
- group: '${{ github.ref }}-${{ github.workflow }}'
14
- cancel-in-progress: true
15
-
16
- jobs:
17
- npm-workflow:
18
- name: Build, Test and Publish
19
- uses: datarails/dr_github_reusable/.github/workflows/npm-build-publish.yml@main
20
- with:
21
- access_level: 'public'
22
- branch_postfix: false
23
- main_branch: 'master'
24
- version_prefix: '1.4'
25
- skip_publish: ${{ github.event_name == 'pull_request' }}
26
- secrets:
27
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28
-