Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Adds the sort_by_metric control to sharedControls #29325

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ const temporal_columns_lookup: SharedControlConfig<'HiddenControl'> = {
),
};

const sort_by_metric: SharedControlConfig<'CheckboxControl'> = {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
};

export default {
metrics: dndAdhocMetricsControl,
metric: dndAdhocMetricControl,
Expand Down Expand Up @@ -400,4 +408,5 @@ export default {
show_empty_columns,
temporal_columns_lookup,
currency_format,
sort_by_metric,
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,7 @@ const config: ControlPanelConfig = {
['metric'],
['adhoc_filters'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,7 @@ const config: ControlPanelConfig = {
['metric'],
['adhoc_filters'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,7 @@ const config: ControlPanelConfig = {
},
},
],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,7 @@ const config: ControlPanelConfig = {
['metric'],
['adhoc_filters'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ const config: ControlPanelConfig = {
{
name: 'sort_by_metric',
config: {
...sharedControls.sort_by_metric,
default: true,
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,7 @@ const config: ControlPanelConfig = {
},
},
],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
D3_FORMAT_OPTIONS,
D3_TIME_FORMAT_OPTIONS,
getStandardizedControls,
sharedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
import { legendSection } from '../controls';
Expand Down Expand Up @@ -56,12 +57,8 @@ const config: ControlPanelConfig = {
{
name: 'sort_by_metric',
config: {
...sharedControls.sort_by_metric,
default: true,
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,7 @@ const config: ControlPanelConfig = {
['secondary_metric'],
['adhoc_filters'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,7 @@ const config: ControlPanelConfig = {
['groupby'],
['metric'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
['adhoc_filters'],
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,7 @@ const config: ControlPanelConfig = {
['metric'],
['adhoc_filters'],
['row_limit'],
[
{
name: 'sort_by_metric',
config: {
type: 'CheckboxControl',
label: t('Sort by metric'),
description: t(
'Whether to sort results by the selected metric in descending order.',
),
},
},
],
['sort_by_metric'],
],
},
{
Expand Down
Loading