mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(plugin-chart-handlebars): order by control not work (#21005)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
import { ControlSetItem, Dataset } from '@superset-ui/chart-controls';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { isAggMode, isRawMode } from './shared';
|
||||
|
||||
export const orderByControlSetItem: ControlSetItem = {
|
||||
@@ -45,7 +46,12 @@ export const orderDescendingControlSetItem: ControlSetItem = {
|
||||
label: t('Sort descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: isAggMode,
|
||||
visibility: ({ controls }) =>
|
||||
!!(
|
||||
isAggMode({ controls }) &&
|
||||
controls?.timeseries_limit_metric.value &&
|
||||
!isEmpty(controls?.timeseries_limit_metric.value)
|
||||
),
|
||||
resetOnHide: false,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user