feat(plugin-chart-pivot-table): support series limit (#17803)

* feat(plugin-chart-pivot-table): support series limit

* Add a migration

* Use non-legacy series limit controls

* Add a todo comment

* Bug fix
This commit is contained in:
Kamil Gabryjelski
2021-12-21 16:58:54 +01:00
committed by GitHub
parent 19daf65b54
commit 2c3f39f3f2
3 changed files with 132 additions and 26 deletions

View File

@@ -30,7 +30,6 @@ import {
sections,
sharedControls,
emitFilterControl,
legacySortBy,
} from '@superset-ui/chart-controls';
import { MetricsLayoutEnum } from '../types';
@@ -90,15 +89,41 @@ const config: ControlPanelConfig = {
],
['adhoc_filters'],
emitFilterControl,
['series_limit'],
[
{
name: 'row_limit',
config: {
...sharedControls.row_limit,
label: t('Cell limit'),
description: t('Limits the number of cells that get retrieved.'),
},
},
],
// TODO(kgabryje): add series_columns control after control panel is redesigned to avoid clutter
[
{
name: 'series_limit_metric',
config: {
...sharedControls.series_limit_metric,
description: t(
'Metric used to define how the top series are sorted if a series or cell limit is present. ' +
'If undefined reverts to the first metric (where appropriate).',
),
},
},
],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort Descending'),
default: true,
description: t('Whether to sort descending or ascending'),
},
},
],
...legacySortBy,
],
},
{