You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by kg...@apache.org on 2023/04/14 13:50:23 UTC

[superset] branch master updated: fix: Further drill by in Pivot Table (#23692)

This is an automated email from the ASF dual-hosted git repository.

kgabryje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new da5f7155c6 fix: Further drill by in Pivot Table (#23692)
da5f7155c6 is described below

commit da5f7155c63c2a9f7b42a31130fa24e9698b1191
Author: Kamil Gabryjelski <ka...@gmail.com>
AuthorDate: Fri Apr 14 15:50:13 2023 +0200

    fix: Further drill by in Pivot Table (#23692)
---
 .../plugin-chart-pivot-table/src/PivotTableChart.tsx  | 19 ++++++++++++-------
 .../src/react-pivottable/TableRenderers.jsx           | 18 ++++++++----------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
index 8ec1cb9ad1..9d5718120f 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
@@ -17,22 +17,24 @@
  * under the License.
  */
 import React, { useCallback, useMemo } from 'react';
-import { PlusSquareOutlined, MinusSquareOutlined } from '@ant-design/icons';
+import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
 import {
   AdhocMetric,
+  BinaryQueryObjectFilterClause,
   DataRecordValue,
+  FeatureFlag,
   getColumnLabel,
   getNumberFormatter,
+  getSelectedText,
+  isAdhocColumn,
+  isFeatureEnabled,
   isPhysicalColumn,
   NumberFormatter,
   styled,
-  useTheme,
-  isAdhocColumn,
-  BinaryQueryObjectFilterClause,
   t,
-  getSelectedText,
+  useTheme,
 } from '@superset-ui/core';
-import { PivotTable, sortAs, aggregatorTemplates } from './react-pivottable';
+import { aggregatorTemplates, PivotTable, sortAs } from './react-pivottable';
 import {
   FilterType,
   MetricsLayoutEnum,
@@ -407,7 +409,10 @@ export default function PivotTableChart(props: PivotTableProps) {
       clickColumnHeaderCallback: toggleFilter,
       colTotals,
       rowTotals,
-      highlightHeaderCellsOnHover: emitCrossFilters,
+      highlightHeaderCellsOnHover:
+        emitCrossFilters ||
+        isFeatureEnabled(FeatureFlag.DRILL_BY) ||
+        isFeatureEnabled(FeatureFlag.DRILL_TO_DETAIL),
       highlightedHeaderCells: selectedFilters,
       omittedHighlightHeaderGroups: [METRIC_KEY],
       cellColorFormatters: { [METRIC_KEY]: metricColorFormatters },
diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
index 4ca3f6d5af..8915ed7e9c 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx
@@ -398,11 +398,10 @@ export class TableRenderer extends React.Component {
       const colSpan = attrIdx < colKey.length ? colAttrSpans[i][attrIdx] : 1;
       let colLabelClass = 'pvtColLabel';
       if (attrIdx < colKey.length) {
-        if (
-          highlightHeaderCellsOnHover &&
-          !omittedHighlightHeaderGroups.includes(colAttrs[attrIdx])
-        ) {
-          colLabelClass += ' hoverable';
+        if (!omittedHighlightHeaderGroups.includes(colAttrs[attrIdx])) {
+          if (highlightHeaderCellsOnHover) {
+            colLabelClass += ' hoverable';
+          }
           handleContextMenu = e =>
             this.props.onContextMenu(e, colKey, undefined, {
               [attrName]: colKey[attrIdx],
@@ -598,11 +597,10 @@ export class TableRenderer extends React.Component {
     const attrValueCells = rowKey.map((r, i) => {
       let handleContextMenu;
       let valueCellClassName = 'pvtRowLabel';
-      if (
-        highlightHeaderCellsOnHover &&
-        !omittedHighlightHeaderGroups.includes(rowAttrs[i])
-      ) {
-        valueCellClassName += ' hoverable';
+      if (!omittedHighlightHeaderGroups.includes(rowAttrs[i])) {
+        if (highlightHeaderCellsOnHover) {
+          valueCellClassName += ' hoverable';
+        }
         handleContextMenu = e =>
           this.props.onContextMenu(e, undefined, rowKey, {
             [rowAttrs[i]]: r,