@datarailsshared/dr_renderer 1.4.99 → 1.4.108
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
@@ -5308,7 +5308,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
5308
5308
|
break;
|
5309
5309
|
}
|
5310
5310
|
options.comboOptions.seriesOptions.push(deltaColumnSeries);
|
5311
|
-
options.comboOptions.secondaryAxisSettings.name = options.chartOptions.delta_column.name.replace('_', '');
|
5312
5311
|
options.comboOptions.secondaryAxisSettings.is_percentage = options.chartOptions.delta_column.is_percentage;
|
5313
5312
|
}
|
5314
5313
|
};
|
package/src/value.formatter.js
CHANGED
@@ -7,7 +7,7 @@ function getAggregatorPercentageValueIfRequired(value, render_options, data, row
|
|
7
7
|
const isVariance = currentRowName.replace('_', '').toLowerCase() === deltaColumnName.replace('_', '').toLowerCase();
|
8
8
|
const baseRowKey = data && data.rowKeys && data.rowKeys.length ? data.rowKeys[0] : null;
|
9
9
|
const currentColKey = colKey ? colKey : [];
|
10
|
-
const agg = data ? data.getAggregator(baseRowKey, currentColKey) : null;
|
10
|
+
const agg = data && baseRowKey ? data.getAggregator(baseRowKey, currentColKey) : null;
|
11
11
|
|
12
12
|
if (isPercentage && isVariance && baseRowKey && agg) {
|
13
13
|
const baseValue = agg.value();
|
@@ -2071,7 +2071,7 @@ describe('highcharts_renderer', () => {
|
|
2071
2071
|
highchartsRenderer.updateBackwardCompatibleWidgetOptions(currentOptions, null);
|
2072
2072
|
expect(currentOptions.comboOptions).toEqual({
|
2073
2073
|
secondaryAxisSettings: {
|
2074
|
-
name: '
|
2074
|
+
name: 'Secondary Axis',
|
2075
2075
|
max: null,
|
2076
2076
|
min: null,
|
2077
2077
|
is_percentage: true
|
@@ -60,6 +60,26 @@ describe('Function getAggregatorPercentageValueIfRequired', () => {
|
|
60
60
|
const result = getAggregatorPercentageValueIfRequired(50, render_options, data, rowKey, colKey);
|
61
61
|
expect(result).toBeNull();
|
62
62
|
});
|
63
|
+
|
64
|
+
it('should return null if data is null', () => {
|
65
|
+
const result = getAggregatorPercentageValueIfRequired(50, render_options, null, rowKey, colKey);
|
66
|
+
expect(result).toBeNull();
|
67
|
+
});
|
68
|
+
|
69
|
+
it('should return null if data is undefined', () => {
|
70
|
+
const result = getAggregatorPercentageValueIfRequired(50, render_options, undefined, rowKey, colKey);
|
71
|
+
expect(result).toBeNull();
|
72
|
+
});
|
73
|
+
|
74
|
+
it('should return null if baseRowKey is null even when data exists', () => {
|
75
|
+
const data = {
|
76
|
+
rowKeys: [null],
|
77
|
+
getAggregator: jest.fn()
|
78
|
+
};
|
79
|
+
const result = getAggregatorPercentageValueIfRequired(50, render_options, data, rowKey, colKey);
|
80
|
+
expect(result).toBeNull();
|
81
|
+
expect(data.getAggregator).not.toHaveBeenCalled();
|
82
|
+
});
|
63
83
|
});
|
64
84
|
|
65
85
|
describe('Function getPercentageValue', () => {
|