mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Fix backward compatibility and resolve conflict
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import angular from 'angular';
|
||||
import $ from 'jquery';
|
||||
import 'pivottable';
|
||||
import 'pivottable/dist/pivot.css';
|
||||
@@ -24,7 +25,7 @@ function pivotTableRenderer() {
|
||||
if ($scope.queryResult.getData() !== null) {
|
||||
// We need to give the pivot table its own copy of the data, because it changes
|
||||
// it which interferes with other visualizations.
|
||||
data = $.extend(true, [], $scope.queryResult.getRawData());
|
||||
data = angular.copy($scope.queryResult.getData());
|
||||
const options = {
|
||||
renderers: $.pivotUtilities.renderers,
|
||||
onRefresh(config) {
|
||||
@@ -47,7 +48,7 @@ function pivotTableRenderer() {
|
||||
Object.assign(options, $scope.visualization.options);
|
||||
}
|
||||
$(element).pivotUI(data, options, true);
|
||||
if ($scope.visualization.options.controls.enabled) {
|
||||
if (options.controls && options.controls.enabled) {
|
||||
const controls = $('.pvtAxisContainer, .pvtRenderer, .pvtVals');
|
||||
for (let i = 0; i < controls.length; i += 1) { controls[i].style.display = 'none'; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user