mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
chore: change Sort-by and Sort-Descending controls for Bar Chart v2 (#20868)
This commit is contained in:
parent
9362e27ce2
commit
7beda3bbdb
@ -328,6 +328,35 @@ const config: ControlPanelConfig = {
|
|||||||
row_limit: {
|
row_limit: {
|
||||||
default: rowLimit,
|
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 => ({
|
formDataOverrides: formData => ({
|
||||||
...formData,
|
...formData,
|
||||||
|
Loading…
Reference in New Issue
Block a user