fix(table): table sort by fix (#33540)

Co-authored-by: Amaan Nawab <nelsondrew07@gmail.com>
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
This commit is contained in:
amaannawab923
2025-05-21 18:30:25 +05:30
committed by GitHub
parent e2a22d481c
commit 950a3313d8

View File

@@ -343,6 +343,26 @@ const config: ControlPanelConfig = {
},
},
],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort descending'),
default: true,
description: t(
'If enabled, this control sorts the results/values descending, otherwise it sorts the results ascending.',
),
visibility: ({ controls }: ControlPanelsContainerProps) => {
const hasSortMetric = Boolean(
controls?.timeseries_limit_metric?.value,
);
return hasSortMetric && isAggMode({ controls });
},
resetOnHide: false,
},
},
],
[
{
name: 'server_pagination',
@@ -413,21 +433,6 @@ const config: ControlPanelConfig = {
},
},
],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort descending'),
default: true,
description: t(
'If enabled, this control sorts the results/values descending, otherwise it sorts the results ascending.',
),
visibility: isAggMode,
resetOnHide: false,
},
},
],
[
{
name: 'show_totals',