chore: use order_desc shared control consistently (#19172)
This commit is contained in:
parent
b5e9fad11a
commit
10eb6c77a4
|
|
@ -43,6 +43,7 @@ import {
|
|||
SequentialScheme,
|
||||
legacyValidateInteger,
|
||||
validateNonEmpty,
|
||||
JsonArray,
|
||||
} from '@superset-ui/core';
|
||||
|
||||
import {
|
||||
|
|
@ -345,7 +346,10 @@ const order_desc: SharedControlConfig<'CheckboxControl'> = {
|
|||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
Boolean(
|
||||
controls?.timeseries_limit_metric.value &&
|
||||
(controls?.timeseries_limit_metric.value as JsonArray).length,
|
||||
),
|
||||
};
|
||||
|
||||
const limit: SharedControlConfig<'SelectControl'> = {
|
||||
|
|
|
|||
|
|
@ -34,18 +34,8 @@ const config: ControlPanelConfig = {
|
|||
['adhoc_filters'],
|
||||
['groupby'],
|
||||
['limit', 'timeseries_limit_metric'],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'contribution',
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -37,18 +37,8 @@ const config: ControlPanelConfig = {
|
|||
},
|
||||
],
|
||||
['limit', 'timeseries_limit_metric'],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'contribution',
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -32,19 +32,7 @@ const config: ControlPanelConfig = {
|
|||
['adhoc_filters'],
|
||||
['limit', 'row_limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,18 +40,8 @@ const config: ControlPanelConfig = {
|
|||
['adhoc_filters'],
|
||||
['groupby'],
|
||||
['limit', 'timeseries_limit_metric'],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'contribution',
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -39,19 +39,7 @@ const config: ControlPanelConfig = {
|
|||
['columns'],
|
||||
['row_limit', null],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,18 +38,8 @@ const config: ControlPanelConfig = {
|
|||
['adhoc_filters'],
|
||||
['groupby'],
|
||||
['limit', 'timeseries_limit_metric'],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'contribution',
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -36,19 +36,7 @@ const config: ControlPanelConfig = {
|
|||
['groupby'],
|
||||
['row_limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,19 +51,7 @@ const config: ControlPanelConfig = {
|
|||
['columns'],
|
||||
['row_limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'contribution',
|
||||
|
|
|
|||
|
|
@ -83,19 +83,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -80,19 +80,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -60,19 +60,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -77,19 +77,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -83,19 +83,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -84,19 +84,7 @@ const config: ControlPanelConfig = {
|
|||
emitFilterControl,
|
||||
['limit'],
|
||||
['timeseries_limit_metric'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
['order_desc'],
|
||||
['row_limit'],
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -108,18 +108,8 @@ export const NVD3TimeSeries: ControlPanelSectionConfig[] = [
|
|||
['adhoc_filters'],
|
||||
['groupby'],
|
||||
['limit', 'timeseries_limit_metric'],
|
||||
['order_desc'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort descending'),
|
||||
default: true,
|
||||
description: t('Whether to sort descending or ascending'),
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.timeseries_limit_metric.value),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'contribution',
|
||||
config: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue