@datarailsshared/dr_renderer 1.5.126 → 1.5.129
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
|
@@ -8238,10 +8238,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8238
8238
|
lodash.forEach(values, (value, key) => {
|
|
8239
8239
|
const formatInfo = pivotData[type][key] || {};
|
|
8240
8240
|
const valueToFloat = parseFloat(value);
|
|
8241
|
+
const isBlankDate = formatInfo.type === 'Date' && (value === '' || value === '[blank]');
|
|
8241
8242
|
const isDate = formatInfo.type === 'Date' && (moment_lib(valueToFloat).isValid() || moment_lib(value, formatInfo.format).isValid());
|
|
8242
8243
|
const isNumberFormatting = !isDate && formatInfo.format && highchartsRenderer.isFormattingNumberAxis(pivotData);
|
|
8243
8244
|
|
|
8244
|
-
if (isNumberFormatting || isDate) {
|
|
8245
|
+
if (isNumberFormatting || isDate || isBlankDate) {
|
|
8245
8246
|
values[key] = highchartsRenderer.returnRawDataValue(
|
|
8246
8247
|
formatInfo.type,
|
|
8247
8248
|
!isNaN(valueToFloat) ? valueToFloat : value,
|
|
@@ -5120,6 +5120,17 @@ describe('highcharts_renderer', () => {
|
|
|
5120
5120
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
|
5121
5121
|
expect(formattedKey).toEqual(initialKey);
|
|
5122
5122
|
});
|
|
5123
|
+
|
|
5124
|
+
// some e2e tests exist that expects this behavior
|
|
5125
|
+
it('should format blank value with [blank] text', () => {
|
|
5126
|
+
const initialKey = ['DR_Others', ''];
|
|
5127
|
+
const pivotData = {
|
|
5128
|
+
colFormats: [{ type: "Text", name: "Month" }, { type: 'Date', name: "Date" }],
|
|
5129
|
+
};
|
|
5130
|
+
const type = 'colFormats';
|
|
5131
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
|
5132
|
+
expect(formattedKey).toEqual(['DR_Others', '[blank]']);
|
|
5133
|
+
});
|
|
5123
5134
|
});
|
|
5124
5135
|
});
|
|
5125
5136
|
|