mirror of
https://github.com/apache/superset.git
synced 2026-04-27 20:14:54 +00:00
chore: change Sort-by and Sort-Descending controls for Bar Chart v2 (#20868)
This commit is contained in:
@@ -328,6 +328,35 @@ const config: ControlPanelConfig = {
|
||||
row_limit: {
|
||||
default: rowLimit,
|
||||
},
|
||||
limit: {
|
||||
rerender: ['timeseries_limit_metric', 'order_desc'],
|
||||
},
|
||||
timeseries_limit_metric: {
|
||||
label: t('Series Limit Sort By'),
|
||||
description: t(
|
||||
'Metric used to order the limit if a series limit is present. ' +
|
||||
'If undefined reverts to the first metric (where appropriate).',
|
||||
),
|
||||
visibility: ({ controls }) => Boolean(controls?.limit.value),
|
||||
mapStateToProps: (state, controlState) => {
|
||||
const timeserieslimitProps =
|
||||
sharedControls.timeseries_limit_metric.mapStateToProps?.(
|
||||
state,
|
||||
controlState,
|
||||
) || {};
|
||||
timeserieslimitProps.value = state.controls?.limit?.value
|
||||
? controlState.value
|
||||
: [];
|
||||
return timeserieslimitProps;
|
||||
},
|
||||
},
|
||||
order_desc: {
|
||||
label: t('Series Limit Sort Descending'),
|
||||
default: false,
|
||||
description: t(
|
||||
'Whether to sort descending or ascending if a series limit is present',
|
||||
),
|
||||
},
|
||||
},
|
||||
formDataOverrides: formData => ({
|
||||
...formData,
|
||||
|
||||
Reference in New Issue
Block a user