@datarailsshared/dr_renderer 1.2.326-dragons → 1.2.328-dragons
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 +1 -1
- package/src/highcharts_renderer.js +12 -10
package/package.json
CHANGED
@@ -8739,6 +8739,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8739
8739
|
let datesFields = [];
|
8740
8740
|
datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
|
8741
8741
|
datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
|
8742
|
+
|
8743
|
+
const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
|
8744
|
+
if (isCustomSorting) {
|
8745
|
+
lodash.forEach(datesFields, function (field) {
|
8746
|
+
const fieldToSort = lodash.find(
|
8747
|
+
widget.options.sortingFields, element => element.id === field.id && lodash.get(element, 'sorting.sort_by') === 'field_items'
|
8748
|
+
);
|
8749
|
+
field.sorting = fieldToSort ? fieldToSort.sorting : field.sorting;
|
8750
|
+
});
|
8751
|
+
}
|
8752
|
+
|
8742
8753
|
datesFields = lodash.map(datesFields, function (row) {
|
8743
8754
|
return { "format": highchartsRenderer.getDateFieldFormat(widget, row), "name": row.name, "type": row.type, "values": [], "sorting": row.sorting } //'MMM - yyyy' format
|
8744
8755
|
});
|
@@ -8769,7 +8780,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8769
8780
|
}
|
8770
8781
|
});
|
8771
8782
|
|
8772
|
-
if (highchartsRenderer.isSortingOnBackendEnabled()) {
|
8783
|
+
if (highchartsRenderer.isSortingOnBackendEnabled() && widget.pivot?.keysObject) {
|
8773
8784
|
lodash.forEach(['col_keys', 'row_keys'], (keysListName, index) => {
|
8774
8785
|
const widgetFields = index ? widget.rows : widget.cols;
|
8775
8786
|
const uniqueFormattedKeysList = [];
|
@@ -8789,15 +8800,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8789
8800
|
}
|
8790
8801
|
|
8791
8802
|
if (!highchartsRenderer.isSortingOnBackendEnabled()) {
|
8792
|
-
const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
|
8793
|
-
if (isCustomSorting) {
|
8794
|
-
lodash.forEach(datesFields, function (field) {
|
8795
|
-
const fieldToSort = lodash.find(
|
8796
|
-
widget.options.sortingFields, element => element.id === field.id && lodash.get(element, 'sorting.sort_by') === 'field_items'
|
8797
|
-
);
|
8798
|
-
field.sorting = fieldToSort ? fieldToSort.sorting : field.sorting;
|
8799
|
-
});
|
8800
|
-
}
|
8801
8803
|
|
8802
8804
|
lodash.forEach(datesFields, function (row) {
|
8803
8805
|
row.values = lodash.uniq(row.values);
|