mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
feat(dashboard): menu improvements, fallback support for Drill to Detail (#21351)
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
styled,
|
||||
useTheme,
|
||||
isAdhocColumn,
|
||||
QueryObjectFilterClause,
|
||||
BinaryQueryObjectFilterClause,
|
||||
} from '@superset-ui/core';
|
||||
import { PivotTable, sortAs, aggregatorTemplates } from './react-pivottable';
|
||||
import {
|
||||
@@ -370,7 +370,8 @@ export default function PivotTableChart(props: PivotTableProps) {
|
||||
) => {
|
||||
if (onContextMenu) {
|
||||
e.preventDefault();
|
||||
const filters: QueryObjectFilterClause[] = [];
|
||||
e.stopPropagation();
|
||||
const filters: BinaryQueryObjectFilterClause[] = [];
|
||||
if (colKey && colKey.length > 1) {
|
||||
colKey.forEach((val, i) => {
|
||||
const col = cols[i];
|
||||
@@ -399,7 +400,7 @@ export default function PivotTableChart(props: PivotTableProps) {
|
||||
});
|
||||
});
|
||||
}
|
||||
onContextMenu(filters, e.clientX, e.clientY);
|
||||
onContextMenu(e.clientX, e.clientY, filters);
|
||||
}
|
||||
},
|
||||
[cols, dateFormatters, onContextMenu, rows],
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class PivotTableChartPlugin extends ChartPlugin<
|
||||
*/
|
||||
constructor() {
|
||||
const metadata = new ChartMetadata({
|
||||
behaviors: [Behavior.INTERACTIVE_CHART],
|
||||
behaviors: [Behavior.INTERACTIVE_CHART, Behavior.DRILL_TO_DETAIL],
|
||||
category: t('Table'),
|
||||
description: t(
|
||||
'Used to summarize a set of data by grouping together multiple statistics along two axes. Examples: Sales numbers by region and month, tasks by status and assignee, active users by age and location. Not the most visually stunning visualization, but highly informative and versatile.',
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
NumberFormatter,
|
||||
QueryFormMetric,
|
||||
QueryFormColumn,
|
||||
QueryObjectFilterClause,
|
||||
BinaryQueryObjectFilterClause,
|
||||
} from '@superset-ui/core';
|
||||
import { ColorFormatters } from '@superset-ui/chart-controls';
|
||||
|
||||
@@ -74,9 +74,9 @@ interface PivotTableCustomizeProps {
|
||||
legacy_order_by: QueryFormMetric[] | QueryFormMetric | null;
|
||||
order_desc: boolean;
|
||||
onContextMenu?: (
|
||||
filters: QueryObjectFilterClause[],
|
||||
clientX: number,
|
||||
clientY: number,
|
||||
filters?: BinaryQueryObjectFilterClause[],
|
||||
) => void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user