Skip to content

Commit

Permalink
fix: Further drill by in Pivot Table
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Apr 14, 2023
1 parent 240b292 commit b6bd8b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b6bd8b1

Please sign in to comment.