mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(generic-chart-axes): set x-axis if unset and ff is enabled (#20107)
* fix(generic-chart-axes): set x-axis if unset and ff is enabled * simplify * simplify * continue cleanup * yet more cleanup
This commit is contained in:
@@ -19,13 +19,14 @@
|
||||
import React from 'react';
|
||||
import { t, validateNonEmpty } from '@superset-ui/core';
|
||||
import {
|
||||
formatSelectOptionsForRange,
|
||||
ColumnOption,
|
||||
columnChoices,
|
||||
ColumnOption,
|
||||
ColumnMeta,
|
||||
ControlPanelConfig,
|
||||
ControlState,
|
||||
formatSelectOptionsForRange,
|
||||
sections,
|
||||
SelectControlConfig,
|
||||
ColumnMeta,
|
||||
} from '@superset-ui/chart-controls';
|
||||
|
||||
const config: ControlPanelConfig = {
|
||||
@@ -46,10 +47,8 @@ const config: ControlPanelConfig = {
|
||||
choices: columnChoices(state?.datasource),
|
||||
}),
|
||||
// choices is from `mapStateToProps`
|
||||
default: (control: { choices?: string[] }) =>
|
||||
control.choices && control.choices.length > 0
|
||||
? control.choices[0][0]
|
||||
: null,
|
||||
default: (control: ControlState) =>
|
||||
control.choices?.[0]?.[0] || null,
|
||||
validators: [validateNonEmpty],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user