diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts index 63571600d2f7e..c87bcc0fef68b 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts @@ -42,6 +42,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, { diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts index f3504ea649447..a8f8d7e7be3ce 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts @@ -45,6 +45,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, { diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts index 2b24a090fc7b7..7023f019ee28c 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts @@ -40,6 +40,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx index 48816891297df..bee80945f0d96 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx @@ -48,6 +48,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, { diff --git a/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.ts index d992829c78956..b1dd768e1d4b4 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.ts @@ -47,6 +47,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx index ed173951ddd3d..72acb61575f9b 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx @@ -46,6 +46,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, { diff --git a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/controlPanel.ts index 972639601360f..666bbd41ddd68 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/controlPanel.ts @@ -44,6 +44,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts index b1459ddea8a47..ed8b31b9e9809 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts @@ -59,6 +59,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx index 8a84263ba8aa1..a71db9d3df468 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx @@ -354,6 +354,8 @@ export const timeSeriesSection: ControlPanelSectionConfig[] = [ label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 44d1e80d196b7..0dcc76fcc8df2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -89,6 +89,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx index 68460e1ece290..99023364249d2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx @@ -86,6 +86,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx index 772e2b06f9fe2..a2a34465679ac 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx @@ -66,6 +66,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx index d7159472fab62..3e0dc46b49e65 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx @@ -83,6 +83,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx index a006d0f66691f..1deb723795d48 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx @@ -89,6 +89,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx index 2763a62c0593c..5878882d3e4cf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx @@ -90,6 +90,8 @@ const config: ControlPanelConfig = { label: t('Sort Descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, ], diff --git a/superset-frontend/src/explore/controlPanels/sections.tsx b/superset-frontend/src/explore/controlPanels/sections.tsx index b231fd5f2b0a1..4ff269df3ff6a 100644 --- a/superset-frontend/src/explore/controlPanels/sections.tsx +++ b/superset-frontend/src/explore/controlPanels/sections.tsx @@ -125,6 +125,8 @@ export const NVD3TimeSeries: ControlPanelSectionConfig[] = [ label: t('Sort descending'), default: true, description: t('Whether to sort descending or ascending'), + visibility: ({ controls }) => + Boolean(controls?.timeseries_limit_metric.value), }, }, {